@BetaApi @Generated(value="by gapic-generator-java") public class ServiceUsageSettings extends com.google.api.gax.rpc.ClientSettings<ServiceUsageSettings>
ServiceUsageClient.
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 getService:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ServiceUsageSettings.Builder serviceUsageSettingsBuilder = ServiceUsageSettings.newBuilder();
serviceUsageSettingsBuilder
.getServiceSettings()
.setRetrySettings(
serviceUsageSettingsBuilder
.getServiceSettings()
.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());
ServiceUsageSettings serviceUsageSettings = serviceUsageSettingsBuilder.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 enableService:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ServiceUsageSettings.Builder serviceUsageSettingsBuilder = ServiceUsageSettings.newBuilder();
TimedRetryAlgorithm timedRetryAlgorithm =
OperationalTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelayDuration(Duration.ofMillis(500))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelayDuration(Duration.ofMillis(5000))
.setTotalTimeoutDuration(Duration.ofHours(24))
.build());
serviceUsageSettingsBuilder
.createClusterOperationSettings()
.setPollingAlgorithm(timedRetryAlgorithm)
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceUsageSettings.Builder
Builder for ServiceUsageSettings.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ServiceUsageSettings(ServiceUsageSettings.Builder settingsBuilder) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.rpc.OperationCallSettings<BatchEnableServicesRequest,com.google.protobuf.Empty,OperationMetadata> |
batchEnableServicesOperationSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallSettings<BatchEnableServicesRequest,com.google.longrunning.Operation> |
batchEnableServicesSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
static ServiceUsageSettings |
create(ServiceUsageStubSettings stub) |
com.google.api.gax.rpc.OperationCallSettings<CreateAdminOverrideRequest,QuotaOverride,OperationMetadata> |
createAdminOverrideOperationSettings()
Returns the object with the settings used for calls to createAdminOverride.
|
com.google.api.gax.rpc.UnaryCallSettings<CreateAdminOverrideRequest,com.google.longrunning.Operation> |
createAdminOverrideSettings()
Returns the object with the settings used for calls to createAdminOverride.
|
com.google.api.gax.rpc.OperationCallSettings<CreateConsumerOverrideRequest,QuotaOverride,OperationMetadata> |
createConsumerOverrideOperationSettings()
Returns the object with the settings used for calls to createConsumerOverride.
|
com.google.api.gax.rpc.UnaryCallSettings<CreateConsumerOverrideRequest,com.google.longrunning.Operation> |
createConsumerOverrideSettings()
Returns the object with the settings used for calls to createConsumerOverride.
|
static com.google.api.gax.rpc.ApiClientHeaderProvider.Builder |
defaultApiClientHeaderProviderBuilder() |
static com.google.api.gax.core.GoogleCredentialsProvider.Builder |
defaultCredentialsProviderBuilder()
Returns a builder for the default credentials for this service.
|
static com.google.api.gax.core.InstantiatingExecutorProvider.Builder |
defaultExecutorProviderBuilder()
Returns a builder for the default ExecutorProvider for this service.
|
static com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder |
defaultGrpcTransportProviderBuilder()
Returns a builder for the default gRPC ChannelProvider for this service.
|
static com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.Builder |
defaultHttpJsonTransportProviderBuilder()
Returns a builder for the default REST ChannelProvider for this service.
|
static com.google.api.gax.rpc.TransportChannelProvider |
defaultTransportChannelProvider() |
com.google.api.gax.rpc.OperationCallSettings<DeleteAdminOverrideRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteAdminOverrideOperationSettings()
Returns the object with the settings used for calls to deleteAdminOverride.
|
com.google.api.gax.rpc.UnaryCallSettings<DeleteAdminOverrideRequest,com.google.longrunning.Operation> |
deleteAdminOverrideSettings()
Returns the object with the settings used for calls to deleteAdminOverride.
|
com.google.api.gax.rpc.OperationCallSettings<DeleteConsumerOverrideRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteConsumerOverrideOperationSettings()
Returns the object with the settings used for calls to deleteConsumerOverride.
|
com.google.api.gax.rpc.UnaryCallSettings<DeleteConsumerOverrideRequest,com.google.longrunning.Operation> |
deleteConsumerOverrideSettings()
Returns the object with the settings used for calls to deleteConsumerOverride.
|
com.google.api.gax.rpc.OperationCallSettings<DisableServiceRequest,com.google.protobuf.Empty,OperationMetadata> |
disableServiceOperationSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallSettings<DisableServiceRequest,com.google.longrunning.Operation> |
disableServiceSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.OperationCallSettings<EnableServiceRequest,com.google.protobuf.Empty,OperationMetadata> |
enableServiceOperationSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.UnaryCallSettings<EnableServiceRequest,com.google.longrunning.Operation> |
enableServiceSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.OperationCallSettings<GenerateServiceIdentityRequest,ServiceIdentity,com.google.protobuf.Empty> |
generateServiceIdentityOperationSettings()
Returns the object with the settings used for calls to generateServiceIdentity.
|
com.google.api.gax.rpc.UnaryCallSettings<GenerateServiceIdentityRequest,com.google.longrunning.Operation> |
generateServiceIdentitySettings()
Returns the object with the settings used for calls to generateServiceIdentity.
|
com.google.api.gax.rpc.UnaryCallSettings<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> |
getConsumerQuotaLimitSettings()
Returns the object with the settings used for calls to getConsumerQuotaLimit.
|
com.google.api.gax.rpc.UnaryCallSettings<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> |
getConsumerQuotaMetricSettings()
Returns the object with the settings used for calls to getConsumerQuotaMetric.
|
static String |
getDefaultEndpoint()
Returns the default service endpoint.
|
static List<String> |
getDefaultServiceScopes()
Returns the default service scopes.
|
com.google.api.gax.rpc.UnaryCallSettings<GetServiceRequest,Service> |
getServiceSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
com.google.api.gax.rpc.OperationCallSettings<ImportAdminOverridesRequest,ImportAdminOverridesResponse,ImportAdminOverridesMetadata> |
importAdminOverridesOperationSettings()
Returns the object with the settings used for calls to importAdminOverrides.
|
com.google.api.gax.rpc.UnaryCallSettings<ImportAdminOverridesRequest,com.google.longrunning.Operation> |
importAdminOverridesSettings()
Returns the object with the settings used for calls to importAdminOverrides.
|
com.google.api.gax.rpc.OperationCallSettings<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> |
importConsumerOverridesOperationSettings()
Returns the object with the settings used for calls to importConsumerOverrides.
|
com.google.api.gax.rpc.UnaryCallSettings<ImportConsumerOverridesRequest,com.google.longrunning.Operation> |
importConsumerOverridesSettings()
Returns the object with the settings used for calls to importConsumerOverrides.
|
com.google.api.gax.rpc.PagedCallSettings<ListAdminOverridesRequest,ListAdminOverridesResponse,ServiceUsageClient.ListAdminOverridesPagedResponse> |
listAdminOverridesSettings()
Returns the object with the settings used for calls to listAdminOverrides.
|
com.google.api.gax.rpc.PagedCallSettings<ListConsumerOverridesRequest,ListConsumerOverridesResponse,ServiceUsageClient.ListConsumerOverridesPagedResponse> |
listConsumerOverridesSettings()
Returns the object with the settings used for calls to listConsumerOverrides.
|
com.google.api.gax.rpc.PagedCallSettings<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse,ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> |
listConsumerQuotaMetricsSettings()
Returns the object with the settings used for calls to listConsumerQuotaMetrics.
|
com.google.api.gax.rpc.PagedCallSettings<ListServicesRequest,ListServicesResponse,ServiceUsageClient.ListServicesPagedResponse> |
listServicesSettings()
Deprecated.
This method is deprecated and will be removed in the next major version update.
|
static ServiceUsageSettings.Builder |
newBuilder()
Returns a new gRPC builder for this class.
|
static ServiceUsageSettings.Builder |
newBuilder(com.google.api.gax.rpc.ClientContext clientContext)
Returns a new builder for this class.
|
static ServiceUsageSettings.Builder |
newHttpJsonBuilder()
Returns a new REST builder for this class.
|
ServiceUsageSettings.Builder |
toBuilder()
Returns a builder containing all the values of this settings class.
|
com.google.api.gax.rpc.OperationCallSettings<UpdateAdminOverrideRequest,QuotaOverride,OperationMetadata> |
updateAdminOverrideOperationSettings()
Returns the object with the settings used for calls to updateAdminOverride.
|
com.google.api.gax.rpc.UnaryCallSettings<UpdateAdminOverrideRequest,com.google.longrunning.Operation> |
updateAdminOverrideSettings()
Returns the object with the settings used for calls to updateAdminOverride.
|
com.google.api.gax.rpc.OperationCallSettings<UpdateConsumerOverrideRequest,QuotaOverride,OperationMetadata> |
updateConsumerOverrideOperationSettings()
Returns the object with the settings used for calls to updateConsumerOverride.
|
com.google.api.gax.rpc.UnaryCallSettings<UpdateConsumerOverrideRequest,com.google.longrunning.Operation> |
updateConsumerOverrideSettings()
Returns the object with the settings used for calls to updateConsumerOverride.
|
getApiKey, getBackgroundExecutorProvider, getClock, getCredentialsProvider, getEndpoint, getExecutorProvider, getGdchApiAudience, getHeaderProvider, getInternalHeaderProvider, getQuotaProjectId, getStubSettings, getTransportChannelProvider, getUniverseDomain, getWatchdogCheckInterval, getWatchdogCheckIntervalDuration, getWatchdogProvider, toStringprotected ServiceUsageSettings(ServiceUsageSettings.Builder settingsBuilder) throws IOException
IOException@Deprecated public com.google.api.gax.rpc.UnaryCallSettings<EnableServiceRequest,com.google.longrunning.Operation> enableServiceSettings()
@Deprecated public com.google.api.gax.rpc.OperationCallSettings<EnableServiceRequest,com.google.protobuf.Empty,OperationMetadata> enableServiceOperationSettings()
@Deprecated public com.google.api.gax.rpc.UnaryCallSettings<DisableServiceRequest,com.google.longrunning.Operation> disableServiceSettings()
@Deprecated public com.google.api.gax.rpc.OperationCallSettings<DisableServiceRequest,com.google.protobuf.Empty,OperationMetadata> disableServiceOperationSettings()
@Deprecated public com.google.api.gax.rpc.UnaryCallSettings<GetServiceRequest,Service> getServiceSettings()
@Deprecated public com.google.api.gax.rpc.PagedCallSettings<ListServicesRequest,ListServicesResponse,ServiceUsageClient.ListServicesPagedResponse> listServicesSettings()
@Deprecated public com.google.api.gax.rpc.UnaryCallSettings<BatchEnableServicesRequest,com.google.longrunning.Operation> batchEnableServicesSettings()
@Deprecated public com.google.api.gax.rpc.OperationCallSettings<BatchEnableServicesRequest,com.google.protobuf.Empty,OperationMetadata> batchEnableServicesOperationSettings()
public com.google.api.gax.rpc.PagedCallSettings<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse,ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> listConsumerQuotaMetricsSettings()
public com.google.api.gax.rpc.UnaryCallSettings<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> getConsumerQuotaMetricSettings()
public com.google.api.gax.rpc.UnaryCallSettings<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> getConsumerQuotaLimitSettings()
public com.google.api.gax.rpc.UnaryCallSettings<CreateAdminOverrideRequest,com.google.longrunning.Operation> createAdminOverrideSettings()
public com.google.api.gax.rpc.OperationCallSettings<CreateAdminOverrideRequest,QuotaOverride,OperationMetadata> createAdminOverrideOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<UpdateAdminOverrideRequest,com.google.longrunning.Operation> updateAdminOverrideSettings()
public com.google.api.gax.rpc.OperationCallSettings<UpdateAdminOverrideRequest,QuotaOverride,OperationMetadata> updateAdminOverrideOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<DeleteAdminOverrideRequest,com.google.longrunning.Operation> deleteAdminOverrideSettings()
public com.google.api.gax.rpc.OperationCallSettings<DeleteAdminOverrideRequest,com.google.protobuf.Empty,OperationMetadata> deleteAdminOverrideOperationSettings()
public com.google.api.gax.rpc.PagedCallSettings<ListAdminOverridesRequest,ListAdminOverridesResponse,ServiceUsageClient.ListAdminOverridesPagedResponse> listAdminOverridesSettings()
public com.google.api.gax.rpc.UnaryCallSettings<ImportAdminOverridesRequest,com.google.longrunning.Operation> importAdminOverridesSettings()
public com.google.api.gax.rpc.OperationCallSettings<ImportAdminOverridesRequest,ImportAdminOverridesResponse,ImportAdminOverridesMetadata> importAdminOverridesOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<CreateConsumerOverrideRequest,com.google.longrunning.Operation> createConsumerOverrideSettings()
public com.google.api.gax.rpc.OperationCallSettings<CreateConsumerOverrideRequest,QuotaOverride,OperationMetadata> createConsumerOverrideOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<UpdateConsumerOverrideRequest,com.google.longrunning.Operation> updateConsumerOverrideSettings()
public com.google.api.gax.rpc.OperationCallSettings<UpdateConsumerOverrideRequest,QuotaOverride,OperationMetadata> updateConsumerOverrideOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<DeleteConsumerOverrideRequest,com.google.longrunning.Operation> deleteConsumerOverrideSettings()
public com.google.api.gax.rpc.OperationCallSettings<DeleteConsumerOverrideRequest,com.google.protobuf.Empty,OperationMetadata> deleteConsumerOverrideOperationSettings()
public com.google.api.gax.rpc.PagedCallSettings<ListConsumerOverridesRequest,ListConsumerOverridesResponse,ServiceUsageClient.ListConsumerOverridesPagedResponse> listConsumerOverridesSettings()
public com.google.api.gax.rpc.UnaryCallSettings<ImportConsumerOverridesRequest,com.google.longrunning.Operation> importConsumerOverridesSettings()
public com.google.api.gax.rpc.OperationCallSettings<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse,ImportConsumerOverridesMetadata> importConsumerOverridesOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<GenerateServiceIdentityRequest,com.google.longrunning.Operation> generateServiceIdentitySettings()
public com.google.api.gax.rpc.OperationCallSettings<GenerateServiceIdentityRequest,ServiceIdentity,com.google.protobuf.Empty> generateServiceIdentityOperationSettings()
public static final ServiceUsageSettings create(ServiceUsageStubSettings stub) throws IOException
IOExceptionpublic static com.google.api.gax.core.InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()
public static String getDefaultEndpoint()
public static List<String> getDefaultServiceScopes()
public static com.google.api.gax.core.GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()
public static com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()
@BetaApi public static com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()
public static com.google.api.gax.rpc.TransportChannelProvider defaultTransportChannelProvider()
public static com.google.api.gax.rpc.ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()
public static ServiceUsageSettings.Builder newBuilder()
public static ServiceUsageSettings.Builder newHttpJsonBuilder()
public static ServiceUsageSettings.Builder newBuilder(com.google.api.gax.rpc.ClientContext clientContext)
public ServiceUsageSettings.Builder toBuilder()
toBuilder in class com.google.api.gax.rpc.ClientSettings<ServiceUsageSettings>Copyright © 2025 Google LLC. All rights reserved.