com.google.cloud.alloydb.v1beta.stub.AlloyDBAdminStubSettings Maven / Gradle / Ivy
Show all versions of google-cloud-alloydb Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.alloydb.v1beta.stub;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListDatabasesPagedResponse;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse;
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListUsersPagedResponse;
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.grpc.ProtoOperationTransformers;
import com.google.api.gax.httpjson.GaxHttpJsonProperties;
import com.google.api.gax.httpjson.HttpJsonTransportChannel;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
import com.google.api.gax.rpc.PagedListResponseFactory;
import com.google.api.gax.rpc.StatusCode;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.alloydb.v1beta.Backup;
import com.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest;
import com.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse;
import com.google.cloud.alloydb.v1beta.Cluster;
import com.google.cloud.alloydb.v1beta.ConnectionInfo;
import com.google.cloud.alloydb.v1beta.CreateBackupRequest;
import com.google.cloud.alloydb.v1beta.CreateClusterRequest;
import com.google.cloud.alloydb.v1beta.CreateInstanceRequest;
import com.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest;
import com.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest;
import com.google.cloud.alloydb.v1beta.CreateUserRequest;
import com.google.cloud.alloydb.v1beta.Database;
import com.google.cloud.alloydb.v1beta.DeleteBackupRequest;
import com.google.cloud.alloydb.v1beta.DeleteClusterRequest;
import com.google.cloud.alloydb.v1beta.DeleteInstanceRequest;
import com.google.cloud.alloydb.v1beta.DeleteUserRequest;
import com.google.cloud.alloydb.v1beta.FailoverInstanceRequest;
import com.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest;
import com.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse;
import com.google.cloud.alloydb.v1beta.GetBackupRequest;
import com.google.cloud.alloydb.v1beta.GetClusterRequest;
import com.google.cloud.alloydb.v1beta.GetConnectionInfoRequest;
import com.google.cloud.alloydb.v1beta.GetInstanceRequest;
import com.google.cloud.alloydb.v1beta.GetUserRequest;
import com.google.cloud.alloydb.v1beta.InjectFaultRequest;
import com.google.cloud.alloydb.v1beta.Instance;
import com.google.cloud.alloydb.v1beta.ListBackupsRequest;
import com.google.cloud.alloydb.v1beta.ListBackupsResponse;
import com.google.cloud.alloydb.v1beta.ListClustersRequest;
import com.google.cloud.alloydb.v1beta.ListClustersResponse;
import com.google.cloud.alloydb.v1beta.ListDatabasesRequest;
import com.google.cloud.alloydb.v1beta.ListDatabasesResponse;
import com.google.cloud.alloydb.v1beta.ListInstancesRequest;
import com.google.cloud.alloydb.v1beta.ListInstancesResponse;
import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest;
import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse;
import com.google.cloud.alloydb.v1beta.ListUsersRequest;
import com.google.cloud.alloydb.v1beta.ListUsersResponse;
import com.google.cloud.alloydb.v1beta.OperationMetadata;
import com.google.cloud.alloydb.v1beta.PromoteClusterRequest;
import com.google.cloud.alloydb.v1beta.RestartInstanceRequest;
import com.google.cloud.alloydb.v1beta.RestoreClusterRequest;
import com.google.cloud.alloydb.v1beta.SupportedDatabaseFlag;
import com.google.cloud.alloydb.v1beta.UpdateBackupRequest;
import com.google.cloud.alloydb.v1beta.UpdateClusterRequest;
import com.google.cloud.alloydb.v1beta.UpdateInstanceRequest;
import com.google.cloud.alloydb.v1beta.UpdateUserRequest;
import com.google.cloud.alloydb.v1beta.User;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.threeten.bp.Duration;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link AlloyDBAdminStub}.
*
* The default instance has everything set to sensible defaults:
*
*
* - The default service address (alloydb.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 getCluster:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder =
* AlloyDBAdminStubSettings.newBuilder();
* alloyDBAdminSettingsBuilder
* .getClusterSettings()
* .setRetrySettings(
* alloyDBAdminSettingsBuilder
* .getClusterSettings()
* .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());
* AlloyDBAdminStubSettings alloyDBAdminSettings = alloyDBAdminSettingsBuilder.build();
* }
*
* Please refer to the [Client Side Retry
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
* additional support in setting retries.
*
* To configure the RetrySettings of a Long Running Operation method, create an
* OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
* configure the RetrySettings for createCluster:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* AlloyDBAdminStubSettings.Builder alloyDBAdminSettingsBuilder =
* AlloyDBAdminStubSettings.newBuilder();
* TimedRetryAlgorithm timedRetryAlgorithm =
* OperationalTimedPollAlgorithm.create(
* RetrySettings.newBuilder()
* .setInitialRetryDelayDuration(Duration.ofMillis(500))
* .setRetryDelayMultiplier(1.5)
* .setMaxRetryDelay(Duration.ofMillis(5000))
* .setTotalTimeoutDuration(Duration.ofHours(24))
* .build());
* alloyDBAdminSettingsBuilder
* .createClusterOperationSettings()
* .setPollingAlgorithm(timedRetryAlgorithm)
* .build();
* }
*/
@BetaApi
@Generated("by gapic-generator-java")
public class AlloyDBAdminStubSettings extends StubSettings {
/** The default scopes of the service. */
private static final ImmutableList DEFAULT_SERVICE_SCOPES =
ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
private final PagedCallSettings<
ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
listClustersSettings;
private final UnaryCallSettings getClusterSettings;
private final UnaryCallSettings createClusterSettings;
private final OperationCallSettings
createClusterOperationSettings;
private final UnaryCallSettings updateClusterSettings;
private final OperationCallSettings
updateClusterOperationSettings;
private final UnaryCallSettings deleteClusterSettings;
private final OperationCallSettings
deleteClusterOperationSettings;
private final UnaryCallSettings promoteClusterSettings;
private final OperationCallSettings
promoteClusterOperationSettings;
private final UnaryCallSettings restoreClusterSettings;
private final OperationCallSettings
restoreClusterOperationSettings;
private final UnaryCallSettings
createSecondaryClusterSettings;
private final OperationCallSettings
createSecondaryClusterOperationSettings;
private final PagedCallSettings<
ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>
listInstancesSettings;
private final UnaryCallSettings getInstanceSettings;
private final UnaryCallSettings createInstanceSettings;
private final OperationCallSettings
createInstanceOperationSettings;
private final UnaryCallSettings
createSecondaryInstanceSettings;
private final OperationCallSettings
createSecondaryInstanceOperationSettings;
private final UnaryCallSettings
batchCreateInstancesSettings;
private final OperationCallSettings<
BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata>
batchCreateInstancesOperationSettings;
private final UnaryCallSettings updateInstanceSettings;
private final OperationCallSettings
updateInstanceOperationSettings;
private final UnaryCallSettings deleteInstanceSettings;
private final OperationCallSettings
deleteInstanceOperationSettings;
private final UnaryCallSettings failoverInstanceSettings;
private final OperationCallSettings
failoverInstanceOperationSettings;
private final UnaryCallSettings injectFaultSettings;
private final OperationCallSettings
injectFaultOperationSettings;
private final UnaryCallSettings restartInstanceSettings;
private final OperationCallSettings
restartInstanceOperationSettings;
private final PagedCallSettings
listBackupsSettings;
private final UnaryCallSettings getBackupSettings;
private final UnaryCallSettings createBackupSettings;
private final OperationCallSettings
createBackupOperationSettings;
private final UnaryCallSettings updateBackupSettings;
private final OperationCallSettings
updateBackupOperationSettings;
private final UnaryCallSettings deleteBackupSettings;
private final OperationCallSettings
deleteBackupOperationSettings;
private final PagedCallSettings<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
ListSupportedDatabaseFlagsPagedResponse>
listSupportedDatabaseFlagsSettings;
private final UnaryCallSettings<
GenerateClientCertificateRequest, GenerateClientCertificateResponse>
generateClientCertificateSettings;
private final UnaryCallSettings
getConnectionInfoSettings;
private final PagedCallSettings
listUsersSettings;
private final UnaryCallSettings getUserSettings;
private final UnaryCallSettings createUserSettings;
private final UnaryCallSettings updateUserSettings;
private final UnaryCallSettings deleteUserSettings;
private final PagedCallSettings<
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
listDatabasesSettings;
private final PagedCallSettings<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings;
private final UnaryCallSettings getLocationSettings;
private static final PagedListDescriptor
LIST_CLUSTERS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListClustersRequest injectToken(ListClustersRequest payload, String token) {
return ListClustersRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListClustersRequest injectPageSize(ListClustersRequest payload, int pageSize) {
return ListClustersRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListClustersRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListClustersResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListClustersResponse payload) {
return payload.getClustersList();
}
};
private static final PagedListDescriptor
LIST_INSTANCES_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) {
return ListInstancesRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) {
return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListInstancesRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListInstancesResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListInstancesResponse payload) {
return payload.getInstancesList();
}
};
private static final PagedListDescriptor
LIST_BACKUPS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) {
return ListBackupsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) {
return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListBackupsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListBackupsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListBackupsResponse payload) {
return payload.getBackupsList();
}
};
private static final PagedListDescriptor<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
SupportedDatabaseFlag>
LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC =
new PagedListDescriptor<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
SupportedDatabaseFlag>() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListSupportedDatabaseFlagsRequest injectToken(
ListSupportedDatabaseFlagsRequest payload, String token) {
return ListSupportedDatabaseFlagsRequest.newBuilder(payload)
.setPageToken(token)
.build();
}
@Override
public ListSupportedDatabaseFlagsRequest injectPageSize(
ListSupportedDatabaseFlagsRequest payload, int pageSize) {
return ListSupportedDatabaseFlagsRequest.newBuilder(payload)
.setPageSize(pageSize)
.build();
}
@Override
public Integer extractPageSize(ListSupportedDatabaseFlagsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListSupportedDatabaseFlagsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(
ListSupportedDatabaseFlagsResponse payload) {
return payload.getSupportedDatabaseFlagsList();
}
};
private static final PagedListDescriptor
LIST_USERS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListUsersRequest injectToken(ListUsersRequest payload, String token) {
return ListUsersRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) {
return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListUsersRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListUsersResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListUsersResponse payload) {
return payload.getUsersList();
}
};
private static final PagedListDescriptor
LIST_DATABASES_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListDatabasesRequest injectToken(ListDatabasesRequest payload, String token) {
return ListDatabasesRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListDatabasesRequest injectPageSize(ListDatabasesRequest payload, int pageSize) {
return ListDatabasesRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListDatabasesRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListDatabasesResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListDatabasesResponse payload) {
return payload.getDatabasesList();
}
};
private static final PagedListDescriptor
LIST_LOCATIONS_PAGE_STR_DESC =
new PagedListDescriptor() {
@Override
public String emptyToken() {
return "";
}
@Override
public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) {
return ListLocationsRequest.newBuilder(payload).setPageToken(token).build();
}
@Override
public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) {
return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build();
}
@Override
public Integer extractPageSize(ListLocationsRequest payload) {
return payload.getPageSize();
}
@Override
public String extractNextToken(ListLocationsResponse payload) {
return payload.getNextPageToken();
}
@Override
public Iterable extractResources(ListLocationsResponse payload) {
return payload.getLocationsList();
}
};
private static final PagedListResponseFactory<
ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
LIST_CLUSTERS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListClustersRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_CLUSTERS_PAGE_STR_DESC, request, context);
return ListClustersPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>
LIST_INSTANCES_PAGE_STR_FACT =
new PagedListResponseFactory<
ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListInstancesRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context);
return ListInstancesPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>
LIST_BACKUPS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListBackupsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context);
return ListBackupsPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
ListSupportedDatabaseFlagsPagedResponse>
LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
ListSupportedDatabaseFlagsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable
callable,
ListSupportedDatabaseFlagsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
SupportedDatabaseFlag>
pageContext =
PageContext.create(
callable, LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_DESC, request, context);
return ListSupportedDatabaseFlagsPagedResponse.createAsync(
pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>
LIST_USERS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListUsersRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context);
return ListUsersPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
LIST_DATABASES_PAGE_STR_FACT =
new PagedListResponseFactory<
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListDatabasesRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_DATABASES_PAGE_STR_DESC, request, context);
return ListDatabasesPagedResponse.createAsync(pageContext, futureResponse);
}
};
private static final PagedListResponseFactory<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
LIST_LOCATIONS_PAGE_STR_FACT =
new PagedListResponseFactory<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() {
@Override
public ApiFuture getFuturePagedResponse(
UnaryCallable callable,
ListLocationsRequest request,
ApiCallContext context,
ApiFuture futureResponse) {
PageContext pageContext =
PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context);
return ListLocationsPagedResponse.createAsync(pageContext, futureResponse);
}
};
/** Returns the object with the settings used for calls to listClusters. */
public PagedCallSettings
listClustersSettings() {
return listClustersSettings;
}
/** Returns the object with the settings used for calls to getCluster. */
public UnaryCallSettings getClusterSettings() {
return getClusterSettings;
}
/** Returns the object with the settings used for calls to createCluster. */
public UnaryCallSettings createClusterSettings() {
return createClusterSettings;
}
/** Returns the object with the settings used for calls to createCluster. */
public OperationCallSettings
createClusterOperationSettings() {
return createClusterOperationSettings;
}
/** Returns the object with the settings used for calls to updateCluster. */
public UnaryCallSettings updateClusterSettings() {
return updateClusterSettings;
}
/** Returns the object with the settings used for calls to updateCluster. */
public OperationCallSettings
updateClusterOperationSettings() {
return updateClusterOperationSettings;
}
/** Returns the object with the settings used for calls to deleteCluster. */
public UnaryCallSettings deleteClusterSettings() {
return deleteClusterSettings;
}
/** Returns the object with the settings used for calls to deleteCluster. */
public OperationCallSettings
deleteClusterOperationSettings() {
return deleteClusterOperationSettings;
}
/** Returns the object with the settings used for calls to promoteCluster. */
public UnaryCallSettings promoteClusterSettings() {
return promoteClusterSettings;
}
/** Returns the object with the settings used for calls to promoteCluster. */
public OperationCallSettings
promoteClusterOperationSettings() {
return promoteClusterOperationSettings;
}
/** Returns the object with the settings used for calls to restoreCluster. */
public UnaryCallSettings restoreClusterSettings() {
return restoreClusterSettings;
}
/** Returns the object with the settings used for calls to restoreCluster. */
public OperationCallSettings
restoreClusterOperationSettings() {
return restoreClusterOperationSettings;
}
/** Returns the object with the settings used for calls to createSecondaryCluster. */
public UnaryCallSettings
createSecondaryClusterSettings() {
return createSecondaryClusterSettings;
}
/** Returns the object with the settings used for calls to createSecondaryCluster. */
public OperationCallSettings
createSecondaryClusterOperationSettings() {
return createSecondaryClusterOperationSettings;
}
/** Returns the object with the settings used for calls to listInstances. */
public PagedCallSettings
listInstancesSettings() {
return listInstancesSettings;
}
/** Returns the object with the settings used for calls to getInstance. */
public UnaryCallSettings getInstanceSettings() {
return getInstanceSettings;
}
/** Returns the object with the settings used for calls to createInstance. */
public UnaryCallSettings createInstanceSettings() {
return createInstanceSettings;
}
/** Returns the object with the settings used for calls to createInstance. */
public OperationCallSettings
createInstanceOperationSettings() {
return createInstanceOperationSettings;
}
/** Returns the object with the settings used for calls to createSecondaryInstance. */
public UnaryCallSettings
createSecondaryInstanceSettings() {
return createSecondaryInstanceSettings;
}
/** Returns the object with the settings used for calls to createSecondaryInstance. */
public OperationCallSettings
createSecondaryInstanceOperationSettings() {
return createSecondaryInstanceOperationSettings;
}
/** Returns the object with the settings used for calls to batchCreateInstances. */
public UnaryCallSettings batchCreateInstancesSettings() {
return batchCreateInstancesSettings;
}
/** Returns the object with the settings used for calls to batchCreateInstances. */
public OperationCallSettings<
BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata>
batchCreateInstancesOperationSettings() {
return batchCreateInstancesOperationSettings;
}
/** Returns the object with the settings used for calls to updateInstance. */
public UnaryCallSettings updateInstanceSettings() {
return updateInstanceSettings;
}
/** Returns the object with the settings used for calls to updateInstance. */
public OperationCallSettings
updateInstanceOperationSettings() {
return updateInstanceOperationSettings;
}
/** Returns the object with the settings used for calls to deleteInstance. */
public UnaryCallSettings deleteInstanceSettings() {
return deleteInstanceSettings;
}
/** Returns the object with the settings used for calls to deleteInstance. */
public OperationCallSettings
deleteInstanceOperationSettings() {
return deleteInstanceOperationSettings;
}
/** Returns the object with the settings used for calls to failoverInstance. */
public UnaryCallSettings failoverInstanceSettings() {
return failoverInstanceSettings;
}
/** Returns the object with the settings used for calls to failoverInstance. */
public OperationCallSettings
failoverInstanceOperationSettings() {
return failoverInstanceOperationSettings;
}
/** Returns the object with the settings used for calls to injectFault. */
public UnaryCallSettings injectFaultSettings() {
return injectFaultSettings;
}
/** Returns the object with the settings used for calls to injectFault. */
public OperationCallSettings
injectFaultOperationSettings() {
return injectFaultOperationSettings;
}
/** Returns the object with the settings used for calls to restartInstance. */
public UnaryCallSettings restartInstanceSettings() {
return restartInstanceSettings;
}
/** Returns the object with the settings used for calls to restartInstance. */
public OperationCallSettings
restartInstanceOperationSettings() {
return restartInstanceOperationSettings;
}
/** Returns the object with the settings used for calls to listBackups. */
public PagedCallSettings
listBackupsSettings() {
return listBackupsSettings;
}
/** Returns the object with the settings used for calls to getBackup. */
public UnaryCallSettings getBackupSettings() {
return getBackupSettings;
}
/** Returns the object with the settings used for calls to createBackup. */
public UnaryCallSettings createBackupSettings() {
return createBackupSettings;
}
/** Returns the object with the settings used for calls to createBackup. */
public OperationCallSettings
createBackupOperationSettings() {
return createBackupOperationSettings;
}
/** Returns the object with the settings used for calls to updateBackup. */
public UnaryCallSettings updateBackupSettings() {
return updateBackupSettings;
}
/** Returns the object with the settings used for calls to updateBackup. */
public OperationCallSettings
updateBackupOperationSettings() {
return updateBackupOperationSettings;
}
/** Returns the object with the settings used for calls to deleteBackup. */
public UnaryCallSettings deleteBackupSettings() {
return deleteBackupSettings;
}
/** Returns the object with the settings used for calls to deleteBackup. */
public OperationCallSettings
deleteBackupOperationSettings() {
return deleteBackupOperationSettings;
}
/** Returns the object with the settings used for calls to listSupportedDatabaseFlags. */
public PagedCallSettings<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
ListSupportedDatabaseFlagsPagedResponse>
listSupportedDatabaseFlagsSettings() {
return listSupportedDatabaseFlagsSettings;
}
/** Returns the object with the settings used for calls to generateClientCertificate. */
public UnaryCallSettings
generateClientCertificateSettings() {
return generateClientCertificateSettings;
}
/** Returns the object with the settings used for calls to getConnectionInfo. */
public UnaryCallSettings getConnectionInfoSettings() {
return getConnectionInfoSettings;
}
/** Returns the object with the settings used for calls to listUsers. */
public PagedCallSettings
listUsersSettings() {
return listUsersSettings;
}
/** Returns the object with the settings used for calls to getUser. */
public UnaryCallSettings getUserSettings() {
return getUserSettings;
}
/** Returns the object with the settings used for calls to createUser. */
public UnaryCallSettings createUserSettings() {
return createUserSettings;
}
/** Returns the object with the settings used for calls to updateUser. */
public UnaryCallSettings updateUserSettings() {
return updateUserSettings;
}
/** Returns the object with the settings used for calls to deleteUser. */
public UnaryCallSettings deleteUserSettings() {
return deleteUserSettings;
}
/** Returns the object with the settings used for calls to listDatabases. */
public PagedCallSettings
listDatabasesSettings() {
return listDatabasesSettings;
}
/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings
listLocationsSettings() {
return listLocationsSettings;
}
/** Returns the object with the settings used for calls to getLocation. */
public UnaryCallSettings getLocationSettings() {
return getLocationSettings;
}
public AlloyDBAdminStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcAlloyDBAdminStub.create(this);
}
if (getTransportChannelProvider()
.getTransportName()
.equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
return HttpJsonAlloyDBAdminStub.create(this);
}
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}
/** Returns the default service name. */
@Override
public String getServiceName() {
return "alloydb";
}
/** 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 "alloydb.googleapis.com:443";
}
/** Returns the default mTLS service endpoint. */
public static String getDefaultMtlsEndpoint() {
return "alloydb.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(AlloyDBAdminStubSettings.class))
.setTransportToken(
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken(
"gapic", GaxProperties.getLibraryVersion(AlloyDBAdminStubSettings.class))
.setTransportToken(
GaxHttpJsonProperties.getHttpJsonTokenName(),
GaxHttpJsonProperties.getHttpJsonVersion());
}
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return AlloyDBAdminStubSettings.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 AlloyDBAdminStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
listClustersSettings = settingsBuilder.listClustersSettings().build();
getClusterSettings = settingsBuilder.getClusterSettings().build();
createClusterSettings = settingsBuilder.createClusterSettings().build();
createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build();
updateClusterSettings = settingsBuilder.updateClusterSettings().build();
updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build();
deleteClusterSettings = settingsBuilder.deleteClusterSettings().build();
deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build();
promoteClusterSettings = settingsBuilder.promoteClusterSettings().build();
promoteClusterOperationSettings = settingsBuilder.promoteClusterOperationSettings().build();
restoreClusterSettings = settingsBuilder.restoreClusterSettings().build();
restoreClusterOperationSettings = settingsBuilder.restoreClusterOperationSettings().build();
createSecondaryClusterSettings = settingsBuilder.createSecondaryClusterSettings().build();
createSecondaryClusterOperationSettings =
settingsBuilder.createSecondaryClusterOperationSettings().build();
listInstancesSettings = settingsBuilder.listInstancesSettings().build();
getInstanceSettings = settingsBuilder.getInstanceSettings().build();
createInstanceSettings = settingsBuilder.createInstanceSettings().build();
createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build();
createSecondaryInstanceSettings = settingsBuilder.createSecondaryInstanceSettings().build();
createSecondaryInstanceOperationSettings =
settingsBuilder.createSecondaryInstanceOperationSettings().build();
batchCreateInstancesSettings = settingsBuilder.batchCreateInstancesSettings().build();
batchCreateInstancesOperationSettings =
settingsBuilder.batchCreateInstancesOperationSettings().build();
updateInstanceSettings = settingsBuilder.updateInstanceSettings().build();
updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build();
deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build();
deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build();
failoverInstanceSettings = settingsBuilder.failoverInstanceSettings().build();
failoverInstanceOperationSettings = settingsBuilder.failoverInstanceOperationSettings().build();
injectFaultSettings = settingsBuilder.injectFaultSettings().build();
injectFaultOperationSettings = settingsBuilder.injectFaultOperationSettings().build();
restartInstanceSettings = settingsBuilder.restartInstanceSettings().build();
restartInstanceOperationSettings = settingsBuilder.restartInstanceOperationSettings().build();
listBackupsSettings = settingsBuilder.listBackupsSettings().build();
getBackupSettings = settingsBuilder.getBackupSettings().build();
createBackupSettings = settingsBuilder.createBackupSettings().build();
createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build();
updateBackupSettings = settingsBuilder.updateBackupSettings().build();
updateBackupOperationSettings = settingsBuilder.updateBackupOperationSettings().build();
deleteBackupSettings = settingsBuilder.deleteBackupSettings().build();
deleteBackupOperationSettings = settingsBuilder.deleteBackupOperationSettings().build();
listSupportedDatabaseFlagsSettings =
settingsBuilder.listSupportedDatabaseFlagsSettings().build();
generateClientCertificateSettings = settingsBuilder.generateClientCertificateSettings().build();
getConnectionInfoSettings = settingsBuilder.getConnectionInfoSettings().build();
listUsersSettings = settingsBuilder.listUsersSettings().build();
getUserSettings = settingsBuilder.getUserSettings().build();
createUserSettings = settingsBuilder.createUserSettings().build();
updateUserSettings = settingsBuilder.updateUserSettings().build();
deleteUserSettings = settingsBuilder.deleteUserSettings().build();
listDatabasesSettings = settingsBuilder.listDatabasesSettings().build();
listLocationsSettings = settingsBuilder.listLocationsSettings().build();
getLocationSettings = settingsBuilder.getLocationSettings().build();
}
/** Builder for AlloyDBAdminStubSettings. */
public static class Builder extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
private final PagedCallSettings.Builder<
ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
listClustersSettings;
private final UnaryCallSettings.Builder getClusterSettings;
private final UnaryCallSettings.Builder createClusterSettings;
private final OperationCallSettings.Builder
createClusterOperationSettings;
private final UnaryCallSettings.Builder updateClusterSettings;
private final OperationCallSettings.Builder
updateClusterOperationSettings;
private final UnaryCallSettings.Builder deleteClusterSettings;
private final OperationCallSettings.Builder
deleteClusterOperationSettings;
private final UnaryCallSettings.Builder
promoteClusterSettings;
private final OperationCallSettings.Builder
promoteClusterOperationSettings;
private final UnaryCallSettings.Builder
restoreClusterSettings;
private final OperationCallSettings.Builder
restoreClusterOperationSettings;
private final UnaryCallSettings.Builder
createSecondaryClusterSettings;
private final OperationCallSettings.Builder<
CreateSecondaryClusterRequest, Cluster, OperationMetadata>
createSecondaryClusterOperationSettings;
private final PagedCallSettings.Builder<
ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>
listInstancesSettings;
private final UnaryCallSettings.Builder getInstanceSettings;
private final UnaryCallSettings.Builder
createInstanceSettings;
private final OperationCallSettings.Builder
createInstanceOperationSettings;
private final UnaryCallSettings.Builder
createSecondaryInstanceSettings;
private final OperationCallSettings.Builder<
CreateSecondaryInstanceRequest, Instance, OperationMetadata>
createSecondaryInstanceOperationSettings;
private final UnaryCallSettings.Builder
batchCreateInstancesSettings;
private final OperationCallSettings.Builder<
BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata>
batchCreateInstancesOperationSettings;
private final UnaryCallSettings.Builder
updateInstanceSettings;
private final OperationCallSettings.Builder
updateInstanceOperationSettings;
private final UnaryCallSettings.Builder
deleteInstanceSettings;
private final OperationCallSettings.Builder
deleteInstanceOperationSettings;
private final UnaryCallSettings.Builder
failoverInstanceSettings;
private final OperationCallSettings.Builder<
FailoverInstanceRequest, Instance, OperationMetadata>
failoverInstanceOperationSettings;
private final UnaryCallSettings.Builder injectFaultSettings;
private final OperationCallSettings.Builder
injectFaultOperationSettings;
private final UnaryCallSettings.Builder
restartInstanceSettings;
private final OperationCallSettings.Builder
restartInstanceOperationSettings;
private final PagedCallSettings.Builder<
ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>
listBackupsSettings;
private final UnaryCallSettings.Builder getBackupSettings;
private final UnaryCallSettings.Builder createBackupSettings;
private final OperationCallSettings.Builder
createBackupOperationSettings;
private final UnaryCallSettings.Builder updateBackupSettings;
private final OperationCallSettings.Builder
updateBackupOperationSettings;
private final UnaryCallSettings.Builder deleteBackupSettings;
private final OperationCallSettings.Builder
deleteBackupOperationSettings;
private final PagedCallSettings.Builder<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
ListSupportedDatabaseFlagsPagedResponse>
listSupportedDatabaseFlagsSettings;
private final UnaryCallSettings.Builder<
GenerateClientCertificateRequest, GenerateClientCertificateResponse>
generateClientCertificateSettings;
private final UnaryCallSettings.Builder
getConnectionInfoSettings;
private final PagedCallSettings.Builder<
ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>
listUsersSettings;
private final UnaryCallSettings.Builder getUserSettings;
private final UnaryCallSettings.Builder createUserSettings;
private final UnaryCallSettings.Builder updateUserSettings;
private final UnaryCallSettings.Builder deleteUserSettings;
private final PagedCallSettings.Builder<
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
listDatabasesSettings;
private final PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings;
private final UnaryCallSettings.Builder getLocationSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
static {
ImmutableMap.Builder> definitions =
ImmutableMap.builder();
definitions.put(
"retry_policy_0_codes",
ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
definitions.put(
"no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
private static final ImmutableMap RETRY_PARAM_DEFINITIONS;
static {
ImmutableMap.Builder definitions = ImmutableMap.builder();
RetrySettings settings = null;
settings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(1000L))
.setRetryDelayMultiplier(1.3)
.setMaxRetryDelay(Duration.ofMillis(60000L))
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_0_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("no_retry_1_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}
protected Builder() {
this(((ClientContext) null));
}
protected Builder(ClientContext clientContext) {
super(clientContext);
listClustersSettings = PagedCallSettings.newBuilder(LIST_CLUSTERS_PAGE_STR_FACT);
getClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createClusterOperationSettings = OperationCallSettings.newBuilder();
updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateClusterOperationSettings = OperationCallSettings.newBuilder();
deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteClusterOperationSettings = OperationCallSettings.newBuilder();
promoteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
promoteClusterOperationSettings = OperationCallSettings.newBuilder();
restoreClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
restoreClusterOperationSettings = OperationCallSettings.newBuilder();
createSecondaryClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createSecondaryClusterOperationSettings = OperationCallSettings.newBuilder();
listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT);
getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createInstanceOperationSettings = OperationCallSettings.newBuilder();
createSecondaryInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createSecondaryInstanceOperationSettings = OperationCallSettings.newBuilder();
batchCreateInstancesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
batchCreateInstancesOperationSettings = OperationCallSettings.newBuilder();
updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateInstanceOperationSettings = OperationCallSettings.newBuilder();
deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteInstanceOperationSettings = OperationCallSettings.newBuilder();
failoverInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
failoverInstanceOperationSettings = OperationCallSettings.newBuilder();
injectFaultSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
injectFaultOperationSettings = OperationCallSettings.newBuilder();
restartInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
restartInstanceOperationSettings = OperationCallSettings.newBuilder();
listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT);
getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createBackupOperationSettings = OperationCallSettings.newBuilder();
updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateBackupOperationSettings = OperationCallSettings.newBuilder();
deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteBackupOperationSettings = OperationCallSettings.newBuilder();
listSupportedDatabaseFlagsSettings =
PagedCallSettings.newBuilder(LIST_SUPPORTED_DATABASE_FLAGS_PAGE_STR_FACT);
generateClientCertificateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getConnectionInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT);
getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listDatabasesSettings = PagedCallSettings.newBuilder(LIST_DATABASES_PAGE_STR_FACT);
listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
listClustersSettings,
getClusterSettings,
createClusterSettings,
updateClusterSettings,
deleteClusterSettings,
promoteClusterSettings,
restoreClusterSettings,
createSecondaryClusterSettings,
listInstancesSettings,
getInstanceSettings,
createInstanceSettings,
createSecondaryInstanceSettings,
batchCreateInstancesSettings,
updateInstanceSettings,
deleteInstanceSettings,
failoverInstanceSettings,
injectFaultSettings,
restartInstanceSettings,
listBackupsSettings,
getBackupSettings,
createBackupSettings,
updateBackupSettings,
deleteBackupSettings,
listSupportedDatabaseFlagsSettings,
generateClientCertificateSettings,
getConnectionInfoSettings,
listUsersSettings,
getUserSettings,
createUserSettings,
updateUserSettings,
deleteUserSettings,
listDatabasesSettings,
listLocationsSettings,
getLocationSettings);
initDefaults(this);
}
protected Builder(AlloyDBAdminStubSettings settings) {
super(settings);
listClustersSettings = settings.listClustersSettings.toBuilder();
getClusterSettings = settings.getClusterSettings.toBuilder();
createClusterSettings = settings.createClusterSettings.toBuilder();
createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder();
updateClusterSettings = settings.updateClusterSettings.toBuilder();
updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder();
deleteClusterSettings = settings.deleteClusterSettings.toBuilder();
deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder();
promoteClusterSettings = settings.promoteClusterSettings.toBuilder();
promoteClusterOperationSettings = settings.promoteClusterOperationSettings.toBuilder();
restoreClusterSettings = settings.restoreClusterSettings.toBuilder();
restoreClusterOperationSettings = settings.restoreClusterOperationSettings.toBuilder();
createSecondaryClusterSettings = settings.createSecondaryClusterSettings.toBuilder();
createSecondaryClusterOperationSettings =
settings.createSecondaryClusterOperationSettings.toBuilder();
listInstancesSettings = settings.listInstancesSettings.toBuilder();
getInstanceSettings = settings.getInstanceSettings.toBuilder();
createInstanceSettings = settings.createInstanceSettings.toBuilder();
createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder();
createSecondaryInstanceSettings = settings.createSecondaryInstanceSettings.toBuilder();
createSecondaryInstanceOperationSettings =
settings.createSecondaryInstanceOperationSettings.toBuilder();
batchCreateInstancesSettings = settings.batchCreateInstancesSettings.toBuilder();
batchCreateInstancesOperationSettings =
settings.batchCreateInstancesOperationSettings.toBuilder();
updateInstanceSettings = settings.updateInstanceSettings.toBuilder();
updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder();
deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder();
deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder();
failoverInstanceSettings = settings.failoverInstanceSettings.toBuilder();
failoverInstanceOperationSettings = settings.failoverInstanceOperationSettings.toBuilder();
injectFaultSettings = settings.injectFaultSettings.toBuilder();
injectFaultOperationSettings = settings.injectFaultOperationSettings.toBuilder();
restartInstanceSettings = settings.restartInstanceSettings.toBuilder();
restartInstanceOperationSettings = settings.restartInstanceOperationSettings.toBuilder();
listBackupsSettings = settings.listBackupsSettings.toBuilder();
getBackupSettings = settings.getBackupSettings.toBuilder();
createBackupSettings = settings.createBackupSettings.toBuilder();
createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder();
updateBackupSettings = settings.updateBackupSettings.toBuilder();
updateBackupOperationSettings = settings.updateBackupOperationSettings.toBuilder();
deleteBackupSettings = settings.deleteBackupSettings.toBuilder();
deleteBackupOperationSettings = settings.deleteBackupOperationSettings.toBuilder();
listSupportedDatabaseFlagsSettings = settings.listSupportedDatabaseFlagsSettings.toBuilder();
generateClientCertificateSettings = settings.generateClientCertificateSettings.toBuilder();
getConnectionInfoSettings = settings.getConnectionInfoSettings.toBuilder();
listUsersSettings = settings.listUsersSettings.toBuilder();
getUserSettings = settings.getUserSettings.toBuilder();
createUserSettings = settings.createUserSettings.toBuilder();
updateUserSettings = settings.updateUserSettings.toBuilder();
deleteUserSettings = settings.deleteUserSettings.toBuilder();
listDatabasesSettings = settings.listDatabasesSettings.toBuilder();
listLocationsSettings = settings.listLocationsSettings.toBuilder();
getLocationSettings = settings.getLocationSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
listClustersSettings,
getClusterSettings,
createClusterSettings,
updateClusterSettings,
deleteClusterSettings,
promoteClusterSettings,
restoreClusterSettings,
createSecondaryClusterSettings,
listInstancesSettings,
getInstanceSettings,
createInstanceSettings,
createSecondaryInstanceSettings,
batchCreateInstancesSettings,
updateInstanceSettings,
deleteInstanceSettings,
failoverInstanceSettings,
injectFaultSettings,
restartInstanceSettings,
listBackupsSettings,
getBackupSettings,
createBackupSettings,
updateBackupSettings,
deleteBackupSettings,
listSupportedDatabaseFlagsSettings,
generateClientCertificateSettings,
getConnectionInfoSettings,
listUsersSettings,
getUserSettings,
createUserSettings,
updateUserSettings,
deleteUserSettings,
listDatabasesSettings,
listLocationsSettings,
getLocationSettings);
}
private static Builder createDefault() {
Builder builder = new Builder(((ClientContext) null));
builder.setTransportChannelProvider(defaultTransportChannelProvider());
builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
builder.setSwitchToMtlsEndpointAllowed(true);
return initDefaults(builder);
}
private static Builder 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
.listClustersSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.createClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.updateClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.promoteClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.restoreClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.createSecondaryClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.listInstancesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.createInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.createSecondaryInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.batchCreateInstancesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.updateInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.failoverInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.injectFaultSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.restartInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.listBackupsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getBackupSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.createBackupSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.updateBackupSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteBackupSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.listSupportedDatabaseFlagsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.generateClientCertificateSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getConnectionInfoSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listUsersSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.getUserSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.createUserSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.updateUserSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.deleteUserSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.listDatabasesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
builder
.listLocationsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.getLocationSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
builder
.createClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.updateClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.deleteClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.promoteClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.restoreClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.createSecondaryClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.createInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.createSecondaryInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.batchCreateInstancesOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(
BatchCreateInstancesResponse.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.updateInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.deleteInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.failoverInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.injectFaultOperationSettings()
.setInitialCallSettings(
UnaryCallSettings.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.restartInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.createBackupOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Backup.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.updateBackupOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Backup.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
builder
.deleteBackupOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
return builder;
}
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
public ImmutableList> unaryMethodSettingsBuilders() {
return unaryMethodSettingsBuilders;
}
/** Returns the builder for the settings used for calls to listClusters. */
public PagedCallSettings.Builder<
ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
listClustersSettings() {
return listClustersSettings;
}
/** Returns the builder for the settings used for calls to getCluster. */
public UnaryCallSettings.Builder getClusterSettings() {
return getClusterSettings;
}
/** Returns the builder for the settings used for calls to createCluster. */
public UnaryCallSettings.Builder createClusterSettings() {
return createClusterSettings;
}
/** Returns the builder for the settings used for calls to createCluster. */
public OperationCallSettings.Builder
createClusterOperationSettings() {
return createClusterOperationSettings;
}
/** Returns the builder for the settings used for calls to updateCluster. */
public UnaryCallSettings.Builder updateClusterSettings() {
return updateClusterSettings;
}
/** Returns the builder for the settings used for calls to updateCluster. */
public OperationCallSettings.Builder
updateClusterOperationSettings() {
return updateClusterOperationSettings;
}
/** Returns the builder for the settings used for calls to deleteCluster. */
public UnaryCallSettings.Builder deleteClusterSettings() {
return deleteClusterSettings;
}
/** Returns the builder for the settings used for calls to deleteCluster. */
public OperationCallSettings.Builder
deleteClusterOperationSettings() {
return deleteClusterOperationSettings;
}
/** Returns the builder for the settings used for calls to promoteCluster. */
public UnaryCallSettings.Builder promoteClusterSettings() {
return promoteClusterSettings;
}
/** Returns the builder for the settings used for calls to promoteCluster. */
public OperationCallSettings.Builder
promoteClusterOperationSettings() {
return promoteClusterOperationSettings;
}
/** Returns the builder for the settings used for calls to restoreCluster. */
public UnaryCallSettings.Builder restoreClusterSettings() {
return restoreClusterSettings;
}
/** Returns the builder for the settings used for calls to restoreCluster. */
public OperationCallSettings.Builder
restoreClusterOperationSettings() {
return restoreClusterOperationSettings;
}
/** Returns the builder for the settings used for calls to createSecondaryCluster. */
public UnaryCallSettings.Builder
createSecondaryClusterSettings() {
return createSecondaryClusterSettings;
}
/** Returns the builder for the settings used for calls to createSecondaryCluster. */
public OperationCallSettings.Builder
createSecondaryClusterOperationSettings() {
return createSecondaryClusterOperationSettings;
}
/** Returns the builder for the settings used for calls to listInstances. */
public PagedCallSettings.Builder<
ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>
listInstancesSettings() {
return listInstancesSettings;
}
/** Returns the builder for the settings used for calls to getInstance. */
public UnaryCallSettings.Builder getInstanceSettings() {
return getInstanceSettings;
}
/** Returns the builder for the settings used for calls to createInstance. */
public UnaryCallSettings.Builder createInstanceSettings() {
return createInstanceSettings;
}
/** Returns the builder for the settings used for calls to createInstance. */
public OperationCallSettings.Builder
createInstanceOperationSettings() {
return createInstanceOperationSettings;
}
/** Returns the builder for the settings used for calls to createSecondaryInstance. */
public UnaryCallSettings.Builder
createSecondaryInstanceSettings() {
return createSecondaryInstanceSettings;
}
/** Returns the builder for the settings used for calls to createSecondaryInstance. */
public OperationCallSettings.Builder<
CreateSecondaryInstanceRequest, Instance, OperationMetadata>
createSecondaryInstanceOperationSettings() {
return createSecondaryInstanceOperationSettings;
}
/** Returns the builder for the settings used for calls to batchCreateInstances. */
public UnaryCallSettings.Builder
batchCreateInstancesSettings() {
return batchCreateInstancesSettings;
}
/** Returns the builder for the settings used for calls to batchCreateInstances. */
public OperationCallSettings.Builder<
BatchCreateInstancesRequest, BatchCreateInstancesResponse, OperationMetadata>
batchCreateInstancesOperationSettings() {
return batchCreateInstancesOperationSettings;
}
/** Returns the builder for the settings used for calls to updateInstance. */
public UnaryCallSettings.Builder updateInstanceSettings() {
return updateInstanceSettings;
}
/** Returns the builder for the settings used for calls to updateInstance. */
public OperationCallSettings.Builder
updateInstanceOperationSettings() {
return updateInstanceOperationSettings;
}
/** Returns the builder for the settings used for calls to deleteInstance. */
public UnaryCallSettings.Builder deleteInstanceSettings() {
return deleteInstanceSettings;
}
/** Returns the builder for the settings used for calls to deleteInstance. */
public OperationCallSettings.Builder
deleteInstanceOperationSettings() {
return deleteInstanceOperationSettings;
}
/** Returns the builder for the settings used for calls to failoverInstance. */
public UnaryCallSettings.Builder
failoverInstanceSettings() {
return failoverInstanceSettings;
}
/** Returns the builder for the settings used for calls to failoverInstance. */
public OperationCallSettings.Builder
failoverInstanceOperationSettings() {
return failoverInstanceOperationSettings;
}
/** Returns the builder for the settings used for calls to injectFault. */
public UnaryCallSettings.Builder injectFaultSettings() {
return injectFaultSettings;
}
/** Returns the builder for the settings used for calls to injectFault. */
public OperationCallSettings.Builder
injectFaultOperationSettings() {
return injectFaultOperationSettings;
}
/** Returns the builder for the settings used for calls to restartInstance. */
public UnaryCallSettings.Builder restartInstanceSettings() {
return restartInstanceSettings;
}
/** Returns the builder for the settings used for calls to restartInstance. */
public OperationCallSettings.Builder
restartInstanceOperationSettings() {
return restartInstanceOperationSettings;
}
/** Returns the builder for the settings used for calls to listBackups. */
public PagedCallSettings.Builder<
ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>
listBackupsSettings() {
return listBackupsSettings;
}
/** Returns the builder for the settings used for calls to getBackup. */
public UnaryCallSettings.Builder getBackupSettings() {
return getBackupSettings;
}
/** Returns the builder for the settings used for calls to createBackup. */
public UnaryCallSettings.Builder createBackupSettings() {
return createBackupSettings;
}
/** Returns the builder for the settings used for calls to createBackup. */
public OperationCallSettings.Builder
createBackupOperationSettings() {
return createBackupOperationSettings;
}
/** Returns the builder for the settings used for calls to updateBackup. */
public UnaryCallSettings.Builder updateBackupSettings() {
return updateBackupSettings;
}
/** Returns the builder for the settings used for calls to updateBackup. */
public OperationCallSettings.Builder
updateBackupOperationSettings() {
return updateBackupOperationSettings;
}
/** Returns the builder for the settings used for calls to deleteBackup. */
public UnaryCallSettings.Builder deleteBackupSettings() {
return deleteBackupSettings;
}
/** Returns the builder for the settings used for calls to deleteBackup. */
public OperationCallSettings.Builder
deleteBackupOperationSettings() {
return deleteBackupOperationSettings;
}
/** Returns the builder for the settings used for calls to listSupportedDatabaseFlags. */
public PagedCallSettings.Builder<
ListSupportedDatabaseFlagsRequest,
ListSupportedDatabaseFlagsResponse,
ListSupportedDatabaseFlagsPagedResponse>
listSupportedDatabaseFlagsSettings() {
return listSupportedDatabaseFlagsSettings;
}
/** Returns the builder for the settings used for calls to generateClientCertificate. */
public UnaryCallSettings.Builder<
GenerateClientCertificateRequest, GenerateClientCertificateResponse>
generateClientCertificateSettings() {
return generateClientCertificateSettings;
}
/** Returns the builder for the settings used for calls to getConnectionInfo. */
public UnaryCallSettings.Builder
getConnectionInfoSettings() {
return getConnectionInfoSettings;
}
/** Returns the builder for the settings used for calls to listUsers. */
public PagedCallSettings.Builder
listUsersSettings() {
return listUsersSettings;
}
/** Returns the builder for the settings used for calls to getUser. */
public UnaryCallSettings.Builder getUserSettings() {
return getUserSettings;
}
/** Returns the builder for the settings used for calls to createUser. */
public UnaryCallSettings.Builder