diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 4ac212c46441..910e67c56f13 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -427,6 +427,13 @@ pom import + + com.google.cloud + google-cloud-databasecenter-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-datacatalog-bom diff --git a/generation_config.yaml b/generation_config.yaml index 629ed2d6a716..69b68a251a3e 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -729,6 +729,27 @@ libraries: - proto_path: google/cloud/datafusion/v1 - proto_path: google/cloud/datafusion/v1beta1 +- api_shortname: databasecenter + name_pretty: Database Center API + product_documentation: https://cloud.google.com/database-center/docs/overview + api_description: Database Center provides an organization-wide, cross-product fleet + health platform to eliminate the overhead, complexity, and risk associated with + aggregating and summarizing health signals through custom dashboards. Through + Database Center’s fleet health dashboard and API, database platform teams that + are responsible for reliability, compliance, security, cost, and administration + of database fleets will now have a single pane of glass that pinpoints issues + relevant to each team. + client_documentation: + https://cloud.google.com/java/docs/reference/google-cloud-databasecenter/latest/overview + release_level: preview + distribution_name: com.google.cloud:google-cloud-databasecenter + api_id: databasecenter.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.cloud + cloud_api: true + GAPICs: + - proto_path: google/cloud/databasecenter/v1beta + requires_billing: true - api_shortname: datacatalog name_pretty: Data Catalog product_documentation: https://cloud.google.com/data-catalog diff --git a/java-databasecenter/.OwlBot-hermetic.yaml b/java-databasecenter/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..01c5b3d486e4 --- /dev/null +++ b/java-databasecenter/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-databasecenter/grpc-google-.*/src" +- "/java-databasecenter/proto-google-.*/src" +- "/java-databasecenter/google-.*/src" +- "/java-databasecenter/samples/snippets/generated" + +deep-preserve-regex: +- "/java-databasecenter/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/databasecenter/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-databasecenter/$1/proto-google-cloud-databasecenter-$1/src" +- source: "/google/cloud/databasecenter/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-databasecenter/$1/grpc-google-cloud-databasecenter-$1/src" +- source: "/google/cloud/databasecenter/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-databasecenter/$1/google-cloud-databasecenter/src" +- source: "/google/cloud/databasecenter/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-databasecenter/$1/samples/snippets/generated" + +api-name: databasecenter \ No newline at end of file diff --git a/java-databasecenter/.repo-metadata.json b/java-databasecenter/.repo-metadata.json new file mode 100644 index 000000000000..efafc5fae2af --- /dev/null +++ b/java-databasecenter/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "databasecenter", + "name_pretty": "Database Center API", + "product_documentation": "https://cloud.google.com/database-center/docs/overview", + "api_description": "Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center\u2019s fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-databasecenter/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-databasecenter", + "distribution_name": "com.google.cloud:google-cloud-databasecenter", + "api_id": "databasecenter.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-databasecenter/README.md b/java-databasecenter/README.md new file mode 100644 index 000000000000..8beb6666e9f8 --- /dev/null +++ b/java-databasecenter/README.md @@ -0,0 +1,224 @@ +# Google Database Center API Client for Java + +Java idiomatic client for [Database Center API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.71.0 + pom + import + + + + + + + com.google.cloud + google-cloud-databasecenter + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + +```xml + + com.google.cloud + google-cloud-databasecenter + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-databasecenter:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-databasecenter" % "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 Database Center API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Database Center API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Database Center API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Database Center API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-databasecenter` library. See the [Quickstart](#quickstart) section +to add `google-cloud-databasecenter` as a dependency in your code. + +## About Database Center API + + +[Database Center API][product-docs] Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center’s fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team. + +See the [Database Center API client library docs][javadocs] to learn how to +use this Database Center API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Database Center API 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. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/database-center/docs/overview +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-databasecenter/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-databasecenter.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-databasecenter/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=databasecenter.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-databasecenter/google-cloud-databasecenter-bom/pom.xml b/java-databasecenter/google-cloud-databasecenter-bom/pom.xml new file mode 100644 index 000000000000..8634547c1bff --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.cloud + google-cloud-databasecenter-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.73.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Database Center API BOM + + BOM for Database Center API + + + + true + + + + + + com.google.cloud + google-cloud-databasecenter + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-databasecenter-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-databasecenter-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-databasecenter/google-cloud-databasecenter/pom.xml b/java-databasecenter/google-cloud-databasecenter/pom.xml new file mode 100644 index 000000000000..a928d2b52e75 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + com.google.cloud + google-cloud-databasecenter + 0.0.1-SNAPSHOT + jar + Google Database Center API + Database Center API Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center’s fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team. + + com.google.cloud + google-cloud-databasecenter-parent + 0.0.1-SNAPSHOT + + + google-cloud-databasecenter + + + + 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-databasecenter-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + proto-google-iam-v1 + + + org.threeten + threetenbp + + + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-databasecenter-v1beta + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClient.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClient.java new file mode 100644 index 000000000000..9c5b3bdb94eb --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClient.java @@ -0,0 +1,404 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.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.databasecenter.v1beta.stub.DatabaseCenterStub; +import com.google.cloud.databasecenter.v1beta.stub.DatabaseCenterStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: DatabaseCenter contains methods to query fleet view for database resources. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) {
+ *   QueryProductsRequest request =
+ *       QueryProductsRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .build();
+ *   for (Product element : databaseCenterClient.queryProducts(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

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

QueryProducts

QueryProducts provides a list of all possible products which can be used to filter database resources.

+ *

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

+ *
    + *
  • queryProducts(QueryProductsRequest request) + *

+ *

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

+ *
    + *
  • queryProductsPagedCallable() + *

  • queryProductsCallable() + *

+ *
+ * + *

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 DatabaseCenterSettings 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
+ * DatabaseCenterSettings databaseCenterSettings =
+ *     DatabaseCenterSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create(databaseCenterSettings);
+ * }
+ * + *

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
+ * DatabaseCenterSettings databaseCenterSettings =
+ *     DatabaseCenterSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create(databaseCenterSettings);
+ * }
+ * + *

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
+ * DatabaseCenterSettings databaseCenterSettings =
+ *     DatabaseCenterSettings.newHttpJsonBuilder().build();
+ * DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create(databaseCenterSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class DatabaseCenterClient implements BackgroundResource { + private final DatabaseCenterSettings settings; + private final DatabaseCenterStub stub; + + /** Constructs an instance of DatabaseCenterClient with default settings. */ + public static final DatabaseCenterClient create() throws IOException { + return create(DatabaseCenterSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DatabaseCenterClient, 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 DatabaseCenterClient create(DatabaseCenterSettings settings) + throws IOException { + return new DatabaseCenterClient(settings); + } + + /** + * Constructs an instance of DatabaseCenterClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(DatabaseCenterSettings). + */ + public static final DatabaseCenterClient create(DatabaseCenterStub stub) { + return new DatabaseCenterClient(stub); + } + + /** + * Constructs an instance of DatabaseCenterClient, 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 DatabaseCenterClient(DatabaseCenterSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DatabaseCenterStubSettings) settings.getStubSettings()).createStub(); + } + + protected DatabaseCenterClient(DatabaseCenterStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DatabaseCenterSettings getSettings() { + return settings; + } + + public DatabaseCenterStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * QueryProducts provides a list of all possible products which can be used to filter database + * resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) {
+   *   QueryProductsRequest request =
+   *       QueryProductsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Product element : databaseCenterClient.queryProducts(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 QueryProductsPagedResponse queryProducts(QueryProductsRequest request) { + return queryProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * QueryProducts provides a list of all possible products which can be used to filter database + * resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) {
+   *   QueryProductsRequest request =
+   *       QueryProductsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       databaseCenterClient.queryProductsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Product element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + queryProductsPagedCallable() { + return stub.queryProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * QueryProducts provides a list of all possible products which can be used to filter database + * resources. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) {
+   *   QueryProductsRequest request =
+   *       QueryProductsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     QueryProductsResponse response = databaseCenterClient.queryProductsCallable().call(request);
+   *     for (Product element : response.getProductsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable queryProductsCallable() { + return stub.queryProductsCallable(); + } + + @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 QueryProductsPagedResponse + extends AbstractPagedListResponse< + QueryProductsRequest, + QueryProductsResponse, + Product, + QueryProductsPage, + QueryProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + QueryProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new QueryProductsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private QueryProductsPagedResponse(QueryProductsPage page) { + super(page, QueryProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class QueryProductsPage + extends AbstractPage< + QueryProductsRequest, QueryProductsResponse, Product, QueryProductsPage> { + + private QueryProductsPage( + PageContext context, + QueryProductsResponse response) { + super(context, response); + } + + private static QueryProductsPage createEmptyPage() { + return new QueryProductsPage(null, null); + } + + @Override + protected QueryProductsPage createPage( + PageContext context, + QueryProductsResponse response) { + return new QueryProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class QueryProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + QueryProductsRequest, + QueryProductsResponse, + Product, + QueryProductsPage, + QueryProductsFixedSizeCollection> { + + private QueryProductsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static QueryProductsFixedSizeCollection createEmptyCollection() { + return new QueryProductsFixedSizeCollection(null, 0); + } + + @Override + protected QueryProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new QueryProductsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterSettings.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterSettings.java new file mode 100644 index 000000000000..d4ea45f05d2f --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterSettings.java @@ -0,0 +1,223 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +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.databasecenter.v1beta.stub.DatabaseCenterStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DatabaseCenterClient}. + * + *

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

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DatabaseCenterSettings.Builder databaseCenterSettingsBuilder =
+ *     DatabaseCenterSettings.newBuilder();
+ * databaseCenterSettingsBuilder
+ *     .queryProductsSettings()
+ *     .setRetrySettings(
+ *         databaseCenterSettingsBuilder
+ *             .queryProductsSettings()
+ *             .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());
+ * DatabaseCenterSettings databaseCenterSettings = databaseCenterSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class DatabaseCenterSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to queryProducts. */ + public PagedCallSettings + queryProductsSettings() { + return ((DatabaseCenterStubSettings) getStubSettings()).queryProductsSettings(); + } + + public static final DatabaseCenterSettings create(DatabaseCenterStubSettings stub) + throws IOException { + return new DatabaseCenterSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DatabaseCenterStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DatabaseCenterStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DatabaseCenterStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DatabaseCenterStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DatabaseCenterStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DatabaseCenterStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DatabaseCenterStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DatabaseCenterStubSettings.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(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 DatabaseCenterSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DatabaseCenterSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DatabaseCenterStubSettings.newBuilder(clientContext)); + } + + protected Builder(DatabaseCenterSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DatabaseCenterStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DatabaseCenterStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(DatabaseCenterStubSettings.newHttpJsonBuilder()); + } + + public DatabaseCenterStubSettings.Builder getStubSettingsBuilder() { + return ((DatabaseCenterStubSettings.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 queryProducts. */ + public PagedCallSettings.Builder< + QueryProductsRequest, QueryProductsResponse, QueryProductsPagedResponse> + queryProductsSettings() { + return getStubSettingsBuilder().queryProductsSettings(); + } + + @Override + public DatabaseCenterSettings build() throws IOException { + return new DatabaseCenterSettings(this); + } + } +} diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/gapic_metadata.json b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..1bfa25c3d038 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/gapic_metadata.json @@ -0,0 +1,21 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.databasecenter.v1beta", + "libraryPackage": "com.google.cloud.databasecenter.v1beta", + "services": { + "DatabaseCenter": { + "clients": { + "grpc": { + "libraryClient": "DatabaseCenterClient", + "rpcs": { + "QueryProducts": { + "methods": ["queryProducts", "queryProductsPagedCallable", "queryProductsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/package-info.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/package-info.java new file mode 100644 index 000000000000..00c3da6a481f --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/package-info.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Database Center API + * + *

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

======================= DatabaseCenterClient ======================= + * + *

Service Description: DatabaseCenter contains methods to query fleet view for database + * resources. + * + *

Sample for DatabaseCenterClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) {
+ *   QueryProductsRequest request =
+ *       QueryProductsRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .build();
+ *   for (Product element : databaseCenterClient.queryProducts(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.databasecenter.v1beta; + +import javax.annotation.Generated; diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/DatabaseCenterStub.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/DatabaseCenterStub.java new file mode 100644 index 000000000000..d7087fbfd87c --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/DatabaseCenterStub.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.databasecenter.v1beta.QueryProductsRequest; +import com.google.cloud.databasecenter.v1beta.QueryProductsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the DatabaseCenter service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class DatabaseCenterStub implements BackgroundResource { + + public UnaryCallable + queryProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: queryProductsPagedCallable()"); + } + + public UnaryCallable queryProductsCallable() { + throw new UnsupportedOperationException("Not implemented: queryProductsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/DatabaseCenterStubSettings.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/DatabaseCenterStubSettings.java new file mode 100644 index 000000000000..6125c918c244 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/DatabaseCenterStubSettings.java @@ -0,0 +1,400 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +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.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.databasecenter.v1beta.Product; +import com.google.cloud.databasecenter.v1beta.QueryProductsRequest; +import com.google.cloud.databasecenter.v1beta.QueryProductsResponse; +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DatabaseCenterStub}. + * + *

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

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DatabaseCenterStubSettings.Builder databaseCenterSettingsBuilder =
+ *     DatabaseCenterStubSettings.newBuilder();
+ * databaseCenterSettingsBuilder
+ *     .queryProductsSettings()
+ *     .setRetrySettings(
+ *         databaseCenterSettingsBuilder
+ *             .queryProductsSettings()
+ *             .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());
+ * DatabaseCenterStubSettings databaseCenterSettings = databaseCenterSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class DatabaseCenterStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + QueryProductsRequest, QueryProductsResponse, QueryProductsPagedResponse> + queryProductsSettings; + + private static final PagedListDescriptor + QUERY_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public QueryProductsRequest injectToken(QueryProductsRequest payload, String token) { + return QueryProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public QueryProductsRequest injectPageSize(QueryProductsRequest payload, int pageSize) { + return QueryProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(QueryProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(QueryProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(QueryProductsResponse payload) { + return payload.getProductsList(); + } + }; + + private static final PagedListResponseFactory< + QueryProductsRequest, QueryProductsResponse, QueryProductsPagedResponse> + QUERY_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + QueryProductsRequest, QueryProductsResponse, QueryProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + QueryProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, QUERY_PRODUCTS_PAGE_STR_DESC, request, context); + return QueryProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to queryProducts. */ + public PagedCallSettings + queryProductsSettings() { + return queryProductsSettings; + } + + public DatabaseCenterStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDatabaseCenterStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDatabaseCenterStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "databasecenter"; + } + + /** 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 "databasecenter.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "databasecenter.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(DatabaseCenterStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DatabaseCenterStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DatabaseCenterStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DatabaseCenterStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + queryProductsSettings = settingsBuilder.queryProductsSettings().build(); + } + + /** Builder for DatabaseCenterStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + QueryProductsRequest, QueryProductsResponse, QueryProductsPagedResponse> + queryProductsSettings; + 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(ClientContext clientContext) { + super(clientContext); + + queryProductsSettings = PagedCallSettings.newBuilder(QUERY_PRODUCTS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(queryProductsSettings); + initDefaults(this); + } + + protected Builder(DatabaseCenterStubSettings settings) { + super(settings); + + queryProductsSettings = settings.queryProductsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(queryProductsSettings); + } + + 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 + .queryProductsSettings() + .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 queryProducts. */ + public PagedCallSettings.Builder< + QueryProductsRequest, QueryProductsResponse, QueryProductsPagedResponse> + queryProductsSettings() { + return queryProductsSettings; + } + + @Override + public DatabaseCenterStubSettings build() throws IOException { + return new DatabaseCenterStubSettings(this); + } + } +} diff --git a/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/GrpcDatabaseCenterCallableFactory.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/GrpcDatabaseCenterCallableFactory.java new file mode 100644 index 000000000000..947c0532de6d --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/GrpcDatabaseCenterCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the DatabaseCenter service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDatabaseCenterCallableFactory 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-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/GrpcDatabaseCenterStub.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/GrpcDatabaseCenterStub.java new file mode 100644 index 000000000000..068b05da98aa --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/GrpcDatabaseCenterStub.java @@ -0,0 +1,172 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +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.databasecenter.v1beta.QueryProductsRequest; +import com.google.cloud.databasecenter.v1beta.QueryProductsResponse; +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DatabaseCenter service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDatabaseCenterStub extends DatabaseCenterStub { + private static final MethodDescriptor + queryProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.databasecenter.v1beta.DatabaseCenter/QueryProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(QueryProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(QueryProductsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable queryProductsCallable; + private final UnaryCallable + queryProductsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDatabaseCenterStub create(DatabaseCenterStubSettings settings) + throws IOException { + return new GrpcDatabaseCenterStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDatabaseCenterStub create(ClientContext clientContext) + throws IOException { + return new GrpcDatabaseCenterStub( + DatabaseCenterStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDatabaseCenterStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDatabaseCenterStub( + DatabaseCenterStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDatabaseCenterStub, 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 GrpcDatabaseCenterStub(DatabaseCenterStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDatabaseCenterCallableFactory()); + } + + /** + * Constructs an instance of GrpcDatabaseCenterStub, 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 GrpcDatabaseCenterStub( + DatabaseCenterStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings queryProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(queryProductsMethodDescriptor) + .build(); + + this.queryProductsCallable = + callableFactory.createUnaryCallable( + queryProductsTransportSettings, settings.queryProductsSettings(), clientContext); + this.queryProductsPagedCallable = + callableFactory.createPagedCallable( + queryProductsTransportSettings, settings.queryProductsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable queryProductsCallable() { + return queryProductsCallable; + } + + @Override + public UnaryCallable + queryProductsPagedCallable() { + return queryProductsPagedCallable; + } + + @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-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/HttpJsonDatabaseCenterCallableFactory.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/HttpJsonDatabaseCenterCallableFactory.java new file mode 100644 index 000000000000..80f967af538f --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/HttpJsonDatabaseCenterCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the DatabaseCenter service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonDatabaseCenterCallableFactory + 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-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/HttpJsonDatabaseCenterStub.java b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/HttpJsonDatabaseCenterStub.java new file mode 100644 index 000000000000..1c14c088d940 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/java/com/google/cloud/databasecenter/v1beta/stub/HttpJsonDatabaseCenterStub.java @@ -0,0 +1,208 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +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.databasecenter.v1beta.QueryProductsRequest; +import com.google.cloud.databasecenter.v1beta.QueryProductsResponse; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the DatabaseCenter service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonDatabaseCenterStub extends DatabaseCenterStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + queryProductsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.databasecenter.v1beta.DatabaseCenter/QueryProducts") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta:queryProducts", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "parent", request.getParent()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QueryProductsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable queryProductsCallable; + private final UnaryCallable + queryProductsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDatabaseCenterStub create(DatabaseCenterStubSettings settings) + throws IOException { + return new HttpJsonDatabaseCenterStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDatabaseCenterStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDatabaseCenterStub( + DatabaseCenterStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDatabaseCenterStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDatabaseCenterStub( + DatabaseCenterStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonDatabaseCenterStub, 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 HttpJsonDatabaseCenterStub( + DatabaseCenterStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDatabaseCenterCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDatabaseCenterStub, 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 HttpJsonDatabaseCenterStub( + DatabaseCenterStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + queryProductsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(queryProductsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.queryProductsCallable = + callableFactory.createUnaryCallable( + queryProductsTransportSettings, settings.queryProductsSettings(), clientContext); + this.queryProductsPagedCallable = + callableFactory.createPagedCallable( + queryProductsTransportSettings, settings.queryProductsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(queryProductsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable queryProductsCallable() { + return queryProductsCallable; + } + + @Override + public UnaryCallable + queryProductsPagedCallable() { + return queryProductsPagedCallable; + } + + @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-databasecenter/google-cloud-databasecenter/src/main/resources/META-INF/native-image/com.google.cloud.databasecenter.v1beta/reflect-config.json b/java-databasecenter/google-cloud-databasecenter/src/main/resources/META-INF/native-image/com.google.cloud.databasecenter.v1beta/reflect-config.json new file mode 100644 index 000000000000..e4a928df9552 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/main/resources/META-INF/native-image/com.google.cloud.databasecenter.v1beta/reflect-config.json @@ -0,0 +1,1235 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.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.cloud.databasecenter.v1beta.Engine", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.Product", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.Product$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.ProductType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.QueryProductsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.QueryProductsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.QueryProductsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.databasecenter.v1beta.QueryProductsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClientHttpJsonTest.java b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClientHttpJsonTest.java new file mode 100644 index 000000000000..032eb234b04e --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClientHttpJsonTest.java @@ -0,0 +1,137 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +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.databasecenter.v1beta.stub.HttpJsonDatabaseCenterStub; +import com.google.common.collect.Lists; +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 DatabaseCenterClientHttpJsonTest { + private static MockHttpService mockService; + private static DatabaseCenterClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDatabaseCenterStub.getMethodDescriptors(), + DatabaseCenterSettings.getDefaultEndpoint()); + DatabaseCenterSettings settings = + DatabaseCenterSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DatabaseCenterSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DatabaseCenterClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void queryProductsTest() throws Exception { + Product responsesElement = Product.newBuilder().build(); + QueryProductsResponse expectedResponse = + QueryProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + QueryProductsPagedResponse pagedListResponse = client.queryProducts(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().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 queryProductsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.queryProducts(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClientTest.java b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClientTest.java new file mode 100644 index 000000000000..8643d4843d18 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterClientTest.java @@ -0,0 +1,136 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta; + +import static com.google.cloud.databasecenter.v1beta.DatabaseCenterClient.QueryProductsPagedResponse; + +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 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 DatabaseCenterClientTest { + private static MockDatabaseCenter mockDatabaseCenter; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DatabaseCenterClient client; + + @BeforeClass + public static void startStaticServer() { + mockDatabaseCenter = new MockDatabaseCenter(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockDatabaseCenter)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DatabaseCenterSettings settings = + DatabaseCenterSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DatabaseCenterClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void queryProductsTest() throws Exception { + Product responsesElement = Product.newBuilder().build(); + QueryProductsResponse expectedResponse = + QueryProductsResponse.newBuilder() + .setNextPageToken("") + .addAllProducts(Arrays.asList(responsesElement)) + .build(); + mockDatabaseCenter.addResponse(expectedResponse); + + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + QueryProductsPagedResponse pagedListResponse = client.queryProducts(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProductsList().get(0), resources.get(0)); + + List actualRequests = mockDatabaseCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + QueryProductsRequest actualRequest = ((QueryProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void queryProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatabaseCenter.addException(exception); + + try { + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.queryProducts(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/MockDatabaseCenter.java b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/MockDatabaseCenter.java new file mode 100644 index 000000000000..b0cc231af5be --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/MockDatabaseCenter.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDatabaseCenter implements MockGrpcService { + private final MockDatabaseCenterImpl serviceImpl; + + public MockDatabaseCenter() { + serviceImpl = new MockDatabaseCenterImpl(); + } + + @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-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/MockDatabaseCenterImpl.java b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/MockDatabaseCenterImpl.java new file mode 100644 index 000000000000..982f40006bf7 --- /dev/null +++ b/java-databasecenter/google-cloud-databasecenter/src/test/java/com/google/cloud/databasecenter/v1beta/MockDatabaseCenterImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.databasecenter.v1beta.DatabaseCenterGrpc.DatabaseCenterImplBase; +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 MockDatabaseCenterImpl extends DatabaseCenterImplBase { + private List requests; + private Queue responses; + + public MockDatabaseCenterImpl() { + 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 queryProducts( + QueryProductsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QueryProductsResponse) { + requests.add(request); + responseObserver.onNext(((QueryProductsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method QueryProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QueryProductsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-databasecenter/grpc-google-cloud-databasecenter-v1beta/pom.xml b/java-databasecenter/grpc-google-cloud-databasecenter-v1beta/pom.xml new file mode 100644 index 000000000000..7bdea562646c --- /dev/null +++ b/java-databasecenter/grpc-google-cloud-databasecenter-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-databasecenter-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-databasecenter-v1beta + GRPC library for google-cloud-databasecenter + + com.google.cloud + google-cloud-databasecenter-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-databasecenter-v1beta + + + com.google.guava + guava + + + diff --git a/java-databasecenter/grpc-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterGrpc.java b/java-databasecenter/grpc-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterGrpc.java new file mode 100644 index 000000000000..0cbf3e1abcdd --- /dev/null +++ b/java-databasecenter/grpc-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/DatabaseCenterGrpc.java @@ -0,0 +1,429 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.databasecenter.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * DatabaseCenter contains methods to query fleet view for database resources.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class DatabaseCenterGrpc { + + private DatabaseCenterGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.databasecenter.v1beta.DatabaseCenter"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.databasecenter.v1beta.QueryProductsRequest, + com.google.cloud.databasecenter.v1beta.QueryProductsResponse> + getQueryProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "QueryProducts", + requestType = com.google.cloud.databasecenter.v1beta.QueryProductsRequest.class, + responseType = com.google.cloud.databasecenter.v1beta.QueryProductsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.databasecenter.v1beta.QueryProductsRequest, + com.google.cloud.databasecenter.v1beta.QueryProductsResponse> + getQueryProductsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.databasecenter.v1beta.QueryProductsRequest, + com.google.cloud.databasecenter.v1beta.QueryProductsResponse> + getQueryProductsMethod; + if ((getQueryProductsMethod = DatabaseCenterGrpc.getQueryProductsMethod) == null) { + synchronized (DatabaseCenterGrpc.class) { + if ((getQueryProductsMethod = DatabaseCenterGrpc.getQueryProductsMethod) == null) { + DatabaseCenterGrpc.getQueryProductsMethod = + getQueryProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "QueryProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.databasecenter.v1beta.QueryProductsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseCenterMethodDescriptorSupplier("QueryProducts")) + .build(); + } + } + } + return getQueryProductsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DatabaseCenterStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatabaseCenterStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterStub(channel, callOptions); + } + }; + return DatabaseCenterStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static DatabaseCenterBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatabaseCenterBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterBlockingV2Stub(channel, callOptions); + } + }; + return DatabaseCenterBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DatabaseCenterBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatabaseCenterBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterBlockingStub(channel, callOptions); + } + }; + return DatabaseCenterBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DatabaseCenterFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatabaseCenterFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterFutureStub(channel, callOptions); + } + }; + return DatabaseCenterFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * DatabaseCenter contains methods to query fleet view for database resources.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * QueryProducts provides a list of all possible products which can be used to
+     * filter database resources.
+     * 
+ */ + default void queryProducts( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getQueryProductsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DatabaseCenter. + * + *
+   * DatabaseCenter contains methods to query fleet view for database resources.
+   * 
+ */ + public abstract static class DatabaseCenterImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DatabaseCenterGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DatabaseCenter. + * + *
+   * DatabaseCenter contains methods to query fleet view for database resources.
+   * 
+ */ + public static final class DatabaseCenterStub + extends io.grpc.stub.AbstractAsyncStub { + private DatabaseCenterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatabaseCenterStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterStub(channel, callOptions); + } + + /** + * + * + *
+     * QueryProducts provides a list of all possible products which can be used to
+     * filter database resources.
+     * 
+ */ + public void queryProducts( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getQueryProductsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DatabaseCenter. + * + *
+   * DatabaseCenter contains methods to query fleet view for database resources.
+   * 
+ */ + public static final class DatabaseCenterBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private DatabaseCenterBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatabaseCenterBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * QueryProducts provides a list of all possible products which can be used to
+     * filter database resources.
+     * 
+ */ + public com.google.cloud.databasecenter.v1beta.QueryProductsResponse queryProducts( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getQueryProductsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service DatabaseCenter. + * + *
+   * DatabaseCenter contains methods to query fleet view for database resources.
+   * 
+ */ + public static final class DatabaseCenterBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DatabaseCenterBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatabaseCenterBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * QueryProducts provides a list of all possible products which can be used to
+     * filter database resources.
+     * 
+ */ + public com.google.cloud.databasecenter.v1beta.QueryProductsResponse queryProducts( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getQueryProductsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service DatabaseCenter. + * + *
+   * DatabaseCenter contains methods to query fleet view for database resources.
+   * 
+ */ + public static final class DatabaseCenterFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DatabaseCenterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatabaseCenterFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatabaseCenterFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * QueryProducts provides a list of all possible products which can be used to
+     * filter database resources.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.databasecenter.v1beta.QueryProductsResponse> + queryProducts(com.google.cloud.databasecenter.v1beta.QueryProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getQueryProductsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_QUERY_PRODUCTS = 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_QUERY_PRODUCTS: + serviceImpl.queryProducts( + (com.google.cloud.databasecenter.v1beta.QueryProductsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.databasecenter.v1beta.QueryProductsResponse>) + 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( + getQueryProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.databasecenter.v1beta.QueryProductsRequest, + com.google.cloud.databasecenter.v1beta.QueryProductsResponse>( + service, METHODID_QUERY_PRODUCTS))) + .build(); + } + + private abstract static class DatabaseCenterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DatabaseCenterBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.databasecenter.v1beta.ServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DatabaseCenter"); + } + } + + private static final class DatabaseCenterFileDescriptorSupplier + extends DatabaseCenterBaseDescriptorSupplier { + DatabaseCenterFileDescriptorSupplier() {} + } + + private static final class DatabaseCenterMethodDescriptorSupplier + extends DatabaseCenterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DatabaseCenterMethodDescriptorSupplier(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 (DatabaseCenterGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DatabaseCenterFileDescriptorSupplier()) + .addMethod(getQueryProductsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-databasecenter/owlbot.py b/java-databasecenter/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-databasecenter/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-databasecenter/pom.xml b/java-databasecenter/pom.xml new file mode 100644 index 000000000000..ca4afbc17305 --- /dev/null +++ b/java-databasecenter/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + google-cloud-databasecenter-parent + pom + 0.0.1-SNAPSHOT + Google Database Center API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.73.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-databasecenter-parent + + + + + + com.google.cloud + google-cloud-databasecenter + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-databasecenter-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-databasecenter-v1beta + 0.0.1-SNAPSHOT + + + + + + + google-cloud-databasecenter + grpc-google-cloud-databasecenter-v1beta + proto-google-cloud-databasecenter-v1beta + google-cloud-databasecenter-bom + + + diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/clirr-ignored-differences.xml b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..f43d5c3e7cae --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/databasecenter/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/databasecenter/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/databasecenter/v1beta/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * clear() + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * clearField(*) + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * clone() + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * setField(*) + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/databasecenter/v1beta/** + * setUnknownFields(*) + ** + + diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/pom.xml b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/pom.xml new file mode 100644 index 000000000000..a93a194f931a --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-databasecenter-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-databasecenter-v1beta + Proto library for google-cloud-databasecenter + + com.google.cloud + google-cloud-databasecenter-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/Engine.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/Engine.java new file mode 100644 index 000000000000..076e71632faa --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/Engine.java @@ -0,0 +1,413 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/product.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +/** + * + * + *
+ * Engine refers to underlying database binary running in an instance.
+ * 
+ * + * Protobuf enum {@code google.cloud.databasecenter.v1beta.Engine} + */ +public enum Engine implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * UNSPECIFIED means engine type is not known or available.
+   * 
+ * + * ENGINE_UNSPECIFIED = 0; + */ + ENGINE_UNSPECIFIED(0), + /** + * + * + *
+   * MySQL binary running as an engine in the database instance.
+   * 
+ * + * ENGINE_MYSQL = 1; + */ + ENGINE_MYSQL(1), + /** + * + * + *
+   * Postgres binary running as engine in database instance.
+   * 
+ * + * ENGINE_POSTGRES = 2; + */ + ENGINE_POSTGRES(2), + /** + * + * + *
+   * SQLServer binary running as engine in database instance.
+   * 
+ * + * ENGINE_SQL_SERVER = 3; + */ + ENGINE_SQL_SERVER(3), + /** + * + * + *
+   * Native database binary running as engine in instance.
+   * 
+ * + * ENGINE_NATIVE = 4; + */ + ENGINE_NATIVE(4), + /** + * + * + *
+   * Memorystore with Redis dialect.
+   * 
+ * + * ENGINE_MEMORYSTORE_FOR_REDIS = 8; + */ + ENGINE_MEMORYSTORE_FOR_REDIS(8), + /** + * + * + *
+   * Memorystore with Redis cluster dialect.
+   * 
+ * + * ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER = 9; + */ + ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER(9), + /** + * + * + *
+   * Firestore with native mode.
+   * 
+ * + * ENGINE_FIRESTORE_WITH_NATIVE_MODE = 10; + */ + ENGINE_FIRESTORE_WITH_NATIVE_MODE(10), + /** + * + * + *
+   * Firestore with datastore mode.
+   * 
+ * + * ENGINE_FIRESTORE_WITH_DATASTORE_MODE = 11; + */ + ENGINE_FIRESTORE_WITH_DATASTORE_MODE(11), + /** + * + * + *
+   * Oracle Exadata engine.
+   * 
+ * + * ENGINE_EXADATA_ORACLE = 12; + */ + ENGINE_EXADATA_ORACLE(12), + /** + * + * + *
+   * Oracle Autonomous DB Serverless engine.
+   * 
+ * + * ENGINE_ADB_SERVERLESS_ORACLE = 13; + */ + ENGINE_ADB_SERVERLESS_ORACLE(13), + /** + * + * + *
+   * Firestore with MongoDB compatibility.
+   * 
+ * + * ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE = 14; + */ + ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE(14), + /** + * + * + *
+   * Other refers to rest of other database engine. This is to be when engine is
+   * known, but it is not present in this enum.
+   * 
+ * + * ENGINE_OTHER = 6; + */ + ENGINE_OTHER(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * UNSPECIFIED means engine type is not known or available.
+   * 
+ * + * ENGINE_UNSPECIFIED = 0; + */ + public static final int ENGINE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * MySQL binary running as an engine in the database instance.
+   * 
+ * + * ENGINE_MYSQL = 1; + */ + public static final int ENGINE_MYSQL_VALUE = 1; + + /** + * + * + *
+   * Postgres binary running as engine in database instance.
+   * 
+ * + * ENGINE_POSTGRES = 2; + */ + public static final int ENGINE_POSTGRES_VALUE = 2; + + /** + * + * + *
+   * SQLServer binary running as engine in database instance.
+   * 
+ * + * ENGINE_SQL_SERVER = 3; + */ + public static final int ENGINE_SQL_SERVER_VALUE = 3; + + /** + * + * + *
+   * Native database binary running as engine in instance.
+   * 
+ * + * ENGINE_NATIVE = 4; + */ + public static final int ENGINE_NATIVE_VALUE = 4; + + /** + * + * + *
+   * Memorystore with Redis dialect.
+   * 
+ * + * ENGINE_MEMORYSTORE_FOR_REDIS = 8; + */ + public static final int ENGINE_MEMORYSTORE_FOR_REDIS_VALUE = 8; + + /** + * + * + *
+   * Memorystore with Redis cluster dialect.
+   * 
+ * + * ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER = 9; + */ + public static final int ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER_VALUE = 9; + + /** + * + * + *
+   * Firestore with native mode.
+   * 
+ * + * ENGINE_FIRESTORE_WITH_NATIVE_MODE = 10; + */ + public static final int ENGINE_FIRESTORE_WITH_NATIVE_MODE_VALUE = 10; + + /** + * + * + *
+   * Firestore with datastore mode.
+   * 
+ * + * ENGINE_FIRESTORE_WITH_DATASTORE_MODE = 11; + */ + public static final int ENGINE_FIRESTORE_WITH_DATASTORE_MODE_VALUE = 11; + + /** + * + * + *
+   * Oracle Exadata engine.
+   * 
+ * + * ENGINE_EXADATA_ORACLE = 12; + */ + public static final int ENGINE_EXADATA_ORACLE_VALUE = 12; + + /** + * + * + *
+   * Oracle Autonomous DB Serverless engine.
+   * 
+ * + * ENGINE_ADB_SERVERLESS_ORACLE = 13; + */ + public static final int ENGINE_ADB_SERVERLESS_ORACLE_VALUE = 13; + + /** + * + * + *
+   * Firestore with MongoDB compatibility.
+   * 
+ * + * ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE = 14; + */ + public static final int ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE_VALUE = 14; + + /** + * + * + *
+   * Other refers to rest of other database engine. This is to be when engine is
+   * known, but it is not present in this enum.
+   * 
+ * + * ENGINE_OTHER = 6; + */ + public static final int ENGINE_OTHER_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 Engine 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 Engine forNumber(int value) { + switch (value) { + case 0: + return ENGINE_UNSPECIFIED; + case 1: + return ENGINE_MYSQL; + case 2: + return ENGINE_POSTGRES; + case 3: + return ENGINE_SQL_SERVER; + case 4: + return ENGINE_NATIVE; + case 8: + return ENGINE_MEMORYSTORE_FOR_REDIS; + case 9: + return ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER; + case 10: + return ENGINE_FIRESTORE_WITH_NATIVE_MODE; + case 11: + return ENGINE_FIRESTORE_WITH_DATASTORE_MODE; + case 12: + return ENGINE_EXADATA_ORACLE; + case 13: + return ENGINE_ADB_SERVERLESS_ORACLE; + case 14: + return ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE; + case 6: + return ENGINE_OTHER; + 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 Engine findValueByNumber(int number) { + return Engine.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ProductProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Engine[] VALUES = values(); + + public static Engine 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 Engine(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.databasecenter.v1beta.Engine) +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/Product.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/Product.java new file mode 100644 index 000000000000..20f3708bf844 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/Product.java @@ -0,0 +1,1203 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/product.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +/** + * + * + *
+ * Product specification for databasecenter resources.
+ * 
+ * + * Protobuf type {@code google.cloud.databasecenter.v1beta.Product} + */ +public final class Product extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.databasecenter.v1beta.Product) + ProductOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Product.newBuilder() to construct. + private Product(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Product() { + type_ = 0; + engine_ = 0; + version_ = ""; + minorVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Product(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ProductProto + .internal_static_google_cloud_databasecenter_v1beta_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.databasecenter.v1beta.ProductProto + .internal_static_google_cloud_databasecenter_v1beta_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.databasecenter.v1beta.Product.class, + com.google.cloud.databasecenter.v1beta.Product.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
+   * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+   * etc..
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+   * etc..
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.ProductType getType() { + com.google.cloud.databasecenter.v1beta.ProductType result = + com.google.cloud.databasecenter.v1beta.ProductType.forNumber(type_); + return result == null + ? com.google.cloud.databasecenter.v1beta.ProductType.UNRECOGNIZED + : result; + } + + public static final int ENGINE_FIELD_NUMBER = 2; + private int engine_ = 0; + + /** + * + * + *
+   * Optional. The specific engine that the underlying database is running.
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for engine. + */ + @java.lang.Override + public int getEngineValue() { + return engine_; + } + + /** + * + * + *
+   * Optional. The specific engine that the underlying database is running.
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The engine. + */ + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Engine getEngine() { + com.google.cloud.databasecenter.v1beta.Engine result = + com.google.cloud.databasecenter.v1beta.Engine.forNumber(engine_); + return result == null ? com.google.cloud.databasecenter.v1beta.Engine.UNRECOGNIZED : result; + } + + public static final int VERSION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + + /** + * + * + *
+   * Optional. Version of the underlying database engine. Example values: For
+   * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+   * etc.
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Version of the underlying database engine. Example values: For
+   * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+   * etc.
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MINOR_VERSION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object minorVersion_ = ""; + + /** + * + * + *
+   * Optional. Minor version of the underlying database engine. Example values:
+   * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+   * "14.4", "15.5" etc.
+   * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The minorVersion. + */ + @java.lang.Override + public java.lang.String getMinorVersion() { + java.lang.Object ref = minorVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + minorVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Minor version of the underlying database engine. Example values:
+   * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+   * "14.4", "15.5" etc.
+   * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for minorVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMinorVersionBytes() { + java.lang.Object ref = minorVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + minorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.databasecenter.v1beta.ProductType.PRODUCT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, type_); + } + if (engine_ != com.google.cloud.databasecenter.v1beta.Engine.ENGINE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, engine_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minorVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, minorVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.databasecenter.v1beta.ProductType.PRODUCT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (engine_ != com.google.cloud.databasecenter.v1beta.Engine.ENGINE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, engine_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minorVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, minorVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.databasecenter.v1beta.Product)) { + return super.equals(obj); + } + com.google.cloud.databasecenter.v1beta.Product other = + (com.google.cloud.databasecenter.v1beta.Product) obj; + + if (type_ != other.type_) return false; + if (engine_ != other.engine_) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!getMinorVersion().equals(other.getMinorVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + 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) + ENGINE_FIELD_NUMBER; + hash = (53 * hash) + engine_; + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + MINOR_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMinorVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.Product parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.databasecenter.v1beta.Product prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Product specification for databasecenter resources.
+   * 
+ * + * Protobuf type {@code google.cloud.databasecenter.v1beta.Product} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.databasecenter.v1beta.Product) + com.google.cloud.databasecenter.v1beta.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ProductProto + .internal_static_google_cloud_databasecenter_v1beta_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.databasecenter.v1beta.ProductProto + .internal_static_google_cloud_databasecenter_v1beta_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.databasecenter.v1beta.Product.class, + com.google.cloud.databasecenter.v1beta.Product.Builder.class); + } + + // Construct using com.google.cloud.databasecenter.v1beta.Product.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + engine_ = 0; + version_ = ""; + minorVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.databasecenter.v1beta.ProductProto + .internal_static_google_cloud_databasecenter_v1beta_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Product getDefaultInstanceForType() { + return com.google.cloud.databasecenter.v1beta.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Product build() { + com.google.cloud.databasecenter.v1beta.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Product buildPartial() { + com.google.cloud.databasecenter.v1beta.Product result = + new com.google.cloud.databasecenter.v1beta.Product(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.databasecenter.v1beta.Product result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.engine_ = engine_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.minorVersion_ = minorVersion_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.databasecenter.v1beta.Product) { + return mergeFrom((com.google.cloud.databasecenter.v1beta.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.databasecenter.v1beta.Product other) { + if (other == com.google.cloud.databasecenter.v1beta.Product.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.engine_ != 0) { + setEngineValue(other.getEngineValue()); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getMinorVersion().isEmpty()) { + minorVersion_ = other.minorVersion_; + 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 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + engine_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + minorVersion_ = 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 int type_ = 0; + + /** + * + * + *
+     * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+     * etc..
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+     * etc..
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + } + + /** + * + * + *
+     * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+     * etc..
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.ProductType getType() { + com.google.cloud.databasecenter.v1beta.ProductType result = + com.google.cloud.databasecenter.v1beta.ProductType.forNumber(type_); + return result == null + ? com.google.cloud.databasecenter.v1beta.ProductType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+     * etc..
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.databasecenter.v1beta.ProductType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+     * etc..
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private int engine_ = 0; + + /** + * + * + *
+     * Optional. The specific engine that the underlying database is running.
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for engine. + */ + @java.lang.Override + public int getEngineValue() { + return engine_; + } + + /** + * + * + *
+     * Optional. The specific engine that the underlying database is running.
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for engine to set. + * @return This builder for chaining. + */ + public Builder setEngineValue(int value) { + engine_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The specific engine that the underlying database is running.
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The engine. + */ + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Engine getEngine() { + com.google.cloud.databasecenter.v1beta.Engine result = + com.google.cloud.databasecenter.v1beta.Engine.forNumber(engine_); + return result == null ? com.google.cloud.databasecenter.v1beta.Engine.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. The specific engine that the underlying database is running.
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The engine to set. + * @return This builder for chaining. + */ + public Builder setEngine(com.google.cloud.databasecenter.v1beta.Engine value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + engine_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The specific engine that the underlying database is running.
+     * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearEngine() { + bitField0_ = (bitField0_ & ~0x00000002); + engine_ = 0; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + + /** + * + * + *
+     * Optional. Version of the underlying database engine. Example values: For
+     * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+     * etc.
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Version of the underlying database engine. Example values: For
+     * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+     * etc.
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Version of the underlying database engine. Example values: For
+     * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+     * etc.
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Version of the underlying database engine. Example values: For
+     * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+     * etc.
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Version of the underlying database engine. Example values: For
+     * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+     * etc.
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + version_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object minorVersion_ = ""; + + /** + * + * + *
+     * Optional. Minor version of the underlying database engine. Example values:
+     * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+     * "14.4", "15.5" etc.
+     * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The minorVersion. + */ + public java.lang.String getMinorVersion() { + java.lang.Object ref = minorVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + minorVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Minor version of the underlying database engine. Example values:
+     * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+     * "14.4", "15.5" etc.
+     * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for minorVersion. + */ + public com.google.protobuf.ByteString getMinorVersionBytes() { + java.lang.Object ref = minorVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + minorVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Minor version of the underlying database engine. Example values:
+     * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+     * "14.4", "15.5" etc.
+     * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The minorVersion to set. + * @return This builder for chaining. + */ + public Builder setMinorVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + minorVersion_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Minor version of the underlying database engine. Example values:
+     * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+     * "14.4", "15.5" etc.
+     * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearMinorVersion() { + minorVersion_ = getDefaultInstance().getMinorVersion(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Minor version of the underlying database engine. Example values:
+     * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+     * "14.4", "15.5" etc.
+     * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for minorVersion to set. + * @return This builder for chaining. + */ + public Builder setMinorVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + minorVersion_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.databasecenter.v1beta.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.databasecenter.v1beta.Product) + private static final com.google.cloud.databasecenter.v1beta.Product DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.databasecenter.v1beta.Product(); + } + + public static com.google.cloud.databasecenter.v1beta.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Product parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductOrBuilder.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductOrBuilder.java new file mode 100644 index 000000000000..8a51b26f9223 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/product.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +public interface ProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.databasecenter.v1beta.Product) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+   * etc..
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
+   * etc..
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.ProductType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The type. + */ + com.google.cloud.databasecenter.v1beta.ProductType getType(); + + /** + * + * + *
+   * Optional. The specific engine that the underlying database is running.
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for engine. + */ + int getEngineValue(); + + /** + * + * + *
+   * Optional. The specific engine that the underlying database is running.
+   * 
+ * + * + * .google.cloud.databasecenter.v1beta.Engine engine = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The engine. + */ + com.google.cloud.databasecenter.v1beta.Engine getEngine(); + + /** + * + * + *
+   * Optional. Version of the underlying database engine. Example values: For
+   * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+   * etc.
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The version. + */ + java.lang.String getVersion(); + + /** + * + * + *
+   * Optional. Version of the underlying database engine. Example values: For
+   * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
+   * etc.
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+   * Optional. Minor version of the underlying database engine. Example values:
+   * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+   * "14.4", "15.5" etc.
+   * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The minorVersion. + */ + java.lang.String getMinorVersion(); + + /** + * + * + *
+   * Optional. Minor version of the underlying database engine. Example values:
+   * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
+   * "14.4", "15.5" etc.
+   * 
+ * + * string minor_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for minorVersion. + */ + com.google.protobuf.ByteString getMinorVersionBytes(); +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductProto.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductProto.java new file mode 100644 index 000000000000..13838e3ff7b8 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductProto.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/product.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +public final class ProductProto { + private ProductProto() {} + + 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_databasecenter_v1beta_Product_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_databasecenter_v1beta_Product_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/databasecenter/v1beta/product.proto\022\"google.cloud.databasecenter." + + "v1beta\032\037google/api/field_behavior.proto\"\300\001\n" + + "\007Product\022B\n" + + "\004type\030\001 \001(\0162/.google.cloud" + + ".databasecenter.v1beta.ProductTypeB\003\340A\001\022?\n" + + "\006engine\030\002" + + " \001(\0162*.google.cloud.databasecenter.v1beta.EngineB\003\340A\001\022\024\n" + + "\007version\030\003 \001(\tB\003\340A\001\022\032\n\r" + + "minor_version\030\004 \001(\tB\003\340A\001*\223\003\n" + + "\006Engine\022\026\n" + + "\022ENGINE_UNSPECIFIED\020\000\022\020\n" + + "\014ENGINE_MYSQL\020\001\022\023\n" + + "\017ENGINE_POSTGRES\020\002\022\025\n" + + "\021ENGINE_SQL_SERVER\020\003\022\021\n\r" + + "ENGINE_NATIVE\020\004\022 \n" + + "\034ENGINE_MEMORYSTORE_FOR_REDIS\020\010\022(\n" + + "$ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER\020\t\022%\n" + + "!ENGINE_FIRESTORE_WITH_NATIVE_MODE\020\n" + + "\022(\n" + + "$ENGINE_FIRESTORE_WITH_DATASTORE_MODE\020\013\022\031\n" + + "\025ENGINE_EXADATA_ORACLE\020\014\022 \n" + + "\034ENGINE_ADB_SERVERLESS_ORACLE\020\r" + + "\0224\n" + + "0ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE\020\016\022\020\n" + + "\014ENGINE_OTHER\020\006*\304\002\n" + + "\013ProductType\022\034\n" + + "\030PRODUCT_TYPE_UNSPECIFIED\020\000\022\032\n" + + "\026PRODUCT_TYPE_CLOUD_SQL\020\001\022\030\n" + + "\024PRODUCT_TYPE_ALLOYDB\020\002\022\030\n" + + "\024PRODUCT_TYPE_SPANNER\020\003\022\031\n" + + "\025PRODUCT_TYPE_BIGTABLE\020\006\022\034\n" + + "\030PRODUCT_TYPE_MEMORYSTORE\020\007\022\032\n" + + "\026PRODUCT_TYPE_FIRESTORE\020\010\022\037\n" + + "\033PRODUCT_TYPE_COMPUTE_ENGINE\020\t\022\036\n" + + "\032PRODUCT_TYPE_ORACLE_ON_GCP\020\n" + + "\022\031\n" + + "\025PRODUCT_TYPE_BIGQUERY\020\013\022\026\n" + + "\022PRODUCT_TYPE_OTHER\020\005B\372\001\n" + + "&com.google.cloud.databasecenter.v1betaB\014ProductProtoP\001ZNcloud.google" + + ".com/go/databasecenter/apiv1beta/databas" + + "ecenterpb;databasecenterpb\252\002\"Google.Clou" + + "d.DatabaseCenter.V1Beta\312\002\"Google\\Cloud\\D" + + "atabaseCenter\\V1beta\352\002%Google::Cloud::DatabaseCenter::V1betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_cloud_databasecenter_v1beta_Product_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_databasecenter_v1beta_Product_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_databasecenter_v1beta_Product_descriptor, + new java.lang.String[] { + "Type", "Engine", "Version", "MinorVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductType.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductType.java new file mode 100644 index 000000000000..e5b71d8d8d74 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ProductType.java @@ -0,0 +1,371 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/product.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +/** + * + * + *
+ * ProductType is used to identify a database service offering either in a cloud
+ * provider or on-premise. This enum needs to be updated whenever we introduce
+ * a new ProductType.
+ * 
+ * + * Protobuf enum {@code google.cloud.databasecenter.v1beta.ProductType} + */ +public enum ProductType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * PRODUCT_TYPE_UNSPECIFIED means product type is not known or that the user
+   * didn't provide this field in the request.
+   * 
+ * + * PRODUCT_TYPE_UNSPECIFIED = 0; + */ + PRODUCT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Cloud SQL product area in GCP
+   * 
+ * + * PRODUCT_TYPE_CLOUD_SQL = 1; + */ + PRODUCT_TYPE_CLOUD_SQL(1), + /** + * + * + *
+   * AlloyDB product area in GCP
+   * 
+ * + * PRODUCT_TYPE_ALLOYDB = 2; + */ + PRODUCT_TYPE_ALLOYDB(2), + /** + * + * + *
+   * Spanner product area in GCP
+   * 
+ * + * PRODUCT_TYPE_SPANNER = 3; + */ + PRODUCT_TYPE_SPANNER(3), + /** + * + * + *
+   * Bigtable product area in GCP
+   * 
+ * + * PRODUCT_TYPE_BIGTABLE = 6; + */ + PRODUCT_TYPE_BIGTABLE(6), + /** + * + * + *
+   * Memorystore product area in GCP
+   * 
+ * + * PRODUCT_TYPE_MEMORYSTORE = 7; + */ + PRODUCT_TYPE_MEMORYSTORE(7), + /** + * + * + *
+   * Firestore product area in GCP
+   * 
+ * + * PRODUCT_TYPE_FIRESTORE = 8; + */ + PRODUCT_TYPE_FIRESTORE(8), + /** + * + * + *
+   * Compute Engine self managed databases
+   * 
+ * + * PRODUCT_TYPE_COMPUTE_ENGINE = 9; + */ + PRODUCT_TYPE_COMPUTE_ENGINE(9), + /** + * + * + *
+   * Oracle product area in GCP
+   * 
+ * + * PRODUCT_TYPE_ORACLE_ON_GCP = 10; + */ + PRODUCT_TYPE_ORACLE_ON_GCP(10), + /** + * + * + *
+   * BigQuery product area in GCP
+   * 
+ * + * PRODUCT_TYPE_BIGQUERY = 11; + */ + PRODUCT_TYPE_BIGQUERY(11), + /** + * + * + *
+   * Other refers to rest of other product type. This is to be when product type
+   * is known, but it is not present in this enum.
+   * 
+ * + * PRODUCT_TYPE_OTHER = 5; + */ + PRODUCT_TYPE_OTHER(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * PRODUCT_TYPE_UNSPECIFIED means product type is not known or that the user
+   * didn't provide this field in the request.
+   * 
+ * + * PRODUCT_TYPE_UNSPECIFIED = 0; + */ + public static final int PRODUCT_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Cloud SQL product area in GCP
+   * 
+ * + * PRODUCT_TYPE_CLOUD_SQL = 1; + */ + public static final int PRODUCT_TYPE_CLOUD_SQL_VALUE = 1; + + /** + * + * + *
+   * AlloyDB product area in GCP
+   * 
+ * + * PRODUCT_TYPE_ALLOYDB = 2; + */ + public static final int PRODUCT_TYPE_ALLOYDB_VALUE = 2; + + /** + * + * + *
+   * Spanner product area in GCP
+   * 
+ * + * PRODUCT_TYPE_SPANNER = 3; + */ + public static final int PRODUCT_TYPE_SPANNER_VALUE = 3; + + /** + * + * + *
+   * Bigtable product area in GCP
+   * 
+ * + * PRODUCT_TYPE_BIGTABLE = 6; + */ + public static final int PRODUCT_TYPE_BIGTABLE_VALUE = 6; + + /** + * + * + *
+   * Memorystore product area in GCP
+   * 
+ * + * PRODUCT_TYPE_MEMORYSTORE = 7; + */ + public static final int PRODUCT_TYPE_MEMORYSTORE_VALUE = 7; + + /** + * + * + *
+   * Firestore product area in GCP
+   * 
+ * + * PRODUCT_TYPE_FIRESTORE = 8; + */ + public static final int PRODUCT_TYPE_FIRESTORE_VALUE = 8; + + /** + * + * + *
+   * Compute Engine self managed databases
+   * 
+ * + * PRODUCT_TYPE_COMPUTE_ENGINE = 9; + */ + public static final int PRODUCT_TYPE_COMPUTE_ENGINE_VALUE = 9; + + /** + * + * + *
+   * Oracle product area in GCP
+   * 
+ * + * PRODUCT_TYPE_ORACLE_ON_GCP = 10; + */ + public static final int PRODUCT_TYPE_ORACLE_ON_GCP_VALUE = 10; + + /** + * + * + *
+   * BigQuery product area in GCP
+   * 
+ * + * PRODUCT_TYPE_BIGQUERY = 11; + */ + public static final int PRODUCT_TYPE_BIGQUERY_VALUE = 11; + + /** + * + * + *
+   * Other refers to rest of other product type. This is to be when product type
+   * is known, but it is not present in this enum.
+   * 
+ * + * PRODUCT_TYPE_OTHER = 5; + */ + public static final int PRODUCT_TYPE_OTHER_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 ProductType 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 ProductType forNumber(int value) { + switch (value) { + case 0: + return PRODUCT_TYPE_UNSPECIFIED; + case 1: + return PRODUCT_TYPE_CLOUD_SQL; + case 2: + return PRODUCT_TYPE_ALLOYDB; + case 3: + return PRODUCT_TYPE_SPANNER; + case 6: + return PRODUCT_TYPE_BIGTABLE; + case 7: + return PRODUCT_TYPE_MEMORYSTORE; + case 8: + return PRODUCT_TYPE_FIRESTORE; + case 9: + return PRODUCT_TYPE_COMPUTE_ENGINE; + case 10: + return PRODUCT_TYPE_ORACLE_ON_GCP; + case 11: + return PRODUCT_TYPE_BIGQUERY; + case 5: + return PRODUCT_TYPE_OTHER; + 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 ProductType findValueByNumber(int number) { + return ProductType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ProductProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ProductType[] VALUES = values(); + + public static ProductType 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 ProductType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.databasecenter.v1beta.ProductType) +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsRequest.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsRequest.java new file mode 100644 index 000000000000..688849f15057 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsRequest.java @@ -0,0 +1,1051 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +/** + * + * + *
+ * QueryProductsRequest is the request to get a list of products.
+ * 
+ * + * Protobuf type {@code google.cloud.databasecenter.v1beta.QueryProductsRequest} + */ +public final class QueryProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.databasecenter.v1beta.QueryProductsRequest) + QueryProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use QueryProductsRequest.newBuilder() to construct. + private QueryProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryProductsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryProductsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest.class, + com.google.cloud.databasecenter.v1beta.QueryProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. Parent can be a project, a folder, or an organization.
+   *
+   * The allowed values are:
+   *
+   * * projects/{PROJECT_ID}/locations/{LOCATION}
+   * (e.g.,"projects/foo-bar/locations/us-central1")
+   * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+   * (e.g.,"projects/12345678/locations/us-central1")
+   * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+   * (e.g.,"folders/1234567/locations/us-central1")
+   * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+   * (e.g.,"organizations/123456/locations/us-central1")
+   * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+   * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+   * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+   * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+   * 
+ * + * string parent = 3 [(.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. Parent can be a project, a folder, or an organization.
+   *
+   * The allowed values are:
+   *
+   * * projects/{PROJECT_ID}/locations/{LOCATION}
+   * (e.g.,"projects/foo-bar/locations/us-central1")
+   * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+   * (e.g.,"projects/12345678/locations/us-central1")
+   * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+   * (e.g.,"folders/1234567/locations/us-central1")
+   * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+   * (e.g.,"organizations/123456/locations/us-central1")
+   * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+   * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+   * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+   * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+   * 
+ * + * string parent = 3 [(.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 PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. If unspecified, at most 50 products will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLocations` call.
+   * Provide this to retrieve the subsequent page.
+   * All other parameters except page size should match the call that provided
+   * the page page token.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLocations` call.
+   * Provide this to retrieve the subsequent page.
+   * All other parameters except page size should match the call that provided
+   * the page page token.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, parent_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.databasecenter.v1beta.QueryProductsRequest)) { + return super.equals(obj); + } + com.google.cloud.databasecenter.v1beta.QueryProductsRequest other = + (com.google.cloud.databasecenter.v1beta.QueryProductsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * QueryProductsRequest is the request to get a list of products.
+   * 
+ * + * Protobuf type {@code google.cloud.databasecenter.v1beta.QueryProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.databasecenter.v1beta.QueryProductsRequest) + com.google.cloud.databasecenter.v1beta.QueryProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.databasecenter.v1beta.QueryProductsRequest.class, + com.google.cloud.databasecenter.v1beta.QueryProductsRequest.Builder.class); + } + + // Construct using com.google.cloud.databasecenter.v1beta.QueryProductsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsRequest getDefaultInstanceForType() { + return com.google.cloud.databasecenter.v1beta.QueryProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsRequest build() { + com.google.cloud.databasecenter.v1beta.QueryProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsRequest buildPartial() { + com.google.cloud.databasecenter.v1beta.QueryProductsRequest result = + new com.google.cloud.databasecenter.v1beta.QueryProductsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.databasecenter.v1beta.QueryProductsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.databasecenter.v1beta.QueryProductsRequest) { + return mergeFrom((com.google.cloud.databasecenter.v1beta.QueryProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.databasecenter.v1beta.QueryProductsRequest other) { + if (other == com.google.cloud.databasecenter.v1beta.QueryProductsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 8 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + parent_ = input.readStringRequireUtf8(); + 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 java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. Parent can be a project, a folder, or an organization.
+     *
+     * The allowed values are:
+     *
+     * * projects/{PROJECT_ID}/locations/{LOCATION}
+     * (e.g.,"projects/foo-bar/locations/us-central1")
+     * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+     * (e.g.,"projects/12345678/locations/us-central1")
+     * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+     * (e.g.,"folders/1234567/locations/us-central1")
+     * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+     * (e.g.,"organizations/123456/locations/us-central1")
+     * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+     * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+     * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+     * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+     * 
+ * + * string parent = 3 [(.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. Parent can be a project, a folder, or an organization.
+     *
+     * The allowed values are:
+     *
+     * * projects/{PROJECT_ID}/locations/{LOCATION}
+     * (e.g.,"projects/foo-bar/locations/us-central1")
+     * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+     * (e.g.,"projects/12345678/locations/us-central1")
+     * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+     * (e.g.,"folders/1234567/locations/us-central1")
+     * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+     * (e.g.,"organizations/123456/locations/us-central1")
+     * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+     * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+     * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+     * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+     * 
+ * + * string parent = 3 [(.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. Parent can be a project, a folder, or an organization.
+     *
+     * The allowed values are:
+     *
+     * * projects/{PROJECT_ID}/locations/{LOCATION}
+     * (e.g.,"projects/foo-bar/locations/us-central1")
+     * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+     * (e.g.,"projects/12345678/locations/us-central1")
+     * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+     * (e.g.,"folders/1234567/locations/us-central1")
+     * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+     * (e.g.,"organizations/123456/locations/us-central1")
+     * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+     * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+     * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+     * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+     * 
+ * + * string parent = 3 [(.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. Parent can be a project, a folder, or an organization.
+     *
+     * The allowed values are:
+     *
+     * * projects/{PROJECT_ID}/locations/{LOCATION}
+     * (e.g.,"projects/foo-bar/locations/us-central1")
+     * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+     * (e.g.,"projects/12345678/locations/us-central1")
+     * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+     * (e.g.,"folders/1234567/locations/us-central1")
+     * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+     * (e.g.,"organizations/123456/locations/us-central1")
+     * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+     * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+     * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+     * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+     * 
+ * + * string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Parent can be a project, a folder, or an organization.
+     *
+     * The allowed values are:
+     *
+     * * projects/{PROJECT_ID}/locations/{LOCATION}
+     * (e.g.,"projects/foo-bar/locations/us-central1")
+     * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+     * (e.g.,"projects/12345678/locations/us-central1")
+     * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+     * (e.g.,"folders/1234567/locations/us-central1")
+     * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+     * (e.g.,"organizations/123456/locations/us-central1")
+     * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+     * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+     * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+     * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+     * 
+ * + * string parent = 3 [(.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 int pageSize_; + + /** + * + * + *
+     * Optional. If unspecified, at most 50 products will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. If unspecified, at most 50 products will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If unspecified, at most 50 products will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLocations` call.
+     * Provide this to retrieve the subsequent page.
+     * All other parameters except page size should match the call that provided
+     * the page page token.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLocations` call.
+     * Provide this to retrieve the subsequent page.
+     * All other parameters except page size should match the call that provided
+     * the page page token.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLocations` call.
+     * Provide this to retrieve the subsequent page.
+     * All other parameters except page size should match the call that provided
+     * the page page token.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLocations` call.
+     * Provide this to retrieve the subsequent page.
+     * All other parameters except page size should match the call that provided
+     * the page page token.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLocations` call.
+     * Provide this to retrieve the subsequent page.
+     * All other parameters except page size should match the call that provided
+     * the page page token.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.databasecenter.v1beta.QueryProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.databasecenter.v1beta.QueryProductsRequest) + private static final com.google.cloud.databasecenter.v1beta.QueryProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.databasecenter.v1beta.QueryProductsRequest(); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryProductsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsRequestOrBuilder.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsRequestOrBuilder.java new file mode 100644 index 000000000000..2c0db587da71 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +public interface QueryProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.databasecenter.v1beta.QueryProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent can be a project, a folder, or an organization.
+   *
+   * The allowed values are:
+   *
+   * * projects/{PROJECT_ID}/locations/{LOCATION}
+   * (e.g.,"projects/foo-bar/locations/us-central1")
+   * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+   * (e.g.,"projects/12345678/locations/us-central1")
+   * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+   * (e.g.,"folders/1234567/locations/us-central1")
+   * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+   * (e.g.,"organizations/123456/locations/us-central1")
+   * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+   * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+   * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+   * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+   * 
+ * + * string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. Parent can be a project, a folder, or an organization.
+   *
+   * The allowed values are:
+   *
+   * * projects/{PROJECT_ID}/locations/{LOCATION}
+   * (e.g.,"projects/foo-bar/locations/us-central1")
+   * * projects/{PROJECT_NUMBER}/locations/{LOCATION}
+   * (e.g.,"projects/12345678/locations/us-central1")
+   * * folders/{FOLDER_NUMBER}/locations/{LOCATION}
+   * (e.g.,"folders/1234567/locations/us-central1")
+   * * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
+   * (e.g.,"organizations/123456/locations/us-central1")
+   * * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
+   * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
+   * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
+   * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
+   * 
+ * + * string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If unspecified, at most 50 products will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLocations` call.
+   * Provide this to retrieve the subsequent page.
+   * All other parameters except page size should match the call that provided
+   * the page page token.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLocations` call.
+   * Provide this to retrieve the subsequent page.
+   * All other parameters except page size should match the call that provided
+   * the page page token.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsResponse.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsResponse.java new file mode 100644 index 000000000000..c989eea4a51a --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsResponse.java @@ -0,0 +1,1466 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +/** + * + * + *
+ * QueryProductsResponse represents the response containing a list of products.
+ * 
+ * + * Protobuf type {@code google.cloud.databasecenter.v1beta.QueryProductsResponse} + */ +public final class QueryProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.databasecenter.v1beta.QueryProductsResponse) + QueryProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use QueryProductsResponse.newBuilder() to construct. + private QueryProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryProductsResponse() { + products_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryProductsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.databasecenter.v1beta.QueryProductsResponse.class, + com.google.cloud.databasecenter.v1beta.QueryProductsResponse.Builder.class); + } + + public static final int PRODUCTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List products_; + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + @java.lang.Override + public java.util.List getProductsList() { + return products_; + } + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + @java.lang.Override + public java.util.List + getProductsOrBuilderList() { + return products_; + } + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + @java.lang.Override + public int getProductsCount() { + return products_.size(); + } + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.Product getProducts(int index) { + return products_.get(index); + } + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.ProductOrBuilder getProductsOrBuilder(int index) { + return products_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < products_.size(); i++) { + output.writeMessage(1, products_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < products_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, products_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.databasecenter.v1beta.QueryProductsResponse)) { + return super.equals(obj); + } + com.google.cloud.databasecenter.v1beta.QueryProductsResponse other = + (com.google.cloud.databasecenter.v1beta.QueryProductsResponse) obj; + + if (!getProductsList().equals(other.getProductsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProductsCount() > 0) { + hash = (37 * hash) + PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getProductsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.databasecenter.v1beta.QueryProductsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * QueryProductsResponse represents the response containing a list of products.
+   * 
+ * + * Protobuf type {@code google.cloud.databasecenter.v1beta.QueryProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.databasecenter.v1beta.QueryProductsResponse) + com.google.cloud.databasecenter.v1beta.QueryProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.databasecenter.v1beta.QueryProductsResponse.class, + com.google.cloud.databasecenter.v1beta.QueryProductsResponse.Builder.class); + } + + // Construct using com.google.cloud.databasecenter.v1beta.QueryProductsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + } else { + products_ = null; + productsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.databasecenter.v1beta.ServiceProto + .internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsResponse + getDefaultInstanceForType() { + return com.google.cloud.databasecenter.v1beta.QueryProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsResponse build() { + com.google.cloud.databasecenter.v1beta.QueryProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsResponse buildPartial() { + com.google.cloud.databasecenter.v1beta.QueryProductsResponse result = + new com.google.cloud.databasecenter.v1beta.QueryProductsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.databasecenter.v1beta.QueryProductsResponse result) { + if (productsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + products_ = java.util.Collections.unmodifiableList(products_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.products_ = products_; + } else { + result.products_ = productsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.databasecenter.v1beta.QueryProductsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.databasecenter.v1beta.QueryProductsResponse) { + return mergeFrom((com.google.cloud.databasecenter.v1beta.QueryProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.databasecenter.v1beta.QueryProductsResponse other) { + if (other + == com.google.cloud.databasecenter.v1beta.QueryProductsResponse.getDefaultInstance()) + return this; + if (productsBuilder_ == null) { + if (!other.products_.isEmpty()) { + if (products_.isEmpty()) { + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProductsIsMutable(); + products_.addAll(other.products_); + } + onChanged(); + } + } else { + if (!other.products_.isEmpty()) { + if (productsBuilder_.isEmpty()) { + productsBuilder_.dispose(); + productsBuilder_ = null; + products_ = other.products_; + bitField0_ = (bitField0_ & ~0x00000001); + productsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductsFieldBuilder() + : null; + } else { + productsBuilder_.addAllMessages(other.products_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.databasecenter.v1beta.Product m = + input.readMessage( + com.google.cloud.databasecenter.v1beta.Product.parser(), extensionRegistry); + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(m); + } else { + productsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List products_ = + java.util.Collections.emptyList(); + + private void ensureProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + products_ = + new java.util.ArrayList(products_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.databasecenter.v1beta.Product, + com.google.cloud.databasecenter.v1beta.Product.Builder, + com.google.cloud.databasecenter.v1beta.ProductOrBuilder> + productsBuilder_; + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public java.util.List getProductsList() { + if (productsBuilder_ == null) { + return java.util.Collections.unmodifiableList(products_); + } else { + return productsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public int getProductsCount() { + if (productsBuilder_ == null) { + return products_.size(); + } else { + return productsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public com.google.cloud.databasecenter.v1beta.Product getProducts(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder setProducts(int index, com.google.cloud.databasecenter.v1beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.set(index, value); + onChanged(); + } else { + productsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder setProducts( + int index, com.google.cloud.databasecenter.v1beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.set(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder addProducts(com.google.cloud.databasecenter.v1beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(value); + onChanged(); + } else { + productsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder addProducts(int index, com.google.cloud.databasecenter.v1beta.Product value) { + if (productsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductsIsMutable(); + products_.add(index, value); + onChanged(); + } else { + productsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder addProducts( + com.google.cloud.databasecenter.v1beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder addProducts( + int index, com.google.cloud.databasecenter.v1beta.Product.Builder builderForValue) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.add(index, builderForValue.build()); + onChanged(); + } else { + productsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder addAllProducts( + java.lang.Iterable values) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, products_); + onChanged(); + } else { + productsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder clearProducts() { + if (productsBuilder_ == null) { + products_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + productsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public Builder removeProducts(int index) { + if (productsBuilder_ == null) { + ensureProductsIsMutable(); + products_.remove(index); + onChanged(); + } else { + productsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public com.google.cloud.databasecenter.v1beta.Product.Builder getProductsBuilder(int index) { + return getProductsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public com.google.cloud.databasecenter.v1beta.ProductOrBuilder getProductsOrBuilder(int index) { + if (productsBuilder_ == null) { + return products_.get(index); + } else { + return productsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public java.util.List + getProductsOrBuilderList() { + if (productsBuilder_ != null) { + return productsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(products_); + } + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public com.google.cloud.databasecenter.v1beta.Product.Builder addProductsBuilder() { + return getProductsFieldBuilder() + .addBuilder(com.google.cloud.databasecenter.v1beta.Product.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public com.google.cloud.databasecenter.v1beta.Product.Builder addProductsBuilder(int index) { + return getProductsFieldBuilder() + .addBuilder(index, com.google.cloud.databasecenter.v1beta.Product.getDefaultInstance()); + } + + /** + * + * + *
+     * List of database products returned.
+     * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + public java.util.List + getProductsBuilderList() { + return getProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.databasecenter.v1beta.Product, + com.google.cloud.databasecenter.v1beta.Product.Builder, + com.google.cloud.databasecenter.v1beta.ProductOrBuilder> + getProductsFieldBuilder() { + if (productsBuilder_ == null) { + productsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.databasecenter.v1beta.Product, + com.google.cloud.databasecenter.v1beta.Product.Builder, + com.google.cloud.databasecenter.v1beta.ProductOrBuilder>( + products_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + products_ = null; + } + return productsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. List of unreachable regions from where data could not be
+     * retrieved.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.databasecenter.v1beta.QueryProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.databasecenter.v1beta.QueryProductsResponse) + private static final com.google.cloud.databasecenter.v1beta.QueryProductsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.databasecenter.v1beta.QueryProductsResponse(); + } + + public static com.google.cloud.databasecenter.v1beta.QueryProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryProductsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.databasecenter.v1beta.QueryProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsResponseOrBuilder.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsResponseOrBuilder.java new file mode 100644 index 000000000000..6b1db0d6b56b --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/QueryProductsResponseOrBuilder.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +public interface QueryProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.databasecenter.v1beta.QueryProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + java.util.List getProductsList(); + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + com.google.cloud.databasecenter.v1beta.Product getProducts(int index); + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + int getProductsCount(); + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + java.util.List + getProductsOrBuilderList(); + + /** + * + * + *
+   * List of database products returned.
+   * 
+ * + * repeated .google.cloud.databasecenter.v1beta.Product products = 1; + */ + com.google.cloud.databasecenter.v1beta.ProductOrBuilder getProductsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
+   * Unordered list. List of unreachable regions from where data could not be
+   * retrieved.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ServiceProto.java b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ServiceProto.java new file mode 100644 index 000000000000..97a72865b490 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/java/com/google/cloud/databasecenter/v1beta/ServiceProto.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/databasecenter/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.databasecenter.v1beta; + +public final class ServiceProto { + private ServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_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/databasecenter/v1beta/service.proto\022\"google.cloud.databasecenter." + + "v1beta\032\034google/api/annotations.proto\032\027go" + + "ogle/api/client.proto\032\037google/api/field_" + + "behavior.proto\0320google/cloud/databasecenter/v1beta/product.proto\"\\\n" + + "\024QueryProductsRequest\022\023\n" + + "\006parent\030\003 \001(\tB\003\340A\002\022\026\n" + + "\tpage_size\030\001 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\"\211\001\n" + + "\025QueryProductsResponse\022=\n" + + "\010products\030\001 \003(\0132+.google.cloud.databasecenter.v1beta.Product\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\030\n" + + "\013unreachable\030\003 \003(\tB\003\340A\0062\211\002\n" + + "\016DatabaseCenter\022\243\001\n\r" + + "QueryProducts\0228.google.cloud.databasecenter.v1beta.QueryProductsRequest\0329.goog" + + "le.cloud.databasecenter.v1beta.QueryProd" + + "uctsResponse\"\035\202\323\344\223\002\027\022\025/v1beta:queryProdu" + + "cts\032Q\312A\035databasecenter.googleapis.com\322A." + + "https://www.googleapis.com/auth/cloud-platformB\372\001\n" + + "&com.google.cloud.databasecenter.v1betaB\014ServiceProtoP\001ZNcloud.google." + + "com/go/databasecenter/apiv1beta/database" + + "centerpb;databasecenterpb\252\002\"Google.Cloud" + + ".DatabaseCenter.V1Beta\312\002\"Google\\Cloud\\Da" + + "tabaseCenter\\V1beta\352\002%Google::Cloud::DatabaseCenter::V1betab\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.databasecenter.v1beta.ProductProto.getDescriptor(), + }); + internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_databasecenter_v1beta_QueryProductsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_databasecenter_v1beta_QueryProductsResponse_descriptor, + new java.lang.String[] { + "Products", "NextPageToken", "Unreachable", + }); + 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); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.databasecenter.v1beta.ProductProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/proto/google/cloud/databasecenter/v1beta/product.proto b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/proto/google/cloud/databasecenter/v1beta/product.proto new file mode 100644 index 000000000000..f24f5cabcddb --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/proto/google/cloud/databasecenter/v1beta/product.proto @@ -0,0 +1,130 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.databasecenter.v1beta; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta"; +option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ProductProto"; +option java_package = "com.google.cloud.databasecenter.v1beta"; +option php_namespace = "Google\\Cloud\\DatabaseCenter\\V1beta"; +option ruby_package = "Google::Cloud::DatabaseCenter::V1beta"; + +// Engine refers to underlying database binary running in an instance. +enum Engine { + // UNSPECIFIED means engine type is not known or available. + ENGINE_UNSPECIFIED = 0; + + // MySQL binary running as an engine in the database instance. + ENGINE_MYSQL = 1; + + // Postgres binary running as engine in database instance. + ENGINE_POSTGRES = 2; + + // SQLServer binary running as engine in database instance. + ENGINE_SQL_SERVER = 3; + + // Native database binary running as engine in instance. + ENGINE_NATIVE = 4; + + // Memorystore with Redis dialect. + ENGINE_MEMORYSTORE_FOR_REDIS = 8; + + // Memorystore with Redis cluster dialect. + ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER = 9; + + // Firestore with native mode. + ENGINE_FIRESTORE_WITH_NATIVE_MODE = 10; + + // Firestore with datastore mode. + ENGINE_FIRESTORE_WITH_DATASTORE_MODE = 11; + + // Oracle Exadata engine. + ENGINE_EXADATA_ORACLE = 12; + + // Oracle Autonomous DB Serverless engine. + ENGINE_ADB_SERVERLESS_ORACLE = 13; + + // Firestore with MongoDB compatibility. + ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE = 14; + + // Other refers to rest of other database engine. This is to be when engine is + // known, but it is not present in this enum. + ENGINE_OTHER = 6; +} + +// ProductType is used to identify a database service offering either in a cloud +// provider or on-premise. This enum needs to be updated whenever we introduce +// a new ProductType. +enum ProductType { + // PRODUCT_TYPE_UNSPECIFIED means product type is not known or that the user + // didn't provide this field in the request. + PRODUCT_TYPE_UNSPECIFIED = 0; + + // Cloud SQL product area in GCP + PRODUCT_TYPE_CLOUD_SQL = 1; + + // AlloyDB product area in GCP + PRODUCT_TYPE_ALLOYDB = 2; + + // Spanner product area in GCP + PRODUCT_TYPE_SPANNER = 3; + + // Bigtable product area in GCP + PRODUCT_TYPE_BIGTABLE = 6; + + // Memorystore product area in GCP + PRODUCT_TYPE_MEMORYSTORE = 7; + + // Firestore product area in GCP + PRODUCT_TYPE_FIRESTORE = 8; + + // Compute Engine self managed databases + PRODUCT_TYPE_COMPUTE_ENGINE = 9; + + // Oracle product area in GCP + PRODUCT_TYPE_ORACLE_ON_GCP = 10; + + // BigQuery product area in GCP + PRODUCT_TYPE_BIGQUERY = 11; + + // Other refers to rest of other product type. This is to be when product type + // is known, but it is not present in this enum. + PRODUCT_TYPE_OTHER = 5; +} + +// Product specification for databasecenter resources. +message Product { + // Optional. Type of specific database product. It could be CloudSQL, AlloyDB + // etc.. + ProductType type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The specific engine that the underlying database is running. + Engine engine = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Version of the underlying database engine. Example values: For + // MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15" + // etc. + string version = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minor version of the underlying database engine. Example values: + // For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be + // "14.4", "15.5" etc. + string minor_version = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/proto/google/cloud/databasecenter/v1beta/service.proto b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/proto/google/cloud/databasecenter/v1beta/service.proto new file mode 100644 index 000000000000..cf4577993a53 --- /dev/null +++ b/java-databasecenter/proto-google-cloud-databasecenter-v1beta/src/main/proto/google/cloud/databasecenter/v1beta/service.proto @@ -0,0 +1,93 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.databasecenter.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/databasecenter/v1beta/product.proto"; + +option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta"; +option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.databasecenter.v1beta"; +option php_namespace = "Google\\Cloud\\DatabaseCenter\\V1beta"; +option ruby_package = "Google::Cloud::DatabaseCenter::V1beta"; + +// DatabaseCenter contains methods to query fleet view for database resources. +service DatabaseCenter { + option (google.api.default_host) = "databasecenter.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // QueryProducts provides a list of all possible products which can be used to + // filter database resources. + rpc QueryProducts(QueryProductsRequest) returns (QueryProductsResponse) { + option (google.api.http) = { + get: "/v1beta:queryProducts" + }; + } +} + +// QueryProductsRequest is the request to get a list of products. +message QueryProductsRequest { + // Required. Parent can be a project, a folder, or an organization. + // + // The allowed values are: + // + // * projects/{PROJECT_ID}/locations/{LOCATION} + // (e.g.,"projects/foo-bar/locations/us-central1") + // * projects/{PROJECT_NUMBER}/locations/{LOCATION} + // (e.g.,"projects/12345678/locations/us-central1") + // * folders/{FOLDER_NUMBER}/locations/{LOCATION} + // (e.g.,"folders/1234567/locations/us-central1") + // * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION} + // (e.g.,"organizations/123456/locations/us-central1") + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + string parent = 3 [ + (google.api.field_behavior) = REQUIRED + ]; + + // Optional. If unspecified, at most 50 products will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListLocations` call. + // Provide this to retrieve the subsequent page. + // All other parameters except page size should match the call that provided + // the page page token. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// QueryProductsResponse represents the response containing a list of products. +message QueryProductsResponse { + // List of database products returned. + repeated Product products = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages + string next_page_token = 2; + + // Unordered list. List of unreachable regions from where data could not be + // retrieved. + repeated string unreachable = 3 + [(google.api.field_behavior) = UNORDERED_LIST]; +} diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateSetCredentialsProvider.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f57116fedf62 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenter_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.databasecenter.v1beta.DatabaseCenterClient; +import com.google.cloud.databasecenter.v1beta.DatabaseCenterSettings; +import com.google.cloud.databasecenter.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DatabaseCenterSettings databaseCenterSettings = + DatabaseCenterSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create(databaseCenterSettings); + } +} +// [END databasecenter_v1beta_generated_DatabaseCenter_Create_SetCredentialsProvider_sync] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateSetEndpoint.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..dfe508db8b93 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenter_Create_SetEndpoint_sync] +import com.google.cloud.databasecenter.v1beta.DatabaseCenterClient; +import com.google.cloud.databasecenter.v1beta.DatabaseCenterSettings; +import com.google.cloud.databasecenter.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DatabaseCenterSettings databaseCenterSettings = + DatabaseCenterSettings.newBuilder().setEndpoint(myEndpoint).build(); + DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create(databaseCenterSettings); + } +} +// [END databasecenter_v1beta_generated_DatabaseCenter_Create_SetEndpoint_sync] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateUseHttpJsonTransport.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..566ae8aed1b8 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenter_Create_UseHttpJsonTransport_sync] +import com.google.cloud.databasecenter.v1beta.DatabaseCenterClient; +import com.google.cloud.databasecenter.v1beta.DatabaseCenterSettings; + +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 + DatabaseCenterSettings databaseCenterSettings = + DatabaseCenterSettings.newHttpJsonBuilder().build(); + DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create(databaseCenterSettings); + } +} +// [END databasecenter_v1beta_generated_DatabaseCenter_Create_UseHttpJsonTransport_sync] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/AsyncQueryProducts.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/AsyncQueryProducts.java new file mode 100644 index 000000000000..dc16ef8635e8 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/AsyncQueryProducts.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenter_QueryProducts_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.databasecenter.v1beta.DatabaseCenterClient; +import com.google.cloud.databasecenter.v1beta.Product; +import com.google.cloud.databasecenter.v1beta.QueryProductsRequest; + +public class AsyncQueryProducts { + + public static void main(String[] args) throws Exception { + asyncQueryProducts(); + } + + public static void asyncQueryProducts() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) { + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + databaseCenterClient.queryProductsPagedCallable().futureCall(request); + // Do something. + for (Product element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END databasecenter_v1beta_generated_DatabaseCenter_QueryProducts_async] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/AsyncQueryProductsPaged.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/AsyncQueryProductsPaged.java new file mode 100644 index 000000000000..f236b6450f88 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/AsyncQueryProductsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenter_QueryProducts_Paged_async] +import com.google.cloud.databasecenter.v1beta.DatabaseCenterClient; +import com.google.cloud.databasecenter.v1beta.Product; +import com.google.cloud.databasecenter.v1beta.QueryProductsRequest; +import com.google.cloud.databasecenter.v1beta.QueryProductsResponse; +import com.google.common.base.Strings; + +public class AsyncQueryProductsPaged { + + public static void main(String[] args) throws Exception { + asyncQueryProductsPaged(); + } + + public static void asyncQueryProductsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) { + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + QueryProductsResponse response = databaseCenterClient.queryProductsCallable().call(request); + for (Product element : response.getProductsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END databasecenter_v1beta_generated_DatabaseCenter_QueryProducts_Paged_async] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/SyncQueryProducts.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/SyncQueryProducts.java new file mode 100644 index 000000000000..f51be46dee08 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecenter/queryproducts/SyncQueryProducts.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenter_QueryProducts_sync] +import com.google.cloud.databasecenter.v1beta.DatabaseCenterClient; +import com.google.cloud.databasecenter.v1beta.Product; +import com.google.cloud.databasecenter.v1beta.QueryProductsRequest; + +public class SyncQueryProducts { + + public static void main(String[] args) throws Exception { + syncQueryProducts(); + } + + public static void syncQueryProducts() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DatabaseCenterClient databaseCenterClient = DatabaseCenterClient.create()) { + QueryProductsRequest request = + QueryProductsRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Product element : databaseCenterClient.queryProducts(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END databasecenter_v1beta_generated_DatabaseCenter_QueryProducts_sync] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecentersettings/queryproducts/SyncQueryProducts.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecentersettings/queryproducts/SyncQueryProducts.java new file mode 100644 index 000000000000..4ecd453e205b --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/databasecentersettings/queryproducts/SyncQueryProducts.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenterSettings_QueryProducts_sync] +import com.google.cloud.databasecenter.v1beta.DatabaseCenterSettings; +import java.time.Duration; + +public class SyncQueryProducts { + + public static void main(String[] args) throws Exception { + syncQueryProducts(); + } + + public static void syncQueryProducts() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DatabaseCenterSettings.Builder databaseCenterSettingsBuilder = + DatabaseCenterSettings.newBuilder(); + databaseCenterSettingsBuilder + .queryProductsSettings() + .setRetrySettings( + databaseCenterSettingsBuilder + .queryProductsSettings() + .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()); + DatabaseCenterSettings databaseCenterSettings = databaseCenterSettingsBuilder.build(); + } +} +// [END databasecenter_v1beta_generated_DatabaseCenterSettings_QueryProducts_sync] diff --git a/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/stub/databasecenterstubsettings/queryproducts/SyncQueryProducts.java b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/stub/databasecenterstubsettings/queryproducts/SyncQueryProducts.java new file mode 100644 index 000000000000..a992a33ce242 --- /dev/null +++ b/java-databasecenter/samples/snippets/generated/com/google/cloud/databasecenter/v1beta/stub/databasecenterstubsettings/queryproducts/SyncQueryProducts.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.databasecenter.v1beta.stub.samples; + +// [START databasecenter_v1beta_generated_DatabaseCenterStubSettings_QueryProducts_sync] +import com.google.cloud.databasecenter.v1beta.stub.DatabaseCenterStubSettings; +import java.time.Duration; + +public class SyncQueryProducts { + + public static void main(String[] args) throws Exception { + syncQueryProducts(); + } + + public static void syncQueryProducts() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DatabaseCenterStubSettings.Builder databaseCenterSettingsBuilder = + DatabaseCenterStubSettings.newBuilder(); + databaseCenterSettingsBuilder + .queryProductsSettings() + .setRetrySettings( + databaseCenterSettingsBuilder + .queryProductsSettings() + .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()); + DatabaseCenterStubSettings databaseCenterSettings = databaseCenterSettingsBuilder.build(); + } +} +// [END databasecenter_v1beta_generated_DatabaseCenterStubSettings_QueryProducts_sync] diff --git a/pom.xml b/pom.xml index 52d55170b877..2b8588398f33 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,7 @@ java-containeranalysis java-contentwarehouse java-data-fusion + java-databasecenter java-datacatalog java-dataflow java-dataform diff --git a/versions.txt b/versions.txt index ce66b973d75d..72fbe2602d79 100644 --- a/versions.txt +++ b/versions.txt @@ -923,3 +923,6 @@ grpc-data-manager-v1:0.0.0:0.0.1-SNAPSHOT google-cloud-vectorsearch:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-vectorsearch-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-vectorsearch-v1:0.0.0:0.0.1-SNAPSHOT +google-cloud-databasecenter:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-databasecenter-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-databasecenter-v1beta:0.0.0:0.0.1-SNAPSHOT