Class GeoLocationClientBuilder

java.lang.Object
com.azure.maps.geolocation.GeoLocationClientBuilder
All Implemented Interfaces:
com.azure.core.client.traits.AzureKeyCredentialTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.ConfigurationTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.EndpointTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.TokenCredentialTrait<GeoLocationClientBuilder>

public final class GeoLocationClientBuilder extends Object implements com.azure.core.client.traits.AzureKeyCredentialTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.TokenCredentialTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.ConfigurationTrait<GeoLocationClientBuilder>, com.azure.core.client.traits.EndpointTrait<GeoLocationClientBuilder>
Builder class used to instantiate both synchronous and asynchronous GeoLocationClient clients.

Example usage

Creating a sync client using a AzureKeyCredential:
 // Authenticates using subscription key
 AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));

 // Creates a client
 GeoLocationClient client = new GeoLocationClientBuilder()
     .credential(keyCredential)
     .buildClient();
 
  • Constructor Details

    • GeoLocationClientBuilder

      public GeoLocationClientBuilder()
      Default constructor for the builder class.
  • Method Details

    • clientId

      public GeoLocationClientBuilder clientId(String clientId)
      Sets Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
      Parameters:
      clientId - the clientId value.
      Returns:
      the GeoLocationClientBuilder.
    • endpoint

      public GeoLocationClientBuilder endpoint(String endpoint)
      Set endpoint of the service.
      Specified by:
      endpoint in interface com.azure.core.client.traits.EndpointTrait<GeoLocationClientBuilder>
      Parameters:
      endpoint - url of the service
      Returns:
      GeoLocationClientBuilder
    • serviceVersion

      public GeoLocationClientBuilder serviceVersion(GeoLocationServiceVersion version)
      Sets the GeoLocationServiceVersion 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 - GeoLocationServiceVersion of the service to be used when making requests.
      Returns:
      the updated GeoLocationClientBuilder object
    • pipeline

      public GeoLocationClientBuilder pipeline(com.azure.core.http.HttpPipeline pipeline)
      Sets The HTTP pipeline to send requests through.
      Specified by:
      pipeline in interface com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>
      Parameters:
      pipeline - the pipeline value.
      Returns:
      the GeoLocationClientBuilder.
    • httpClient

      public GeoLocationClientBuilder httpClient(com.azure.core.http.HttpClient httpClient)
      Sets The HTTP client used to send the request.
      Specified by:
      httpClient in interface com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>
      Parameters:
      httpClient - the httpClient value.
      Returns:
      the GeoLocationClientBuilder.
    • configuration

      public GeoLocationClientBuilder configuration(com.azure.core.util.Configuration configuration)
      Sets The configuration store that is used during construction of the service client.
      Specified by:
      configuration in interface com.azure.core.client.traits.ConfigurationTrait<GeoLocationClientBuilder>
      Parameters:
      configuration - the configuration value.
      Returns:
      the GeoLocationClientBuilder.
    • httpLogOptions

      public GeoLocationClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions)
      Sets The logging configuration for HTTP requests and responses.
      Specified by:
      httpLogOptions in interface com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>
      Parameters:
      httpLogOptions - the httpLogOptions value.
      Returns:
      the GeoLocationClientBuilder.
    • retryPolicy

      public GeoLocationClientBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
      Sets The retry policy that will attempt to retry failed requests, if applicable.
      Parameters:
      retryPolicy - the retryPolicy value.
      Returns:
      the GeoLocationClientBuilder.
    • clientOptions

      public GeoLocationClientBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions)
      Sets The client options such as application ID and custom headers to set on a request.
      Specified by:
      clientOptions in interface com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>
      Parameters:
      clientOptions - the clientOptions value.
      Returns:
      the GeoLocationClientBuilder.
    • addPolicy

      public GeoLocationClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy customPolicy)
      Adds a custom Http pipeline policy.
      Specified by:
      addPolicy in interface com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>
      Parameters:
      customPolicy - The custom Http pipeline policy to add.
      Returns:
      the GeoLocationClientBuilder.
    • credential

      public GeoLocationClientBuilder credential(com.azure.core.credential.TokenCredential tokenCredential)
      Sets the TokenCredential used to authenticate HTTP requests.
      Specified by:
      credential in interface com.azure.core.client.traits.TokenCredentialTrait<GeoLocationClientBuilder>
      Parameters:
      tokenCredential - TokenCredential used to authenticate HTTP requests.
      Returns:
      The updated GeoLocationClientBuilder object.
      Throws:
      NullPointerException - If tokenCredential is null.
    • credential

      public GeoLocationClientBuilder credential(com.azure.core.credential.AzureKeyCredential keyCredential)
      Sets the AzureKeyCredential used to authenticate HTTP requests.
      Specified by:
      credential in interface com.azure.core.client.traits.AzureKeyCredentialTrait<GeoLocationClientBuilder>
      Parameters:
      keyCredential - The AzureKeyCredential used to authenticate HTTP requests.
      Returns:
      The updated GeoLocationClientBuilder object.
      Throws:
      NullPointerException - If keyCredential is null.
    • retryOptions

      public GeoLocationClientBuilder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions)
      Sets retry options
      Specified by:
      retryOptions in interface com.azure.core.client.traits.HttpTrait<GeoLocationClientBuilder>
      Parameters:
      retryOptions - the retry options for the client
      Returns:
      a reference to this GeoLocationClientBuilder
    • buildAsyncClient

      public GeoLocationAsyncClient buildAsyncClient()
      Builds an instance of GeoLocationAsyncClient async client.
      Returns:
      an instance of GeoLocationAsyncClient.
    • buildClient

      public GeoLocationClient buildClient()
      Builds an instance of GeoLocationClient sync client.
      Returns:
      an instance of GeoLocationClient.