Поделиться через


RoomsClientBuilder Class

  • java.lang.Object
    • com.azure.communication.rooms.RoomsClientBuilder

Implements

public final class RoomsClientBuilder
implements HttpTrait<RoomsClientBuilder>, ConfigurationTrait<RoomsClientBuilder>, ConnectionStringTrait<RoomsClientBuilder>, TokenCredentialTrait<RoomsClientBuilder>, AzureKeyCredentialTrait<RoomsClientBuilder>, EndpointTrait<RoomsClientBuilder>

RoomsClientBuilder that creates RoomsAsyncClient and RoomsClient.

Instantiating a Rooms CLient Builder

RoomsClientBuilder builder = new RoomsClientBuilder();

Using room client builder build a Rooms Client

RoomsClient roomsClient = new RoomsClientBuilder()
      .endpoint(endpoint)
      .credential(azureKeyCredential)
      .buildClient();

Constructor Summary

Constructor Description
RoomsClientBuilder()

Creates a new instance of the RoomsClientBuilder.

Method Summary

Modifier and Type Method and Description
RoomsClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

Apply additional HttpPipelinePolicy

RoomsAsyncClient buildAsyncClient()

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

RoomsClient buildClient()

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

RoomsClientBuilder clientOptions(ClientOptions clientOptions)

Allows the user to set a variety of client-related options, such as user-agent string, headers, etc.

RoomsClientBuilder configuration(Configuration configuration)

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

RoomsClientBuilder connectionString(String connectionString)

Set endpoint and credential to use

RoomsClientBuilder credential(AzureKeyCredential keyCredential)

Sets the AzureKeyCredential used to authenticate HTTP requests.

RoomsClientBuilder credential(TokenCredential tokenCredential)

Sets the TokenCredential used to authenticate HTTP requests.

RoomsClientBuilder endpoint(String endpoint)

Set endpoint of the service

RoomsClientBuilder httpClient(HttpClient httpClient)

Set httpClient to use

RoomsClientBuilder httpLogOptions(HttpLogOptions logOptions)

Sets the HttpLogOptions for service requests.

RoomsClientBuilder pipeline(HttpPipeline pipeline)

Set endpoint of the service

RoomsClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions for all the requests made through the client.

RoomsClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets the retry policy to use (using the RetryPolicy type).

RoomsClientBuilder serviceVersion(RoomsServiceVersion version)

Sets the RoomsServiceVersion that is used when making API requests.

Methods inherited from java.lang.Object

Constructor Details

RoomsClientBuilder

public RoomsClientBuilder()

Creates a new instance of the RoomsClientBuilder.

Method Details

addPolicy

public RoomsClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

Apply additional HttpPipelinePolicy

Parameters:

customPolicy - HttpPipelinePolicy object to be applied after AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy

Returns:

RoomsClientBuilder

buildAsyncClient

public RoomsAsyncClient buildAsyncClient()

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

Returns:

RoomsAsyncClient instance

buildClient

public RoomsClient buildClient()

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

Returns:

RoomsClient instance

clientOptions

public RoomsClientBuilder clientOptions(ClientOptions clientOptions)

Allows the user to set a variety of client-related options, such as user-agent string, headers, etc.

Parameters:

clientOptions - object to be applied

Returns:

RoomsClientBuilder

configuration

public RoomsClientBuilder 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 RoomsClientBuilder object

connectionString

public RoomsClientBuilder connectionString(String connectionString)

Set endpoint and credential to use

Parameters:

connectionString - connection string for setting endpoint and initalizing AzureKeyCredential

Returns:

RoomsClientBuilder

credential

public RoomsClientBuilder credential(AzureKeyCredential keyCredential)

Sets the AzureKeyCredential used to authenticate HTTP requests.

Parameters:

keyCredential - The AzureKeyCredential used to authenticate HTTP requests.

Returns:

The updated RoomsClientBuilder object.

credential

public RoomsClientBuilder credential(TokenCredential tokenCredential)

Sets the TokenCredential used to authenticate HTTP requests.

Parameters:

tokenCredential - TokenCredential used to authenticate HTTP requests.

Returns:

The updated RoomsClientBuilder object.

endpoint

public RoomsClientBuilder endpoint(String endpoint)

Set endpoint of the service

Parameters:

endpoint - url of the service

Returns:

RoomsClientBuilder

httpClient

public RoomsClientBuilder httpClient(HttpClient httpClient)

Set httpClient to use

Parameters:

httpClient - httpClient to use, overridden by the pipeline field.

Returns:

RoomsClientBuilder

httpLogOptions

public RoomsClientBuilder httpLogOptions(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 RoomsClientBuilder object

pipeline

public RoomsClientBuilder pipeline(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:

RoomsClientBuilder

retryOptions

public RoomsClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions for all the requests made through the client.

Parameters:

retryOptions - The RetryOptions to use for all the requests made through the client.

Returns:

Updated RoomsClientBuilder object.

retryPolicy

public RoomsClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets the retry policy to use (using the RetryPolicy type).

Parameters:

retryPolicy - object to be applied

Returns:

RoomsClientBuilder

serviceVersion

public RoomsClientBuilder serviceVersion(RoomsServiceVersion version)

Sets the RoomsServiceVersion 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 - RoomsServiceVersion of the service to be used when making requests.

Returns:

the updated RoomsClientBuilder object

Applies to