Class MapsSearchClient

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

public final class MapsSearchClient extends Object
MapsSearchClient instances are created via the MapsSearchClientBuilder, as shown below. Creating a sync 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
 MapsSearchClient client = builder.buildClient();
 
  • Method Details

    • getPolygons

      public List<MapsPolygon> getPolygons(List<String> geometryIds)
      List Polygons
       SearchAddressResult results = client.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5));
       Response<SearchAddressResult> response = client.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5), null);
       String id = response.getValue().getResults().get(0).getDataSource().getGeometry();
       List<String> ids = results.getResults().stream()
           .filter(item -> item.getDataSource() != null && item.getDataSource().getGeometry() != null)
           .map(item -> item.getDataSource().getGeometry())
           .collect(Collectors.toList());
       ids.add(id);
      
       if (ids != null && !ids.isEmpty()) {
           System.out.println("Get Polygon: " + ids);
           client.getPolygons(ids);
           client.getPolygonsWithResponse(ids, null).getValue().getClass();
       }
       
      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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getPolygonsWithResponse

      public com.azure.core.http.rest.Response<List<MapsPolygon>> getPolygonsWithResponse(List<String> geometryIds, com.azure.core.util.Context context)
      List Polygons
       SearchAddressResult results = client.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5));
       Response<SearchAddressResult> response = client.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5), null);
       String id = response.getValue().getResults().get(0).getDataSource().getGeometry();
       List<String> ids = results.getResults().stream()
           .filter(item -> item.getDataSource() != null && item.getDataSource().getGeometry() != null)
           .map(item -> item.getDataSource().getGeometry())
           .collect(Collectors.toList());
       ids.add(id);
      
       if (ids != null && !ids.isEmpty()) {
           System.out.println("Get Polygon: " + ids);
           client.getPolygons(ids);
           client.getPolygonsWithResponse(ids, null).getValue().getClass();
       }
       
      Parameters:
      geometryIds - Comma separated list of geometry UUIDs, previously retrieved from an Online Search request.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Polygon call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • fuzzySearch

      public SearchAddressResult fuzzySearch(FuzzySearchOptions options)
      Fuzzy Search
       System.out.println("Search Fuzzy:");
      
       // simple
       client.fuzzySearch(new FuzzySearchOptions("starbucks"));
      
       // with options
       SearchAddressResult results = client.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5));
      
       // with response
       Response<SearchAddressResult> response = client.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5), null);
       
      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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • fuzzySearch

      public SearchAddressResult fuzzySearch(String query)
      Fuzzy Search
       System.out.println("Search Fuzzy:");
      
       // simple
       client.fuzzySearch(new FuzzySearchOptions("starbucks"));
      
       // with options
       SearchAddressResult results = client.fuzzySearch(
           new FuzzySearchOptions("1 Microsoft Way", new GeoPosition(-74.011454, 40.706270))
               .setTop(5));
      
       // with response
       Response<SearchAddressResult> response = client.fuzzySearchWithResponse(
           new FuzzySearchOptions("Monaco").setEntityType(GeographicEntityType.COUNTRY)
               .setTop(5), null);
       
      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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • fuzzySearchWithResponse

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

      public SearchAddressResult searchPointOfInterest(SearchPointOfInterestOptions options)
      Search Point of Interest
       System.out.println("Search Points of Interest:");
      
       // coordinates
       client.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844)));
      
       // options
       client.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS));
      
       // with response
       client.searchPointOfInterestWithResponse(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterest

      public SearchAddressResult searchPointOfInterest(String query)
      Search Point of Interest
       System.out.println("Search Points of Interest:");
      
       // coordinates
       client.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844)));
      
       // options
       client.searchPointOfInterest(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS));
      
       // with response
       client.searchPointOfInterestWithResponse(
           new SearchPointOfInterestOptions("pizza", new GeoPosition(-121.97483, 36.98844))
               .setTop(10)
               .setOperatingHours(OperatingHoursRange.NEXT_SEVEN_DAYS),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestWithResponse

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

      public SearchAddressResult searchNearbyPointsOfInterest(SearchNearbyPointsOfInterestOptions options)
      Search Nearby Points of Interest
       System.out.println("Search Nearby:");
      
       // options
       client.searchNearbyPointsOfInterest(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10));
      
       // response
       client.searchNearbyPointsOfInterestWithResponse(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchNearbyPointsOfInterest

      public SearchAddressResult searchNearbyPointsOfInterest(com.azure.core.models.GeoPosition query)
      Search Nearby Points of Interest
       System.out.println("Search Nearby:");
      
       // options
       client.searchNearbyPointsOfInterest(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10));
      
       // response
       client.searchNearbyPointsOfInterestWithResponse(
           new SearchNearbyPointsOfInterestOptions(new GeoPosition(-74.011454, 40.706270))
               .setCountryFilter(Arrays.asList("US"))
               .setTop(10),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchNearbyPointsOfInterestWithResponse

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

      public 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
       client.searchPointOfInterestCategory(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3));
      
       // with response
       client.searchPointOfInterestCategoryWithResponse(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestCategory

      public 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
       client.searchPointOfInterestCategory(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3));
      
       // with response
       client.searchPointOfInterestCategoryWithResponse(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchPointOfInterestCategoryWithResponse

      public com.azure.core.http.rest.Response<SearchAddressResult> searchPointOfInterestCategoryWithResponse(SearchPointOfInterestCategoryOptions options, com.azure.core.util.Context context)
      Search Point of Interest per Category
       System.out.println("Get Point of Interest Category:");
      
       // complete - search for italian restaurant in NYC
       client.searchPointOfInterestCategory(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3));
      
       // with response
       client.searchPointOfInterestCategoryWithResponse(
           new SearchPointOfInterestCategoryOptions("pasta", new GeoPosition(-74.011454, 40.706270))
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(3),
           null).getStatusCode();
       
      Parameters:
      options - a SearchPointOfInterestCategoryOptions representing the search parameters.
      context - The context to associate with this operation.
      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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getPointOfInterestCategoryTree

      public 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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getPointOfInterestCategoryTreeWithResponse

      public com.azure.core.http.rest.Response<PointOfInterestCategoryTreeResult> getPointOfInterestCategoryTreeWithResponse(String language, com.azure.core.util.Context context)
      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.

      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful POI Category Tree call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAddress

      public SearchAddressResult searchAddress(SearchAddressOptions options)
      Search Address
       System.out.println("Search Address:");
      
       // simple
       client.searchAddress(
           new SearchAddressOptions("15127 NE 24th Street, Redmond, WA 98052"));
      
       // options
       client.searchAddress(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5));
      
       // complete
       client.searchAddressWithResponse(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5), null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAddress

      public SearchAddressResult searchAddress(String query)
      Search Address
       System.out.println("Search Address:");
      
       // simple
       client.searchAddress(
           new SearchAddressOptions("15127 NE 24th Street, Redmond, WA 98052"));
      
       // options
       client.searchAddress(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5));
      
       // complete
       client.searchAddressWithResponse(
           new SearchAddressOptions("1 Main Street")
               .setCoordinates(new GeoPosition(-74.011454, 40.706270))
               .setRadiusInMeters(40000)
               .setTop(5), null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAddressWithResponse

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

      public ReverseSearchAddressResult reverseSearchAddress(ReverseSearchAddressOptions options)
      Reverse Address Search
       System.out.println("Search Address Reverse:");
      
       // simple
       client.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       client.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       client.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION) // returns only city
       );
      
       // complete
       client.reverseSearchAddressWithResponse(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION),
               null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchAddress

      public ReverseSearchAddressResult reverseSearchAddress(com.azure.core.models.GeoPosition query)
      Reverse Address Search
       System.out.println("Search Address Reverse:");
      
       // simple
       client.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       client.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       client.reverseSearchAddress(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION) // returns only city
       );
      
       // complete
       client.reverseSearchAddressWithResponse(
           new ReverseSearchAddressOptions(new GeoPosition(-121.89, 37.337))
               .setIncludeSpeedLimit(true)
               .setEntityType(GeographicEntityType.COUNTRY_SECONDARY_SUBDIVISION),
               null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchAddressWithResponse

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

      public ReverseSearchCrossStreetAddressResult reverseSearchCrossStreetAddress(ReverseSearchCrossStreetAddressOptions options)
      Reverse Address Search to a Cross Street
       System.out.println("Revere Search Cross Street Address:");
      
       // options
       client.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       client.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5));
      
       // complete
       client.reverseSearchCrossStreetAddressWithResponse(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchCrossStreetAddress

      public ReverseSearchCrossStreetAddressResult reverseSearchCrossStreetAddress(com.azure.core.models.GeoPosition query)
      Reverse Address Search to a Cross Street
       System.out.println("Revere Search Cross Street Address:");
      
       // options
       client.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337)));
      
       // options
       client.reverseSearchCrossStreetAddress(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5));
      
       // complete
       client.reverseSearchCrossStreetAddressWithResponse(
           new ReverseSearchCrossStreetAddressOptions(new GeoPosition(-121.89, 37.337))
               .setTop(2)
               .setHeading(5),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • reverseSearchCrossStreetAddressWithResponse

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

      public SearchAddressResult searchStructuredAddress(StructuredAddress address, SearchStructuredAddressOptions options)
      Structured Address Search
       System.out.println("Search Address Structured:");
      
       // simple
       client.searchStructuredAddress(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"), null);
      
       // complete
       client.searchStructuredAddressWithResponse(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"),
           new SearchStructuredAddressOptions()
                   .setTop(2)
                   .setRadiusInMeters(1000),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchStructuredAddress

      public SearchAddressResult searchStructuredAddress(String countryCode)
      Structured Address Search
       System.out.println("Search Address Structured:");
      
       // simple
       client.searchStructuredAddress(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"), null);
      
       // complete
       client.searchStructuredAddressWithResponse(new StructuredAddress("US")
           .setPostalCode("98121")
           .setStreetNumber("15127")
           .setStreetName("NE 24th Street")
           .setMunicipality("Redmond")
           .setCountrySubdivision("WA"),
           new SearchStructuredAddressOptions()
                   .setTop(2)
                   .setRadiusInMeters(1000),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchStructuredAddressWithResponse

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

      public SearchAddressResult searchInsideGeometry(SearchInsideGeometryOptions options)
      Search Inside Geometry
       System.out.println("Search Inside Geometry");
      
       // create GeoPolygon
       List<GeoPosition> coordinates = new ArrayList<>();
       coordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       coordinates.add(new GeoPosition(-122.43301391601562, 37.70660472542312));
       coordinates.add(new GeoPosition(-122.36434936523438, 37.712059855877314));
       coordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       GeoLinearRing ring = new GeoLinearRing(coordinates);
       GeoPolygon polygon = new GeoPolygon(ring);
      
       // simple
       client.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", polygon));
      
       // options
       client.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", polygon)
               .setTop(5));
      
       // complete
       client.searchInsideGeometryWithResponse(
           new SearchInsideGeometryOptions("Leland Avenue", polygon)
               .setTop(5),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchInsideGeometry

      public SearchAddressResult searchInsideGeometry(String query)
      Search Inside Geometry
       System.out.println("Search Inside Geometry");
      
       // create GeoPolygon
       List<GeoPosition> coordinates = new ArrayList<>();
       coordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       coordinates.add(new GeoPosition(-122.43301391601562, 37.70660472542312));
       coordinates.add(new GeoPosition(-122.36434936523438, 37.712059855877314));
       coordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       GeoLinearRing ring = new GeoLinearRing(coordinates);
       GeoPolygon polygon = new GeoPolygon(ring);
      
       // simple
       client.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", polygon));
      
       // options
       client.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", polygon)
               .setTop(5));
      
       // complete
       client.searchInsideGeometryWithResponse(
           new SearchInsideGeometryOptions("Leland Avenue", polygon)
               .setTop(5),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchInsideGeometryWithResponse

      public com.azure.core.http.rest.Response<SearchAddressResult> searchInsideGeometryWithResponse(SearchInsideGeometryOptions options, com.azure.core.util.Context context)
      Search Inside Geometry
       System.out.println("Search Inside Geometry");
      
       // create GeoPolygon
       List<GeoPosition> coordinates = new ArrayList<>();
       coordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       coordinates.add(new GeoPosition(-122.43301391601562, 37.70660472542312));
       coordinates.add(new GeoPosition(-122.36434936523438, 37.712059855877314));
       coordinates.add(new GeoPosition(-122.43576049804686, 37.7524152343544));
       GeoLinearRing ring = new GeoLinearRing(coordinates);
       GeoPolygon polygon = new GeoPolygon(ring);
      
       // simple
       client.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", polygon));
      
       // options
       client.searchInsideGeometry(
           new SearchInsideGeometryOptions("Leland Avenue", polygon)
               .setTop(5));
      
       // complete
       client.searchInsideGeometryWithResponse(
           new SearchInsideGeometryOptions("Leland Avenue", polygon)
               .setTop(5),
           null).getStatusCode();
       
      Parameters:
      options - a SearchInsideGeometryOptions representing the search parameters.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Inside Geometry call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAlongRoute

      public SearchAddressResult searchAlongRoute(SearchAlongRouteOptions options)
      Search Along Route
       System.out.println("Search Along Route");
      
       // create route points
       List<GeoPosition> points = 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 route = new GeoLineString(points);
      
       // simple
       client.searchAlongRoute(new SearchAlongRouteOptions("burger", 1000, route));
      
       // options
       client.searchAlongRoute(
           new SearchAlongRouteOptions("burger", 1000, route)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5));
      
       // complete
       client.searchAlongRouteWithResponse(
           new SearchAlongRouteOptions("burger", 1000, route)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAlongRoute

      public SearchAddressResult searchAlongRoute(String query, int maxDetourTime)
      Search Along Route
       System.out.println("Search Along Route");
      
       // create route points
       List<GeoPosition> points = 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 route = new GeoLineString(points);
      
       // simple
       client.searchAlongRoute(new SearchAlongRouteOptions("burger", 1000, route));
      
       // options
       client.searchAlongRoute(
           new SearchAlongRouteOptions("burger", 1000, route)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5));
      
       // complete
       client.searchAlongRouteWithResponse(
           new SearchAlongRouteOptions("burger", 1000, route)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5),
           null).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.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • searchAlongRouteWithResponse

      public com.azure.core.http.rest.Response<SearchAddressResult> searchAlongRouteWithResponse(SearchAlongRouteOptions options, com.azure.core.util.Context context)
      Search Along Route
       System.out.println("Search Along Route");
      
       // create route points
       List<GeoPosition> points = 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 route = new GeoLineString(points);
      
       // simple
       client.searchAlongRoute(new SearchAlongRouteOptions("burger", 1000, route));
      
       // options
       client.searchAlongRoute(
           new SearchAlongRouteOptions("burger", 1000, route)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5));
      
       // complete
       client.searchAlongRouteWithResponse(
           new SearchAlongRouteOptions("burger", 1000, route)
               .setCategoryFilter(Arrays.asList(7315))
               .setTop(5),
           null).getStatusCode();
       
      Parameters:
      options - a SearchAlongRouteOptions representing the search parameters.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Along Route call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginFuzzySearchBatch(List<FuzzySearchOptions> optionsList)
      Batch Fuzzy Search
       List<FuzzySearchOptions> fuzzyOptionsList = new ArrayList<>();
       fuzzyOptionsList.add(new FuzzySearchOptions("atm", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000).setTop(5));
       fuzzyOptionsList.add(new FuzzySearchOptions("Statue of Liberty").setTop(2));
       fuzzyOptionsList.add(new FuzzySearchOptions("Starbucks", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000));
      
       System.out.println("Post Search Fuzzy Batch Async");
       client.beginFuzzySearchBatch(fuzzyOptionsList).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.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginFuzzySearchBatch(List<FuzzySearchOptions> optionsList, com.azure.core.util.Context context)
      Batch Fuzzy Search
       List<FuzzySearchOptions> fuzzyOptionsList = new ArrayList<>();
       fuzzyOptionsList.add(new FuzzySearchOptions("atm", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000).setTop(5));
       fuzzyOptionsList.add(new FuzzySearchOptions("Statue of Liberty").setTop(2));
       fuzzyOptionsList.add(new FuzzySearchOptions("Starbucks", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000));
      
       System.out.println("Post Search Fuzzy Batch Async");
       client.beginFuzzySearchBatch(fuzzyOptionsList).getFinalResult();
       
      Parameters:
      optionsList - a list of FuzzySearchOptions to be searched.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginGetFuzzySearchBatch(String batchId)
      Get Fuzzy Batch Search by Id
       List<FuzzySearchOptions> fuzzyOptionsList = new ArrayList<>();
       fuzzyOptionsList.add(new FuzzySearchOptions("atm", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000).setTop(5));
       fuzzyOptionsList.add(new FuzzySearchOptions("Statue of Liberty").setTop(2));
       fuzzyOptionsList.add(new FuzzySearchOptions("Starbucks", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000));
      
       System.out.println("Post Search Fuzzy Batch Async");
       client.beginFuzzySearchBatch(fuzzyOptionsList).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.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginGetFuzzySearchBatch(String batchId, com.azure.core.util.Context context)
      Get Fuzzy Batch Search by Id
       List<FuzzySearchOptions> fuzzyOptionsList = new ArrayList<>();
       fuzzyOptionsList.add(new FuzzySearchOptions("atm", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000).setTop(5));
       fuzzyOptionsList.add(new FuzzySearchOptions("Statue of Liberty").setTop(2));
       fuzzyOptionsList.add(new FuzzySearchOptions("Starbucks", new GeoPosition(-122.128362, 47.639769))
           .setRadiusInMeters(5000));
      
       System.out.println("Post Search Fuzzy Batch Async");
       client.beginFuzzySearchBatch(fuzzyOptionsList).getFinalResult();
       
      Parameters:
      batchId - Batch id for querying the operation.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginSearchAddressBatch(List<SearchAddressOptions> optionsList)
      Batch Address Search
       List<SearchAddressOptions> optionsList = new ArrayList<>();
       optionsList.add(new SearchAddressOptions("400 Broad St, Seattle, WA 98109").setTop(3));
       optionsList.add(new SearchAddressOptions("One, Microsoft Way, Redmond, WA 98052").setTop(3));
       optionsList.add(new SearchAddressOptions("350 5th Ave, New York, NY 10118").setTop(3));
       optionsList.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");
       client.beginSearchAddressBatch(optionsList).getFinalResult();
       SyncPoller<BatchSearchResult, BatchSearchResult> poller = client.beginSearchAddressBatch(optionsList);
       BatchSearchResult result = poller.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.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginSearchAddressBatch(List<SearchAddressOptions> optionsList, com.azure.core.util.Context context)
      Batch Address Search
       List<SearchAddressOptions> optionsList = new ArrayList<>();
       optionsList.add(new SearchAddressOptions("400 Broad St, Seattle, WA 98109").setTop(3));
       optionsList.add(new SearchAddressOptions("One, Microsoft Way, Redmond, WA 98052").setTop(3));
       optionsList.add(new SearchAddressOptions("350 5th Ave, New York, NY 10118").setTop(3));
       optionsList.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");
       client.beginSearchAddressBatch(optionsList).getFinalResult();
       SyncPoller<BatchSearchResult, BatchSearchResult> poller = client.beginSearchAddressBatch(optionsList);
       BatchSearchResult result = poller.getFinalResult();
       
      Parameters:
      optionsList - a list of SearchAddressOptions to be searched.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginGetSearchAddressBatch(String batchId)
      Get Batch Search Id
       List<SearchAddressOptions> optionsList = new ArrayList<>();
       optionsList.add(new SearchAddressOptions("400 Broad St, Seattle, WA 98109").setTop(3));
       optionsList.add(new SearchAddressOptions("One, Microsoft Way, Redmond, WA 98052").setTop(3));
       optionsList.add(new SearchAddressOptions("350 5th Ave, New York, NY 10118").setTop(3));
       optionsList.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");
       client.beginSearchAddressBatch(optionsList).getFinalResult();
       SyncPoller<BatchSearchResult, BatchSearchResult> poller = client.beginSearchAddressBatch(optionsList);
       BatchSearchResult result = poller.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.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchSearchResult,BatchSearchResult> beginGetSearchAddressBatch(String batchId, com.azure.core.util.Context context)
      Get Batch Search Id
       List<SearchAddressOptions> optionsList = new ArrayList<>();
       optionsList.add(new SearchAddressOptions("400 Broad St, Seattle, WA 98109").setTop(3));
       optionsList.add(new SearchAddressOptions("One, Microsoft Way, Redmond, WA 98052").setTop(3));
       optionsList.add(new SearchAddressOptions("350 5th Ave, New York, NY 10118").setTop(3));
       optionsList.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");
       client.beginSearchAddressBatch(optionsList).getFinalResult();
       SyncPoller<BatchSearchResult, BatchSearchResult> poller = client.beginSearchAddressBatch(optionsList);
       BatchSearchResult result = poller.getFinalResult();
       
      Parameters:
      batchId - Batch id for querying the operation.
      context - The context to associate with this operation.
      Returns:
      this object is returned from a successful Search Address Batch service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchReverseSearchResult,BatchReverseSearchResult> beginReverseSearchAddressBatch(List<ReverseSearchAddressOptions> optionsList)
      Searches a batch of addresses given their coordinates.
       List<ReverseSearchAddressOptions> reverseOptionsList = new ArrayList<>();
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(2.294911, 48.858561)));
       reverseOptionsList.add(
           new ReverseSearchAddressOptions(new GeoPosition(-122.127896, 47.639765))
               .setRadiusInMeters(5000)
       );
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(-122.348170, 47.621028)));
      
       System.out.println("Reverse Search Address Batch Async");
       BatchReverseSearchResult br1 =
           client.beginReverseSearchAddressBatch(reverseOptionsList).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.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchReverseSearchResult,BatchReverseSearchResult> beginReverseSearchAddressBatch(List<ReverseSearchAddressOptions> optionsList, com.azure.core.util.Context context)
      Searches a batch of addresses given their coordinates.
       List<ReverseSearchAddressOptions> reverseOptionsList = new ArrayList<>();
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(2.294911, 48.858561)));
       reverseOptionsList.add(
           new ReverseSearchAddressOptions(new GeoPosition(-122.127896, 47.639765))
               .setRadiusInMeters(5000)
       );
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(-122.348170, 47.621028)));
      
       System.out.println("Reverse Search Address Batch Async");
       BatchReverseSearchResult br1 =
           client.beginReverseSearchAddressBatch(reverseOptionsList).getFinalResult();
       
      Parameters:
      optionsList - a list of ReverseSearchAddressOptions to be searched.
      context - a Context object for distributed tracing.
      Returns:
      a SyncPoller wrapping the service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchReverseSearchResult,BatchReverseSearchResult> beginGetReverseSearchAddressBatch(String batchId)
      Returns a batch of previously searched addressed given a batch id.
       List<ReverseSearchAddressOptions> reverseOptionsList = new ArrayList<>();
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(2.294911, 48.858561)));
       reverseOptionsList.add(
           new ReverseSearchAddressOptions(new GeoPosition(-122.127896, 47.639765))
               .setRadiusInMeters(5000)
       );
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(-122.348170, 47.621028)));
      
       System.out.println("Reverse Search Address Batch Async");
       BatchReverseSearchResult br1 =
           client.beginReverseSearchAddressBatch(reverseOptionsList).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.maps.search.implementation.models.ErrorResponseException - 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.SyncPoller<BatchReverseSearchResult,BatchReverseSearchResult> beginGetReverseSearchAddressBatch(String batchId, com.azure.core.util.Context context)
      Returns a batch of previously searched addressed given a batch id.
       List<ReverseSearchAddressOptions> reverseOptionsList = new ArrayList<>();
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(2.294911, 48.858561)));
       reverseOptionsList.add(
           new ReverseSearchAddressOptions(new GeoPosition(-122.127896, 47.639765))
               .setRadiusInMeters(5000)
       );
       reverseOptionsList.add(new ReverseSearchAddressOptions(new GeoPosition(-122.348170, 47.621028)));
      
       System.out.println("Reverse Search Address Batch Async");
       BatchReverseSearchResult br1 =
           client.beginReverseSearchAddressBatch(reverseOptionsList).getFinalResult();
       
      Parameters:
      batchId - Batch id for querying the operation.
      context - a Context object for distributed tracing.
      Returns:
      a SyncPoller wrapping the service call.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.search.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.