Package com.azure.maps.render
Class MapsRenderClientBuilder
java.lang.Object
com.azure.maps.render.MapsRenderClientBuilder
- All Implemented Interfaces:
com.azure.core.client.traits.AzureKeyCredentialTrait<MapsRenderClientBuilder>
,com.azure.core.client.traits.ConfigurationTrait<MapsRenderClientBuilder>
,com.azure.core.client.traits.EndpointTrait<MapsRenderClientBuilder>
,com.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
,com.azure.core.client.traits.TokenCredentialTrait<MapsRenderClientBuilder>
public final class MapsRenderClientBuilder
extends Object
implements com.azure.core.client.traits.AzureKeyCredentialTrait<MapsRenderClientBuilder>, com.azure.core.client.traits.TokenCredentialTrait<MapsRenderClientBuilder>, com.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>, com.azure.core.client.traits.ConfigurationTrait<MapsRenderClientBuilder>, com.azure.core.client.traits.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
-
Method Summary
Modifier and TypeMethodDescriptionaddPolicy
(com.azure.core.http.policy.HttpPipelinePolicy customPolicy) Adds a custom Http pipeline policy.Builds an instance of RenderAsyncClient async client.Builds an instance of RenderClient sync client.clientOptions
(com.azure.core.util.ClientOptions clientOptions) Sets The client options such as application ID and custom headers to set on a request.configuration
(com.azure.core.util.Configuration configuration) Sets The configuration store that is used during construction of the service client.credential
(com.azure.core.credential.AzureKeyCredential keyCredential) Sets theAzureKeyCredential
used to authenticate HTTP requests.credential
(com.azure.core.credential.TokenCredential tokenCredential) Sets theTokenCredential
used to authenticate HTTP requests.Set endpoint of the service.httpClient
(com.azure.core.http.HttpClient httpClient) Sets The HTTP client used to send the request.httpLogOptions
(com.azure.core.http.policy.HttpLogOptions httpLogOptions) Sets The http log options.mapsClientId
(String mapsClientId) Sets the Azure Maps client id for use with Azure AD Authentication.pipeline
(com.azure.core.http.HttpPipeline pipeline) Sets The HTTP pipeline to send requests through.retryOptions
(com.azure.core.http.policy.RetryOptions retryOptions) Sets retry optionsretryPolicy
(com.azure.core.http.policy.RetryPolicy retryPolicy) Sets The retry policy that will attempt to retry failed requests, if applicable.serviceVersion
(MapsRenderServiceVersion version) Render service version
-
Constructor Details
-
MapsRenderClientBuilder
public MapsRenderClientBuilder()Create an instance of the RenderClientBuilder.
-
-
Method Details
-
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.
-
endpoint
Set endpoint of the service.- Specified by:
endpoint
in interfacecom.azure.core.client.traits.EndpointTrait<MapsRenderClientBuilder>
- Parameters:
endpoint
- url of the service- Returns:
- RenderClientBuilder
-
serviceVersion
Render service version- Parameters:
version
- the service version- Returns:
- a reference to this
RenderClientBuilder
-
pipeline
Sets The HTTP pipeline to send requests through.- Specified by:
pipeline
in interfacecom.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
- Parameters:
pipeline
- the pipeline value.- Returns:
- a reference to this
RenderClientBuilder
.
-
httpClient
Sets The HTTP client used to send the request.- Specified by:
httpClient
in interfacecom.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
- Parameters:
httpClient
- the httpClient value.- Returns:
- a reference to this
RenderClientBuilder
.
-
configuration
Sets The configuration store that is used during construction of the service client.- Specified by:
configuration
in interfacecom.azure.core.client.traits.ConfigurationTrait<MapsRenderClientBuilder>
- Parameters:
configuration
- the configuration value.- Returns:
- a reference to this
RenderClientBuilder
.
-
httpLogOptions
public MapsRenderClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) Sets The http log options.- Specified by:
httpLogOptions
in interfacecom.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
- Parameters:
httpLogOptions
- the http log options.- Returns:
- a reference to this
RenderClientBuilder
.
-
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
.
-
clientOptions
Sets The client options such as application ID and custom headers to set on a request.- Specified by:
clientOptions
in interfacecom.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
- Parameters:
clientOptions
- the clientOptions value.- Returns:
- a reference to this
RenderClientBuilder
.
-
addPolicy
public MapsRenderClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy) Adds a custom Http pipeline policy.- Specified by:
addPolicy
in interfacecom.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
- Parameters:
customPolicy
- The custom Http pipeline policy to add.- Returns:
- a reference to this
RenderClientBuilder
.
-
credential
public MapsRenderClientBuilder credential(com.azure.core.credential.TokenCredential tokenCredential) Sets theTokenCredential
used to authenticate HTTP requests.- Specified by:
credential
in interfacecom.azure.core.client.traits.TokenCredentialTrait<MapsRenderClientBuilder>
- Parameters:
tokenCredential
-TokenCredential
used to authenticate HTTP requests.- Returns:
- The updated
MapsRenderClientBuilder
object. - Throws:
NullPointerException
- IftokenCredential
is null.
-
credential
public MapsRenderClientBuilder credential(com.azure.core.credential.AzureKeyCredential keyCredential) Sets theAzureKeyCredential
used to authenticate HTTP requests.- Specified by:
credential
in interfacecom.azure.core.client.traits.AzureKeyCredentialTrait<MapsRenderClientBuilder>
- Parameters:
keyCredential
- TheAzureKeyCredential
used to authenticate HTTP requests.- Returns:
- The updated
MapsRenderClientBuilder
object. - Throws:
NullPointerException
- IfkeyCredential
is null.
-
buildAsyncClient
Builds an instance of RenderAsyncClient async client.- Returns:
- an instance of RenderAsyncClient.
-
buildClient
Builds an instance of RenderClient sync client.- Returns:
- an instance of RenderClient.
-
retryOptions
Sets retry options- Specified by:
retryOptions
in interfacecom.azure.core.client.traits.HttpTrait<MapsRenderClientBuilder>
- Parameters:
retryOptions
- the retry options for the client- Returns:
- a reference to this
RenderClientBuilder
-