Package com.azure.ai.translation.text
Class TextTranslationClientBuilder
java.lang.Object
com.azure.ai.translation.text.TextTranslationClientBuilder
- All Implemented Interfaces:
com.azure.core.client.traits.AzureKeyCredentialTrait<TextTranslationClientBuilder>
,com.azure.core.client.traits.ConfigurationTrait<TextTranslationClientBuilder>
,com.azure.core.client.traits.EndpointTrait<TextTranslationClientBuilder>
,com.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
,com.azure.core.client.traits.TokenCredentialTrait<TextTranslationClientBuilder>
public final class TextTranslationClientBuilder
extends Object
implements com.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>, com.azure.core.client.traits.ConfigurationTrait<TextTranslationClientBuilder>, com.azure.core.client.traits.EndpointTrait<TextTranslationClientBuilder>, com.azure.core.client.traits.AzureKeyCredentialTrait<TextTranslationClientBuilder>, com.azure.core.client.traits.TokenCredentialTrait<TextTranslationClientBuilder>
A builder for creating a new instance of the TextTranslationClient type.
-
Constructor Summary
ConstructorDescriptionCreate an instance of the TextTranslationClientBuilder. -
Method Summary
Modifier and TypeMethodDescriptionaddPolicy
(com.azure.core.http.policy.HttpPipelinePolicy customPolicy) .Builds an instance of TextTranslationAsyncClient class.Builds an instance of TextTranslationClient class.clientOptions
(com.azure.core.util.ClientOptions clientOptions) .configuration
(com.azure.core.util.Configuration configuration) .credential
(com.azure.core.credential.AzureKeyCredential credential) Sets theAzureKeyCredential
used to authorize requests sent to the service.credential
(com.azure.core.credential.TokenCredential tokenCredential) Sets theTokenCredential
used to authorize requests sent to the service..httpClient
(com.azure.core.http.HttpClient httpClient) .httpLogOptions
(com.azure.core.http.policy.HttpLogOptions httpLogOptions) .pipeline
(com.azure.core.http.HttpPipeline pipeline) .Sets the region used to authorize requests sent to the service.retryOptions
(com.azure.core.http.policy.RetryOptions retryOptions) .retryPolicy
(com.azure.core.http.policy.RetryPolicy retryPolicy) Sets The retry policy that will attempt to retry failed requests, if applicable.serviceVersion
(TextTranslationServiceVersion serviceVersion) Sets Service version.
-
Constructor Details
-
TextTranslationClientBuilder
public TextTranslationClientBuilder()Create an instance of the TextTranslationClientBuilder.
-
-
Method Details
-
pipeline
.- Specified by:
pipeline
in interfacecom.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
-
httpClient
.- Specified by:
httpClient
in interfacecom.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
-
httpLogOptions
public TextTranslationClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) .- Specified by:
httpLogOptions
in interfacecom.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
-
clientOptions
.- Specified by:
clientOptions
in interfacecom.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
-
retryOptions
public TextTranslationClientBuilder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) .- Specified by:
retryOptions
in interfacecom.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
-
addPolicy
public TextTranslationClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy) .- Specified by:
addPolicy
in interfacecom.azure.core.client.traits.HttpTrait<TextTranslationClientBuilder>
-
configuration
.- Specified by:
configuration
in interfacecom.azure.core.client.traits.ConfigurationTrait<TextTranslationClientBuilder>
-
endpoint
.- Specified by:
endpoint
in interfacecom.azure.core.client.traits.EndpointTrait<TextTranslationClientBuilder>
-
serviceVersion
Sets Service version.- Parameters:
serviceVersion
- the serviceVersion value.- Returns:
- the TextTranslationClientBuilder.
-
retryPolicy
Sets The retry policy that will attempt to retry failed requests, if applicable.- Parameters:
retryPolicy
- the retryPolicy value.- Returns:
- the TextTranslationClientBuilder.
-
credential
public TextTranslationClientBuilder credential(com.azure.core.credential.AzureKeyCredential credential) Sets theAzureKeyCredential
used to authorize requests sent to the service.- Specified by:
credential
in interfacecom.azure.core.client.traits.AzureKeyCredentialTrait<TextTranslationClientBuilder>
- Parameters:
credential
-AzureKeyCredential
used to authorize requests sent to the service.- Returns:
- The updated
TextTranslationClientBuilder
object. - Throws:
NullPointerException
- Ifcredential
is null.
-
region
Sets the region used to authorize requests sent to the service.- Parameters:
region
- where the Translator resource is created.- Returns:
- The updated
TextTranslationClientBuilder
object. - Throws:
NullPointerException
- IftokenCredential
is null.
-
credential
public TextTranslationClientBuilder credential(com.azure.core.credential.TokenCredential tokenCredential) Sets theTokenCredential
used to authorize requests sent to the service. Refer to the Azure SDK for Java identity and authentication documentation for more details on proper usage of theTokenCredential
type.- Specified by:
credential
in interfacecom.azure.core.client.traits.TokenCredentialTrait<TextTranslationClientBuilder>
- Parameters:
tokenCredential
-TokenCredential
used to authorize requests sent to the service.- Returns:
- The updated
TextTranslationClientBuilder
object. - Throws:
NullPointerException
- IftokenCredential
is null.
-
buildAsyncClient
Builds an instance of TextTranslationAsyncClient class.- Returns:
- an instance of TextTranslationAsyncClient.
-
buildClient
Builds an instance of TextTranslationClient class.- Returns:
- an instance of TextTranslationClient.
-