MapsRenderClientBuilder Class

  • java.lang.Object
    • com.azure.maps.render.MapsRenderClientBuilder

Implements

public final class MapsRenderClientBuilder
implements AzureKeyCredentialTrait<MapsRenderClientBuilder>, AzureSasCredentialTrait<MapsRenderClientBuilder>, TokenCredentialTrait<MapsRenderClientBuilder>, HttpTrait<MapsRenderClientBuilder>, ConfigurationTrait<MapsRenderClientBuilder>, EndpointTrait<MapsRenderClientBuilder>

A builder for creating a new instance of the RenderClient type. Builder class used to instantiate both synchronous and asynchronous MapsRenderClient clients. Creating a sync client using a AzureKeyCredential:

// Authenticates using subscription key
 AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));

 // Creates a builder
 MapsRenderClientBuilder builder = new MapsRenderClientBuilder();
 builder.credential(keyCredential);
 builder.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS));

 // Builds the client
 MapsRenderClient client = builder.buildClient();

Creating a sync client using a TokenCredential:

// Authenticates using Azure AD building a default credential
 // This will look for AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET env variables
 DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder().build();

 // Creates a builder
 MapsRenderClientBuilder builder = new MapsRenderClientBuilder();
 builder.credential(tokenCredential);
 builder.mapsClientId(System.getenv("MAPS_CLIENT_ID"));
 builder.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS));

 // Builds a client
 MapsRenderClient client = builder.buildClient();

Constructor Summary

Constructor Description
MapsRenderClientBuilder()

Create an instance of the RenderClientBuilder.

Method Summary

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

Adds a custom Http pipeline policy.

MapsRenderAsyncClient buildAsyncClient()

Builds an instance of RenderAsyncClient async client.

MapsRenderClient buildClient()

Builds an instance of RenderClient sync client.

MapsRenderClientBuilder clientOptions(ClientOptions clientOptions)

Sets The client options such as application ID and custom headers to set on a request.

MapsRenderClientBuilder configuration(Configuration configuration)

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

MapsRenderClientBuilder credential(AzureKeyCredential keyCredential)

Sets the AzureKeyCredential used to authenticate HTTP requests.

MapsRenderClientBuilder credential(AzureSasCredential sasCredential)

Sets the AzureSasCredential used to authenticate HTTP requests.

MapsRenderClientBuilder credential(TokenCredential tokenCredential)

Sets the TokenCredential used to authenticate HTTP requests.

MapsRenderClientBuilder endpoint(String endpoint)

Set endpoint of the service.

MapsRenderClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

MapsRenderClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The http log options.

MapsRenderClientBuilder mapsClientId(String mapsClientId)

Sets the Azure Maps client id for use with Azure AD Authentication.

MapsRenderClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

MapsRenderClientBuilder retryOptions(RetryOptions retryOptions)

Sets retry options

MapsRenderClientBuilder retryPolicy(RetryPolicy retryPolicy)

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

MapsRenderClientBuilder serviceVersion(MapsRenderServiceVersion version)

Render service version

Methods inherited from java.lang.Object

Constructor Details

MapsRenderClientBuilder

public MapsRenderClientBuilder()

Create an instance of the RenderClientBuilder.

Method Details

addPolicy

public MapsRenderClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

Adds a custom Http pipeline policy.

Parameters:

customPolicy - The custom Http pipeline policy to add.

Returns:

a reference to this RenderClientBuilder.

buildAsyncClient

public MapsRenderAsyncClient buildAsyncClient()

Builds an instance of RenderAsyncClient async client.

Returns:

an instance of RenderAsyncClient.

buildClient

public MapsRenderClient buildClient()

Builds an instance of RenderClient sync client.

Returns:

an instance of RenderClient.

clientOptions

public MapsRenderClientBuilder clientOptions(ClientOptions clientOptions)

Sets The client options such as application ID and custom headers to set on a request.

Parameters:

clientOptions - the clientOptions value.

Returns:

a reference to this RenderClientBuilder.

configuration

public MapsRenderClientBuilder configuration(Configuration configuration)

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

Parameters:

configuration - the configuration value.

Returns:

a reference to this RenderClientBuilder.

credential

public MapsRenderClientBuilder credential(AzureKeyCredential keyCredential)

Sets the AzureKeyCredential used to authenticate HTTP requests.

Parameters:

keyCredential - The AzureKeyCredential used to authenticate HTTP requests.

Returns:

The updated MapsRenderClientBuilder object.

credential

public MapsRenderClientBuilder credential(AzureSasCredential sasCredential)

Sets the AzureSasCredential used to authenticate HTTP requests.

Parameters:

sasCredential - The AzureSasCredential used to authenticate HTTP requests.

Returns:

The updated MapsRenderClientBuilder object.

credential

public MapsRenderClientBuilder credential(TokenCredential tokenCredential)

Sets the TokenCredential used to authenticate HTTP requests.

Parameters:

tokenCredential - TokenCredential used to authenticate HTTP requests.

Returns:

The updated MapsRenderClientBuilder object.

endpoint

public MapsRenderClientBuilder endpoint(String endpoint)

Set endpoint of the service.

Parameters:

endpoint - url of the service

Returns:

RenderClientBuilder

httpClient

public MapsRenderClientBuilder httpClient(HttpClient httpClient)

Sets The HTTP client used to send the request.

Parameters:

httpClient - the httpClient value.

Returns:

a reference to this RenderClientBuilder.

httpLogOptions

public MapsRenderClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

Sets The http log options.

Parameters:

httpLogOptions - the http log options.

Returns:

a reference to this RenderClientBuilder.

mapsClientId

public MapsRenderClientBuilder mapsClientId(String mapsClientId)

Sets the Azure Maps client id for use with Azure AD Authentication. This client id is the account-based GUID that appears on the Azure Maps Authentication page.

More details: Azure Maps AD Authentication

Parameters:

mapsClientId - the clientId value.

Returns:

the RenderhClientBuilder.

pipeline

public MapsRenderClientBuilder pipeline(HttpPipeline pipeline)

Sets The HTTP pipeline to send requests through.

Parameters:

pipeline - the pipeline value.

Returns:

a reference to this RenderClientBuilder.

retryOptions

public MapsRenderClientBuilder retryOptions(RetryOptions retryOptions)

Sets retry options

Parameters:

retryOptions - the retry options for the client

Returns:

a reference to this RenderClientBuilder

retryPolicy

public MapsRenderClientBuilder retryPolicy(RetryPolicy retryPolicy)

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

Parameters:

retryPolicy - the retryPolicy value.

Returns:

a reference to this RenderClientBuilder.

serviceVersion

public MapsRenderClientBuilder serviceVersion(MapsRenderServiceVersion version)

Render service version

Parameters:

version - the service version

Returns:

a reference to this RenderClientBuilder

Applies to