Class MapsSearchAsyncClient

java.lang.Object
com.azure.maps.search.MapsSearchAsyncClient

public final class MapsSearchAsyncClient extends Object
Initializes a new instance of the asynchronous SearchClient type. Creating an async client using a AzureKeyCredential:
 // Authenticates using subscription key
 AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));

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

 // Builds the client
 MapsSearchAsyncClient client = builder.buildAsyncClient();
 
Creating an async 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
 MapsSearchClientBuilder builder = new MapsSearchClientBuilder();
 builder.credential(tokenCredential);
 builder.mapsClientId(System.getenv("MAPS_CLIENT_ID"));
 builder.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS));

 // Builds a client
 MapsSearchAsyncClient client = builder.buildAsyncClient();
 
  • Method Details

    • getPolygons

      public Mono<List<MapsPolygon>> getPolygons(List<String> geometryIds)
      List Polygons
       Response<SearchAddressResult> fuzzySearchResponse = asyncClient.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5)).block();
       String fuzzySearchId = fuzzySearchResponse.getValue().getResults().get(0).getDataSource().getGeometry();
       List<String> getPolygonIds = results.getResults().stream()
           .filter(item -> item.getDataSource() != null && item.getDataSource().getGeometry() != null)
           .map(item -> item.getDataSource().getGeometry())
           .collect(Collectors.toList());
       getPolygonIds.add(fuzzySearchId);
      
       if (ids != null && !getPolygonIds.isEmpty()) {
           System.out.println("Get Polygon: " + ids);
       }
       
      Parameters:
      geometryIds - Comma separated list of geometry UUIDs, previously retrieved from an Online Search request.
      Returns:
      this object is returned from a successful Search Polygon call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getPolygonsWithResponse

      public Mono<com.azure.core.http.rest.Response<List<MapsPolygon>>> getPolygonsWithResponse(List<String> geometryIds)
      List Polygons
       Response<SearchAddressResult> fuzzySearchResponse = asyncClient.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5)).block();
       String fuzzySearchId = fuzzySearchResponse.getValue().getResults().get(0).getDataSource().getGeometry();
       List<String> getPolygonIds = results.getResults().stream()
           .filter(item -> item.getDataSource() != null && item.getDataSource().getGeometry() != null)
           .map(item -> item.getDataSource().getGeometry())
           .collect(Collectors.toList());
       getPolygonIds.add(fuzzySearchId);
      
       if (ids != null && !getPolygonIds.isEmpty()) {
           System.out.println("Get Polygon: " + ids);
       }
       
      Parameters:
      geometryIds - Comma separated list of geometry UUIDs, previously retrieved from an Online Search request.
      Returns:
      this object is returned from a successful Search Polygon call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • fuzzySearch

      public Mono<SearchAddressResult> fuzzySearch(FuzzySearchOptions options)
      Fuzzy Search
       System.out.println("Search Fuzzy:");
      
       // simple
       asyncClient.fuzzySearch(new FuzzySearchOptions("starbucks"));
      
       // with options
       SearchAddressResult fuzzySearchResults = asyncClient.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5)).block();
      
       // with response
       Response<SearchAddressResult> fuzzySearchResponse = asyncClient.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5)).block();
       
      Parameters:
      options - FuzzySearchOptions the options to be used in this search.
      Returns:
      this object is returned from a successful Fuzzy Search call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • fuzzySearch

      public Mono<SearchAddressResult> fuzzySearch(String query)
      Fuzzy Search
       System.out.println("Search Fuzzy:");
      
       // simple
       asyncClient.fuzzySearch(new FuzzySearchOptions("starbucks"));
      
       // with options
       SearchAddressResult fuzzySearchResults = asyncClient.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5)).block();
      
       // with response
       Response<SearchAddressResult> fuzzySearchResponse = asyncClient.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5)).block();
       
      Parameters:
      query - the query string used in the search.
      Returns:
      this object is returned from a successful Fuzzy Search call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • fuzzySearchWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> fuzzySearchWithResponse(FuzzySearchOptions options)
      Fuzzy Search
       System.out.println("Search Fuzzy:");
      
       // simple
       asyncClient.fuzzySearch(new FuzzySearchOptions("starbucks"));
      
       // with options
       SearchAddressResult fuzzySearchResults = asyncClient.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5)).block();
      
       // with response
       Response<SearchAddressResult> fuzzySearchResponse = asyncClient.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5)).block();
       
      Parameters:
      options - FuzzySearchOptions the options to be used in this search.
      Returns:
      this object is returned from a successful Fuzzy Search call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterest

      public Mono<SearchAddressResult> searchPointOfInterest(SearchPointOfInterestOptions options)
      Search Point of Interest
       System.out.println("Search Points of Interest:");
      
       // coordinates
       asyncClient.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844)));
      
       // options
       asyncClient.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS));
      
       // with response
       asyncClient.searchPointOfInterestWithResponse(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS)).block().getStatusCode();
       
      Parameters:
      options - SearchPointOfInterestOptions the options to be used in this search.
      Returns:
      this object is returned from a successful Search Point of Interest call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterest

      public Mono<SearchAddressResult> searchPointOfInterest(String query)
      Search Point of Interest
       System.out.println("Search Points of Interest:");
      
       // coordinates
       asyncClient.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844)));
      
       // options
       asyncClient.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS));
      
       // with response
       asyncClient.searchPointOfInterestWithResponse(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS)).block().getStatusCode();
       
      Parameters:
      query - The query to be used to search for points of interest.
      Returns:
      this object is returned from a successful Search Point of Interest call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchPointOfInterestWithResponse(SearchPointOfInterestOptions options)
      Search Point of Interest
       System.out.println("Search Points of Interest:");
      
       // coordinates
       asyncClient.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844)));
      
       // options
       asyncClient.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS));
      
       // with response
       asyncClient.searchPointOfInterestWithResponse(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS)).block().getStatusCode();
       
      Parameters:
      options - SearchPointOfInterestOptions the options to be used in this search.
      Returns:
      this object is returned from a successful Search Point of Interest call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchNearbyPointsOfInterest

      public Mono<SearchAddressResult> searchNearbyPointsOfInterest(SearchNearbyPointsOfInterestOptions options)
      Search Nearby Points of Interest
       System.out.println("Search Nearby:");
      
       // options
       asyncClient.searchNearbyPointsOfInterest(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10));
      
       // response
       asyncClient.searchNearbyPointsOfInterestWithResponse(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10)).block().getStatusCode();
       
      Parameters:
      options - SearchNearbyPointsOfInterestOptions the options to be used in this search.
      Returns:
      this object is returned from a successful Search Nearby Point of Interest call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchNearbyPointsOfInterest

      public Mono<SearchAddressResult> searchNearbyPointsOfInterest(com.azure.core.models.GeoPosition query)
      Search Nearby Points of Interest
       System.out.println("Search Nearby:");
      
       // options
       asyncClient.searchNearbyPointsOfInterest(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10));
      
       // response
       asyncClient.searchNearbyPointsOfInterestWithResponse(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10)).block().getStatusCode();
       
      Parameters:
      query - A pair of coordinates for query.
      Returns:
      this object is returned from a successful Search Nearby Point of Interest call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchNearbyPointsOfInterestWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchNearbyPointsOfInterestWithResponse(SearchNearbyPointsOfInterestOptions options)
      Search Nearby Points of Interest
       System.out.println("Search Nearby:");
      
       // options
       asyncClient.searchNearbyPointsOfInterest(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10));
      
       // response
       asyncClient.searchNearbyPointsOfInterestWithResponse(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10)).block().getStatusCode();
       
      Parameters:
      options - SearchNearbyPointsOfInterestOptions the options to be used in this search.
      Returns:
      this object is returned from a successful Search Nearby Point of Interest call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestCategory

      public Mono<SearchAddressResult> searchPointOfInterestCategory(SearchPointOfInterestCategoryOptions options)
      Search Point of Interest per Category
       System.out.println("Get Point of Interest Category:");
      
       // complete - search for italian restaurant in NYC
       asyncClient.searchPointOfInterestCategory(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3));
      
       // with response
       asyncClient.searchPointOfInterestCategoryWithResponse(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3)).block().getStatusCode();
       
      Parameters:
      options - a SearchPointOfInterestCategoryOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Point of Interest per Category calls.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestCategory

      public Mono<SearchAddressResult> searchPointOfInterestCategory(String query)
      Search Point of Interest per Category
       System.out.println("Get Point of Interest Category:");
      
       // complete - search for italian restaurant in NYC
       asyncClient.searchPointOfInterestCategory(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3));
      
       // with response
       asyncClient.searchPointOfInterestCategoryWithResponse(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3)).block().getStatusCode();
       
      Parameters:
      query - The query to be used to search for points of interest.
      Returns:
      this object is returned from a successful Search Point of Interest per Category calls.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestCategoryWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchPointOfInterestCategoryWithResponse(SearchPointOfInterestCategoryOptions options)
      Search Point of Interest per Category
       System.out.println("Get Point of Interest Category:");
      
       // complete - search for italian restaurant in NYC
       asyncClient.searchPointOfInterestCategory(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3));
      
       // with response
       asyncClient.searchPointOfInterestCategoryWithResponse(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3)).block().getStatusCode();
       
      Parameters:
      options - a SearchPointOfInterestCategoryOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Point of Interest per Category calls.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getPointOfInterestCategoryTree

      public Mono<PointOfInterestCategoryTreeResult> getPointOfInterestCategoryTree()
      Get Point of Interest Category Tree
       System.out.println("Get Search POI Category Tree:");
       client.getPointOfInterestCategoryTree();
       
      Returns:
      this object is returned from a successful POI Category Tree call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getPointOfInterestCategoryTreeWithResponse

      public Mono<com.azure.core.http.rest.Response<PointOfInterestCategoryTreeResult>> getPointOfInterestCategoryTreeWithResponse(String language)
      Get Point of Interest Category Tree
       System.out.println("Get Search POI Category Tree:");
       client.getPointOfInterestCategoryTree();
       
      Parameters:
      language - Language in which search results should be returned. Should be one of supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When data in specified language is not available for a specific field, default language is used (English).

      Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.

      Returns:
      this object is returned from a successful POI Category Tree call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAddress

      public Mono<SearchAddressResult> searchAddress(SearchAddressOptions options)
      Search Address
       System.out.println("Search Address:");
      
       // simple
       asyncClient.searchAddress(
           new SearchAddressOptions("15127 NE 24th Street, Redmond, WA 98052"));
      
       // options
       asyncClient.searchAddress(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5));
      
       // complete
       asyncClient.searchAddressWithResponse(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      options - a SearchAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAddress

      public Mono<SearchAddressResult> searchAddress(String query)
      Search Address
       System.out.println("Search Address:");
      
       // simple
       asyncClient.searchAddress(
           new SearchAddressOptions("15127 NE 24th Street, Redmond, WA 98052"));
      
       // options
       asyncClient.searchAddress(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5));
      
       // complete
       asyncClient.searchAddressWithResponse(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      query - the query string used in the fuzzy search.
      Returns:
      this object is returned from a successful Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAddressWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchAddressWithResponse(SearchAddressOptions options)
      Search Address
       System.out.println("Search Address:");
      
       // simple
       asyncClient.searchAddress(
           new SearchAddressOptions("15127 NE 24th Street, Redmond, WA 98052"));
      
       // options
       asyncClient.searchAddress(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5));
      
       // complete
       asyncClient.searchAddressWithResponse(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      options - a SearchAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchAddress

      public Mono<ReverseSearchAddressResult> reverseSearchAddress(ReverseSearchAddressOptions options)
      Reverse Address Search
       System.out.println("Search Address Reverse:");
      
       // simple
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION) // returns only city
       );
      
       // complete
       asyncClient.reverseSearchAddressWithResponse(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION)).block().getStatusCode();
       
      Parameters:
      options - a ReverseSearchAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchAddress

      public Mono<ReverseSearchAddressResult> reverseSearchAddress(com.azure.core.models.GeoPosition query)
      Reverse Address Search
       System.out.println("Search Address Reverse:");
      
       // simple
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION) // returns only city
       );
      
       // complete
       asyncClient.reverseSearchAddressWithResponse(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION)).block().getStatusCode();
       
      Parameters:
      query - The applicable query as a pair of coordinates.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchAddressWithResponse

      public Mono<com.azure.core.http.rest.Response<ReverseSearchAddressResult>> reverseSearchAddressWithResponse(ReverseSearchAddressOptions options)
      Reverse Address Search
       System.out.println("Search Address Reverse:");
      
       // simple
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       asyncClient.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION) // returns only city
       );
      
       // complete
       asyncClient.reverseSearchAddressWithResponse(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION)).block().getStatusCode();
       
      Parameters:
      options - a ReverseSearchAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchCrossStreetAddress

      public Mono<ReverseSearchCrossStreetAddressResult> reverseSearchCrossStreetAddress(ReverseSearchCrossStreetAddressOptions options)
      Reverse Address Search to a Cross Street
       System.out.println("Revere Search Cross Street Address:");
      
       // options
       asyncClient.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       asyncClient.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5));
      
       // complete
       asyncClient.reverseSearchCrossStreetAddressWithResponse(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5)).block().getStatusCode();
       
      Parameters:
      options - a ReverseSearchCrossStreetAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchCrossStreetAddress

      public Mono<ReverseSearchCrossStreetAddressResult> reverseSearchCrossStreetAddress(com.azure.core.models.GeoPosition query)
      Reverse Address Search to a Cross Street
       System.out.println("Revere Search Cross Street Address:");
      
       // options
       asyncClient.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       asyncClient.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5));
      
       // complete
       asyncClient.reverseSearchCrossStreetAddressWithResponse(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5)).block().getStatusCode();
       
      Parameters:
      query - with a pair of coordinates.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchCrossStreetAddressWithResponse

      public Mono<com.azure.core.http.rest.Response<ReverseSearchCrossStreetAddressResult>> reverseSearchCrossStreetAddressWithResponse(ReverseSearchCrossStreetAddressOptions options)
      Reverse Address Search to a Cross Street
       System.out.println("Revere Search Cross Street Address:");
      
       // options
       asyncClient.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       asyncClient.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5));
      
       // complete
       asyncClient.reverseSearchCrossStreetAddressWithResponse(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5)).block().getStatusCode();
       
      Parameters:
      options - a ReverseSearchCrossStreetAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchStructuredAddress

      public Mono<SearchAddressResult> searchStructuredAddress(StructuredAddress address, SearchStructuredAddressOptions options)
      Structured Address Search
       System.out.println("Search Address Structured:");
      
       // simple
       asyncClient.searchStructuredAddress(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"), null);
      
       // complete
       asyncClient.searchStructuredAddressWithResponse(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"),
           new SearchStructuredAddressOptions()
                   .setTop(2)
                   .setRadiusInMeters(1000)).block().getStatusCode();
       
      Parameters:
      address - a StructuredAddress to be searched by the API.
      options - a SearchStructuredAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchStructuredAddress

      public Mono<SearchAddressResult> searchStructuredAddress(String countryCode)
      Structured Address Search
       System.out.println("Search Address Structured:");
      
       // simple
       asyncClient.searchStructuredAddress(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"), null);
      
       // complete
       asyncClient.searchStructuredAddressWithResponse(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"),
           new SearchStructuredAddressOptions()
                   .setTop(2)
                   .setRadiusInMeters(1000)).block().getStatusCode();
       
      Parameters:
      countryCode - the country code for query.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchStructuredAddressWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchStructuredAddressWithResponse(StructuredAddress address, SearchStructuredAddressOptions options)
      Structured Address Search
       System.out.println("Search Address Structured:");
      
       // simple
       asyncClient.searchStructuredAddress(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"), null);
      
       // complete
       asyncClient.searchStructuredAddressWithResponse(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"),
           new SearchStructuredAddressOptions()
                   .setTop(2)
                   .setRadiusInMeters(1000)).block().getStatusCode();
       
      Parameters:
      address - a StructuredAddress to be searched by the API.
      options - a SearchStructuredAddressOptions representing the search parameters.
      Returns:
      this object is returned from a successful Reverse Search Address call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchInsideGeometry

      public Mono<SearchAddressResult> searchInsideGeometry(SearchInsideGeometryOptions options)
      Search Inside Geometry
       System.out.println("Search Inside Geometry");
      
       // create GeoPolygon
       List<GeoPosition> searchInsideGeometryCoordinates = new ArrayList<>();
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43301391601562, 37.70660472542312));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.36434936523438, 37.712059855877314));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       GeoLinearRing searchInsideGeometryRing = new GeoLinearRing(searchInsideGeometryCoordinates);
       GeoPolygon searchInsideGeometryPolygon = new GeoPolygon(searchInsideGeometryRing);
      
       // simple
       asyncClient.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon));
      
       // options
       asyncClient.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon)
               .setTop(5));
      
       // complete
       asyncClient.searchInsideGeometryWithResponse(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon)
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      options - a SearchInsideGeometryOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Inside Geometry call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchInsideGeometry

      public Mono<SearchAddressResult> searchInsideGeometry(String query)
      Search Inside Geometry
       System.out.println("Search Inside Geometry");
      
       // create GeoPolygon
       List<GeoPosition> searchInsideGeometryCoordinates = new ArrayList<>();
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43301391601562, 37.70660472542312));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.36434936523438, 37.712059855877314));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       GeoLinearRing searchInsideGeometryRing = new GeoLinearRing(searchInsideGeometryCoordinates);
       GeoPolygon searchInsideGeometryPolygon = new GeoPolygon(searchInsideGeometryRing);
      
       // simple
       asyncClient.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon));
      
       // options
       asyncClient.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon)
               .setTop(5));
      
       // complete
       asyncClient.searchInsideGeometryWithResponse(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon)
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      query - query string
      Returns:
      this object is returned from a successful Search Inside Geometry call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchInsideGeometryWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchInsideGeometryWithResponse(SearchInsideGeometryOptions options)
      Search Inside Geometry
       System.out.println("Search Inside Geometry");
      
       // create GeoPolygon
       List<GeoPosition> searchInsideGeometryCoordinates = new ArrayList<>();
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43301391601562, 37.70660472542312));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.36434936523438, 37.712059855877314));
       searchInsideGeometryCoordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       GeoLinearRing searchInsideGeometryRing = new GeoLinearRing(searchInsideGeometryCoordinates);
       GeoPolygon searchInsideGeometryPolygon = new GeoPolygon(searchInsideGeometryRing);
      
       // simple
       asyncClient.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon));
      
       // options
       asyncClient.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon)
               .setTop(5));
      
       // complete
       asyncClient.searchInsideGeometryWithResponse(
           new SearchInsideGeometryOptions("Leland Avenue", searchInsideGeometryPolygon)
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      options - a SearchInsideGeometryOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Inside Geometry call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAlongRoute

      public Mono<SearchAddressResult> searchAlongRoute(SearchAlongRouteOptions options)
      Search Along Route
       System.out.println("Search Along Route");
      
       // create route points
       List<GeoPosition> getPolygonPoints = new ArrayList<>();
       points.add(new GeoPosition(-122.143035, 47.653536));
       points.add(new GeoPosition(-122.187164, 47.617556));
       points.add(new GeoPosition(-122.114981, 47.570599));
       points.add(new GeoPosition(-122.132756, 47.654009));
       GeoLineString getPolygonRoute = new GeoLineString(getPolygonPoints);
      
       // simple
       asyncClient.searchAlongRoute(new SearchAlongRouteOptions("burger", 1000, getPolygonRoute));
      
       // options
       asyncClient.searchAlongRoute(
           new SearchAlongRouteOptions("burger", 1000, getPolygonRoute)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5));
      
       // complete
       asyncClient.searchAlongRouteWithResponse(
           new SearchAlongRouteOptions("burger", 1000, getPolygonRoute)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      options - a SearchAlongRouteOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Along Route call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAlongRoute

      public Mono<SearchAddressResult> searchAlongRoute(String query, int maxDetourTime)
      Search Along Route
       System.out.println("Search Along Route");
      
       // create route points
       List<GeoPosition> getPolygonPoints = new ArrayList<>();
       points.add(new GeoPosition(-122.143035, 47.653536));
       points.add(new GeoPosition(-122.187164, 47.617556));
       points.add(new GeoPosition(-122.114981, 47.570599));
       points.add(new GeoPosition(-122.132756, 47.654009));
       GeoLineString getPolygonRoute = new GeoLineString(getPolygonPoints);
      
       // simple
       asyncClient.searchAlongRoute(new SearchAlongRouteOptions("burger", 1000, getPolygonRoute));
      
       // options
       asyncClient.searchAlongRoute(
           new SearchAlongRouteOptions("burger", 1000, getPolygonRoute)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5));
      
       // complete
       asyncClient.searchAlongRouteWithResponse(
           new SearchAlongRouteOptions("burger", 1000, getPolygonRoute)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      query - the search query
      maxDetourTime - the maximum detour time allowed
      Returns:
      this object is returned from a successful Search Along Route call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAlongRouteWithResponse

      public Mono<com.azure.core.http.rest.Response<SearchAddressResult>> searchAlongRouteWithResponse(SearchAlongRouteOptions options)
      Search Along Route
       System.out.println("Search Along Route");
      
       // create route points
       List<GeoPosition> getPolygonPoints = new ArrayList<>();
       points.add(new GeoPosition(-122.143035, 47.653536));
       points.add(new GeoPosition(-122.187164, 47.617556));
       points.add(new GeoPosition(-122.114981, 47.570599));
       points.add(new GeoPosition(-122.132756, 47.654009));
       GeoLineString getPolygonRoute = new GeoLineString(getPolygonPoints);
      
       // simple
       asyncClient.searchAlongRoute(new SearchAlongRouteOptions("burger", 1000, getPolygonRoute));
      
       // options
       asyncClient.searchAlongRoute(
           new SearchAlongRouteOptions("burger", 1000, getPolygonRoute)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5));
      
       // complete
       asyncClient.searchAlongRouteWithResponse(
           new SearchAlongRouteOptions("burger", 1000, getPolygonRoute)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5)).block().getStatusCode();
       
      Parameters:
      options - a SearchAlongRouteOptions representing the search parameters.
      Returns:
      this object is returned from a successful Search Along Route call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginFuzzySearchBatch

      public com.azure.core.util.polling.PollerFlux<BatchSearchResult,BatchSearchResult> beginFuzzySearchBatch(List<FuzzySearchOptions> optionsList)
      Batch Fuzzy Search
       List<FuzzySearchOptions> fuzzySearchBatchOptionsList = new ArrayList<>();
       fuzzySearchBatchOptionsList.add(new FuzzySearchOptions("atm", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000).setTop(5));
       fuzzySearchBatchOptionsList.add(new FuzzySearchOptions("Statue of Liberty").setTop(2));
       fuzzySearchBatchOptionsList.add(new FuzzySearchOptions("Starbucks", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000));
      
       System.out.println("Post Search Fuzzy Batch Async");
       asyncClient.beginFuzzySearchBatch(fuzzyOptionsList).getSyncPoller().getFinalResult();
       
      Parameters:
      optionsList - a list of FuzzySearchOptions to be searched.
      Returns:
      this object is returned from a successful Batch Fuzzy Search service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginGetFuzzySearchBatch

      public com.azure.core.util.polling.PollerFlux<BatchSearchResult,BatchSearchResult> beginGetFuzzySearchBatch(String batchId)
      Get Fuzzy Batch Search by Id
       List<FuzzySearchOptions> fuzzySearchBatchOptionsList = new ArrayList<>();
       fuzzySearchBatchOptionsList.add(new FuzzySearchOptions("atm", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000).setTop(5));
       fuzzySearchBatchOptionsList.add(new FuzzySearchOptions("Statue of Liberty").setTop(2));
       fuzzySearchBatchOptionsList.add(new FuzzySearchOptions("Starbucks", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000));
      
       System.out.println("Post Search Fuzzy Batch Async");
       asyncClient.beginFuzzySearchBatch(fuzzyOptionsList).getSyncPoller().getFinalResult();
       
      Parameters:
      batchId - Batch id for querying the operation.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginSearchAddressBatch

      public com.azure.core.util.polling.PollerFlux<BatchSearchResult,BatchSearchResult> beginSearchAddressBatch(List<SearchAddressOptions> optionsList)
      Batch Address Search
       List<SearchAddressOptions> list = new ArrayList<>();
       list.add(new SearchAddressOptions("400 Broad St, Seattle, WA 98109").setTop(3));
       list.add(new SearchAddressOptions("One, Microsoft Way, Redmond, WA 98052").setTop(3));
       list.add(new SearchAddressOptions("350 5th Ave, New York, NY 10118").setTop(3));
       list.add(new SearchAddressOptions("1 Main Street")
           .setCountryFilter(Arrays.asList("GB", "US", "AU")).setTop(3));
      
       // Search address batch async -
       // https://docs.microsoft.com/en-us/rest/api/maps/search/post-search-address-batch
       // This call posts addresses for search using the Asynchronous Batch API.
       // SyncPoller will do the polling automatically and you can retrieve the result
       // with getFinalResult()
       System.out.println("Search Address Batch Async");
       asyncClient.beginSearchAddressBatch(list).blockFirst().getFinalResult();
       SyncPoller<BatchSearchResult, BatchSearchResult> bp2 = asyncClient.beginSearchAddressBatch(list).getSyncPoller();
       BatchSearchResult batchResult2 = bp2.getFinalResult();
       
      Parameters:
      optionsList - a list of FuzzySearchOptions to be searched.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginGetSearchAddressBatch

      public com.azure.core.util.polling.PollerFlux<BatchSearchResult,BatchSearchResult> beginGetSearchAddressBatch(String batchId)
      Get Batch Search Id
       List<SearchAddressOptions> list = new ArrayList<>();
       list.add(new SearchAddressOptions("400 Broad St, Seattle, WA 98109").setTop(3));
       list.add(new SearchAddressOptions("One, Microsoft Way, Redmond, WA 98052").setTop(3));
       list.add(new SearchAddressOptions("350 5th Ave, New York, NY 10118").setTop(3));
       list.add(new SearchAddressOptions("1 Main Street")
           .setCountryFilter(Arrays.asList("GB", "US", "AU")).setTop(3));
      
       // Search address batch async -
       // https://docs.microsoft.com/en-us/rest/api/maps/search/post-search-address-batch
       // This call posts addresses for search using the Asynchronous Batch API.
       // SyncPoller will do the polling automatically and you can retrieve the result
       // with getFinalResult()
       System.out.println("Search Address Batch Async");
       asyncClient.beginSearchAddressBatch(list).blockFirst().getFinalResult();
       SyncPoller<BatchSearchResult, BatchSearchResult> bp2 = asyncClient.beginSearchAddressBatch(list).getSyncPoller();
       BatchSearchResult batchResult2 = bp2.getFinalResult();
       
      Parameters:
      batchId - Batch id for querying the operation.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginReverseSearchAddressBatch

      public com.azure.core.util.polling.PollerFlux<BatchReverseSearchResult,BatchReverseSearchResult> beginReverseSearchAddressBatch(List<ReverseSearchAddressOptions> optionsList)
      Searches a batch of addresses given their coordinates.
       List<ReverseSearchAddressOptions> list2 = new ArrayList<>();
       list2.add(new ReverseSearchAddressOptions(new GeoPosition(2.294911, 48.858561)));
       list2.add(
           new ReverseSearchAddressOptions(new GeoPosition(-122.127896, 47.639765))
               .setRadiusInMeters(5000)
       );
       list2.add(new ReverseSearchAddressOptions(new GeoPosition(-122.348170, 47.621028)));
      
       System.out.println("Reverse Search Address Batch Async");
       BatchReverseSearchResult batchReverseSearchResult =
           asyncClient.beginReverseSearchAddressBatch(list2).getSyncPoller().getFinalResult();
       
      Parameters:
      optionsList - a list of ReverseSearchAddressOptions to be searched.
      Returns:
      a SyncPoller wrapping the service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • beginGetReverseSearchAddressBatch

      public com.azure.core.util.polling.PollerFlux<BatchReverseSearchResult,BatchReverseSearchResult> beginGetReverseSearchAddressBatch(String batchId)
      Returns a batch of previously searched addressed given a batch id.
       List<ReverseSearchAddressOptions> list2 = new ArrayList<>();
       list2.add(new ReverseSearchAddressOptions(new GeoPosition(2.294911, 48.858561)));
       list2.add(
           new ReverseSearchAddressOptions(new GeoPosition(-122.127896, 47.639765))
               .setRadiusInMeters(5000)
       );
       list2.add(new ReverseSearchAddressOptions(new GeoPosition(-122.348170, 47.621028)));
      
       System.out.println("Reverse Search Address Batch Async");
       BatchReverseSearchResult batchReverseSearchResult =
           asyncClient.beginReverseSearchAddressBatch(list2).getSyncPoller().getFinalResult();
       
      Parameters:
      batchId - Batch id for querying the operation.
      Returns:
      a SyncPoller wrapping the service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.