Class CommunicationRelayClientBuilder
- java.lang.Object
-
- com.azure.communication.networktraversal.CommunicationRelayClientBuilder
-
public final class CommunicationRelayClientBuilder extends Object
CommunicationRelayClientBuilder that creates CommunicationRelayAsyncClient and CommunicationRelayClient.
-
-
Constructor Summary
Constructors Constructor Description CommunicationRelayClientBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommunicationRelayClientBuilder
addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy)
Apply additional HttpPipelinePolicyCommunicationRelayAsyncClient
buildAsyncClient()
Create asynchronous client applying HMACAuthenticationPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy.CommunicationRelayClient
buildClient()
Create synchronous client applying HmacAuthenticationPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy.CommunicationRelayClientBuilder
clientOptions(com.azure.core.util.ClientOptions clientOptions)
Sets the client options for all the requests made through the client.CommunicationRelayClientBuilder
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration object used to retrieve environment configuration values during building of the client.CommunicationRelayClientBuilder
connectionString(String connectionString)
Set endpoint and credential to useCommunicationRelayClientBuilder
credential(com.azure.core.credential.AzureKeyCredential keyCredential)
Sets theAzureKeyCredential
used to authenticate HTTP requests.CommunicationRelayClientBuilder
credential(com.azure.core.credential.TokenCredential tokenCredential)
Sets theTokenCredential
used to authenticate HTTP requests.CommunicationRelayClientBuilder
endpoint(String endpoint)
Set endpoint of the serviceCommunicationRelayClientBuilder
httpClient(com.azure.core.http.HttpClient httpClient)
Set httpClient to useCommunicationRelayClientBuilder
httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets theHttpLogOptions
for service requests.CommunicationRelayClientBuilder
pipeline(com.azure.core.http.HttpPipeline pipeline)
Set endpoint of the serviceCommunicationRelayClientBuilder
retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
Sets theRetryPolicy
that is used when each request is sent.CommunicationRelayClientBuilder
serviceVersion(CommunicationRelayServiceVersion version)
Sets theCommunicationRelayServiceVersion
that is used when making API requests.
-
-
-
Method Detail
-
endpoint
public CommunicationRelayClientBuilder endpoint(String endpoint)
Set endpoint of the service- Parameters:
endpoint
- url of the service- Returns:
- CommunicationRelayClientBuilder
-
pipeline
public CommunicationRelayClientBuilder pipeline(com.azure.core.http.HttpPipeline pipeline)
Set endpoint of the service- Parameters:
pipeline
- HttpPipeline to use, if a pipeline is not supplied, the credential and httpClient fields must be set- Returns:
- CommunicationRelayClientBuilder
-
credential
public CommunicationRelayClientBuilder credential(com.azure.core.credential.TokenCredential tokenCredential)
Sets theTokenCredential
used to authenticate HTTP requests.- Parameters:
tokenCredential
-TokenCredential
used to authenticate HTTP requests.- Returns:
- The updated
CommunicationRelayClientBuilder
object.
-
credential
public CommunicationRelayClientBuilder credential(com.azure.core.credential.AzureKeyCredential keyCredential)
Sets theAzureKeyCredential
used to authenticate HTTP requests.- Parameters:
keyCredential
- TheAzureKeyCredential
used to authenticate HTTP requests.- Returns:
- The updated
CommunicationRelayClientBuilder
object.
-
connectionString
public CommunicationRelayClientBuilder connectionString(String connectionString)
Set endpoint and credential to use- Parameters:
connectionString
- connection string for setting endpoint and initalizing CommunicationClientCredential- Returns:
- CommunicationRelayClientBuilder
-
httpClient
public CommunicationRelayClientBuilder httpClient(com.azure.core.http.HttpClient httpClient)
Set httpClient to use- Parameters:
httpClient
- httpClient to use, overridden by the pipeline field.- Returns:
- CommunicationRelayClientBuilder
-
addPolicy
public CommunicationRelayClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy)
Apply additional HttpPipelinePolicy- Parameters:
customPolicy
- HttpPipelinePolicy object to be applied after AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy- Returns:
- CommunicationRelayClientBuilder
-
clientOptions
public CommunicationRelayClientBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions)
Sets the client options for all the requests made through the client.- Parameters:
clientOptions
-ClientOptions
.- Returns:
- The updated
CommunicationRelayClientBuilder
object.
-
configuration
public CommunicationRelayClientBuilder configuration(com.azure.core.util.Configuration configuration)
Sets the configuration object used to retrieve environment configuration values during building of the client.- Parameters:
configuration
- Configuration store used to retrieve environment configurations.- Returns:
- the updated CommunicationRelayClientBuilder object
-
httpLogOptions
public CommunicationRelayClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets theHttpLogOptions
for service requests.- Parameters:
logOptions
- The logging configuration to use when sending and receiving HTTP requests/responses.- Returns:
- the updated CommunicationRelayClientBuilder object
-
retryPolicy
public CommunicationRelayClientBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
Sets theRetryPolicy
that is used when each request is sent.- Parameters:
retryPolicy
- User's retry policy applied to each request.- Returns:
- The updated
CommunicationRelayClientBuilder
object.
-
serviceVersion
public CommunicationRelayClientBuilder serviceVersion(CommunicationRelayServiceVersion version)
Sets theCommunicationRelayServiceVersion
that is used when making API requests.If a service version is not provided, the service version that will be used will be the latest known service version based on the version of the client library being used. If no service version is specified, updating to a newer version of the client library will have the result of potentially moving to a newer service version.
Targeting a specific service version may also mean that the service will return an error for newer APIs.
- Parameters:
version
-CommunicationRelayServiceVersion
of the service to be used when making requests.- Returns:
- the updated CommunicationRelayClientBuilder object
-
buildAsyncClient
public CommunicationRelayAsyncClient buildAsyncClient()
Create asynchronous client applying HMACAuthenticationPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy. Additional HttpPolicies specified by additionalPolicies will be applied after them- Returns:
- CommunicationRelayAsyncClient instance
-
buildClient
public CommunicationRelayClient buildClient()
Create synchronous client applying HmacAuthenticationPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy. Additional HttpPolicies specified by additionalPolicies will be applied after them- Returns:
- CommunicationRelayClient instance
-
-