Class CommunicationRelayClientBuilder


  • public final class CommunicationRelayClientBuilder
    extends Object
    CommunicationRelayClientBuilder that creates CommunicationRelayAsyncClient and CommunicationRelayClient.
    • Constructor Detail

      • CommunicationRelayClientBuilder

        public CommunicationRelayClientBuilder()
    • 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 the TokenCredential 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 the AzureKeyCredential used to authenticate HTTP requests.
        Parameters:
        keyCredential - The AzureKeyCredential 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
      • 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 the HttpLogOptions 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 the RetryPolicy 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 the CommunicationRelayServiceVersion 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