Udostępnij za pośrednictwem


ModelsRepositoryClientBuilder Class

  • java.lang.Object
    • com.azure.iot.modelsrepository.ModelsRepositoryClientBuilder

public final class ModelsRepositoryClientBuilder

This class provides a fluent builder API to help aid the configuration and instantiation of ModelsRepositoryClient and ModelsRepositoryAsyncClient, call buildClient() and buildAsyncClient() respectively to construct an instance of the desired client.

Constructor Summary

Constructor Description
ModelsRepositoryClientBuilder()

The public constructor for ModelsRepositoryClientBuilder

Method Summary

Modifier and Type Method and Description
ModelsRepositoryClientBuilder addPolicy(HttpPipelinePolicy pipelinePolicy)

Adds a pipeline policy to apply on each request sent.

ModelsRepositoryAsyncClient buildAsyncClient()

Create a ModelsRepositoryAsyncClient based on the builder settings.

ModelsRepositoryClient buildClient()

Create a ModelsRepositoryClient based on the builder settings.

ModelsRepositoryClientBuilder clientOptions(ClientOptions clientOptions)

Sets the ClientOptions which enables various options to be set on the client.

ModelsRepositoryClientBuilder configuration(Configuration configuration)

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

ModelsRepositoryClientBuilder httpClient(HttpClient httpClient)

Sets the HttpClient to use for sending a receiving requests to and from the service.

ModelsRepositoryClientBuilder httpLogOptions(HttpLogOptions logOptions)

Sets the HttpLogOptions for service requests.

ModelsRepositoryClientBuilder modelDependencyResolution(ModelDependencyResolution modelDependencyResolution)

Set the default dependency resolution option that the built client will use.

ModelsRepositoryClientBuilder pipeline(HttpPipeline httpPipeline)

Sets the HttpPipeline to use for the service client.

ModelsRepositoryClientBuilder repositoryEndpoint(String repositoryEndpoint)

Set the service endpoint that the built client will communicate with.

ModelsRepositoryClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets the HttpPipelinePolicy that is used as the retry policy for each request that is sent.

ModelsRepositoryClientBuilder serviceVersion(ModelsRepositoryServiceVersion serviceVersion)

Sets the ModelsRepositoryServiceVersion that is used when making API requests.

Methods inherited from java.lang.Object

Constructor Details

ModelsRepositoryClientBuilder

public ModelsRepositoryClientBuilder()

The public constructor for ModelsRepositoryClientBuilder

Method Details

addPolicy

public ModelsRepositoryClientBuilder addPolicy(HttpPipelinePolicy pipelinePolicy)

Adds a pipeline policy to apply on each request sent. The policy will be added after the retry policy. If the method is called multiple times, all policies will be added and their order preserved.

Parameters:

pipelinePolicy - a pipeline policy

Returns:

the updated ModelsRepositoryClientBuilder instance for fluent building.

buildAsyncClient

public ModelsRepositoryAsyncClient buildAsyncClient()

Create a ModelsRepositoryAsyncClient based on the builder settings.

Returns:

the created asynchronous ModelsRepositoryAsyncClient

buildClient

public ModelsRepositoryClient buildClient()

Create a ModelsRepositoryClient based on the builder settings.

Returns:

the created synchronous ModelsRepotioryClient

clientOptions

public ModelsRepositoryClientBuilder clientOptions(ClientOptions clientOptions)

Sets the ClientOptions which enables various options to be set on the client. For example setting an applicationId using ClientOptions#setApplicationId(String) to configure the UserAgentPolicy for telemetry/monitoring purposes.

More About Azure Core: Telemetry policy

Parameters:

clientOptions - the ClientOptions to be set on the client.

Returns:

The updated KeyClientBuilder object.

configuration

public ModelsRepositoryClientBuilder configuration(Configuration configuration)

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

The default configuration store is a clone of the global configuration store, use NONE to bypass using configuration settings during construction.

Parameters:

configuration - The configuration store used to

Returns:

The updated ModelsRepositoryClientBuilder object for fluent building.

httpClient

public ModelsRepositoryClientBuilder httpClient(HttpClient httpClient)

Sets the HttpClient to use for sending a receiving requests to and from the service.

Parameters:

httpClient - HttpClient to use for requests.

Returns:

the updated ModelsRepositoryClientBuilder instance for fluent building.

httpLogOptions

public ModelsRepositoryClientBuilder 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 ModelsRepositoryClientBuilder instance for fluent building.

modelDependencyResolution

public ModelsRepositoryClientBuilder modelDependencyResolution(ModelDependencyResolution modelDependencyResolution)

Set the default dependency resolution option that the built client will use. This field will have a default value.

Parameters:

modelDependencyResolution - A DependencyResolutionOption value to force model resolution behavior.

Returns:

the updated ModelsRepositoryClientBuilder instance for fluent building.

pipeline

public ModelsRepositoryClientBuilder pipeline(HttpPipeline httpPipeline)

Sets the HttpPipeline to use for the service client.

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

Parameters:

httpPipeline - HttpPipeline to use for sending service requests and receiving responses.

Returns:

the updated ModelsRepositoryClientBuilder instance for fluent building.

repositoryEndpoint

public ModelsRepositoryClientBuilder repositoryEndpoint(String repositoryEndpoint)

Set the service endpoint that the built client will communicate with. This field is mandatory to set.

Parameters:

repositoryEndpoint - Uri of the service in String format.

Returns:

the updated ModelsRepositoryClientBuilder instance for fluent building.

retryPolicy

public ModelsRepositoryClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets the HttpPipelinePolicy that is used as the retry policy for each request that is sent.

The default retry policy will be used if not provided. The default retry policy is RetryPolicy#RetryPolicy(). For implementing custom retry logic, see RetryPolicy as an example.

Parameters:

retryPolicy - the retry policy applied to each request.

Returns:

The updated ConfigurationClientBuilder object.

serviceVersion

public ModelsRepositoryClientBuilder serviceVersion(ModelsRepositoryServiceVersion serviceVersion)

Sets the ModelsRepositoryServiceVersion 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:

serviceVersion - The service API version to use.

Returns:

the updated ModelsRepositoryClientBuilder instance for fluent building.

Applies to