PhoneNumberClientBuilder Class

  • java.lang.Object
    • com.azure.communication.administration.PhoneNumberClientBuilder

public final class PhoneNumberClientBuilder

Builder for creating clients of Communication Service phone number configuration

Constructor Summary

Constructor Description
PhoneNumberClientBuilder()

Method Summary

Modifier and Type Method and Description
PhoneNumberClientBuilder accessKey(String accessKey)

Set CommunicationClientCredential for authorization

PhoneNumberClientBuilder addPolicy(HttpPipelinePolicy policy)

Adds a policy to the set of existing policies that are executed after required policies.

PhoneNumberAsyncClient buildAsyncClient()

Create asynchronous client applying CommunicationClientCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy.

PhoneNumberClient buildClient()

Create synchronous client applying CommunicationClientCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy.

PhoneNumberClientBuilder configuration(Configuration configuration)

Sets the configuration object used to retrieve environment configuration values during building of the client.

PhoneNumberClientBuilder connectionString(String connectionString)

Set the endpoint and CommunicationClientCredential for authorization

PhoneNumberClientBuilder endpoint(String endpoint)

Set endpoint of the service

PhoneNumberClientBuilder httpClient(HttpClient httpClient)

Set HttpClient to use

PhoneNumberClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets the logging configuration for HTTP requests and responses.

PhoneNumberClientBuilder pipeline(HttpPipeline pipeline)

Sets the HTTP pipeline to use for the service client

PhoneNumberClientBuilder serviceVersion(PhoneNumberServiceVersion version)

Sets the PhoneNumberServiceVersion that is used when making API requests.

Methods inherited from java.lang.Object

Constructor Details

PhoneNumberClientBuilder

public PhoneNumberClientBuilder()

Method Details

accessKey

public PhoneNumberClientBuilder accessKey(String accessKey)

Set CommunicationClientCredential for authorization

Parameters:

accessKey - access key for initalizing CommunicationClientCredential

Returns:

The updated PhoneNumberClientBuilder object.

addPolicy

public PhoneNumberClientBuilder addPolicy(HttpPipelinePolicy policy)

Adds a policy to the set of existing policies that are executed after required policies.

Parameters:

policy - The retry policy for service requests.

Returns:

The updated PhoneNumberClientBuilder object.

buildAsyncClient

public PhoneNumberAsyncClient buildAsyncClient()

Create asynchronous client applying CommunicationClientCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy. Additional HttpPolicies specified by additionalPolicies will be applied after them

Returns:

buildClient

public PhoneNumberClient buildClient()

Create synchronous client applying CommunicationClientCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy. Additional HttpPolicies specified by additionalPolicies will be applied after them

Returns:

configuration

public PhoneNumberClientBuilder configuration(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 PhoneNumberClientBuilder object.

connectionString

public PhoneNumberClientBuilder connectionString(String connectionString)

Set the endpoint and CommunicationClientCredential for authorization

Parameters:

connectionString - connection string for setting endpoint and initalizing CommunicationClientCredential

Returns:

The updated PhoneNumberClientBuilder object.

endpoint

public PhoneNumberClientBuilder endpoint(String endpoint)

Set endpoint of the service

Parameters:

endpoint - url of the service

Returns:

The updated PhoneNumberClientBuilder object.

httpClient

public PhoneNumberClientBuilder httpClient(HttpClient httpClient)

Set HttpClient to use

Parameters:

httpClient - HttpClient to use

Returns:

The updated PhoneNumberClientBuilder object.

httpLogOptions

public PhoneNumberClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets the logging configuration for HTTP requests and responses.

If logLevel is not provided, default value of HttpLogDetailLevel#NONE is set.

Parameters:

httpLogOptions - The logging configuration to use when sending and receiving HTTP requests/responses.

Returns:

the updated PhoneNumberClientBuilder object.

pipeline

public PhoneNumberClientBuilder pipeline(HttpPipeline pipeline)

Sets the HTTP pipeline to use for the service client

If pipeline is set, all other settings aside from endpoint(String endpoint) are ignored.

Parameters:

pipeline - HttpPipeline to use

Returns:

The updated PhoneNumberClientBuilder object.

serviceVersion

public PhoneNumberClientBuilder serviceVersion(PhoneNumberServiceVersion version)

Sets the PhoneNumberServiceVersion 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 the client library will have the result of potentially moving to a newer service version.

Parameters:

version - PhoneNumberServiceVersion of the service to be used when making requests.

Returns:

The updated PhoneNumberClientBuilder object.

Applies to