Class ServiceUsageStubSettings
java.lang.Object
com.google.api.gax.rpc.StubSettings<ServiceUsageStubSettings>
com.google.api.serviceusage.v1beta1.stub.ServiceUsageStubSettings
@BetaApi
@Generated("by gapic-generator-java")
public class ServiceUsageStubSettings
extends StubSettings<ServiceUsageStubSettings>
Settings class to configure an instance of
ServiceUsageStub.
The default instance has everything set to sensible defaults:
- The default service address (serviceusage.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 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
ServiceUsageStubSettings.Builder serviceUsageSettingsBuilder =
ServiceUsageStubSettings.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());
ServiceUsageStubSettings serviceUsageSettings = serviceUsageSettingsBuilder.build();
Please refer to the [Client Side Retry
Guide](https://docs.cloud.google.com/java/docs/client-retries) 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
ServiceUsageStubSettings.Builder serviceUsageSettingsBuilder =
ServiceUsageStubSettings.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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for ServiceUsageStubSettings. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServiceUsageStubSettings(ServiceUsageStubSettings.Builder settingsBuilder) -
Method Summary
Modifier and TypeMethodDescriptionOperationCallSettings<BatchEnableServicesRequest,com.google.protobuf.Empty, OperationMetadata> Returns the object with the settings used for calls to batchEnableServices.Deprecated.This method is deprecated and will be removed in the next major version update.Returns the object with the settings used for calls to createAdminOverride.Returns the object with the settings used for calls to createAdminOverride.Returns the object with the settings used for calls to createConsumerOverride.Returns the object with the settings used for calls to createConsumerOverride.Returns a builder for the default credentials for this service.Returns a builder for the default ExecutorProvider for this service.Returns a builder for the default gRPC ChannelProvider for this service.Returns a builder for the default REST ChannelProvider for this service.static TransportChannelProviderOperationCallSettings<DeleteAdminOverrideRequest,com.google.protobuf.Empty, OperationMetadata> Returns the object with the settings used for calls to deleteAdminOverride.Returns the object with the settings used for calls to deleteAdminOverride.OperationCallSettings<DeleteConsumerOverrideRequest,com.google.protobuf.Empty, OperationMetadata> Returns the object with the settings used for calls to deleteConsumerOverride.Returns the object with the settings used for calls to deleteConsumerOverride.OperationCallSettings<DisableServiceRequest,com.google.protobuf.Empty, OperationMetadata> Returns the object with the settings used for calls to disableService.Deprecated.This method is deprecated and will be removed in the next major version update.OperationCallSettings<EnableServiceRequest,com.google.protobuf.Empty, OperationMetadata> Returns the object with the settings used for calls to enableService.Deprecated.This method is deprecated and will be removed in the next major version update.OperationCallSettings<GenerateServiceIdentityRequest,ServiceIdentity, com.google.protobuf.Empty> Returns the object with the settings used for calls to generateServiceIdentity.Returns the object with the settings used for calls to generateServiceIdentity.Returns the object with the settings used for calls to getConsumerQuotaLimit.Returns the object with the settings used for calls to getConsumerQuotaMetric.static StringReturns the default service endpoint.static StringReturns the default mTLS service endpoint.Returns the default service scopes.protected LibraryMetadataReturns the default service name.Deprecated.This method is deprecated and will be removed in the next major version update.OperationCallSettings<ImportAdminOverridesRequest,ImportAdminOverridesResponse, ImportAdminOverridesMetadata> Returns the object with the settings used for calls to importAdminOverrides.Returns the object with the settings used for calls to importAdminOverrides.OperationCallSettings<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse, ImportConsumerOverridesMetadata> Returns the object with the settings used for calls to importConsumerOverrides.Returns the object with the settings used for calls to importConsumerOverrides.PagedCallSettings<ListAdminOverridesRequest,ListAdminOverridesResponse, ServiceUsageClient.ListAdminOverridesPagedResponse> Returns the object with the settings used for calls to listAdminOverrides.PagedCallSettings<ListConsumerOverridesRequest,ListConsumerOverridesResponse, ServiceUsageClient.ListConsumerOverridesPagedResponse> Returns the object with the settings used for calls to listConsumerOverrides.PagedCallSettings<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse, ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> Returns the object with the settings used for calls to listConsumerQuotaMetrics.PagedCallSettings<ListServicesRequest,ListServicesResponse, ServiceUsageClient.ListServicesPagedResponse> Deprecated.This method is deprecated and will be removed in the next major version update.Returns a new gRPC builder for this class.newBuilder(ClientContext clientContext) Returns a new builder for this class.Returns a new REST builder for this class.Returns a builder containing all the values of this settings class.Returns the object with the settings used for calls to updateAdminOverride.Returns the object with the settings used for calls to updateAdminOverride.Returns the object with the settings used for calls to updateConsumerOverride.Returns the object with the settings used for calls to updateConsumerOverride.Methods inherited from class com.google.api.gax.rpc.StubSettings
getApiKey, getBackgroundExecutorProvider, getClock, getCredentialsProvider, getEndpoint, getExecutorProvider, getGdchApiAudience, getHeaderProvider, getInternalHeaderProvider, getMtlsEndpoint, getQuotaProjectId, getStreamWatchdogCheckInterval, getStreamWatchdogCheckIntervalDuration, getStreamWatchdogProvider, getTracerFactory, getTransportChannelProvider, getUniverseDomain, toString
-
Constructor Details
-
ServiceUsageStubSettings
protected ServiceUsageStubSettings(ServiceUsageStubSettings.Builder settingsBuilder) throws IOException - Throws:
IOException
-
-
Method Details
-
enableServiceSettings
Deprecated.This method is deprecated and will be removed in the next major version update.Returns the object with the settings used for calls to enableService. -
enableServiceOperationSettings
public OperationCallSettings<EnableServiceRequest,com.google.protobuf.Empty, enableServiceOperationSettings()OperationMetadata> Returns the object with the settings used for calls to enableService. -
disableServiceSettings
Deprecated.This method is deprecated and will be removed in the next major version update.Returns the object with the settings used for calls to disableService. -
disableServiceOperationSettings
public OperationCallSettings<DisableServiceRequest,com.google.protobuf.Empty, disableServiceOperationSettings()OperationMetadata> Returns the object with the settings used for calls to disableService. -
getServiceSettings
Deprecated.This method is deprecated and will be removed in the next major version update.Returns the object with the settings used for calls to getService. -
listServicesSettings
@Deprecated public PagedCallSettings<ListServicesRequest,ListServicesResponse, listServicesSettings()ServiceUsageClient.ListServicesPagedResponse> Deprecated.This method is deprecated and will be removed in the next major version update.Returns the object with the settings used for calls to listServices. -
batchEnableServicesSettings
@Deprecated public UnaryCallSettings<BatchEnableServicesRequest,Operation> batchEnableServicesSettings()Deprecated.This method is deprecated and will be removed in the next major version update.Returns the object with the settings used for calls to batchEnableServices. -
batchEnableServicesOperationSettings
public OperationCallSettings<BatchEnableServicesRequest,com.google.protobuf.Empty, batchEnableServicesOperationSettings()OperationMetadata> Returns the object with the settings used for calls to batchEnableServices. -
listConsumerQuotaMetricsSettings
public PagedCallSettings<ListConsumerQuotaMetricsRequest,ListConsumerQuotaMetricsResponse, listConsumerQuotaMetricsSettings()ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse> Returns the object with the settings used for calls to listConsumerQuotaMetrics. -
getConsumerQuotaMetricSettings
public UnaryCallSettings<GetConsumerQuotaMetricRequest,ConsumerQuotaMetric> getConsumerQuotaMetricSettings()Returns the object with the settings used for calls to getConsumerQuotaMetric. -
getConsumerQuotaLimitSettings
public UnaryCallSettings<GetConsumerQuotaLimitRequest,ConsumerQuotaLimit> getConsumerQuotaLimitSettings()Returns the object with the settings used for calls to getConsumerQuotaLimit. -
createAdminOverrideSettings
Returns the object with the settings used for calls to createAdminOverride. -
createAdminOverrideOperationSettings
public OperationCallSettings<CreateAdminOverrideRequest,QuotaOverride, createAdminOverrideOperationSettings()OperationMetadata> Returns the object with the settings used for calls to createAdminOverride. -
updateAdminOverrideSettings
Returns the object with the settings used for calls to updateAdminOverride. -
updateAdminOverrideOperationSettings
public OperationCallSettings<UpdateAdminOverrideRequest,QuotaOverride, updateAdminOverrideOperationSettings()OperationMetadata> Returns the object with the settings used for calls to updateAdminOverride. -
deleteAdminOverrideSettings
Returns the object with the settings used for calls to deleteAdminOverride. -
deleteAdminOverrideOperationSettings
public OperationCallSettings<DeleteAdminOverrideRequest,com.google.protobuf.Empty, deleteAdminOverrideOperationSettings()OperationMetadata> Returns the object with the settings used for calls to deleteAdminOverride. -
listAdminOverridesSettings
public PagedCallSettings<ListAdminOverridesRequest,ListAdminOverridesResponse, listAdminOverridesSettings()ServiceUsageClient.ListAdminOverridesPagedResponse> Returns the object with the settings used for calls to listAdminOverrides. -
importAdminOverridesSettings
Returns the object with the settings used for calls to importAdminOverrides. -
importAdminOverridesOperationSettings
public OperationCallSettings<ImportAdminOverridesRequest,ImportAdminOverridesResponse, importAdminOverridesOperationSettings()ImportAdminOverridesMetadata> Returns the object with the settings used for calls to importAdminOverrides. -
createConsumerOverrideSettings
Returns the object with the settings used for calls to createConsumerOverride. -
createConsumerOverrideOperationSettings
public OperationCallSettings<CreateConsumerOverrideRequest,QuotaOverride, createConsumerOverrideOperationSettings()OperationMetadata> Returns the object with the settings used for calls to createConsumerOverride. -
updateConsumerOverrideSettings
Returns the object with the settings used for calls to updateConsumerOverride. -
updateConsumerOverrideOperationSettings
public OperationCallSettings<UpdateConsumerOverrideRequest,QuotaOverride, updateConsumerOverrideOperationSettings()OperationMetadata> Returns the object with the settings used for calls to updateConsumerOverride. -
deleteConsumerOverrideSettings
Returns the object with the settings used for calls to deleteConsumerOverride. -
deleteConsumerOverrideOperationSettings
public OperationCallSettings<DeleteConsumerOverrideRequest,com.google.protobuf.Empty, deleteConsumerOverrideOperationSettings()OperationMetadata> Returns the object with the settings used for calls to deleteConsumerOverride. -
listConsumerOverridesSettings
public PagedCallSettings<ListConsumerOverridesRequest,ListConsumerOverridesResponse, listConsumerOverridesSettings()ServiceUsageClient.ListConsumerOverridesPagedResponse> Returns the object with the settings used for calls to listConsumerOverrides. -
importConsumerOverridesSettings
public UnaryCallSettings<ImportConsumerOverridesRequest,Operation> importConsumerOverridesSettings()Returns the object with the settings used for calls to importConsumerOverrides. -
importConsumerOverridesOperationSettings
public OperationCallSettings<ImportConsumerOverridesRequest,ImportConsumerOverridesResponse, importConsumerOverridesOperationSettings()ImportConsumerOverridesMetadata> Returns the object with the settings used for calls to importConsumerOverrides. -
generateServiceIdentitySettings
public UnaryCallSettings<GenerateServiceIdentityRequest,Operation> generateServiceIdentitySettings()Returns the object with the settings used for calls to generateServiceIdentity. -
generateServiceIdentityOperationSettings
public OperationCallSettings<GenerateServiceIdentityRequest,ServiceIdentity, generateServiceIdentityOperationSettings()com.google.protobuf.Empty> Returns the object with the settings used for calls to generateServiceIdentity. -
createStub
- Throws:
IOException
-
getServiceName
Returns the default service name.- Overrides:
getServiceNamein classStubSettings<ServiceUsageStubSettings>
-
defaultExecutorProviderBuilder
Returns a builder for the default ExecutorProvider for this service. -
getDefaultEndpoint
Returns the default service endpoint. -
getDefaultMtlsEndpoint
Returns the default mTLS service endpoint. -
getDefaultServiceScopes
Returns the default service scopes. -
defaultCredentialsProviderBuilder
Returns a builder for the default credentials for this service. -
defaultGrpcTransportProviderBuilder
Returns a builder for the default gRPC ChannelProvider for this service. -
defaultHttpJsonTransportProviderBuilder
@BetaApi public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()Returns a builder for the default REST ChannelProvider for this service. -
defaultTransportChannelProvider
-
defaultGrpcApiClientHeaderProviderBuilder
-
defaultHttpJsonApiClientHeaderProviderBuilder
-
defaultApiClientHeaderProviderBuilder
-
newBuilder
Returns a new gRPC builder for this class. -
newHttpJsonBuilder
Returns a new REST builder for this class. -
newBuilder
Returns a new builder for this class. -
toBuilder
Returns a builder containing all the values of this settings class.- Specified by:
toBuilderin classStubSettings<ServiceUsageStubSettings>
-
getLibraryMetadata
- Overrides:
getLibraryMetadatain classStubSettings<ServiceUsageStubSettings>
-