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(). + * + *
| Method | + *Description | + *Method 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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of 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 UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 UnaryCallableThe default instance has everything set to sensible defaults: + * + *
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 ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * 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 The default instance has everything set to sensible defaults:
+ *
+ * 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:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcDatabaseCenterCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public 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 This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonDatabaseCenterCallableFactory
+ implements HttpJsonStubCallableFactory 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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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.
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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