@BetaApi @Generated(value="by gapic-generator-java") public class TranslationServiceSettings extends com.google.api.gax.rpc.ClientSettings<TranslationServiceSettings>
TranslationServiceClient.
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 translateText:
// 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
TranslationServiceSettings.Builder translationServiceSettingsBuilder =
TranslationServiceSettings.newBuilder();
translationServiceSettingsBuilder
.translateTextSettings()
.setRetrySettings(
translationServiceSettingsBuilder
.translateTextSettings()
.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());
TranslationServiceSettings translationServiceSettings =
translationServiceSettingsBuilder.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 batchTranslateText:
// 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
TranslationServiceSettings.Builder translationServiceSettingsBuilder =
TranslationServiceSettings.newBuilder();
TimedRetryAlgorithm timedRetryAlgorithm =
OperationalTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelayDuration(Duration.ofMillis(500))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelayDuration(Duration.ofMillis(5000))
.setTotalTimeoutDuration(Duration.ofHours(24))
.build());
translationServiceSettingsBuilder
.createClusterOperationSettings()
.setPollingAlgorithm(timedRetryAlgorithm)
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
TranslationServiceSettings.Builder
Builder for TranslationServiceSettings.
|
| Modifier | Constructor and Description |
|---|---|
protected |
TranslationServiceSettings(TranslationServiceSettings.Builder settingsBuilder) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.rpc.OperationCallSettings<BatchTranslateDocumentRequest,BatchTranslateDocumentResponse,BatchTranslateDocumentMetadata> |
batchTranslateDocumentOperationSettings()
Returns the object with the settings used for calls to batchTranslateDocument.
|
com.google.api.gax.rpc.UnaryCallSettings<BatchTranslateDocumentRequest,com.google.longrunning.Operation> |
batchTranslateDocumentSettings()
Returns the object with the settings used for calls to batchTranslateDocument.
|
com.google.api.gax.rpc.OperationCallSettings<BatchTranslateTextRequest,BatchTranslateResponse,BatchTranslateMetadata> |
batchTranslateTextOperationSettings()
Returns the object with the settings used for calls to batchTranslateText.
|
com.google.api.gax.rpc.UnaryCallSettings<BatchTranslateTextRequest,com.google.longrunning.Operation> |
batchTranslateTextSettings()
Returns the object with the settings used for calls to batchTranslateText.
|
static TranslationServiceSettings |
create(TranslationServiceStubSettings stub) |
com.google.api.gax.rpc.OperationCallSettings<CreateGlossaryRequest,Glossary,CreateGlossaryMetadata> |
createGlossaryOperationSettings()
Returns the object with the settings used for calls to createGlossary.
|
com.google.api.gax.rpc.UnaryCallSettings<CreateGlossaryRequest,com.google.longrunning.Operation> |
createGlossarySettings()
Returns the object with the settings used for calls to createGlossary.
|
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<DeleteGlossaryRequest,DeleteGlossaryResponse,DeleteGlossaryMetadata> |
deleteGlossaryOperationSettings()
Returns the object with the settings used for calls to deleteGlossary.
|
com.google.api.gax.rpc.UnaryCallSettings<DeleteGlossaryRequest,com.google.longrunning.Operation> |
deleteGlossarySettings()
Returns the object with the settings used for calls to deleteGlossary.
|
com.google.api.gax.rpc.UnaryCallSettings<DetectLanguageRequest,DetectLanguageResponse> |
detectLanguageSettings()
Returns the object with the settings used for calls to detectLanguage.
|
static String |
getDefaultEndpoint()
Returns the default service endpoint.
|
static List<String> |
getDefaultServiceScopes()
Returns the default service scopes.
|
com.google.api.gax.rpc.UnaryCallSettings<GetGlossaryRequest,Glossary> |
getGlossarySettings()
Returns the object with the settings used for calls to getGlossary.
|
com.google.api.gax.rpc.UnaryCallSettings<GetSupportedLanguagesRequest,SupportedLanguages> |
getSupportedLanguagesSettings()
Returns the object with the settings used for calls to getSupportedLanguages.
|
com.google.api.gax.rpc.PagedCallSettings<ListGlossariesRequest,ListGlossariesResponse,TranslationServiceClient.ListGlossariesPagedResponse> |
listGlossariesSettings()
Returns the object with the settings used for calls to listGlossaries.
|
static TranslationServiceSettings.Builder |
newBuilder()
Returns a new gRPC builder for this class.
|
static TranslationServiceSettings.Builder |
newBuilder(com.google.api.gax.rpc.ClientContext clientContext)
Returns a new builder for this class.
|
static TranslationServiceSettings.Builder |
newHttpJsonBuilder()
Returns a new REST builder for this class.
|
TranslationServiceSettings.Builder |
toBuilder()
Returns a builder containing all the values of this settings class.
|
com.google.api.gax.rpc.UnaryCallSettings<TranslateDocumentRequest,TranslateDocumentResponse> |
translateDocumentSettings()
Returns the object with the settings used for calls to translateDocument.
|
com.google.api.gax.rpc.UnaryCallSettings<TranslateTextRequest,TranslateTextResponse> |
translateTextSettings()
Returns the object with the settings used for calls to translateText.
|
getApiKey, getBackgroundExecutorProvider, getClock, getCredentialsProvider, getEndpoint, getExecutorProvider, getGdchApiAudience, getHeaderProvider, getInternalHeaderProvider, getQuotaProjectId, getStubSettings, getTransportChannelProvider, getUniverseDomain, getWatchdogCheckInterval, getWatchdogCheckIntervalDuration, getWatchdogProvider, toStringprotected TranslationServiceSettings(TranslationServiceSettings.Builder settingsBuilder) throws IOException
IOExceptionpublic com.google.api.gax.rpc.UnaryCallSettings<TranslateTextRequest,TranslateTextResponse> translateTextSettings()
public com.google.api.gax.rpc.UnaryCallSettings<DetectLanguageRequest,DetectLanguageResponse> detectLanguageSettings()
public com.google.api.gax.rpc.UnaryCallSettings<GetSupportedLanguagesRequest,SupportedLanguages> getSupportedLanguagesSettings()
public com.google.api.gax.rpc.UnaryCallSettings<TranslateDocumentRequest,TranslateDocumentResponse> translateDocumentSettings()
public com.google.api.gax.rpc.UnaryCallSettings<BatchTranslateTextRequest,com.google.longrunning.Operation> batchTranslateTextSettings()
public com.google.api.gax.rpc.OperationCallSettings<BatchTranslateTextRequest,BatchTranslateResponse,BatchTranslateMetadata> batchTranslateTextOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<BatchTranslateDocumentRequest,com.google.longrunning.Operation> batchTranslateDocumentSettings()
public com.google.api.gax.rpc.OperationCallSettings<BatchTranslateDocumentRequest,BatchTranslateDocumentResponse,BatchTranslateDocumentMetadata> batchTranslateDocumentOperationSettings()
public com.google.api.gax.rpc.UnaryCallSettings<CreateGlossaryRequest,com.google.longrunning.Operation> createGlossarySettings()
public com.google.api.gax.rpc.OperationCallSettings<CreateGlossaryRequest,Glossary,CreateGlossaryMetadata> createGlossaryOperationSettings()
public com.google.api.gax.rpc.PagedCallSettings<ListGlossariesRequest,ListGlossariesResponse,TranslationServiceClient.ListGlossariesPagedResponse> listGlossariesSettings()
public com.google.api.gax.rpc.UnaryCallSettings<GetGlossaryRequest,Glossary> getGlossarySettings()
public com.google.api.gax.rpc.UnaryCallSettings<DeleteGlossaryRequest,com.google.longrunning.Operation> deleteGlossarySettings()
public com.google.api.gax.rpc.OperationCallSettings<DeleteGlossaryRequest,DeleteGlossaryResponse,DeleteGlossaryMetadata> deleteGlossaryOperationSettings()
public static final TranslationServiceSettings create(TranslationServiceStubSettings 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 TranslationServiceSettings.Builder newBuilder()
public static TranslationServiceSettings.Builder newHttpJsonBuilder()
public static TranslationServiceSettings.Builder newBuilder(com.google.api.gax.rpc.ClientContext clientContext)
public TranslationServiceSettings.Builder toBuilder()
toBuilder in class com.google.api.gax.rpc.ClientSettings<TranslationServiceSettings>Copyright © 2024 Google LLC. All rights reserved.