MetricsClientBuilder Class

  • java.lang.Object
    • com.azure.monitor.query.MetricsClientBuilder

Implements

public final class MetricsClientBuilder
implements EndpointTrait<MetricsClientBuilder>, HttpTrait<MetricsClientBuilder>, ConfigurationTrait<MetricsClientBuilder>, TokenCredentialTrait<MetricsClientBuilder>

Fluent builder for creating instances of MetricsClient and MetricsAsyncClient.

Constructor Summary

Constructor Description
MetricsClientBuilder()

Creates an instance of MetricsClientBuilder.

Method Summary

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

Adds a custom Http pipeline policy.

MetricsClientBuilder audience(MetricsAudience audience)

Sets the metrics audience.

MetricsAsyncClient buildAsyncClient()

Creates an asynchronous client with the configured options in this builder.

MetricsClient buildClient()

Creates a synchronous client with the configured options in this builder.

MetricsClientBuilder clientOptions(ClientOptions clientOptions)

Set the ClientOptions used for creating the client.

MetricsClientBuilder configuration(Configuration configuration)

Sets The configuration store that is used during construction of the service client.

MetricsClientBuilder credential(TokenCredential tokenCredential)

Sets The TokenCredential used for authentication.

MetricsClientBuilder endpoint(String endpoint)

Sets the metrics endpoint.

MetricsClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

MetricsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The logging configuration for HTTP requests and responses.

MetricsClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

MetricsClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions used for creating the client.

MetricsClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

MetricsClientBuilder serviceVersion(MetricsServiceVersion serviceVersion)

The service version to use when creating the client.

Methods inherited from java.lang.Object

Constructor Details

MetricsClientBuilder

public MetricsClientBuilder()

Creates an instance of MetricsClientBuilder.

Method Details

addPolicy

public MetricsClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

Adds a custom Http pipeline policy.

Parameters:

customPolicy - The custom Http pipeline policy to add.

Returns:

audience

public MetricsClientBuilder audience(MetricsAudience audience)

Sets the metrics audience.

Parameters:

audience - the audience.

Returns:

buildAsyncClient

public MetricsAsyncClient buildAsyncClient()

Creates an asynchronous client with the configured options in this builder.

Returns:

An asynchronous MetricsAsyncClient.

buildClient

public MetricsClient buildClient()

Creates a synchronous client with the configured options in this builder.

Returns:

A synchronous MetricsClient.

clientOptions

public MetricsClientBuilder clientOptions(ClientOptions clientOptions)

Set the ClientOptions used for creating the client.

Parameters:

clientOptions - The ClientOptions.

Returns:

configuration

public MetricsClientBuilder configuration(Configuration configuration)

Sets The configuration store that is used during construction of the service client.

Parameters:

configuration - the configuration value.

Returns:

credential

public MetricsClientBuilder credential(TokenCredential tokenCredential)

Sets The TokenCredential used for authentication.

Parameters:

tokenCredential - the tokenCredential value.

Returns:

endpoint

public MetricsClientBuilder endpoint(String endpoint)

Sets the metrics endpoint.

Parameters:

endpoint - the endpoint.

Returns:

httpClient

public MetricsClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

Parameters:

httpClient - the httpClient value.

Returns:

httpLogOptions

public MetricsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The logging configuration for HTTP requests and responses.

Parameters:

httpLogOptions - the httpLogOptions value.

Returns:

pipeline

public MetricsClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

Parameters:

pipeline - the pipeline value.

Returns:

retryOptions

public MetricsClientBuilder retryOptions(RetryOptions retryOptions)

Sets the RetryOptions used for creating the client.

Parameters:

retryOptions - The RetryOptions.

Returns:

retryPolicy

public MetricsClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

Parameters:

retryPolicy - the retryPolicy value.

Returns:

serviceVersion

public MetricsClientBuilder serviceVersion(MetricsServiceVersion serviceVersion)

The service version to use when creating the client.

Parameters:

serviceVersion - The MetricsServiceVersion.

Returns:

Applies to