diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/ISearchClient.cs b/sdk/maps/Azure.Maps.Search/src/Generated/ISearchClient.cs new file mode 100644 index 000000000000..8c5184bedc09 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/ISearchClient.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + + /// + /// Azure Maps Search REST APIs + /// + public partial interface ISearchClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Version number of Azure Maps API. + /// + string ApiVersion { get; set; } + + /// + /// Specifies which account is intended for usage in conjunction with + /// the Azure AD security model. It represents a unique ID for the + /// Azure Maps account and can be retrieved from the Azure Maps + /// management plane Account API. To use Azure AD security in Azure + /// Maps see the following [articles](https://aka.ms/amauthdetails) for + /// guidance. + /// + string XMsClientId { get; set; } + + /// + /// This parameter specifies where the Azure Maps Creator resource is + /// located. Valid values are us and eu. Possible values include: + /// 'us', 'eu' + /// + string Geography { get; set; } + + /// + /// Subscription credentials which uniquely identify client + /// subscription. + /// + ServiceClientCredentials Credentials { get; } + + + /// + /// Gets the ISearchOperations. + /// + ISearchOperations Search { get; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/ISearchOperations.cs b/sdk/maps/Azure.Maps.Search/src/Generated/ISearchOperations.cs new file mode 100644 index 000000000000..959753c04a54 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/ISearchOperations.cs @@ -0,0 +1,3996 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search +{ + using Microsoft.Rest; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SearchOperations operations. + /// + public partial interface ISearchOperations + { + /// + /// **Get Polygon** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// The Get Polygon service allows you to request the geometry data + /// such as a city or country outline for a set of entities, + /// previously retrieved from an Online Search request in GeoJSON + /// format. The geometry ID is returned in the dataSources object + /// under "geometry" and "id" in either a Search Address or Search + /// Fuzzy call. + /// + /// Please note that any geometry ID retrieved from an Online Search + /// endpoint has a limited lifetime. The client should not store + /// geometry IDs in persistent storage for later referral, as the + /// stability of these identifiers is not guaranteed for a long period + /// of time. It is expected that a request to the Polygon method is + /// made within a few minutes of the request to the Online Search + /// method that provided the ID. The service allows for batch requests + /// up to 20 identifiers. + /// + /// + /// Comma separated list of geometry UUIDs, previously retrieved from + /// an Online Search request. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchPolygonWithHttpMessagesAsync(IList geometries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// + /// **Free Form Search** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The basic default API is Free Form Search which handles the most + /// fuzzy of inputs handling any combination of address or POI tokens. + /// This search API is the canonical 'single line search'. The Free + /// Form Search API is a seamless combination of POI search and + /// geocoding. The API can also be weighted with a contextual position + /// (lat./lon. pair), or fully constrained by a coordinate and radius, + /// or it can be executed more generally without any geo biasing anchor + /// point.<br><br>We strongly advise you to use the + /// 'countrySet' parameter to specify only the countries for which your + /// application needs coverage, as the default behavior will be to + /// search the entire world, potentially returning unnecessary + /// results.<br><br> E.g.: `countrySet`=US,FR + /// <br><br>Please see [Search + /// Coverage](https://docs.microsoft.com/azure/location-based-services/geocoding-coverage) + /// for a complete list of all the supported + /// countries.<br><br>Most Search queries default to + /// `maxFuzzyLevel`=2 to gain performance and also reduce unusual + /// results. This new default can be overridden as needed per request + /// by passing in the query param `maxFuzzyLevel`=3 or 4. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The applicable query string (e.g., "seattle", "pizza"). Can _also_ + /// be specified as a comma separated string composed by latitude + /// followed by longitude (e.g., "47.641268, -122.125679"). Must be + /// properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be + /// interpreted as a partial input and the search will enter predictive + /// mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to + /// restrict the result to specific Points of Interest categories. ID + /// order does not matter. When multiple category identifiers are + /// provided, only POIs that belong to (at least) one of the categories + /// from the provided list will be returned. The list of supported + /// categories can be discovered using  [POI Categories + /// API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category + /// Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of + /// category either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will + /// limit the search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any + /// order) or **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes + /// except Geo. Extended postal code lists for geographies can be quite + /// long so they have to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// Minimum fuzziness level to be used. Default: 1, minimum: 1 and + /// maximum: 4 + /// + /// * Level 1 has no spell checking. + /// + /// * Level 2 uses normal n-gram spell checking. For example, query + /// "restrant" can be matched to "restaurant." + /// + /// * Level 3 uses sound-like spell checking, and shingle spell + /// checking. Sound-like spell checking is for "rstrnt" to "restaurant" + /// matching. Shingle spell checking is for "mountainview" to "mountain + /// view" matching. + /// + /// * Level 4 doesn’t add any more spell checking functions. + /// + /// + /// + /// The search engine will start looking for a match on the level + /// defined by minFuzzyLevel, and will stop searching at the level + /// specified by maxFuzzyLevel. + /// + /// + /// Maximum fuzziness level to be used. Default: 2, minimum: 1 and + /// maximum: 4 + /// + /// * Level 1 has no spell checking. + /// + /// * Level 2 uses normal n-gram spell checking. For example, query + /// "restrant" can be matched to "restaurant." + /// + /// * Level 3 uses sound-like spell checking, and shingle spell + /// checking. Sound-like spell checking is for "rstrnt" to "restaurant" + /// matching. Shingle spell checking is for "mountainview" to "mountain + /// view" matching. + /// + /// * Level 4 doesn’t add any more spell checking functions. + /// + /// + /// + /// The search engine will start looking for a match on the level + /// defined by minFuzzyLevel, and will stop searching at the level + /// specified by maxFuzzyLevel. + /// + /// + /// A comma separated list of indexes which should be utilized for the + /// search. Item order does not matter. Available indexes are: Addr = + /// Address range interpolation, Geo = Geographies, PAD = Point + /// Addresses, POI = Points of interest, Str = Streets, Xstr = Cross + /// Streets (intersections) + /// + /// + /// A comma-separated list of brand names which could be used to + /// restrict the result to specific brands. Item order does not matter. + /// When multiple brands are provided, only results that belong to (at + /// least) one of the provided list will be returned. Brands that + /// contain a "," in their name should be put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to + /// restrict the result to Electric Vehicle Station supporting specific + /// connector types. Item order does not matter. When multiple + /// connector types are provided, only results that belong to (at + /// least) one of the provided list will be returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard + /// household connectors for a certain region. They are all AC single + /// phase and the standard Voltage and standard Amperage. See also: + /// [Plug & socket types - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE + /// J1772 after the standard that first published it. Mostly used in + /// combination with 120V single phase or up to 240V single phase + /// infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 1 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the + /// IEC 62196-2 standard. Provided as a cable and plug attached to the + /// charging point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 2 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly + /// used in combination with up to 240V single phase or up to 420V + /// three phase infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed + /// by the Tokyo Electric Power Company and industrial partners. + /// Because of this is is also known as the TEPCO's connector. It + /// supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector + /// defined in the IEC 60309 standard. It is sometime referred to as by + /// some combination of the standard, the color and the fact that is a + /// single phase connector. The connector usually has the "P+N+E, 6h" + /// configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector + /// defined in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's + /// proprietary connector, sometimes referred to as Tesla Port mostly + /// limited to North America or the modified Type 2 (DC over Type 2) in + /// Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability + /// of hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: + /// 'nextSevenDays' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchFuzzyWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), int? minFuzzyLevel = default(int?), int? maxFuzzyLevel = default(int?), IList idxSet = default(IList), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get POI by Name** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Points of Interest (POI) Search allows you to request POI results + /// by name. Search supports additional query parameters such as + /// language and filtering results by area of interest driven by + /// country or bounding box. Endpoint will return only POI results + /// matching the query string. Response includes POI details such as + /// address, coordinate location and category. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", + /// "starbucks"), must be properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be + /// interpreted as a partial input and the search will enter predictive + /// mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to + /// restrict the result to specific Points of Interest categories. ID + /// order does not matter. When multiple category identifiers are + /// provided, only POIs that belong to (at least) one of the categories + /// from the provided list will be returned. The list of supported + /// categories can be discovered using  [POI Categories + /// API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category + /// Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of + /// category either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will + /// limit the search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **POI** = Points of Interest + /// + /// Value should be **POI** or **None** to disable extended postal + /// codes. + /// + /// By default extended postal codes are included. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to + /// restrict the result to specific brands. Item order does not matter. + /// When multiple brands are provided, only results that belong to (at + /// least) one of the provided list will be returned. Brands that + /// contain a "," in their name should be put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to + /// restrict the result to Electric Vehicle Station supporting specific + /// connector types. Item order does not matter. When multiple + /// connector types are provided, only results that belong to (at + /// least) one of the provided list will be returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard + /// household connectors for a certain region. They are all AC single + /// phase and the standard Voltage and standard Amperage. See also: + /// [Plug & socket types - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE + /// J1772 after the standard that first published it. Mostly used in + /// combination with 120V single phase or up to 240V single phase + /// infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 1 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the + /// IEC 62196-2 standard. Provided as a cable and plug attached to the + /// charging point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 2 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly + /// used in combination with up to 240V single phase or up to 420V + /// three phase infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed + /// by the Tokyo Electric Power Company and industrial partners. + /// Because of this is is also known as the TEPCO's connector. It + /// supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector + /// defined in the IEC 60309 standard. It is sometime referred to as by + /// some combination of the standard, the color and the fact that is a + /// single phase connector. The connector usually has the "P+N+E, 6h" + /// configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector + /// defined in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's + /// proprietary connector, sometimes referred to as Tesla Port mostly + /// limited to North America or the modified Type 2 (DC over Type 2) in + /// Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability + /// of hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: + /// 'nextSevenDays' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchPOIWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Nearby Search** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// If you have a use case for only retrieving POI results around a + /// specific location, the nearby search method may be the right + /// choice. This endpoint will only return POI results, and does not + /// take in a search query parameter. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// Latitude where results should be biased. E.g. 37.337. + /// + /// + /// Longitude where results should be biased. E.g. -121.89. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to + /// restrict the result to specific Points of Interest categories. ID + /// order does not matter. When multiple category identifiers are + /// provided, only POIs that belong to (at least) one of the categories + /// from the provided list will be returned. The list of supported + /// categories can be discovered using  [POI Categories + /// API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category + /// Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of + /// category either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will + /// limit the search to the specified countries + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area, Min value is 1, Max Value is 50000. + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any + /// order) or **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes + /// except Geo. Extended postal code lists for geographies can be quite + /// long so they have to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to + /// restrict the result to specific brands. Item order does not matter. + /// When multiple brands are provided, only results that belong to (at + /// least) one of the provided list will be returned. Brands that + /// contain a "," in their name should be put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to + /// restrict the result to Electric Vehicle Station supporting specific + /// connector types. Item order does not matter. When multiple + /// connector types are provided, only results that belong to (at + /// least) one of the provided list will be returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard + /// household connectors for a certain region. They are all AC single + /// phase and the standard Voltage and standard Amperage. See also: + /// [Plug & socket types - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE + /// J1772 after the standard that first published it. Mostly used in + /// combination with 120V single phase or up to 240V single phase + /// infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 1 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the + /// IEC 62196-2 standard. Provided as a cable and plug attached to the + /// charging point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 2 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly + /// used in combination with up to 240V single phase or up to 420V + /// three phase infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed + /// by the Tokyo Electric Power Company and industrial partners. + /// Because of this is is also known as the TEPCO's connector. It + /// supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector + /// defined in the IEC 60309 standard. It is sometime referred to as by + /// some combination of the standard, the color and the fact that is a + /// single phase connector. The connector usually has the "P+N+E, 6h" + /// configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector + /// defined in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's + /// proprietary connector, sometimes referred to as Tesla Port mostly + /// limited to North America or the modified Type 2 (DC over Type 2) in + /// Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchNearbyWithHttpMessagesAsync(string format, double lat, double lon, int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? radius = default(double?), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get POI by Category** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Points of Interest (POI) Category Search allows you to request POI + /// results from given category. Search allows to query POIs from one + /// category at a time. Endpoint will only return POI results which + /// are categorized as specified. Response includes POI details such + /// as address, coordinate location and classification. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The POI category to search for (e.g., "AIRPORT", "RESTAURANT"), + /// must be properly URL encoded. Supported main categories can be + /// requested by calling [Get Search POI Category Tree + /// API](https://aka.ms/AzureMapsPOICategoryTree). List of available + /// categories can also be found + /// [here](https://docs.microsoft.com/azure/azure-maps/supported-search-categories). + /// We recommend to use POI Search Category Tree API to request the + /// supported categories. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be + /// interpreted as a partial input and the search will enter predictive + /// mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to + /// restrict the result to specific Points of Interest categories. ID + /// order does not matter. When multiple category identifiers are + /// provided, only POIs that belong to (at least) one of the categories + /// from the provided list will be returned. The list of supported + /// categories can be discovered using  [POI Categories + /// API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category + /// Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of + /// category either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will + /// limit the search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any + /// order) or **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes + /// except Geo. Extended postal code lists for geographies can be quite + /// long so they have to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to + /// restrict the result to specific brands. Item order does not matter. + /// When multiple brands are provided, only results that belong to (at + /// least) one of the provided list will be returned. Brands that + /// contain a "," in their name should be put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to + /// restrict the result to Electric Vehicle Station supporting specific + /// connector types. Item order does not matter. When multiple + /// connector types are provided, only results that belong to (at + /// least) one of the provided list will be returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard + /// household connectors for a certain region. They are all AC single + /// phase and the standard Voltage and standard Amperage. See also: + /// [Plug & socket types - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE + /// J1772 after the standard that first published it. Mostly used in + /// combination with 120V single phase or up to 240V single phase + /// infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 1 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the + /// IEC 62196-2 standard. Provided as a cable and plug attached to the + /// charging point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 2 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly + /// used in combination with up to 240V single phase or up to 420V + /// three phase infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed + /// by the Tokyo Electric Power Company and industrial partners. + /// Because of this is is also known as the TEPCO's connector. It + /// supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector + /// defined in the IEC 60309 standard. It is sometime referred to as by + /// some combination of the standard, the color and the fact that is a + /// single phase connector. The connector usually has the "P+N+E, 6h" + /// configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector + /// defined in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's + /// proprietary connector, sometimes referred to as Tesla Port mostly + /// limited to North America or the modified Type 2 (DC over Type 2) in + /// Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability + /// of hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: + /// 'nextSevenDays' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchPOICategoryWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Get POI Category Tree** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// POI Category API provides a full list of supported Points of + /// Interest (POI) categories and subcategories together with their + /// translations and synonyms. The returned content can be used to + /// provide more meaningful results through other Search Service APIs, + /// like [Get Search + /// POI](https://docs.microsoft.com/rest/api/maps/search/getsearchpoi). + /// + /// + /// 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. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchPOICategoryTreePreviewWithHttpMessagesAsync(string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Address Geocoding** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// In many cases, the complete search service might be too much, for + /// instance if you are only interested in traditional geocoding. + /// Search can also be accessed for address look up exclusively. The + /// geocoding is performed by hitting the geocode endpoint with just + /// the address or partial address in question. The geocoding search + /// index will be queried for everything above the street level data. + /// No POIs will be returned. Note that the geocoder is very tolerant + /// of typos and incomplete addresses. It will also handle everything + /// from exact street addresses or street or intersections as well as + /// higher level geographies such as city centers, counties, states + /// etc. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The address to search for (e.g., "1 Microsoft way, Redmond, WA"), + /// must be properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be + /// interpreted as a partial input and the search will enter predictive + /// mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will + /// limit the search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any + /// order) or **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes + /// except Geo. Extended postal code lists for geographies can be quite + /// long so they have to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchAddressWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Reverse Geocode to an Address** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// There may be times when you need to translate a coordinate + /// (example: 37.786505, -122.3862) into a human understandable street + /// address. Most often this is needed in tracking applications where + /// you receive a GPS feed from the device or asset and wish to know + /// what address where the coordinate is located. This endpoint will + /// return address information for a given coordinate. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Boolean. To enable return of the posted speed limit + /// + /// + /// The directional heading of the vehicle in degrees, for travel along + /// a segment of roadway. 0 is North, 90 is East and so on, values + /// range from -360 to 360. The precision can include upto one decimal + /// place + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area + /// + /// + /// If a number is sent in along with the request, the response may + /// include the side of the street (Left/Right) and also an offset + /// position for that number + /// + /// + /// Boolean. To enable return of the road use array for reverse + /// geocodes at street level + /// + /// + /// To restrict reverse geocodes to a certain type of road use. The + /// road use array for reverse geocodes can be one or more of + /// LimitedAccess, Arterial, Terminal, Ramp, Rotary, LocalStreet + /// + /// + /// Format of newlines in the formatted address. + /// + /// If true, the address will contain newlines. + /// If false, newlines will be converted to commas. + /// + /// + /// Include information on the type of match the geocoder achieved in + /// the response. + /// + /// + /// Specifies the level of filtering performed on geographies. Narrows + /// the search for specified geography entity types, e.g. return only + /// municipality. The resulting response will contain the geography ID + /// as well as the entity type matched. If you provide more than one + /// entity as a comma separated list, endpoint will return the + /// 'smallest entity available'. Returned Geometry ID can be used to + /// get the geometry of that geography via [Get Search + /// Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) + /// API. The following parameters are ignored when entityType is set: + /// + /// * heading + /// * number + /// * returnRoadUse + /// * returnSpeedLimit + /// * roadUse + /// * returnMatchType. Possible values include: 'Country', + /// 'CountrySubdivision', 'CountrySecondarySubdivision', + /// 'CountryTertiarySubdivision', 'Municipality', + /// 'MunicipalitySubdivision', 'Neighbourhood', 'PostalCodeArea' + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchAddressReverseWithHttpMessagesAsync(string format, string query, string language = default(string), bool? returnSpeedLimit = default(bool?), double? heading = default(double?), double? radius = default(double?), string number = default(string), bool? returnRoadUse = default(bool?), string roadUse = default(string), bool? allowFreeformNewline = default(bool?), bool? returnMatchType = default(bool?), string entityType = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Reverse Geocode to a Cross Street** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// There may be times when you need to translate a coordinate + /// (example: 37.786505, -122.3862) into a human understandable cross + /// street. Most often this is needed in tracking applications where + /// you receive a GPS feed from the device or asset and wish to know + /// what address where the coordinate is located. + /// This endpoint will return cross street information for a given + /// coordinate. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The applicable query specified as a comma separated string composed + /// by latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// The directional heading of the vehicle in degrees, for travel along + /// a segment of roadway. 0 is North, 90 is East and so on, values + /// range from -360 to 360. The precision can include upto one decimal + /// place + /// + /// + /// The radius in meters to for the results to be constrained to the + /// defined area + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchAddressReverseCrossStreetWithHttpMessagesAsync(string format, string query, int? limit = default(int?), double? heading = default(double?), double? radius = default(double?), string language = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Structured Address Geocoding** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Azure Address Geocoding can also be accessed for structured + /// address look up exclusively. The geocoding search index will be + /// queried for everything above the street level data. No POIs will + /// be returned. Note that the geocoder is very tolerant of typos and + /// incomplete addresses. It will also handle everything from exact + /// street addresses or street or intersections as well as higher level + /// geographies such as city centers, counties, states etc. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The 2 or 3 letter + /// [ISO3166-1](https://www.iso.org/iso-3166-country-codes.html) + /// country code portion of an address. E.g. US. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// The street number portion of an address + /// + /// + /// The street name portion of an address + /// + /// + /// The cross street name for the structured address + /// + /// + /// The municipality portion of an address + /// + /// + /// The municipality subdivision (sub/super city) for the structured + /// address + /// + /// + /// The named area for the structured address + /// + /// + /// The county for the structured address + /// + /// + /// The country subdivision portion of an address + /// + /// + /// The postal code portion of an address + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any + /// order) or **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes + /// except Geo. Extended postal code lists for geographies can be quite + /// long so they have to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchAddressStructuredWithHttpMessagesAsync(string format, string language = default(string), string countryCode = "US", int? limit = default(int?), int? ofs = default(int?), string streetNumber = default(string), string streetName = default(string), string crossStreet = default(string), string municipality = default(string), string municipalitySubdivision = default(string), string countryTertiarySubdivision = default(string), string countrySecondarySubdivision = default(string), string countrySubdivision = default(string), string postalCode = default(string), string extendedPostalCodesFor = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Search Geometry endpoint allows you to perform a free form + /// search inside a single geometry or many of them. The search results + /// that fall inside the geometry/geometries will be + /// returned.<br><br>To send the geometry you will use a + /// `POST` request where the request body will contain the `geometry` + /// object represented as a `GeoJSON` type and the `Content-Type` + /// header will be set to `application/json`. The geographical features + /// to be searched can be modeled as Polygon and/or Circle geometries + /// represented using any one of the following `GeoJSON` + /// types:<ul><li>**GeoJSON FeatureCollection** + /// <br>The `geometry` can be represented as a `GeoJSON + /// FeatureCollection` object. This is the recommended option if the + /// geometry contains both Polygons and Circles. The + /// `FeatureCollection` can contain a max of 50 `GeoJSON Feature` + /// objects. Each `Feature` object should represent either a Polygon or + /// a Circle with the following conditions:<ul + /// style="list-style-type:none"><li>A `Feature` object for + /// the Polygon geometry can have a max of 50 coordinates and it's + /// properties must be empty.</li><li>A `Feature` object + /// for the Circle geometry is composed of a _center_ represented using + /// a `GeoJSON Point` type and a _radius_ value (in meters) which must + /// be specified in the object's properties along with the _subType_ + /// property whose value should be + /// 'Circle'.</li></ul><br> Please see the Examples + /// section below for a sample `FeatureCollection` + /// representation.<br><br></li><li>**GeoJSON + /// GeometryCollection**<br>The `geometry` can be represented as + /// a `GeoJSON GeometryCollection` object. This is the recommended + /// option if the geometry contains a list of Polygons only. The + /// `GeometryCollection` can contain a max of 50 `GeoJSON Polygon` + /// objects. Each `Polygon` object can have a max of 50 coordinates. + /// Please see the Examples section below for a sample + /// `GeometryCollection` + /// representation.<br><br></li><li>**GeoJSON + /// Polygon**<br>The `geometry` can be represented as a `GeoJSON + /// Polygon` object. This is the recommended option if the geometry + /// contains a single Polygon. The `Polygon` object can have a max of + /// 50 coordinates. Please see the Examples section below for a sample + /// `Polygon` + /// representation.<br><br></li></ul>.<br><br> + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks", + /// "pizza"). Must be properly URL encoded. + /// + /// + /// This represents the geometry for one or more geographical features + /// (parks, state boundary etc.) to search in and should be a GeoJSON + /// compliant type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946) for details. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, + /// minimum: 1 and maximum: 100 + /// + /// + /// Language in which search results should be returned. Should be one + /// of supported IETF language tags, case insensitive. When data in + /// specified language is not available for a specific field, default + /// language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// A comma-separated list of category set IDs which could be used to + /// restrict the result to specific Points of Interest categories. ID + /// order does not matter. When multiple category identifiers are + /// provided, only POIs that belong to (at least) one of the categories + /// from the provided list will be returned. The list of supported + /// categories can be discovered using  [POI Categories + /// API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category + /// Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of + /// category either Italian or French Restaurant) + /// + /// + /// Indexes for which extended postal codes should be included in the + /// results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any + /// order) or **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes + /// except Geo. Extended postal code lists for geographies can be quite + /// long so they have to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** + /// property of an address. Availability is region-dependent. + /// + /// + /// A comma separated list of indexes which should be utilized for the + /// search. Item order does not matter. Available indexes are: Addr = + /// Address range interpolation, Geo = Geographies, PAD = Point + /// Addresses, POI = Points of interest, Str = Streets, Xstr = Cross + /// Streets (intersections) + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability + /// of hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: + /// 'nextSevenDays' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchInsideGeometryWithHttpMessagesAsync(string format, string query, SearchInsideGeometryRequestBody searchInsideGeometryRequestBody, int? limit = default(int?), string language = default(string), IList categorySet = default(IList), string extendedPostalCodesFor = default(string), IList idxSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The Search Along Route endpoint allows you to perform a fuzzy + /// search for POIs along a specified route. This search is constrained + /// by specifying the `maxDetourTime` limiting + /// measure.<br><br>To send the route-points you will use a + /// `POST` request where the request body will contain the `route` + /// object represented as a `GeoJSON LineString` type and the + /// `Content-Type` header will be set to `application/json`. Each + /// route-point in `route` is represented as a `GeoJSON Position` type + /// i.e. an array where the _longitude_ value is followed by the + /// _latitude_ value and the _altitude_ value is ignored. The `route` + /// should contain at least 2 route-points.<br><br>It is + /// possible that original route will be altered, some of it's points + /// may be skipped. If the route that passes through the found point is + /// faster than the original one, the `detourTime` value in the + /// response is negative. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks", + /// "pizza"). Must be properly URL encoded. + /// + /// + /// Maximum detour time of the point of interest in seconds. Max value + /// is 3600 seconds + /// + /// + /// This represents the route to search along and should be a valid + /// `GeoJSON LineString` type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for + /// details. + /// + /// + /// A comma-separated list of category set IDs which could be used to + /// restrict the result to specific Points of Interest categories. ID + /// order does not matter. When multiple category identifiers are + /// provided, only POIs that belong to (at least) one of the categories + /// from the provided list will be returned. The list of supported + /// categories can be discovered using  [POI Categories + /// API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category + /// Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of + /// category either Italian or French Restaurant) + /// + /// + /// Maximum number of responses that will be returned. Default value is + /// 10. Max value is 20 + /// + /// + /// A comma-separated list of brand names which could be used to + /// restrict the result to specific brands. Item order does not matter. + /// When multiple brands are provided, only results that belong to (at + /// least) one of the provided list will be returned. Brands that + /// contain a "," in their name should be put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to + /// restrict the result to Electric Vehicle Station supporting specific + /// connector types. Item order does not matter. When multiple + /// connector types are provided, only results that belong to (at + /// least) one of the provided list will be returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard + /// household connectors for a certain region. They are all AC single + /// phase and the standard Voltage and standard Amperage. See also: + /// [Plug & socket types - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE + /// J1772 after the standard that first published it. Mostly used in + /// combination with 120V single phase or up to 240V single phase + /// infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 1 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the + /// IEC 62196-2 standard. Provided as a cable and plug attached to the + /// charging point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in + /// the IEC 62196-3 standard. The connector is based on the Type 2 + /// connector – as defined in the IEC 62196-2 standard – with two + /// additional direct current (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly + /// used in combination with up to 240V single phase or up to 420V + /// three phase infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed + /// by the Tokyo Electric Power Company and industrial partners. + /// Because of this is is also known as the TEPCO's connector. It + /// supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector + /// defined in the IEC 60309 standard. It is sometime referred to as by + /// some combination of the standard, the color and the fact that is a + /// single phase connector. The connector usually has the "P+N+E, 6h" + /// configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector + /// defined in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's + /// proprietary connector, sometimes referred to as Tesla Port mostly + /// limited to North America or the modified Type 2 (DC over Type 2) in + /// Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed + /// content is returned via Azure Maps services, including borders and + /// labels displayed on the map. The View parameter (also referred to + /// as “user region parameter”) will show the correct maps for that + /// country/region. By default, the View parameter is set to “Unified” + /// even if you haven’t defined it in the request. It is your + /// responsibility to determine the location of your users, and then + /// set the View parameter correctly for that location. Alternatively, + /// you have the option to set ‘View=Auto’, which will return the map + /// data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, + /// including those regarding mapping, of the country where maps, + /// images and other data and third party content that you are + /// authorized to access via Azure Maps is made available. Example: + /// view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and + /// to see the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability + /// of hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: + /// 'nextSevenDays' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchAlongRouteWithHttpMessagesAsync(string format, string query, int maxDetourTime, SearchAlongRouteRequestBody searchAlongRouteRequestBody, IList categorySet = default(IList), int? limit = default(int?), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy + /// Batch API to run either asynchronously (async) or synchronously + /// (sync). The async API allows caller to batch up to **10,000** + /// queries and sync API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in + /// `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It + /// can accept any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of search fuzzy queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchFuzzyBatchSyncWithHttpMessagesAsync(BatchRequestBody searchFuzzyBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy + /// Batch API to run either asynchronously (async) or synchronously + /// (sync). The async API allows caller to batch up to **10,000** + /// queries and sync API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in + /// `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It + /// can accept any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of search fuzzy queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchFuzzyBatchWithHttpMessagesAsync(BatchRequestBody searchFuzzyBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy + /// Batch API to run either asynchronously (async) or synchronously + /// (sync). The async API allows caller to batch up to **10,000** + /// queries and sync API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in + /// `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It + /// can accept any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchFuzzyBatchWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API + /// to run either asynchronously (async) or synchronously (sync). The + /// async API allows caller to batch up to **10,000** queries and sync + /// API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in + /// `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA + /// 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 + /// Paris, France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It + /// can accept any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of address geocoding queries/requests to process. The list + /// can contain a max of 10,000 queries and must contain at least 1 + /// query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchAddressBatchSyncWithHttpMessagesAsync(BatchRequestBody searchAddressBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API + /// to run either asynchronously (async) or synchronously (sync). The + /// async API allows caller to batch up to **10,000** queries and sync + /// API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in + /// `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA + /// 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 + /// Paris, France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It + /// can accept any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of address geocoding queries/requests to process. The list + /// can contain a max of 10,000 queries and must contain at least 1 + /// query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchAddressBatchWithHttpMessagesAsync(BatchRequestBody searchAddressBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API + /// to run either asynchronously (async) or synchronously (sync). The + /// async API allows caller to batch up to **10,000** queries and sync + /// API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in + /// `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA + /// 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 + /// Paris, France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It + /// can accept any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should + /// also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchAddressBatchWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Address Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse + /// Batch API to run either asynchronously (async) or synchronously + /// (sync). The async API allows caller to batch up to **10,000** + /// queries and sync API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` + /// request where the request body will contain the `batchItems` array + /// in `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": + /// "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL + /// _without_ the protocol, base URL, path, api-version and + /// subscription-key. It can accept any of the supported _search + /// address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be + /// properly escaped (e.g. " character should be escaped with \\ ) and + /// it should also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of reverse geocoding queries/requests to process. The list + /// can contain a max of 10,000 queries and must contain at least 1 + /// query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchAddressReverseBatchSyncWithHttpMessagesAsync(BatchRequestBody searchAddressReverseBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Address Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse + /// Batch API to run either asynchronously (async) or synchronously + /// (sync). The async API allows caller to batch up to **10,000** + /// queries and sync API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` + /// request where the request body will contain the `batchItems` array + /// in `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": + /// "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL + /// _without_ the protocol, base URL, path, api-version and + /// subscription-key. It can accept any of the supported _search + /// address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be + /// properly escaped (e.g. " character should be escaped with \\ ) and + /// it should also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of reverse geocoding queries/requests to process. The list + /// can contain a max of 10,000 queries and must contain at least 1 + /// query. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PostSearchAddressReverseBatchWithHttpMessagesAsync(BatchRequestBody searchAddressReverseBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search + /// Address Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse + /// Batch API to run either asynchronously (async) or synchronously + /// (sync). The async API allows caller to batch up to **10,000** + /// queries and sync API up to **100** queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. + /// When the service receives a request, it will respond as soon as the + /// batch items are calculated and there will be no possibility to + /// retrieve the results later. The Synchronous API will return a + /// timeout error (a 408 response) if the request takes longer than 60 + /// seconds. The number of batch items is limited to **100** for this + /// API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple + /// downloads are possible). + /// - The asynchronous API is optimized for reliability and is not + /// expected to run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the + /// service returns a 202 response code along a redirect URL in the + /// Location field of the response header. This URL should be checked + /// periodically until the response data or error information is + /// available. + /// The asynchronous responses are stored for **14** days. The redirect + /// URL returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running + /// request. Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch + /// request. This could either be a `400 Bad Request` or any other + /// `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` + /// header in the response contains the URL to download the results of + /// the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in + /// Step 3 to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` + /// request where the request body will contain the `batchItems` array + /// in `json` format and the `Content-Type` header will be set to + /// `application/json`. Here's a sample request body containing 5 + /// _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": + /// "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL + /// _without_ the protocol, base URL, path, api-version and + /// subscription-key. It can accept any of the supported _search + /// address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be + /// properly escaped (e.g. " character should be escaped with \\ ) and + /// it should also be properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and + /// sync API up to **100** queries, and the batch should contain at + /// least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request + /// to the batch download endpoint. This _download URL_ can be obtained + /// from the `Location` header of a successful `POST` batch request and + /// looks like the following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still + /// being processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The + /// response body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. + /// When downloading the results of an async batch request, if the + /// batch has finished processing, the response body contains the batch + /// response. This batch response contains a `summary` component that + /// indicates the `totalRequests` that were part of the original batch + /// request and `successfulRequests`i.e. queries which were executed + /// successfully. The batch response also includes a `batchItems` array + /// which contains a response for each and every query in the batch + /// request. The `batchItems` will contain the results in the exact + /// same order the original queries were sent in the batch request. + /// Each item in `batchItems` contains `statusCode` and `response` + /// fields. Each `response` in `batchItems` is of one of the following + /// types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` + /// and a `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ + /// result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly + /// specified or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSearchAddressReverseBatchWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchItem.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchItem.cs new file mode 100644 index 000000000000..26fc828ff9b2 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchItem.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An item returned from Batch API. Extend with 'response' property. + /// + public partial class BatchItem + { + /// + /// Initializes a new instance of the BatchItem class. + /// + public BatchItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchItem class. + /// + /// HTTP request status code. + public BatchItem(double? statusCode = default(double?)) + { + StatusCode = statusCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets HTTP request status code. + /// + [JsonProperty(PropertyName = "statusCode")] + public double? StatusCode { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchRequestBody.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchRequestBody.cs new file mode 100644 index 000000000000..b9e33ce7d7e8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchRequestBody.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This type represents the request body for the Batch service. + /// + public partial class BatchRequestBody + { + /// + /// Initializes a new instance of the BatchRequestBody class. + /// + public BatchRequestBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchRequestBody class. + /// + /// The list of queries to process. + public BatchRequestBody(IList batchItems = default(IList)) + { + BatchItems = batchItems; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of queries to process. + /// + [JsonProperty(PropertyName = "batchItems")] + public IList BatchItems { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchRequestBodyBatchItemsItem.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchRequestBodyBatchItemsItem.cs new file mode 100644 index 000000000000..914bbdf42127 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchRequestBodyBatchItemsItem.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Batch Query object + /// + public partial class BatchRequestBodyBatchItemsItem + { + /// + /// Initializes a new instance of the BatchRequestBodyBatchItemsItem + /// class. + /// + public BatchRequestBodyBatchItemsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchRequestBodyBatchItemsItem + /// class. + /// + /// Partial query string. + public BatchRequestBodyBatchItemsItem(string query = default(string)) + { + Query = query; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets partial query string. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchResponse.cs new file mode 100644 index 000000000000..1bddfaa93b8d --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchResponse.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This object is returned from a successful Batch service call. Extend + /// with 'batchItems' property. + /// + public partial class BatchResponse + { + /// + /// Initializes a new instance of the BatchResponse class. + /// + public BatchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchResponse class. + /// + /// Summary for the batch request + public BatchResponse(BatchResponseSummary summary = default(BatchResponseSummary)) + { + Summary = summary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary for the batch request + /// + [JsonProperty(PropertyName = "summary")] + public BatchResponseSummary Summary { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchResponseSummary.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchResponseSummary.cs new file mode 100644 index 000000000000..979651372be3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/BatchResponseSummary.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary for the batch request + /// + public partial class BatchResponseSummary + { + /// + /// Initializes a new instance of the BatchResponseSummary class. + /// + public BatchResponseSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchResponseSummary class. + /// + /// Number of successful requests in + /// the batch + /// Total number of requests in the + /// batch + public BatchResponseSummary(int? successfulRequests = default(int?), int? totalRequests = default(int?)) + { + SuccessfulRequests = successfulRequests; + TotalRequests = totalRequests; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets number of successful requests in the batch + /// + [JsonProperty(PropertyName = "successfulRequests")] + public int? SuccessfulRequests { get; private set; } + + /// + /// Gets total number of requests in the batch + /// + [JsonProperty(PropertyName = "totalRequests")] + public int? TotalRequests { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/ConnectorSet.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ConnectorSet.cs new file mode 100644 index 000000000000..c13c30d63dd3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ConnectorSet.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for ConnectorSet. + /// + public static class ConnectorSet + { + /// + /// These are the standard household connectors for a certain region. + /// They are all AC single phase and the standard Voltage and standard + /// Amperage. + /// + /// See also: [Plug & socket types - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets) + /// + public const string StandardHouseholdCountrySpecific = "StandardHouseholdCountrySpecific"; + /// + /// Type 1 connector as defined in the IEC 62196-2 standard. Also + /// called Yazaki after the original manufacturer or SAE J1772 after + /// the standard that first published it. Mostly used in combination + /// with 120V single phase or up to 240V single phase infrastructure. + /// + public const string IEC62196Type1 = "IEC62196Type1"; + /// + /// Type 1 based combo connector as defined in the IEC 62196-3 + /// standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct + /// current (DC) contacts to allow DC fast charging. + /// + public const string IEC62196Type1CCS = "IEC62196Type1CCS"; + /// + /// Type 2 connector as defined in the IEC 62196-2 standard. Provided + /// as a cable and plug attached to the charging point + /// + public const string IEC62196Type2CableAttached = "IEC62196Type2CableAttached"; + /// + /// Type 2 connector as defined in the IEC 62196-2 standard. Provided + /// as a socket set into the charging point. + /// + public const string IEC62196Type2Outlet = "IEC62196Type2Outlet"; + /// + /// Type 2 based combo connector as defined in the IEC 62196-3 + /// standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct + /// current (DC) contacts to allow DC fast charging. + /// + public const string IEC62196Type2CCS = "IEC62196Type2CCS"; + /// + /// Type 3 connector as defined in the IEC 62196-2 standard. Also + /// called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// + public const string IEC62196Type3 = "IEC62196Type3"; + /// + /// CHAdeMO connector named after an association formed by the Tokyo + /// Electric Power Company and industrial partners. Because of this is + /// is also known as the TEPCO's connector. It supports fast DC + /// charging. + /// + public const string Chademo = "Chademo"; + /// + /// Industrial Blue connector is a connector defined in the IEC 60309 + /// standard. It is sometime referred to as by some combination of the + /// standard, the color and the fact that is a single phase connector. + /// The connector usually has the "P+N+E, 6h" configuration. + /// + public const string IEC60309AC1PhaseBlue = "IEC60309AC1PhaseBlue"; + /// + /// Industrial White connector is a DC connector defined in the IEC + /// 60309 standard. + /// + public const string IEC60309DCWhite = "IEC60309DCWhite"; + /// + /// The Tesla connector is the regionally specific Tesla Supercharger + /// connector. I.e. it refers to either Tesla's proprietary connector, + /// sometimes referred to as Tesla Port mostly limited to North America + /// or the modified Type 2 (DC over Type 2) in Europe. + /// + public const string Tesla = "Tesla"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/CoordinatesPairAbbreviated.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/CoordinatesPairAbbreviated.cs new file mode 100644 index 000000000000..dba061be5e58 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/CoordinatesPairAbbreviated.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A location represented as a latitude and longitude using short names + /// 'lat' & 'lon'. + /// + public partial class CoordinatesPairAbbreviated + { + /// + /// Initializes a new instance of the CoordinatesPairAbbreviated class. + /// + public CoordinatesPairAbbreviated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CoordinatesPairAbbreviated class. + /// + /// Latitude property + /// Longitude property + public CoordinatesPairAbbreviated(double? lat = default(double?), double? lon = default(double?)) + { + Lat = lat; + Lon = lon; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets latitude property + /// + [JsonProperty(PropertyName = "lat")] + public double? Lat { get; set; } + + /// + /// Gets or sets longitude property + /// + [JsonProperty(PropertyName = "lon")] + public double? Lon { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/DataSources.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/DataSources.cs new file mode 100644 index 000000000000..0aeb55150d8f --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/DataSources.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Optional section. Reference ids for use with the [Get Search + /// Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) + /// API. + /// + public partial class DataSources + { + /// + /// Initializes a new instance of the DataSources class. + /// + public DataSources() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSources class. + /// + public DataSources(DataSourcesGeometry geometry = default(DataSourcesGeometry)) + { + Geometry = geometry; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public DataSourcesGeometry Geometry { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/DataSourcesGeometry.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/DataSourcesGeometry.cs new file mode 100644 index 000000000000..74af2d1b03a1 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/DataSourcesGeometry.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information about the geometric shape of the result. Only present if + /// type == Geography. + /// + public partial class DataSourcesGeometry + { + /// + /// Initializes a new instance of the DataSourcesGeometry class. + /// + public DataSourcesGeometry() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSourcesGeometry class. + /// + /// Pass this as geometryId to the [Get Search + /// Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) + /// API to fetch geometry information for this result. + public DataSourcesGeometry(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets pass this as geometryId to the [Get Search + /// Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) + /// API to fetch geometry information for this result. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/EntityType.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/EntityType.cs new file mode 100644 index 000000000000..799ce145db1c --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/EntityType.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for EntityType. + /// + public static class EntityType + { + /// + /// Country name + /// + public const string Country = "Country"; + /// + /// State or Province + /// + public const string CountrySubdivision = "CountrySubdivision"; + /// + /// County + /// + public const string CountrySecondarySubdivision = "CountrySecondarySubdivision"; + /// + /// Named Area + /// + public const string CountryTertiarySubdivision = "CountryTertiarySubdivision"; + /// + /// City / Town + /// + public const string Municipality = "Municipality"; + /// + /// Sub / Super City + /// + public const string MunicipalitySubdivision = "MunicipalitySubdivision"; + /// + /// Neighbourhood + /// + public const string Neighbourhood = "Neighbourhood"; + /// + /// Postal Code / Zip Code + /// + public const string PostalCodeArea = "PostalCodeArea"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/EntryPointType.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/EntryPointType.cs new file mode 100644 index 000000000000..a959ee9cb595 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/EntryPointType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for EntryPointType. + /// + public static class EntryPointType + { + public const string Main = "main"; + public const string Minor = "minor"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..e3c08fd63c0d --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorDetail.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..8ab69592862f --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..d1df3b39ab1e --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorResponseException.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..857cbf3f40e9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeature.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeature.cs new file mode 100644 index 000000000000..1cf255da6512 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeature.cs @@ -0,0 +1,121 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A valid `GeoJSON Feature` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.2) for details. + /// + public partial class GeoJsonFeature + { + /// + /// Initializes a new instance of the GeoJsonFeature class. + /// + public GeoJsonFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeature class. + /// + /// Specifies the `GeoJSON` type. Must be one of the + /// nine valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// Properties can contain any additional + /// metadata about the `Feature`. Value can be any JSON object or a + /// JSON null value + /// Identifier for the feature. + /// The type of the feature. The value + /// depends on the data model the current feature is part of. Some data + /// models may have an empty value. + public GeoJsonFeature(string type, GeoJsonGeometry geometry, object properties = default(object), string id = default(string), string featureType = default(string)) + { + Type = type; + Geometry = geometry; + Properties = properties; + Id = id; + FeatureType = featureType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the `GeoJSON` type. Must be one of the nine + /// valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + /// + /// Gets or sets properties can contain any additional metadata about + /// the `Feature`. Value can be any JSON object or a JSON null value + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets identifier for the feature. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the type of the feature. The value depends on the data + /// model the current feature is part of. Some data models may have an + /// empty value. + /// + [JsonProperty(PropertyName = "featureType")] + public string FeatureType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (Geometry == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometry"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureCollection.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureCollection.cs new file mode 100644 index 000000000000..f75153692eb7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureCollection.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON FeatureCollection` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. + /// + public partial class GeoJsonFeatureCollection + { + /// + /// Initializes a new instance of the GeoJsonFeatureCollection class. + /// + public GeoJsonFeatureCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureCollection class. + /// + /// Specifies the `GeoJSON` type. Must be one of the + /// nine valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// Contains a list of valid `GeoJSON Feature` + /// objects. + public GeoJsonFeatureCollection(string type, IList features) + { + Type = type; + Features = features; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the `GeoJSON` type. Must be one of the nine + /// valid GeoJSON object types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature + /// and FeatureCollection. Possible values include: 'GeoJsonPoint', + /// 'GeoJsonMultiPoint', 'GeoJsonLineString', 'GeoJsonMultiLineString', + /// 'GeoJsonPolygon', 'GeoJsonMultiPolygon', + /// 'GeoJsonGeometryCollection', 'GeoJsonFeature', + /// 'GeoJsonFeatureCollection' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets contains a list of valid `GeoJSON Feature` objects. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (Features == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Features"); + } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureCollectionData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureCollectionData.cs new file mode 100644 index 000000000000..d5787471286c --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureCollectionData.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonFeatureCollectionData + { + /// + /// Initializes a new instance of the GeoJsonFeatureCollectionData + /// class. + /// + public GeoJsonFeatureCollectionData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureCollectionData + /// class. + /// + /// Contains a list of valid `GeoJSON Feature` + /// objects. + public GeoJsonFeatureCollectionData(IList features) + { + Features = features; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Feature` objects. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Features == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Features"); + } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureData.cs new file mode 100644 index 000000000000..0cf2c65fff25 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonFeatureData.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class GeoJsonFeatureData + { + /// + /// Initializes a new instance of the GeoJsonFeatureData class. + /// + public GeoJsonFeatureData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonFeatureData class. + /// + /// Properties can contain any additional + /// metadata about the `Feature`. Value can be any JSON object or a + /// JSON null value + /// Identifier for the feature. + /// The type of the feature. The value + /// depends on the data model the current feature is part of. Some data + /// models may have an empty value. + public GeoJsonFeatureData(GeoJsonGeometry geometry, object properties = default(object), string id = default(string), string featureType = default(string)) + { + Geometry = geometry; + Properties = properties; + Id = id; + FeatureType = featureType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonGeometry Geometry { get; set; } + + /// + /// Gets or sets properties can contain any additional metadata about + /// the `Feature`. Value can be any JSON object or a JSON null value + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets identifier for the feature. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the type of the feature. The value depends on the data + /// model the current feature is part of. Some data models may have an + /// empty value. + /// + [JsonProperty(PropertyName = "featureType")] + public string FeatureType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometry == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometry"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometry.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometry.cs new file mode 100644 index 000000000000..8909bcb3533b --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometry.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using System.Linq; + + /// + /// A valid `GeoJSON` geometry object. The type must be one of the seven + /// valid GeoJSON geometry types - Point, MultiPoint, LineString, + /// MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please + /// refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) + /// for details. + /// + public partial class GeoJsonGeometry : GeoJsonObject + { + /// + /// Initializes a new instance of the GeoJsonGeometry class. + /// + public GeoJsonGeometry() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometryCollection.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometryCollection.cs new file mode 100644 index 000000000000..e73eee3fc3bd --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometryCollection.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON GeometryCollection` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.8) for details. + /// + public partial class GeoJsonGeometryCollection + { + /// + /// Initializes a new instance of the GeoJsonGeometryCollection class. + /// + public GeoJsonGeometryCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonGeometryCollection class. + /// + /// Contains a list of valid `GeoJSON` + /// geometry objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonGeometryCollection(IList geometries) + { + Geometries = geometries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON` geometry objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "geometries")] + public IList Geometries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometries"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometryCollectionData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometryCollectionData.cs new file mode 100644 index 000000000000..8ffcf3d9fff6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonGeometryCollectionData.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonGeometryCollectionData + { + /// + /// Initializes a new instance of the GeoJsonGeometryCollectionData + /// class. + /// + public GeoJsonGeometryCollectionData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonGeometryCollectionData + /// class. + /// + /// Contains a list of valid `GeoJSON` + /// geometry objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonGeometryCollectionData(IList geometries) + { + Geometries = geometries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON` geometry objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "geometries")] + public IList Geometries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Geometries"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonLineString.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonLineString.cs new file mode 100644 index 000000000000..ae3b7295eaba --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonLineString.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON LineString` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. + /// + public partial class GeoJsonLineString + { + /// + /// Initializes a new instance of the GeoJsonLineString class. + /// + public GeoJsonLineString() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonLineString class. + /// + /// Coordinates for the `GeoJson LineString` + /// geometry. + public GeoJsonLineString(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson LineString` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonLineStringData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonLineStringData.cs new file mode 100644 index 000000000000..5dcb10b9d195 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonLineStringData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonLineStringData + { + /// + /// Initializes a new instance of the GeoJsonLineStringData class. + /// + public GeoJsonLineStringData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonLineStringData class. + /// + /// Coordinates for the `GeoJson LineString` + /// geometry. + public GeoJsonLineStringData(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson LineString` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiLineString.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiLineString.cs new file mode 100644 index 000000000000..7348c126eb51 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiLineString.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiLineString` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.5) for details. + /// + public partial class GeoJsonMultiLineString + { + /// + /// Initializes a new instance of the GeoJsonMultiLineString class. + /// + public GeoJsonMultiLineString() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiLineString class. + /// + /// Coordinates for the `GeoJson + /// MultiLineString` geometry. + public GeoJsonMultiLineString(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiLineString` + /// geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiLineStringData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiLineStringData.cs new file mode 100644 index 000000000000..fd26b0fecad9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiLineStringData.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonMultiLineStringData + { + /// + /// Initializes a new instance of the GeoJsonMultiLineStringData class. + /// + public GeoJsonMultiLineStringData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiLineStringData class. + /// + /// Coordinates for the `GeoJson + /// MultiLineString` geometry. + public GeoJsonMultiLineStringData(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiLineString` + /// geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPoint.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPoint.cs new file mode 100644 index 000000000000..9fa1b10691fe --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPoint.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiPoint` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.3) for details. + /// + public partial class GeoJsonMultiPoint + { + /// + /// Initializes a new instance of the GeoJsonMultiPoint class. + /// + public GeoJsonMultiPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPoint class. + /// + /// Coordinates for the `GeoJson MultiPoint` + /// geometry. + public GeoJsonMultiPoint(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiPoint` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPointData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPointData.cs new file mode 100644 index 000000000000..e7c4775d9ac6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPointData.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data contained by a `GeoJson MultiPoint`. + /// + public partial class GeoJsonMultiPointData + { + /// + /// Initializes a new instance of the GeoJsonMultiPointData class. + /// + public GeoJsonMultiPointData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPointData class. + /// + /// Coordinates for the `GeoJson MultiPoint` + /// geometry. + public GeoJsonMultiPointData(IList> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson MultiPoint` geometry. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPolygon.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPolygon.cs new file mode 100644 index 000000000000..6a36be63570c --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPolygon.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON MultiPolygon` object type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.7) for details. + /// + public partial class GeoJsonMultiPolygon + { + /// + /// Initializes a new instance of the GeoJsonMultiPolygon class. + /// + public GeoJsonMultiPolygon() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPolygon class. + /// + /// Contains a list of valid `GeoJSON + /// Polygon` objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonMultiPolygon(IList>>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Polygon` objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPolygonData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPolygonData.cs new file mode 100644 index 000000000000..4c2cf7306c2d --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonMultiPolygonData.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonMultiPolygonData + { + /// + /// Initializes a new instance of the GeoJsonMultiPolygonData class. + /// + public GeoJsonMultiPolygonData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonMultiPolygonData class. + /// + /// Contains a list of valid `GeoJSON + /// Polygon` objects. **Note** that coordinates in GeoJSON are in x, y + /// order (longitude, latitude). + public GeoJsonMultiPolygonData(IList>>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contains a list of valid `GeoJSON Polygon` objects. + /// **Note** that coordinates in GeoJSON are in x, y order (longitude, + /// latitude). + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonObject.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonObject.cs new file mode 100644 index 000000000000..3e4726332695 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonObject.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using System.Linq; + + /// + /// A valid `GeoJSON` object. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3) for details. + /// + public partial class GeoJsonObject + { + /// + /// Initializes a new instance of the GeoJsonObject class. + /// + public GeoJsonObject() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonObjectType.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonObjectType.cs new file mode 100644 index 000000000000..fd4ff5de3e73 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonObjectType.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for GeoJsonObjectType. + /// + public static class GeoJsonObjectType + { + /// + /// `GeoJSON Point` geometry. + /// + public const string GeoJsonPoint = "Point"; + /// + /// `GeoJSON MultiPoint` geometry. + /// + public const string GeoJsonMultiPoint = "MultiPoint"; + /// + /// `GeoJSON LineString` geometry. + /// + public const string GeoJsonLineString = "LineString"; + /// + /// `GeoJSON MultiLineString` geometry. + /// + public const string GeoJsonMultiLineString = "MultiLineString"; + /// + /// `GeoJSON Polygon` geometry. + /// + public const string GeoJsonPolygon = "Polygon"; + /// + /// `GeoJSON MultiPolygon` geometry. + /// + public const string GeoJsonMultiPolygon = "MultiPolygon"; + /// + /// `GeoJSON GeometryCollection` geometry. + /// + public const string GeoJsonGeometryCollection = "GeometryCollection"; + /// + /// `GeoJSON Feature` object. + /// + public const string GeoJsonFeature = "Feature"; + /// + /// `GeoJSON FeatureCollection` object. + /// + public const string GeoJsonFeatureCollection = "FeatureCollection"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPoint.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPoint.cs new file mode 100644 index 000000000000..d1bee06d6c5d --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPoint.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON Point` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details. + /// + public partial class GeoJsonPoint + { + /// + /// Initializes a new instance of the GeoJsonPoint class. + /// + public GeoJsonPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPoint class. + /// + public GeoJsonPoint(IList coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "coordinates")] + public IList Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPointData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPointData.cs new file mode 100644 index 000000000000..ea6c5a021942 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPointData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data contained by a `GeoJson Point`. + /// + public partial class GeoJsonPointData + { + /// + /// Initializes a new instance of the GeoJsonPointData class. + /// + public GeoJsonPointData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPointData class. + /// + public GeoJsonPointData(IList coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "coordinates")] + public IList Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPolygon.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPolygon.cs new file mode 100644 index 000000000000..d00384a6c8ef --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPolygon.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A valid `GeoJSON Polygon` geometry type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.6) for details. + /// + public partial class GeoJsonPolygon + { + /// + /// Initializes a new instance of the GeoJsonPolygon class. + /// + public GeoJsonPolygon() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPolygon class. + /// + /// Coordinates for the `GeoJson Polygon` + /// geometry type. + public GeoJsonPolygon(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson Polygon` geometry type. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPolygonData.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPolygonData.cs new file mode 100644 index 000000000000..dc03b54a7025 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeoJsonPolygonData.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class GeoJsonPolygonData + { + /// + /// Initializes a new instance of the GeoJsonPolygonData class. + /// + public GeoJsonPolygonData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GeoJsonPolygonData class. + /// + /// Coordinates for the `GeoJson Polygon` + /// geometry type. + public GeoJsonPolygonData(IList>> coordinates) + { + Coordinates = coordinates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets coordinates for the `GeoJson Polygon` geometry type. + /// + [JsonProperty(PropertyName = "coordinates")] + public IList>> Coordinates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Coordinates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Coordinates"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeographicResourceLocation.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeographicResourceLocation.cs new file mode 100644 index 000000000000..a919e48e6732 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/GeographicResourceLocation.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for GeographicResourceLocation. + /// + public static class GeographicResourceLocation + { + /// + /// Used to access an Azure Maps Creator resource in the United States + /// + public const string Us = "us"; + /// + /// Used to access an Azure Maps Creator resource in Europe + /// + public const string Eu = "eu"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/OpeningHours.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/OpeningHours.cs new file mode 100644 index 000000000000..bca64f6f3a86 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/OpeningHours.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for OpeningHours. + /// + public static class OpeningHours + { + /// + /// Shows the hours of operation for the next week, starting with the + /// current day in the local time of the POI. + /// + public const string NextSevenDays = "nextSevenDays"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/PoiCategoryResult.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/PoiCategoryResult.cs new file mode 100644 index 000000000000..38249420a4f8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/PoiCategoryResult.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// POI category result + /// + public partial class PoiCategoryResult + { + /// + /// Initializes a new instance of the PoiCategoryResult class. + /// + public PoiCategoryResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PoiCategoryResult class. + /// + /// Unique ID for the category. ID can be used to + /// restrict search results to specific categories through other Search + /// Service APIs, like [Get Search + /// POI](https://docs.microsoft.com/rest/api/maps/search/getsearchpoi). + /// Name of the category + /// Array of child category ids + /// Array of alternative names of the + /// category + public PoiCategoryResult(int? id = default(int?), string name = default(string), IList childCategoryIds = default(IList), IList synonyms = default(IList)) + { + Id = id; + Name = name; + ChildCategoryIds = childCategoryIds; + Synonyms = synonyms; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets unique ID for the category. ID can be used to restrict search + /// results to specific categories through other Search Service APIs, + /// like [Get Search + /// POI](https://docs.microsoft.com/rest/api/maps/search/getsearchpoi). + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; private set; } + + /// + /// Gets name of the category + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets array of child category ids + /// + [JsonProperty(PropertyName = "childCategoryIds")] + public IList ChildCategoryIds { get; private set; } + + /// + /// Gets array of alternative names of the category + /// + [JsonProperty(PropertyName = "synonyms")] + public IList Synonyms { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchItem.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchItem.cs new file mode 100644 index 000000000000..9ebe3c7950ba --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchItem.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An item returned from Search Address Batch service call. + /// + public partial class SearchAddressBatchItem : BatchItem + { + /// + /// Initializes a new instance of the SearchAddressBatchItem class. + /// + public SearchAddressBatchItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressBatchItem class. + /// + /// HTTP request status code. + /// The result of the query. + /// SearchCommonResponse if the query completed successfully, + /// ErrorResponse otherwise. + public SearchAddressBatchItem(double? statusCode = default(double?), SearchAddressBatchItemResponse response = default(SearchAddressBatchItemResponse)) + : base(statusCode) + { + Response = response; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the result of the query. SearchCommonResponse if the query + /// completed successfully, ErrorResponse otherwise. + /// + [JsonProperty(PropertyName = "response")] + public SearchAddressBatchItemResponse Response { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchItemResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchItemResponse.cs new file mode 100644 index 000000000000..b464f1729244 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchItemResponse.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of the query. SearchCommonResponse if the query completed + /// successfully, ErrorResponse otherwise. + /// + public partial class SearchAddressBatchItemResponse + { + /// + /// Initializes a new instance of the SearchAddressBatchItemResponse + /// class. + /// + public SearchAddressBatchItemResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressBatchItemResponse + /// class. + /// + /// Summary object for a Search API + /// response + /// A list of Search API results. + /// The error object. + public SearchAddressBatchItemResponse(SearchCommonSummary summary = default(SearchCommonSummary), IList results = default(IList), ErrorDetail error = default(ErrorDetail)) + { + Summary = summary; + Results = results; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary object for a Search API response + /// + [JsonProperty(PropertyName = "summary")] + public SearchCommonSummary Summary { get; private set; } + + /// + /// Gets a list of Search API results. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchResponse.cs new file mode 100644 index 000000000000..6808d6e3e010 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressBatchResponse.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search Address Batch service + /// call. + /// + public partial class SearchAddressBatchResponse : BatchResponse + { + /// + /// Initializes a new instance of the SearchAddressBatchResponse class. + /// + public SearchAddressBatchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressBatchResponse class. + /// + /// Summary for the batch request + /// Array containing the batch + /// results. + public SearchAddressBatchResponse(BatchResponseSummary summary = default(BatchResponseSummary), IList batchItems = default(IList)) + : base(summary) + { + BatchItems = batchItems; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets array containing the batch results. + /// + [JsonProperty(PropertyName = "batchItems")] + public IList BatchItems { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchItem.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchItem.cs new file mode 100644 index 000000000000..44d0c46259e7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchItem.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An item returned from Search Address Reverse Batch service call. + /// + public partial class SearchAddressReverseBatchItem : BatchItem + { + /// + /// Initializes a new instance of the SearchAddressReverseBatchItem + /// class. + /// + public SearchAddressReverseBatchItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressReverseBatchItem + /// class. + /// + /// HTTP request status code. + /// The result of the query. + /// SearchAddressReverseResponse if the query completed successfully, + /// ErrorResponse otherwise. + public SearchAddressReverseBatchItem(double? statusCode = default(double?), SearchAddressReverseBatchItemResponse response = default(SearchAddressReverseBatchItemResponse)) + : base(statusCode) + { + Response = response; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the result of the query. SearchAddressReverseResponse if the + /// query completed successfully, ErrorResponse otherwise. + /// + [JsonProperty(PropertyName = "response")] + public SearchAddressReverseBatchItemResponse Response { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchItemResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchItemResponse.cs new file mode 100644 index 000000000000..fd7a31e3a3e7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchItemResponse.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of the query. SearchAddressReverseResponse if the query + /// completed successfully, ErrorResponse otherwise. + /// + public partial class SearchAddressReverseBatchItemResponse + { + /// + /// Initializes a new instance of the + /// SearchAddressReverseBatchItemResponse class. + /// + public SearchAddressReverseBatchItemResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchAddressReverseBatchItemResponse class. + /// + /// Summary object for a Search Address Reverse + /// response + /// Addresses array + /// The error object. + public SearchAddressReverseBatchItemResponse(SearchCommonSummary summary = default(SearchCommonSummary), IList addresses = default(IList), ErrorDetail error = default(ErrorDetail)) + { + Summary = summary; + Addresses = addresses; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary object for a Search Address Reverse response + /// + [JsonProperty(PropertyName = "summary")] + public SearchCommonSummary Summary { get; private set; } + + /// + /// Gets addresses array + /// + [JsonProperty(PropertyName = "addresses")] + public IList Addresses { get; private set; } + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchResponse.cs new file mode 100644 index 000000000000..a37e614bb4d7 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseBatchResponse.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search Address Reverse Batch + /// service call. + /// + public partial class SearchAddressReverseBatchResponse : BatchResponse + { + /// + /// Initializes a new instance of the SearchAddressReverseBatchResponse + /// class. + /// + public SearchAddressReverseBatchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressReverseBatchResponse + /// class. + /// + /// Summary for the batch request + /// Array containing the batch + /// results. + public SearchAddressReverseBatchResponse(BatchResponseSummary summary = default(BatchResponseSummary), IList batchItems = default(IList)) + : base(summary) + { + BatchItems = batchItems; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets array containing the batch results. + /// + [JsonProperty(PropertyName = "batchItems")] + public IList BatchItems { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseCrossStreetResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseCrossStreetResponse.cs new file mode 100644 index 000000000000..0a8ffe3a743a --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseCrossStreetResponse.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search Address Reverse + /// CrossStreet call + /// + public partial class SearchAddressReverseCrossStreetResponse + { + /// + /// Initializes a new instance of the + /// SearchAddressReverseCrossStreetResponse class. + /// + public SearchAddressReverseCrossStreetResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchAddressReverseCrossStreetResponse class. + /// + /// Summary object for a Search Address Reverse + /// Cross Street response + /// Addresses array + public SearchAddressReverseCrossStreetResponse(SearchCommonSummary summary = default(SearchCommonSummary), IList addresses = default(IList)) + { + Summary = summary; + Addresses = addresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary object for a Search Address Reverse Cross Street + /// response + /// + [JsonProperty(PropertyName = "summary")] + public SearchCommonSummary Summary { get; private set; } + + /// + /// Gets addresses array + /// + [JsonProperty(PropertyName = "addresses")] + public IList Addresses { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseCrossStreetResult.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseCrossStreetResult.cs new file mode 100644 index 000000000000..f8722bd58e9e --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseCrossStreetResult.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Result object for a Search Address Reverse Cross Street response + /// + public partial class SearchAddressReverseCrossStreetResult + { + /// + /// Initializes a new instance of the + /// SearchAddressReverseCrossStreetResult class. + /// + public SearchAddressReverseCrossStreetResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchAddressReverseCrossStreetResult class. + /// + /// Position property in the form of + /// "{latitude},{longitude}" + public SearchAddressReverseCrossStreetResult(SearchResultAddress address = default(SearchResultAddress), string position = default(string)) + { + Address = address; + Position = position; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "address")] + public SearchResultAddress Address { get; set; } + + /// + /// Gets position property in the form of "{latitude},{longitude}" + /// + [JsonProperty(PropertyName = "position")] + public string Position { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseResponse.cs new file mode 100644 index 000000000000..a684d2a78126 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseResponse.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search Address Reverse call + /// + public partial class SearchAddressReverseResponse + { + /// + /// Initializes a new instance of the SearchAddressReverseResponse + /// class. + /// + public SearchAddressReverseResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressReverseResponse + /// class. + /// + /// Summary object for a Search Address Reverse + /// response + /// Addresses array + public SearchAddressReverseResponse(SearchCommonSummary summary = default(SearchCommonSummary), IList addresses = default(IList)) + { + Summary = summary; + Addresses = addresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary object for a Search Address Reverse response + /// + [JsonProperty(PropertyName = "summary")] + public SearchCommonSummary Summary { get; private set; } + + /// + /// Gets addresses array + /// + [JsonProperty(PropertyName = "addresses")] + public IList Addresses { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseResult.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseResult.cs new file mode 100644 index 000000000000..94ce0689b8d0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAddressReverseResult.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Result object for a Search Address Reverse response + /// + public partial class SearchAddressReverseResult + { + /// + /// Initializes a new instance of the SearchAddressReverseResult class. + /// + public SearchAddressReverseResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAddressReverseResult class. + /// + /// Position property in the form of + /// "{latitude},{longitude}" + /// Information on the type of match. + /// + /// One of: + /// * AddressPoint + /// * HouseNumberRange + /// * Street + public SearchAddressReverseResult(SearchResultAddress address = default(SearchResultAddress), string position = default(string), string matchType = default(string)) + { + Address = address; + Position = position; + MatchType = matchType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "address")] + public SearchResultAddress Address { get; set; } + + /// + /// Gets position property in the form of "{latitude},{longitude}" + /// + [JsonProperty(PropertyName = "position")] + public string Position { get; private set; } + + /// + /// Gets information on the type of match. + /// + /// One of: + /// * AddressPoint + /// * HouseNumberRange + /// * Street + /// + [JsonProperty(PropertyName = "matchType")] + public string MatchType { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAlongRouteRequestBody.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAlongRouteRequestBody.cs new file mode 100644 index 000000000000..44a4619d202f --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchAlongRouteRequestBody.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This type represents the request body for the Search Along Route + /// service. + /// + public partial class SearchAlongRouteRequestBody + { + /// + /// Initializes a new instance of the SearchAlongRouteRequestBody + /// class. + /// + public SearchAlongRouteRequestBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchAlongRouteRequestBody + /// class. + /// + public SearchAlongRouteRequestBody(GeoJsonLineString route = default(GeoJsonLineString)) + { + Route = route; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "route")] + public GeoJsonLineString Route { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Route != null) + { + Route.Validate(); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonResponse.cs new file mode 100644 index 000000000000..fea152369695 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonResponse.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search calls. + /// + public partial class SearchCommonResponse + { + /// + /// Initializes a new instance of the SearchCommonResponse class. + /// + public SearchCommonResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchCommonResponse class. + /// + /// Summary object for a Search API + /// response + /// A list of Search API results. + public SearchCommonResponse(SearchCommonSummary summary = default(SearchCommonSummary), IList results = default(IList)) + { + Summary = summary; + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary object for a Search API response + /// + [JsonProperty(PropertyName = "summary")] + public SearchCommonSummary Summary { get; private set; } + + /// + /// Gets a list of Search API results. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonResult.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonResult.cs new file mode 100644 index 000000000000..d4eee97cde76 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonResult.cs @@ -0,0 +1,178 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result object for a Search API response. + /// + public partial class SearchCommonResult + { + /// + /// Initializes a new instance of the SearchCommonResult class. + /// + public SearchCommonResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchCommonResult class. + /// + /// One of: + /// * POI + /// * Street + /// * Geography + /// * Point Address + /// * Address Range + /// * Cross Street + /// Id property + /// Info property + /// Possible values include: 'Country', + /// 'CountrySubdivision', 'CountrySecondarySubdivision', + /// 'CountryTertiarySubdivision', 'Municipality', + /// 'MunicipalitySubdivision', 'Neighbourhood', + /// 'PostalCodeArea' + /// Entry Points array + /// Information on the type of match. + /// + /// One of: + /// * AddressPoint + /// * HouseNumberRange + /// * Street + /// Detour time in seconds + public SearchCommonResult(string type = default(string), string id = default(string), double? score = default(double?), double? dist = default(double?), string info = default(string), string entityType = default(string), SearchResultPoi poi = default(SearchResultPoi), SearchResultAddress address = default(SearchResultAddress), CoordinatesPairAbbreviated position = default(CoordinatesPairAbbreviated), SearchResultViewport viewport = default(SearchResultViewport), IList entryPoints = default(IList), SearchResultAddressRanges addressRanges = default(SearchResultAddressRanges), DataSources dataSources = default(DataSources), string matchType = default(string), double? detourTime = default(double?)) + { + Type = type; + Id = id; + Score = score; + Dist = dist; + Info = info; + EntityType = entityType; + Poi = poi; + Address = address; + Position = position; + Viewport = viewport; + EntryPoints = entryPoints; + AddressRanges = addressRanges; + DataSources = dataSources; + MatchType = matchType; + DetourTime = detourTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets one of: + /// * POI + /// * Street + /// * Geography + /// * Point Address + /// * Address Range + /// * Cross Street + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets id property + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "score")] + public double? Score { get; set; } + + /// + /// + [JsonProperty(PropertyName = "dist")] + public double? Dist { get; set; } + + /// + /// Gets info property + /// + [JsonProperty(PropertyName = "info")] + public string Info { get; private set; } + + /// + /// Gets or sets possible values include: 'Country', + /// 'CountrySubdivision', 'CountrySecondarySubdivision', + /// 'CountryTertiarySubdivision', 'Municipality', + /// 'MunicipalitySubdivision', 'Neighbourhood', 'PostalCodeArea' + /// + [JsonProperty(PropertyName = "entityType")] + public string EntityType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "poi")] + public SearchResultPoi Poi { get; set; } + + /// + /// + [JsonProperty(PropertyName = "address")] + public SearchResultAddress Address { get; set; } + + /// + /// + [JsonProperty(PropertyName = "position")] + public CoordinatesPairAbbreviated Position { get; set; } + + /// + /// + [JsonProperty(PropertyName = "viewport")] + public SearchResultViewport Viewport { get; set; } + + /// + /// Gets entry Points array + /// + [JsonProperty(PropertyName = "entryPoints")] + public IList EntryPoints { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "addressRanges")] + public SearchResultAddressRanges AddressRanges { get; set; } + + /// + /// + [JsonProperty(PropertyName = "dataSources")] + public DataSources DataSources { get; set; } + + /// + /// Gets information on the type of match. + /// + /// One of: + /// * AddressPoint + /// * HouseNumberRange + /// * Street + /// + [JsonProperty(PropertyName = "matchType")] + public string MatchType { get; private set; } + + /// + /// Gets detour time in seconds + /// + [JsonProperty(PropertyName = "detourTime")] + public double? DetourTime { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonSummary.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonSummary.cs new file mode 100644 index 000000000000..245b0c4d018c --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonSummary.cs @@ -0,0 +1,123 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary object for a Search API response. + /// + public partial class SearchCommonSummary + { + /// + /// Initializes a new instance of the SearchCommonSummary class. + /// + public SearchCommonSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchCommonSummary class. + /// + /// Query property + /// QueryType property + /// QueryTime property + /// NumResults property + /// Maximum number of responses that will be + /// returned + /// Offset property + /// TotalResults property + /// FuzzyLevel property + /// Indication when the internal search engine + /// has applied a geospatial bias to improve the ranking of results. + /// In some methods, this can be affected by setting the lat and lon + /// parameters where available. In other cases it is purely + /// internal. + public SearchCommonSummary(string query = default(string), string queryType = default(string), int? queryTime = default(int?), int? numResults = default(int?), int? limit = default(int?), int? offset = default(int?), int? totalResults = default(int?), int? fuzzyLevel = default(int?), SearchCommonSummaryGeoBias geoBias = default(SearchCommonSummaryGeoBias)) + { + Query = query; + QueryType = queryType; + QueryTime = queryTime; + NumResults = numResults; + Limit = limit; + Offset = offset; + TotalResults = totalResults; + FuzzyLevel = fuzzyLevel; + GeoBias = geoBias; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets query property + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; private set; } + + /// + /// Gets queryType property + /// + [JsonProperty(PropertyName = "queryType")] + public string QueryType { get; private set; } + + /// + /// Gets queryTime property + /// + [JsonProperty(PropertyName = "queryTime")] + public int? QueryTime { get; private set; } + + /// + /// Gets numResults property + /// + [JsonProperty(PropertyName = "numResults")] + public int? NumResults { get; private set; } + + /// + /// Gets maximum number of responses that will be returned + /// + [JsonProperty(PropertyName = "limit")] + public int? Limit { get; private set; } + + /// + /// Gets offset property + /// + [JsonProperty(PropertyName = "offset")] + public int? Offset { get; private set; } + + /// + /// Gets totalResults property + /// + [JsonProperty(PropertyName = "totalResults")] + public int? TotalResults { get; private set; } + + /// + /// Gets fuzzyLevel property + /// + [JsonProperty(PropertyName = "fuzzyLevel")] + public int? FuzzyLevel { get; private set; } + + /// + /// Gets indication when the internal search engine has applied a + /// geospatial bias to improve the ranking of results. In some + /// methods, this can be affected by setting the lat and lon parameters + /// where available. In other cases it is purely internal. + /// + [JsonProperty(PropertyName = "geoBias")] + public SearchCommonSummaryGeoBias GeoBias { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonSummaryGeoBias.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonSummaryGeoBias.cs new file mode 100644 index 000000000000..4f38b2a465a0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchCommonSummaryGeoBias.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using System.Linq; + + /// + /// Indication when the internal search engine has applied a geospatial + /// bias to improve the ranking of results. In some methods, this can be + /// affected by setting the lat and lon parameters where available. In + /// other cases it is purely internal. + /// + public partial class SearchCommonSummaryGeoBias : CoordinatesPairAbbreviated + { + /// + /// Initializes a new instance of the SearchCommonSummaryGeoBias class. + /// + public SearchCommonSummaryGeoBias() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchCommonSummaryGeoBias class. + /// + /// Latitude property + /// Longitude property + public SearchCommonSummaryGeoBias(double? lat = default(double?), double? lon = default(double?)) + : base(lat, lon) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchItem.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchItem.cs new file mode 100644 index 000000000000..c4ddc123ac78 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchItem.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An item returned from Search Fuzzy Batch service call. + /// + public partial class SearchFuzzyBatchItem : BatchItem + { + /// + /// Initializes a new instance of the SearchFuzzyBatchItem class. + /// + public SearchFuzzyBatchItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchFuzzyBatchItem class. + /// + /// HTTP request status code. + /// The result of the query. + /// SearchCommonResponse if the query completed successfully, + /// ErrorResponse otherwise. + public SearchFuzzyBatchItem(double? statusCode = default(double?), SearchFuzzyBatchItemResponse response = default(SearchFuzzyBatchItemResponse)) + : base(statusCode) + { + Response = response; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the result of the query. SearchCommonResponse if the query + /// completed successfully, ErrorResponse otherwise. + /// + [JsonProperty(PropertyName = "response")] + public SearchFuzzyBatchItemResponse Response { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchItemResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchItemResponse.cs new file mode 100644 index 000000000000..fd4ea5b2e52b --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchItemResponse.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of the query. SearchCommonResponse if the query completed + /// successfully, ErrorResponse otherwise. + /// + public partial class SearchFuzzyBatchItemResponse + { + /// + /// Initializes a new instance of the SearchFuzzyBatchItemResponse + /// class. + /// + public SearchFuzzyBatchItemResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchFuzzyBatchItemResponse + /// class. + /// + /// Summary object for a Search API + /// response + /// A list of Search API results. + /// The error object. + public SearchFuzzyBatchItemResponse(SearchCommonSummary summary = default(SearchCommonSummary), IList results = default(IList), ErrorDetail error = default(ErrorDetail)) + { + Summary = summary; + Results = results; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets summary object for a Search API response + /// + [JsonProperty(PropertyName = "summary")] + public SearchCommonSummary Summary { get; private set; } + + /// + /// Gets a list of Search API results. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchResponse.cs new file mode 100644 index 000000000000..3c2731016eab --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchFuzzyBatchResponse.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search Fuzzy Batch service + /// call. + /// + public partial class SearchFuzzyBatchResponse : BatchResponse + { + /// + /// Initializes a new instance of the SearchFuzzyBatchResponse class. + /// + public SearchFuzzyBatchResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchFuzzyBatchResponse class. + /// + /// Summary for the batch request + /// Array containing the batch + /// results. + public SearchFuzzyBatchResponse(BatchResponseSummary summary = default(BatchResponseSummary), IList batchItems = default(IList)) + : base(summary) + { + BatchItems = batchItems; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets array containing the batch results. + /// + [JsonProperty(PropertyName = "batchItems")] + public IList BatchItems { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchAddressBatchHeaders.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchAddressBatchHeaders.cs new file mode 100644 index 000000000000..a59ed7615ad9 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchAddressBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetSearchAddressBatch operation. + /// + public partial class SearchGetSearchAddressBatchHeaders + { + /// + /// Initializes a new instance of the + /// SearchGetSearchAddressBatchHeaders class. + /// + public SearchGetSearchAddressBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchGetSearchAddressBatchHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public SearchGetSearchAddressBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchAddressReverseBatchHeaders.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchAddressReverseBatchHeaders.cs new file mode 100644 index 000000000000..a20071f8ed19 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchAddressReverseBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetSearchAddressReverseBatch operation. + /// + public partial class SearchGetSearchAddressReverseBatchHeaders + { + /// + /// Initializes a new instance of the + /// SearchGetSearchAddressReverseBatchHeaders class. + /// + public SearchGetSearchAddressReverseBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchGetSearchAddressReverseBatchHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public SearchGetSearchAddressReverseBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchFuzzyBatchHeaders.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchFuzzyBatchHeaders.cs new file mode 100644 index 000000000000..f87cb3ae3c42 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchGetSearchFuzzyBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetSearchFuzzyBatch operation. + /// + public partial class SearchGetSearchFuzzyBatchHeaders + { + /// + /// Initializes a new instance of the SearchGetSearchFuzzyBatchHeaders + /// class. + /// + public SearchGetSearchFuzzyBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchGetSearchFuzzyBatchHeaders + /// class. + /// + /// New URL to check for the results of the long + /// running process. + public SearchGetSearchFuzzyBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchIndexSet.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchIndexSet.cs new file mode 100644 index 000000000000..dd626a33f7b5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchIndexSet.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for SearchIndexSet. + /// + public static class SearchIndexSet + { + /// + /// Address range interpolation + /// + public const string Addr = "Addr"; + /// + /// Geographies + /// + public const string Geo = "Geo"; + /// + /// Point Addresses + /// + public const string PAD = "PAD"; + /// + /// Points of interest + /// + public const string POI = "POI"; + /// + /// Streets + /// + public const string Str = "Str"; + /// + /// Cross Streets (Intersections) + /// + public const string Xstr = "Xstr"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchInsideGeometryRequestBody.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchInsideGeometryRequestBody.cs new file mode 100644 index 000000000000..68f1c3543042 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchInsideGeometryRequestBody.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This type represents the request body for the Search Inside Geometry + /// service. + /// + public partial class SearchInsideGeometryRequestBody + { + /// + /// Initializes a new instance of the SearchInsideGeometryRequestBody + /// class. + /// + public SearchInsideGeometryRequestBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchInsideGeometryRequestBody + /// class. + /// + public SearchInsideGeometryRequestBody(GeoJsonObject geometry = default(GeoJsonObject)) + { + Geometry = geometry; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "geometry")] + public GeoJsonObject Geometry { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPoiCategoryTreeResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPoiCategoryTreeResponse.cs new file mode 100644 index 000000000000..d76b76a0b2cc --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPoiCategoryTreeResponse.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful POI Category Tree call + /// + public partial class SearchPoiCategoryTreeResponse + { + /// + /// Initializes a new instance of the SearchPoiCategoryTreeResponse + /// class. + /// + public SearchPoiCategoryTreeResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchPoiCategoryTreeResponse + /// class. + /// + /// Categories array + public SearchPoiCategoryTreeResponse(IList poiCategories = default(IList)) + { + PoiCategories = poiCategories; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets categories array + /// + [JsonProperty(PropertyName = "poiCategories")] + public IList PoiCategories { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPolygonResponse.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPolygonResponse.cs new file mode 100644 index 000000000000..4fceca07fa35 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPolygonResponse.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful Search Polygon call + /// + public partial class SearchPolygonResponse + { + /// + /// Initializes a new instance of the SearchPolygonResponse class. + /// + public SearchPolygonResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchPolygonResponse class. + /// + /// Results array + public SearchPolygonResponse(IList additionalData = default(IList)) + { + AdditionalData = additionalData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets results array + /// + [JsonProperty(PropertyName = "additionalData")] + public IList AdditionalData { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPolygonResult.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPolygonResult.cs new file mode 100644 index 000000000000..5a5becbead42 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPolygonResult.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class SearchPolygonResult + { + /// + /// Initializes a new instance of the SearchPolygonResult class. + /// + public SearchPolygonResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchPolygonResult class. + /// + /// ID of the returned entity + /// Reason for the failure to obtain data for this + /// provider. + /// Geometry data in GeoJSON format. Please + /// refer to [RFC 7946](https://tools.ietf.org/html/rfc7946) for + /// details. Present only if "error" is not present. + public SearchPolygonResult(string providerID = default(string), string error = default(string), GeoJsonObject geometryData = default(GeoJsonObject)) + { + ProviderID = providerID; + Error = error; + GeometryData = geometryData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets ID of the returned entity + /// + [JsonProperty(PropertyName = "providerID")] + public string ProviderID { get; private set; } + + /// + /// Gets reason for the failure to obtain data for this provider. + /// + [JsonProperty(PropertyName = "error")] + public string Error { get; private set; } + + /// + /// Gets or sets geometry data in GeoJSON format. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946) for details. Present + /// only if "error" is not present. + /// + [JsonProperty(PropertyName = "geometryData")] + public GeoJsonObject GeometryData { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchAddressBatchHeaders.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchAddressBatchHeaders.cs new file mode 100644 index 000000000000..c47b551de3f4 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchAddressBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for PostSearchAddressBatch operation. + /// + public partial class SearchPostSearchAddressBatchHeaders + { + /// + /// Initializes a new instance of the + /// SearchPostSearchAddressBatchHeaders class. + /// + public SearchPostSearchAddressBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchPostSearchAddressBatchHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public SearchPostSearchAddressBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchAddressReverseBatchHeaders.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchAddressReverseBatchHeaders.cs new file mode 100644 index 000000000000..bcc5e09f8e8d --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchAddressReverseBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for PostSearchAddressReverseBatch operation. + /// + public partial class SearchPostSearchAddressReverseBatchHeaders + { + /// + /// Initializes a new instance of the + /// SearchPostSearchAddressReverseBatchHeaders class. + /// + public SearchPostSearchAddressReverseBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchPostSearchAddressReverseBatchHeaders class. + /// + /// New URL to check for the results of the long + /// running process. + public SearchPostSearchAddressReverseBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchFuzzyBatchHeaders.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchFuzzyBatchHeaders.cs new file mode 100644 index 000000000000..8d02237b2cde --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchPostSearchFuzzyBatchHeaders.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for PostSearchFuzzyBatch operation. + /// + public partial class SearchPostSearchFuzzyBatchHeaders + { + /// + /// Initializes a new instance of the SearchPostSearchFuzzyBatchHeaders + /// class. + /// + public SearchPostSearchFuzzyBatchHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchPostSearchFuzzyBatchHeaders + /// class. + /// + /// New URL to check for the results of the long + /// running process. + public SearchPostSearchFuzzyBatchHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new URL to check for the results of the long running + /// process. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultAddress.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultAddress.cs new file mode 100644 index 000000000000..d7a15c87ea7b --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultAddress.cs @@ -0,0 +1,227 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The address of the result + /// + public partial class SearchResultAddress + { + /// + /// Initializes a new instance of the SearchResultAddress class. + /// + public SearchResultAddress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultAddress class. + /// + /// Building Number property + /// Street property + /// Cross Street property + /// Street Number property + /// number of routes + /// Street Name property + /// Street Name and Number + /// property + /// Municipality property + /// Municipality Subdivision + /// property + /// Country Tertiary + /// Subdivision property + /// Country Secondary + /// Subdivision property + /// Country Subdivision + /// property + /// Postal Code property + /// Extended Postal Code + /// property + /// Country Code property + /// Country property + /// Country Code ISO3 property + /// Free form Address property + /// Country Subdivision Name + /// property + /// An address component which represents the + /// name of a geographic area or locality that groups a number of + /// addressable objects for addressing purposes, without being an + /// administrative unit. This field is used to build the + /// `freeformAddress` property. + /// Bounding box coordinates. + public SearchResultAddress(string buildingNumber = default(string), string street = default(string), string crossStreet = default(string), string streetNumber = default(string), IList routeNumbers = default(IList), string streetName = default(string), string streetNameAndNumber = default(string), string municipality = default(string), string municipalitySubdivision = default(string), string countryTertiarySubdivision = default(string), string countrySecondarySubdivision = default(string), string countrySubdivision = default(string), string postalCode = default(string), string extendedPostalCode = default(string), string countryCode = default(string), string country = default(string), string countryCodeISO3 = default(string), string freeformAddress = default(string), string countrySubdivisionName = default(string), string localName = default(string), object boundingBox = default(object)) + { + BuildingNumber = buildingNumber; + Street = street; + CrossStreet = crossStreet; + StreetNumber = streetNumber; + RouteNumbers = routeNumbers; + StreetName = streetName; + StreetNameAndNumber = streetNameAndNumber; + Municipality = municipality; + MunicipalitySubdivision = municipalitySubdivision; + CountryTertiarySubdivision = countryTertiarySubdivision; + CountrySecondarySubdivision = countrySecondarySubdivision; + CountrySubdivision = countrySubdivision; + PostalCode = postalCode; + ExtendedPostalCode = extendedPostalCode; + CountryCode = countryCode; + Country = country; + CountryCodeISO3 = countryCodeISO3; + FreeformAddress = freeformAddress; + CountrySubdivisionName = countrySubdivisionName; + LocalName = localName; + BoundingBox = boundingBox; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets building Number property + /// + [JsonProperty(PropertyName = "buildingNumber")] + public string BuildingNumber { get; private set; } + + /// + /// Gets street property + /// + [JsonProperty(PropertyName = "street")] + public string Street { get; private set; } + + /// + /// Gets cross Street property + /// + [JsonProperty(PropertyName = "crossStreet")] + public string CrossStreet { get; private set; } + + /// + /// Gets street Number property + /// + [JsonProperty(PropertyName = "streetNumber")] + public string StreetNumber { get; private set; } + + /// + /// Gets number of routes + /// + [JsonProperty(PropertyName = "routeNumbers")] + public IList RouteNumbers { get; private set; } + + /// + /// Gets street Name property + /// + [JsonProperty(PropertyName = "streetName")] + public string StreetName { get; private set; } + + /// + /// Gets street Name and Number property + /// + [JsonProperty(PropertyName = "streetNameAndNumber")] + public string StreetNameAndNumber { get; private set; } + + /// + /// Gets municipality property + /// + [JsonProperty(PropertyName = "municipality")] + public string Municipality { get; private set; } + + /// + /// Gets municipality Subdivision property + /// + [JsonProperty(PropertyName = "municipalitySubdivision")] + public string MunicipalitySubdivision { get; private set; } + + /// + /// Gets country Tertiary Subdivision property + /// + [JsonProperty(PropertyName = "countryTertiarySubdivision")] + public string CountryTertiarySubdivision { get; private set; } + + /// + /// Gets country Secondary Subdivision property + /// + [JsonProperty(PropertyName = "countrySecondarySubdivision")] + public string CountrySecondarySubdivision { get; private set; } + + /// + /// Gets country Subdivision property + /// + [JsonProperty(PropertyName = "countrySubdivision")] + public string CountrySubdivision { get; private set; } + + /// + /// Gets postal Code property + /// + [JsonProperty(PropertyName = "postalCode")] + public string PostalCode { get; private set; } + + /// + /// Gets extended Postal Code property + /// + [JsonProperty(PropertyName = "extendedPostalCode")] + public string ExtendedPostalCode { get; private set; } + + /// + /// Gets country Code property + /// + [JsonProperty(PropertyName = "countryCode")] + public string CountryCode { get; private set; } + + /// + /// Gets country property + /// + [JsonProperty(PropertyName = "country")] + public string Country { get; private set; } + + /// + /// Gets country Code ISO3 property + /// + [JsonProperty(PropertyName = "countryCodeISO3")] + public string CountryCodeISO3 { get; private set; } + + /// + /// Gets free form Address property + /// + [JsonProperty(PropertyName = "freeformAddress")] + public string FreeformAddress { get; private set; } + + /// + /// Gets country Subdivision Name property + /// + [JsonProperty(PropertyName = "countrySubdivisionName")] + public string CountrySubdivisionName { get; private set; } + + /// + /// Gets an address component which represents the name of a geographic + /// area or locality that groups a number of addressable objects for + /// addressing purposes, without being an administrative unit. This + /// field is used to build the `freeformAddress` property. + /// + [JsonProperty(PropertyName = "localName")] + public string LocalName { get; private set; } + + /// + /// Gets bounding box coordinates. + /// + [JsonProperty(PropertyName = "boundingBox")] + public object BoundingBox { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultAddressRanges.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultAddressRanges.cs new file mode 100644 index 000000000000..21e346a36212 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultAddressRanges.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the address range on both sides of the street for a search + /// result. Coordinates for the start and end locations of the address + /// range are included. + /// + public partial class SearchResultAddressRanges + { + /// + /// Initializes a new instance of the SearchResultAddressRanges class. + /// + public SearchResultAddressRanges() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultAddressRanges class. + /// + /// Address range on the left side of the + /// street. + /// Address range on the right side of the + /// street. + public SearchResultAddressRanges(string rangeLeft = default(string), string rangeRight = default(string), CoordinatesPairAbbreviated fromProperty = default(CoordinatesPairAbbreviated), CoordinatesPairAbbreviated to = default(CoordinatesPairAbbreviated)) + { + RangeLeft = rangeLeft; + RangeRight = rangeRight; + FromProperty = fromProperty; + To = to; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets address range on the left side of the street. + /// + [JsonProperty(PropertyName = "rangeLeft")] + public string RangeLeft { get; set; } + + /// + /// Gets or sets address range on the right side of the street. + /// + [JsonProperty(PropertyName = "rangeRight")] + public string RangeRight { get; set; } + + /// + /// + [JsonProperty(PropertyName = "from")] + public CoordinatesPairAbbreviated FromProperty { get; set; } + + /// + /// + [JsonProperty(PropertyName = "to")] + public CoordinatesPairAbbreviated To { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultEntryPoint.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultEntryPoint.cs new file mode 100644 index 000000000000..a5c9a3498194 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultEntryPoint.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The entry point for the POI being returned. + /// + public partial class SearchResultEntryPoint + { + /// + /// Initializes a new instance of the SearchResultEntryPoint class. + /// + public SearchResultEntryPoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultEntryPoint class. + /// + /// The type of entry point. Value can be either + /// _main_ or _minor_. Possible values include: 'main', 'minor' + public SearchResultEntryPoint(string type = default(string), CoordinatesPairAbbreviated position = default(CoordinatesPairAbbreviated)) + { + Type = type; + Position = position; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of entry point. Value can be either _main_ or + /// _minor_. Possible values include: 'main', 'minor' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "position")] + public CoordinatesPairAbbreviated Position { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoi.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoi.cs new file mode 100644 index 000000000000..45c18a2992e8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoi.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details of the returned POI including information such as the name, + /// phone, url address, and classifications. + /// + public partial class SearchResultPoi + { + /// + /// Initializes a new instance of the SearchResultPoi class. + /// + public SearchResultPoi() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultPoi class. + /// + /// Name of the POI property + /// Telephone number property + /// Website URL property + /// The list of the most specific POI + /// categories + /// __[Deprecated]__ Use classifications + /// instead. Categories array + /// Classification array + /// Brands array. The name of the brand for the + /// POI being returned. + public SearchResultPoi(string name = default(string), string phone = default(string), string url = default(string), IList categorySet = default(IList), IList categories = default(IList), IList classifications = default(IList), IList brands = default(IList), SearchResultPoiOpeningHours openingHours = default(SearchResultPoiOpeningHours)) + { + Name = name; + Phone = phone; + Url = url; + CategorySet = categorySet; + Categories = categories; + Classifications = classifications; + Brands = brands; + OpeningHours = openingHours; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the POI property + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets telephone number property + /// + [JsonProperty(PropertyName = "phone")] + public string Phone { get; private set; } + + /// + /// Gets website URL property + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; private set; } + + /// + /// Gets the list of the most specific POI categories + /// + [JsonProperty(PropertyName = "categorySet")] + public IList CategorySet { get; private set; } + + /// + /// Gets __[Deprecated]__ Use classifications instead. Categories array + /// + [JsonProperty(PropertyName = "categories")] + public IList Categories { get; private set; } + + /// + /// Gets classification array + /// + [JsonProperty(PropertyName = "classifications")] + public IList Classifications { get; private set; } + + /// + /// Gets brands array. The name of the brand for the POI being + /// returned. + /// + [JsonProperty(PropertyName = "brands")] + public IList Brands { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "openingHours")] + public SearchResultPoiOpeningHours OpeningHours { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiBrand.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiBrand.cs new file mode 100644 index 000000000000..e3a97eb4c476 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiBrand.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The name of the brand for the POI being returned + /// + public partial class SearchResultPoiBrand + { + /// + /// Initializes a new instance of the SearchResultPoiBrand class. + /// + public SearchResultPoiBrand() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultPoiBrand class. + /// + /// Name of the brand + public SearchResultPoiBrand(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the brand + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiCategorySet.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiCategorySet.cs new file mode 100644 index 000000000000..1dad94ac3225 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiCategorySet.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// POI category + /// + public partial class SearchResultPoiCategorySet + { + /// + /// Initializes a new instance of the SearchResultPoiCategorySet class. + /// + public SearchResultPoiCategorySet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultPoiCategorySet class. + /// + /// Category ID + public SearchResultPoiCategorySet(int? id = default(int?)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets category ID + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiClassification.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiClassification.cs new file mode 100644 index 000000000000..9d554d384906 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiClassification.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The classification for the POI being returned + /// + public partial class SearchResultPoiClassification + { + /// + /// Initializes a new instance of the SearchResultPoiClassification + /// class. + /// + public SearchResultPoiClassification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultPoiClassification + /// class. + /// + /// Code property + /// Names array + public SearchResultPoiClassification(string code = default(string), IList names = default(IList)) + { + Code = code; + Names = names; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets code property + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets names array + /// + [JsonProperty(PropertyName = "names")] + public IList Names { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiClassificationName.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiClassificationName.cs new file mode 100644 index 000000000000..464ddb034a7f --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiClassificationName.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Name for the classification + /// + public partial class SearchResultPoiClassificationName + { + /// + /// Initializes a new instance of the SearchResultPoiClassificationName + /// class. + /// + public SearchResultPoiClassificationName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultPoiClassificationName + /// class. + /// + /// Name Locale property + /// Name property + public SearchResultPoiClassificationName(string nameLocale = default(string), string name = default(string)) + { + NameLocale = nameLocale; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name Locale property + /// + [JsonProperty(PropertyName = "nameLocale")] + public string NameLocale { get; private set; } + + /// + /// Gets name property + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHours.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHours.cs new file mode 100644 index 000000000000..9578becf901c --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHours.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Opening hours for a POI (Points of Interest). + /// + public partial class SearchResultPoiOpeningHours + { + /// + /// Initializes a new instance of the SearchResultPoiOpeningHours + /// class. + /// + public SearchResultPoiOpeningHours() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultPoiOpeningHours + /// class. + /// + /// Value used in the Request + /// List of time ranges for the next 7 + /// days + public SearchResultPoiOpeningHours(string mode = default(string), IList timeRanges = default(IList)) + { + Mode = mode; + TimeRanges = timeRanges; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets value used in the Request + /// + [JsonProperty(PropertyName = "mode")] + public string Mode { get; private set; } + + /// + /// Gets list of time ranges for the next 7 days + /// + [JsonProperty(PropertyName = "timeRanges")] + public IList TimeRanges { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHoursTimeRange.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHoursTimeRange.cs new file mode 100644 index 000000000000..109878a6c2c5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHoursTimeRange.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Open time range for a day + /// + public partial class SearchResultPoiOpeningHoursTimeRange + { + /// + /// Initializes a new instance of the + /// SearchResultPoiOpeningHoursTimeRange class. + /// + public SearchResultPoiOpeningHoursTimeRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchResultPoiOpeningHoursTimeRange class. + /// + /// The point in the next 7 days range when a + /// given POI is being opened, or the beginning of the range if it was + /// opened before the range. + /// The point in the next 7 days range when a + /// given POI is being closed, or the beginning of the range if it was + /// closed before the range. + public SearchResultPoiOpeningHoursTimeRange(SearchResultPoiOpeningHoursTimeRangeTime startTime = default(SearchResultPoiOpeningHoursTimeRangeTime), SearchResultPoiOpeningHoursTimeRangeTime endTime = default(SearchResultPoiOpeningHoursTimeRangeTime)) + { + StartTime = startTime; + EndTime = endTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the point in the next 7 days range when a given POI is + /// being opened, or the beginning of the range if it was opened before + /// the range. + /// + [JsonProperty(PropertyName = "startTime")] + public SearchResultPoiOpeningHoursTimeRangeTime StartTime { get; set; } + + /// + /// Gets or sets the point in the next 7 days range when a given POI is + /// being closed, or the beginning of the range if it was closed before + /// the range. + /// + [JsonProperty(PropertyName = "endTime")] + public SearchResultPoiOpeningHoursTimeRangeTime EndTime { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHoursTimeRangeTime.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHoursTimeRangeTime.cs new file mode 100644 index 000000000000..1f67c8d5269c --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultPoiOpeningHoursTimeRangeTime.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a date and time + /// + public partial class SearchResultPoiOpeningHoursTimeRangeTime + { + /// + /// Initializes a new instance of the + /// SearchResultPoiOpeningHoursTimeRangeTime class. + /// + public SearchResultPoiOpeningHoursTimeRangeTime() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SearchResultPoiOpeningHoursTimeRangeTime class. + /// + /// Represents current day in calendar year in POI + /// time zone. + /// Hours are in the 24 hour format in the local + /// time of a POI; possible values are 0 - 23. + /// Minutes are in the local time of a POI; + /// possible values are 0 - 59. + public SearchResultPoiOpeningHoursTimeRangeTime(string date = default(string), int? hour = default(int?), int? minute = default(int?)) + { + Date = date; + Hour = hour; + Minute = minute; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets represents current day in calendar year in POI time zone. + /// + [JsonProperty(PropertyName = "date")] + public string Date { get; private set; } + + /// + /// Gets hours are in the 24 hour format in the local time of a POI; + /// possible values are 0 - 23. + /// + [JsonProperty(PropertyName = "hour")] + public int? Hour { get; private set; } + + /// + /// Gets minutes are in the local time of a POI; possible values are 0 + /// - 59. + /// + [JsonProperty(PropertyName = "minute")] + public int? Minute { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultViewport.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultViewport.cs new file mode 100644 index 000000000000..886ef5998414 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchResultViewport.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The viewport that covers the result represented by the top-left and + /// bottom-right coordinates of the viewport. + /// + public partial class SearchResultViewport + { + /// + /// Initializes a new instance of the SearchResultViewport class. + /// + public SearchResultViewport() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResultViewport class. + /// + public SearchResultViewport(CoordinatesPairAbbreviated topLeftPoint = default(CoordinatesPairAbbreviated), CoordinatesPairAbbreviated btmRightPoint = default(CoordinatesPairAbbreviated)) + { + TopLeftPoint = topLeftPoint; + BtmRightPoint = btmRightPoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "topLeftPoint")] + public CoordinatesPairAbbreviated TopLeftPoint { get; set; } + + /// + /// + [JsonProperty(PropertyName = "btmRightPoint")] + public CoordinatesPairAbbreviated BtmRightPoint { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchSummaryGeoBias.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchSummaryGeoBias.cs new file mode 100644 index 000000000000..67a0050f138f --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/SearchSummaryGeoBias.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Indication when the internal search engine has applied a geospatial + /// bias to improve the ranking of results. In some methods, this can be + /// affected by setting the lat and lon parameters where available. In + /// other cases it is purely internal. + /// + public partial class SearchSummaryGeoBias + { + /// + /// Initializes a new instance of the SearchSummaryGeoBias class. + /// + public SearchSummaryGeoBias() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchSummaryGeoBias class. + /// + /// Latitude property + /// Longitude property + public SearchSummaryGeoBias(double? lat = default(double?), double? lon = default(double?)) + { + Lat = lat; + Lon = lon; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets latitude property + /// + [JsonProperty(PropertyName = "lat")] + public double? Lat { get; private set; } + + /// + /// Gets longitude property + /// + [JsonProperty(PropertyName = "lon")] + public double? Lon { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/Models/TextFormat.cs b/sdk/maps/Azure.Maps.Search/src/Generated/Models/TextFormat.cs new file mode 100644 index 000000000000..5bd93188cd73 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/Models/TextFormat.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search.Models +{ + + /// + /// Defines values for TextFormat. + /// + public static class TextFormat + { + /// + /// [The JavaScript Object Notation Data Interchange + /// Format](https://tools.ietf.org/html/rfc8259) + /// + public const string Json = "json"; + /// + /// [The Extensible Markup Language](https://www.w3.org/TR/xml/) + /// + public const string Xml = "xml"; + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/SdkInfo_SearchClient.cs b/sdk/maps/Azure.Maps.Search/src/Generated/SdkInfo_SearchClient.cs new file mode 100644 index 000000000000..db26a6864c1d --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/SdkInfo_SearchClient.cs @@ -0,0 +1,27 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_SearchClient + { + get + { + return new Tuple[] + { + new Tuple("SearchClient", "Search", "1.0"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/SearchClient.cs b/sdk/maps/Azure.Maps.Search/src/Generated/SearchClient.cs new file mode 100644 index 000000000000..19514edbbbc6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/SearchClient.cs @@ -0,0 +1,233 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + + /// + /// Azure Maps Search REST APIs + /// + public partial class SearchClient : ServiceClient, ISearchClient + { + /// + /// The base URI of the service. + /// + internal string BaseUri {get; set;} + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Version number of Azure Maps API. + /// + public string ApiVersion { get; set; } + + /// + /// Specifies which account is intended for usage in conjunction with the Azure + /// AD security model. It represents a unique ID for the Azure Maps account + /// and can be retrieved from the Azure Maps management plane Account API. To + /// use Azure AD security in Azure Maps see the following + /// [articles](https://aka.ms/amauthdetails) for guidance. + /// + public string XMsClientId { get; set; } + + /// + /// This parameter specifies where the Azure Maps Creator resource is located. + /// Valid values are us and eu. Possible values include: 'us', 'eu' + /// + public string Geography { get; set; } + + /// + /// Subscription credentials which uniquely identify client subscription. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Gets the ISearchOperations. + /// + public virtual ISearchOperations Search { get; private set; } + + /// + /// Initializes a new instance of the SearchClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling SearchClient.Dispose(). False: will not dispose provided httpClient + protected SearchClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SearchClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected SearchClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SearchClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected SearchClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SearchClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling SearchClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public SearchClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SearchClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SearchClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Search = new SearchOperations(this); + BaseUri = "https://{geography}.atlas.microsoft.com"; + ApiVersion = "1.0"; + Geography = "us"; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + CustomInitialize(); + } + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/SearchOperations.cs b/sdk/maps/Azure.Maps.Search/src/Generated/SearchOperations.cs new file mode 100644 index 000000000000..fd7ca22885df --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/SearchOperations.cs @@ -0,0 +1,8048 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SearchOperations operations. + /// + public partial class SearchOperations : IServiceOperations, ISearchOperations + { + /// + /// Initializes a new instance of the SearchOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + public SearchOperations(SearchClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SearchClient + /// + public SearchClient Client { get; private set; } + + /// + /// **Get Polygon** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// The Get Polygon service allows you to request the geometry data such as a + /// city or country outline for a set of entities, previously retrieved from + /// an Online Search request in GeoJSON format. The geometry ID is returned in + /// the dataSources object under "geometry" and "id" in either a Search Address + /// or Search Fuzzy call. + /// + /// Please note that any geometry ID retrieved from an Online Search endpoint + /// has a limited lifetime. The client should not store geometry IDs in + /// persistent storage for later referral, as the stability of these + /// identifiers is not guaranteed for a long period of time. It is expected + /// that a request to the Polygon method is made within a few minutes of the + /// request to the Online Search method that provided the ID. The service + /// allows for batch requests up to 20 identifiers. + /// + /// + /// Comma separated list of geometry UUIDs, previously retrieved from an Online + /// Search request. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchPolygonWithHttpMessagesAsync(IList geometries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (geometries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "geometries"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("geometries", geometries); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchPolygon", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/polygon/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (geometries != null) + { + _queryParameters.Add(string.Format("geometries={0}", System.Uri.EscapeDataString(string.Join(",", geometries)))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// + /// **Free Form Search** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The basic default API is Free Form Search which handles the most fuzzy of + /// inputs handling any combination of address or POI tokens. This search API + /// is the canonical 'single line search'. The Free Form Search API is a + /// seamless combination of POI search and geocoding. The API can also be + /// weighted with a contextual position (lat./lon. pair), or fully constrained + /// by a coordinate and radius, or it can be executed more generally without + /// any geo biasing anchor point.<br><br>We strongly advise you to + /// use the 'countrySet' parameter to specify only the countries for which your + /// application needs coverage, as the default behavior will be to search the + /// entire world, potentially returning unnecessary + /// results.<br><br> E.g.: `countrySet`=US,FR + /// <br><br>Please see [Search + /// Coverage](https://docs.microsoft.com/azure/location-based-services/geocoding-coverage) + /// for a complete list of all the supported countries.<br><br>Most + /// Search queries default to `maxFuzzyLevel`=2 to gain performance and also + /// reduce unusual results. This new default can be overridden as needed per + /// request by passing in the query param `maxFuzzyLevel`=3 or 4. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The applicable query string (e.g., "seattle", "pizza"). Can _also_ be + /// specified as a comma separated string composed by latitude followed by + /// longitude (e.g., "47.641268, -122.125679"). Must be properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum: 4 + /// + /// * Level 1 has no spell checking. + /// + /// * Level 2 uses normal n-gram spell checking. For example, query "restrant" + /// can be matched to "restaurant." + /// + /// * Level 3 uses sound-like spell checking, and shingle spell checking. + /// Sound-like spell checking is for "rstrnt" to "restaurant" matching. Shingle + /// spell checking is for "mountainview" to "mountain view" matching. + /// + /// * Level 4 doesn’t add any more spell checking functions. + /// + /// + /// + /// The search engine will start looking for a match on the level defined by + /// minFuzzyLevel, and will stop searching at the level specified by + /// maxFuzzyLevel. + /// + /// + /// Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum: 4 + /// + /// * Level 1 has no spell checking. + /// + /// * Level 2 uses normal n-gram spell checking. For example, query "restrant" + /// can be matched to "restaurant." + /// + /// * Level 3 uses sound-like spell checking, and shingle spell checking. + /// Sound-like spell checking is for "rstrnt" to "restaurant" matching. Shingle + /// spell checking is for "mountainview" to "mountain view" matching. + /// + /// * Level 4 doesn’t add any more spell checking functions. + /// + /// + /// + /// The search engine will start looking for a match on the level defined by + /// minFuzzyLevel, and will stop searching at the level specified by + /// maxFuzzyLevel. + /// + /// + /// A comma separated list of indexes which should be utilized for the search. + /// Item order does not matter. Available indexes are: Addr = Address range + /// interpolation, Geo = Geographies, PAD = Point Addresses, POI = Points of + /// interest, Str = Streets, Xstr = Cross Streets (intersections) + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchFuzzyWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), int? minFuzzyLevel = default(int?), int? maxFuzzyLevel = default(int?), IList idxSet = default(IList), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (ofs > 1900) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ofs", 1900); + } + if (ofs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ofs", 0); + } + if (minFuzzyLevel > 4) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "minFuzzyLevel", 4); + } + if (minFuzzyLevel < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "minFuzzyLevel", 1); + } + if (maxFuzzyLevel > 4) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "maxFuzzyLevel", 4); + } + if (maxFuzzyLevel < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "maxFuzzyLevel", 1); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("typeahead", typeahead); + tracingParameters.Add("limit", limit); + tracingParameters.Add("ofs", ofs); + tracingParameters.Add("categorySet", categorySet); + tracingParameters.Add("countrySet", countrySet); + tracingParameters.Add("lat", lat); + tracingParameters.Add("lon", lon); + tracingParameters.Add("radius", radius); + tracingParameters.Add("topLeft", topLeft); + tracingParameters.Add("btmRight", btmRight); + tracingParameters.Add("language", language); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("minFuzzyLevel", minFuzzyLevel); + tracingParameters.Add("maxFuzzyLevel", maxFuzzyLevel); + tracingParameters.Add("idxSet", idxSet); + tracingParameters.Add("brandSet", brandSet); + tracingParameters.Add("connectorSet", connectorSet); + tracingParameters.Add("view", view); + tracingParameters.Add("openingHours", openingHours); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchFuzzy", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/fuzzy/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (typeahead != null) + { + _queryParameters.Add(string.Format("typeahead={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(typeahead, Client.SerializationSettings).Trim('"')))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (ofs != null) + { + _queryParameters.Add(string.Format("ofs={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ofs, Client.SerializationSettings).Trim('"')))); + } + if (categorySet != null) + { + _queryParameters.Add(string.Format("categorySet={0}", System.Uri.EscapeDataString(string.Join(",", categorySet)))); + } + if (countrySet != null) + { + _queryParameters.Add(string.Format("countrySet={0}", System.Uri.EscapeDataString(string.Join(",", countrySet)))); + } + if (lat != null) + { + _queryParameters.Add(string.Format("lat={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lat, Client.SerializationSettings).Trim('"')))); + } + if (lon != null) + { + _queryParameters.Add(string.Format("lon={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lon, Client.SerializationSettings).Trim('"')))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (topLeft != null) + { + _queryParameters.Add(string.Format("topLeft={0}", System.Uri.EscapeDataString(topLeft))); + } + if (btmRight != null) + { + _queryParameters.Add(string.Format("btmRight={0}", System.Uri.EscapeDataString(btmRight))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (minFuzzyLevel != null) + { + _queryParameters.Add(string.Format("minFuzzyLevel={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(minFuzzyLevel, Client.SerializationSettings).Trim('"')))); + } + if (maxFuzzyLevel != null) + { + _queryParameters.Add(string.Format("maxFuzzyLevel={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxFuzzyLevel, Client.SerializationSettings).Trim('"')))); + } + if (idxSet != null) + { + _queryParameters.Add(string.Format("idxSet={0}", System.Uri.EscapeDataString(string.Join(",", idxSet)))); + } + if (brandSet != null) + { + _queryParameters.Add(string.Format("brandSet={0}", System.Uri.EscapeDataString(string.Join(",", brandSet)))); + } + if (connectorSet != null) + { + _queryParameters.Add(string.Format("connectorSet={0}", System.Uri.EscapeDataString(string.Join(",", connectorSet)))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (openingHours != null) + { + _queryParameters.Add(string.Format("openingHours={0}", System.Uri.EscapeDataString(openingHours))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get POI by Name** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Points of Interest (POI) Search allows you to request POI results by name. + /// Search supports additional query parameters such as language and filtering + /// results by area of interest driven by country or bounding box. Endpoint + /// will return only POI results matching the query string. Response includes + /// POI details such as address, coordinate location and category. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks"), must + /// be properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **POI** = Points of Interest + /// + /// Value should be **POI** or **None** to disable extended postal codes. + /// + /// By default extended postal codes are included. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchPOIWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (ofs > 1900) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ofs", 1900); + } + if (ofs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ofs", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("typeahead", typeahead); + tracingParameters.Add("limit", limit); + tracingParameters.Add("ofs", ofs); + tracingParameters.Add("categorySet", categorySet); + tracingParameters.Add("countrySet", countrySet); + tracingParameters.Add("lat", lat); + tracingParameters.Add("lon", lon); + tracingParameters.Add("radius", radius); + tracingParameters.Add("topLeft", topLeft); + tracingParameters.Add("btmRight", btmRight); + tracingParameters.Add("language", language); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("brandSet", brandSet); + tracingParameters.Add("connectorSet", connectorSet); + tracingParameters.Add("view", view); + tracingParameters.Add("openingHours", openingHours); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchPOI", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/poi/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (typeahead != null) + { + _queryParameters.Add(string.Format("typeahead={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(typeahead, Client.SerializationSettings).Trim('"')))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (ofs != null) + { + _queryParameters.Add(string.Format("ofs={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ofs, Client.SerializationSettings).Trim('"')))); + } + if (categorySet != null) + { + _queryParameters.Add(string.Format("categorySet={0}", System.Uri.EscapeDataString(string.Join(",", categorySet)))); + } + if (countrySet != null) + { + _queryParameters.Add(string.Format("countrySet={0}", System.Uri.EscapeDataString(string.Join(",", countrySet)))); + } + if (lat != null) + { + _queryParameters.Add(string.Format("lat={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lat, Client.SerializationSettings).Trim('"')))); + } + if (lon != null) + { + _queryParameters.Add(string.Format("lon={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lon, Client.SerializationSettings).Trim('"')))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (topLeft != null) + { + _queryParameters.Add(string.Format("topLeft={0}", System.Uri.EscapeDataString(topLeft))); + } + if (btmRight != null) + { + _queryParameters.Add(string.Format("btmRight={0}", System.Uri.EscapeDataString(btmRight))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (brandSet != null) + { + _queryParameters.Add(string.Format("brandSet={0}", System.Uri.EscapeDataString(string.Join(",", brandSet)))); + } + if (connectorSet != null) + { + _queryParameters.Add(string.Format("connectorSet={0}", System.Uri.EscapeDataString(string.Join(",", connectorSet)))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (openingHours != null) + { + _queryParameters.Add(string.Format("openingHours={0}", System.Uri.EscapeDataString(openingHours))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Nearby Search** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// If you have a use case for only retrieving POI results around a specific + /// location, the nearby search method may be the right choice. This endpoint + /// will only return POI results, and does not take in a search query + /// parameter. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Latitude where results should be biased. E.g. 37.337. + /// + /// + /// Longitude where results should be biased. E.g. -121.89. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area, Min value is 1, Max Value is 50000. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchNearbyWithHttpMessagesAsync(string format, double lat, double lon, int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? radius = default(double?), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (ofs > 1900) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ofs", 1900); + } + if (ofs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ofs", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("lat", lat); + tracingParameters.Add("lon", lon); + tracingParameters.Add("limit", limit); + tracingParameters.Add("ofs", ofs); + tracingParameters.Add("categorySet", categorySet); + tracingParameters.Add("countrySet", countrySet); + tracingParameters.Add("radius", radius); + tracingParameters.Add("language", language); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("brandSet", brandSet); + tracingParameters.Add("connectorSet", connectorSet); + tracingParameters.Add("view", view); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchNearby", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/nearby/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + _queryParameters.Add(string.Format("lat={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lat, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("lon={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lon, Client.SerializationSettings).Trim('"')))); + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (ofs != null) + { + _queryParameters.Add(string.Format("ofs={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ofs, Client.SerializationSettings).Trim('"')))); + } + if (categorySet != null) + { + _queryParameters.Add(string.Format("categorySet={0}", System.Uri.EscapeDataString(string.Join(",", categorySet)))); + } + if (countrySet != null) + { + _queryParameters.Add(string.Format("countrySet={0}", System.Uri.EscapeDataString(string.Join(",", countrySet)))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (brandSet != null) + { + _queryParameters.Add(string.Format("brandSet={0}", System.Uri.EscapeDataString(string.Join(",", brandSet)))); + } + if (connectorSet != null) + { + _queryParameters.Add(string.Format("connectorSet={0}", System.Uri.EscapeDataString(string.Join(",", connectorSet)))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get POI by Category** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Points of Interest (POI) Category Search allows you to request POI results + /// from given category. Search allows to query POIs from one category at a + /// time. Endpoint will only return POI results which are categorized as + /// specified. Response includes POI details such as address, coordinate + /// location and classification. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI category to search for (e.g., "AIRPORT", "RESTAURANT"), must be + /// properly URL encoded. Supported main categories can be requested by calling + /// [Get Search POI Category Tree + /// API](https://aka.ms/AzureMapsPOICategoryTree). List of available categories + /// can also be found + /// [here](https://docs.microsoft.com/azure/azure-maps/supported-search-categories). + /// We recommend to use POI Search Category Tree API to request the supported + /// categories. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchPOICategoryWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (ofs > 1900) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ofs", 1900); + } + if (ofs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ofs", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("typeahead", typeahead); + tracingParameters.Add("limit", limit); + tracingParameters.Add("ofs", ofs); + tracingParameters.Add("categorySet", categorySet); + tracingParameters.Add("countrySet", countrySet); + tracingParameters.Add("lat", lat); + tracingParameters.Add("lon", lon); + tracingParameters.Add("radius", radius); + tracingParameters.Add("topLeft", topLeft); + tracingParameters.Add("btmRight", btmRight); + tracingParameters.Add("language", language); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("brandSet", brandSet); + tracingParameters.Add("connectorSet", connectorSet); + tracingParameters.Add("view", view); + tracingParameters.Add("openingHours", openingHours); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchPOICategory", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/poi/category/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (typeahead != null) + { + _queryParameters.Add(string.Format("typeahead={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(typeahead, Client.SerializationSettings).Trim('"')))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (ofs != null) + { + _queryParameters.Add(string.Format("ofs={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ofs, Client.SerializationSettings).Trim('"')))); + } + if (categorySet != null) + { + _queryParameters.Add(string.Format("categorySet={0}", System.Uri.EscapeDataString(string.Join(",", categorySet)))); + } + if (countrySet != null) + { + _queryParameters.Add(string.Format("countrySet={0}", System.Uri.EscapeDataString(string.Join(",", countrySet)))); + } + if (lat != null) + { + _queryParameters.Add(string.Format("lat={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lat, Client.SerializationSettings).Trim('"')))); + } + if (lon != null) + { + _queryParameters.Add(string.Format("lon={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lon, Client.SerializationSettings).Trim('"')))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (topLeft != null) + { + _queryParameters.Add(string.Format("topLeft={0}", System.Uri.EscapeDataString(topLeft))); + } + if (btmRight != null) + { + _queryParameters.Add(string.Format("btmRight={0}", System.Uri.EscapeDataString(btmRight))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (brandSet != null) + { + _queryParameters.Add(string.Format("brandSet={0}", System.Uri.EscapeDataString(string.Join(",", brandSet)))); + } + if (connectorSet != null) + { + _queryParameters.Add(string.Format("connectorSet={0}", System.Uri.EscapeDataString(string.Join(",", connectorSet)))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (openingHours != null) + { + _queryParameters.Add(string.Format("openingHours={0}", System.Uri.EscapeDataString(openingHours))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Get POI Category Tree** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// POI Category API provides a full list of supported Points of Interest (POI) + /// categories and subcategories together with their translations and synonyms. + /// The returned content can be used to provide more meaningful results through + /// other Search Service APIs, like [Get Search + /// POI](https://docs.microsoft.com/rest/api/maps/search/getsearchpoi). + /// + /// + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchPOICategoryTreePreviewWithHttpMessagesAsync(string language = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("language", language); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchPOICategoryTreePreview", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/poi/category/tree/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Address Geocoding** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// In many cases, the complete search service might be too much, for instance + /// if you are only interested in traditional geocoding. Search can also be + /// accessed for address look up exclusively. The geocoding is performed by + /// hitting the geocode endpoint with just the address or partial address in + /// question. The geocoding search index will be queried for everything above + /// the street level data. No POIs will be returned. Note that the geocoder is + /// very tolerant of typos and incomplete addresses. It will also handle + /// everything from exact street addresses or street or intersections as well + /// as higher level geographies such as city centers, counties, states etc. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The address to search for (e.g., "1 Microsoft way, Redmond, WA"), must be + /// properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchAddressWithHttpMessagesAsync(string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (ofs > 1900) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ofs", 1900); + } + if (ofs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ofs", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("typeahead", typeahead); + tracingParameters.Add("limit", limit); + tracingParameters.Add("ofs", ofs); + tracingParameters.Add("countrySet", countrySet); + tracingParameters.Add("lat", lat); + tracingParameters.Add("lon", lon); + tracingParameters.Add("radius", radius); + tracingParameters.Add("topLeft", topLeft); + tracingParameters.Add("btmRight", btmRight); + tracingParameters.Add("language", language); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("view", view); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchAddress", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (typeahead != null) + { + _queryParameters.Add(string.Format("typeahead={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(typeahead, Client.SerializationSettings).Trim('"')))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (ofs != null) + { + _queryParameters.Add(string.Format("ofs={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ofs, Client.SerializationSettings).Trim('"')))); + } + if (countrySet != null) + { + _queryParameters.Add(string.Format("countrySet={0}", System.Uri.EscapeDataString(string.Join(",", countrySet)))); + } + if (lat != null) + { + _queryParameters.Add(string.Format("lat={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lat, Client.SerializationSettings).Trim('"')))); + } + if (lon != null) + { + _queryParameters.Add(string.Format("lon={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lon, Client.SerializationSettings).Trim('"')))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (topLeft != null) + { + _queryParameters.Add(string.Format("topLeft={0}", System.Uri.EscapeDataString(topLeft))); + } + if (btmRight != null) + { + _queryParameters.Add(string.Format("btmRight={0}", System.Uri.EscapeDataString(btmRight))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Reverse Geocode to an Address** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// There may be times when you need to translate a coordinate (example: + /// 37.786505, -122.3862) into a human understandable street address. Most + /// often this is needed in tracking applications where you receive a GPS + /// feed from the device or asset and wish to know what address where the + /// coordinate is located. This endpoint will return address information for + /// a given coordinate. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Boolean. To enable return of the posted speed limit + /// + /// + /// The directional heading of the vehicle in degrees, for travel along a + /// segment of roadway. 0 is North, 90 is East and so on, values range from + /// -360 to 360. The precision can include upto one decimal place + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// If a number is sent in along with the request, the response may include the + /// side of the street (Left/Right) and also an offset position for that number + /// + /// + /// Boolean. To enable return of the road use array for reverse geocodes at + /// street level + /// + /// + /// To restrict reverse geocodes to a certain type of road use. The road use + /// array for reverse geocodes can be one or more of LimitedAccess, Arterial, + /// Terminal, Ramp, Rotary, LocalStreet + /// + /// + /// Format of newlines in the formatted address. + /// + /// If true, the address will contain newlines. + /// If false, newlines will be converted to commas. + /// + /// + /// Include information on the type of match the geocoder achieved in the + /// response. + /// + /// + /// Specifies the level of filtering performed on geographies. Narrows the + /// search for specified geography entity types, e.g. return only municipality. + /// The resulting response will contain the geography ID as well as the entity + /// type matched. If you provide more than one entity as a comma separated + /// list, endpoint will return the 'smallest entity available'. Returned + /// Geometry ID can be used to get the geometry of that geography via [Get + /// Search + /// Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) + /// API. The following parameters are ignored when entityType is set: + /// + /// * heading + /// * number + /// * returnRoadUse + /// * returnSpeedLimit + /// * roadUse + /// * returnMatchType. Possible values include: 'Country', + /// 'CountrySubdivision', 'CountrySecondarySubdivision', + /// 'CountryTertiarySubdivision', 'Municipality', 'MunicipalitySubdivision', + /// 'Neighbourhood', 'PostalCodeArea' + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchAddressReverseWithHttpMessagesAsync(string format, string query, string language = default(string), bool? returnSpeedLimit = default(bool?), double? heading = default(double?), double? radius = default(double?), string number = default(string), bool? returnRoadUse = default(bool?), string roadUse = default(string), bool? allowFreeformNewline = default(bool?), bool? returnMatchType = default(bool?), string entityType = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (heading > 360) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "heading", 360); + } + if (heading < -360) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "heading", -360); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("language", language); + tracingParameters.Add("returnSpeedLimit", returnSpeedLimit); + tracingParameters.Add("heading", heading); + tracingParameters.Add("radius", radius); + tracingParameters.Add("number", number); + tracingParameters.Add("returnRoadUse", returnRoadUse); + tracingParameters.Add("roadUse", roadUse); + tracingParameters.Add("allowFreeformNewline", allowFreeformNewline); + tracingParameters.Add("returnMatchType", returnMatchType); + tracingParameters.Add("entityType", entityType); + tracingParameters.Add("view", view); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchAddressReverse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/reverse/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (returnSpeedLimit != null) + { + _queryParameters.Add(string.Format("returnSpeedLimit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnSpeedLimit, Client.SerializationSettings).Trim('"')))); + } + if (heading != null) + { + _queryParameters.Add(string.Format("heading={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(heading, Client.SerializationSettings).Trim('"')))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (number != null) + { + _queryParameters.Add(string.Format("number={0}", System.Uri.EscapeDataString(number))); + } + if (returnRoadUse != null) + { + _queryParameters.Add(string.Format("returnRoadUse={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnRoadUse, Client.SerializationSettings).Trim('"')))); + } + if (roadUse != null) + { + _queryParameters.Add(string.Format("roadUse={0}", System.Uri.EscapeDataString(roadUse))); + } + if (allowFreeformNewline != null) + { + _queryParameters.Add(string.Format("allowFreeformNewline={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(allowFreeformNewline, Client.SerializationSettings).Trim('"')))); + } + if (returnMatchType != null) + { + _queryParameters.Add(string.Format("returnMatchType={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(returnMatchType, Client.SerializationSettings).Trim('"')))); + } + if (entityType != null) + { + _queryParameters.Add(string.Format("entityType={0}", System.Uri.EscapeDataString(entityType))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Reverse Geocode to a Cross Street** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// There may be times when you need to translate a coordinate (example: + /// 37.786505, -122.3862) into a human understandable cross street. Most often + /// this is needed in tracking applications where you receive a GPS feed from + /// the device or asset and wish to know what address where the coordinate is + /// located. + /// This endpoint will return cross street information for a given coordinate. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// The directional heading of the vehicle in degrees, for travel along a + /// segment of roadway. 0 is North, 90 is East and so on, values range from + /// -360 to 360. The precision can include upto one decimal place + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchAddressReverseCrossStreetWithHttpMessagesAsync(string format, string query, int? limit = default(int?), double? heading = default(double?), double? radius = default(double?), string language = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (heading > 360) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "heading", 360); + } + if (heading < -360) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "heading", -360); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("limit", limit); + tracingParameters.Add("heading", heading); + tracingParameters.Add("radius", radius); + tracingParameters.Add("language", language); + tracingParameters.Add("view", view); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchAddressReverseCrossStreet", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/reverse/crossStreet/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (heading != null) + { + _queryParameters.Add(string.Format("heading={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(heading, Client.SerializationSettings).Trim('"')))); + } + if (radius != null) + { + _queryParameters.Add(string.Format("radius={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(radius, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Structured Address Geocoding** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Azure Address Geocoding can also be accessed for structured address look + /// up exclusively. The geocoding search index will be queried for everything + /// above the street level data. No POIs will be returned. Note that the + /// geocoder is very tolerant of typos and incomplete addresses. It will also + /// handle everything from exact street addresses or street or intersections + /// as well as higher level geographies such as city centers, counties, states + /// etc. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The 2 or 3 letter + /// [ISO3166-1](https://www.iso.org/iso-3166-country-codes.html) country code + /// portion of an address. E.g. US. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// The street number portion of an address + /// + /// + /// The street name portion of an address + /// + /// + /// The cross street name for the structured address + /// + /// + /// The municipality portion of an address + /// + /// + /// The municipality subdivision (sub/super city) for the structured address + /// + /// + /// The named area for the structured address + /// + /// + /// The county for the structured address + /// + /// + /// The country subdivision portion of an address + /// + /// + /// The postal code portion of an address + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchAddressStructuredWithHttpMessagesAsync(string format, string language = default(string), string countryCode = "US", int? limit = default(int?), int? ofs = default(int?), string streetNumber = default(string), string streetName = default(string), string crossStreet = default(string), string municipality = default(string), string municipalitySubdivision = default(string), string countryTertiarySubdivision = default(string), string countrySecondarySubdivision = default(string), string countrySubdivision = default(string), string postalCode = default(string), string extendedPostalCodesFor = default(string), string view = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (ofs > 1900) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ofs", 1900); + } + if (ofs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ofs", 0); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("language", language); + tracingParameters.Add("countryCode", countryCode); + tracingParameters.Add("limit", limit); + tracingParameters.Add("ofs", ofs); + tracingParameters.Add("streetNumber", streetNumber); + tracingParameters.Add("streetName", streetName); + tracingParameters.Add("crossStreet", crossStreet); + tracingParameters.Add("municipality", municipality); + tracingParameters.Add("municipalitySubdivision", municipalitySubdivision); + tracingParameters.Add("countryTertiarySubdivision", countryTertiarySubdivision); + tracingParameters.Add("countrySecondarySubdivision", countrySecondarySubdivision); + tracingParameters.Add("countrySubdivision", countrySubdivision); + tracingParameters.Add("postalCode", postalCode); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("view", view); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchAddressStructured", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/structured/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (countryCode != null) + { + _queryParameters.Add(string.Format("countryCode={0}", System.Uri.EscapeDataString(countryCode))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (ofs != null) + { + _queryParameters.Add(string.Format("ofs={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(ofs, Client.SerializationSettings).Trim('"')))); + } + if (streetNumber != null) + { + _queryParameters.Add(string.Format("streetNumber={0}", System.Uri.EscapeDataString(streetNumber))); + } + if (streetName != null) + { + _queryParameters.Add(string.Format("streetName={0}", System.Uri.EscapeDataString(streetName))); + } + if (crossStreet != null) + { + _queryParameters.Add(string.Format("crossStreet={0}", System.Uri.EscapeDataString(crossStreet))); + } + if (municipality != null) + { + _queryParameters.Add(string.Format("municipality={0}", System.Uri.EscapeDataString(municipality))); + } + if (municipalitySubdivision != null) + { + _queryParameters.Add(string.Format("municipalitySubdivision={0}", System.Uri.EscapeDataString(municipalitySubdivision))); + } + if (countryTertiarySubdivision != null) + { + _queryParameters.Add(string.Format("countryTertiarySubdivision={0}", System.Uri.EscapeDataString(countryTertiarySubdivision))); + } + if (countrySecondarySubdivision != null) + { + _queryParameters.Add(string.Format("countrySecondarySubdivision={0}", System.Uri.EscapeDataString(countrySecondarySubdivision))); + } + if (countrySubdivision != null) + { + _queryParameters.Add(string.Format("countrySubdivision={0}", System.Uri.EscapeDataString(countrySubdivision))); + } + if (postalCode != null) + { + _queryParameters.Add(string.Format("postalCode={0}", System.Uri.EscapeDataString(postalCode))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Search Geometry endpoint allows you to perform a free form search + /// inside a single geometry or many of them. The search results that fall + /// inside the geometry/geometries will be returned.<br><br>To send + /// the geometry you will use a `POST` request where the request body will + /// contain the `geometry` object represented as a `GeoJSON` type and the + /// `Content-Type` header will be set to `application/json`. The geographical + /// features to be searched can be modeled as Polygon and/or Circle geometries + /// represented using any one of the following `GeoJSON` + /// types:<ul><li>**GeoJSON FeatureCollection** <br>The + /// `geometry` can be represented as a `GeoJSON FeatureCollection` object. This + /// is the recommended option if the geometry contains both Polygons and + /// Circles. The `FeatureCollection` can contain a max of 50 `GeoJSON Feature` + /// objects. Each `Feature` object should represent either a Polygon or a + /// Circle with the following conditions:<ul + /// style="list-style-type:none"><li>A `Feature` object for the + /// Polygon geometry can have a max of 50 coordinates and it's properties must + /// be empty.</li><li>A `Feature` object for the Circle geometry is + /// composed of a _center_ represented using a `GeoJSON Point` type and a + /// _radius_ value (in meters) which must be specified in the object's + /// properties along with the _subType_ property whose value should be + /// 'Circle'.</li></ul><br> Please see the Examples section + /// below for a sample `FeatureCollection` + /// representation.<br><br></li><li>**GeoJSON + /// GeometryCollection**<br>The `geometry` can be represented as a + /// `GeoJSON GeometryCollection` object. This is the recommended option if the + /// geometry contains a list of Polygons only. The `GeometryCollection` can + /// contain a max of 50 `GeoJSON Polygon` objects. Each `Polygon` object can + /// have a max of 50 coordinates. Please see the Examples section below for a + /// sample `GeometryCollection` + /// representation.<br><br></li><li>**GeoJSON + /// Polygon**<br>The `geometry` can be represented as a `GeoJSON Polygon` + /// object. This is the recommended option if the geometry contains a single + /// Polygon. The `Polygon` object can have a max of 50 coordinates. Please see + /// the Examples section below for a sample `Polygon` + /// representation.<br><br></li></ul>.<br><br> + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks", + /// "pizza"). Must be properly URL encoded. + /// + /// + /// This represents the geometry for one or more geographical features (parks, + /// state boundary etc.) to search in and should be a GeoJSON compliant type. + /// Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946) for + /// details. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma separated list of indexes which should be utilized for the search. + /// Item order does not matter. Available indexes are: Addr = Address range + /// interpolation, Geo = Geographies, PAD = Point Addresses, POI = Points of + /// interest, Str = Streets, Xstr = Cross Streets (intersections) + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchInsideGeometryWithHttpMessagesAsync(string format, string query, SearchInsideGeometryRequestBody searchInsideGeometryRequestBody, int? limit = default(int?), string language = default(string), IList categorySet = default(IList), string extendedPostalCodesFor = default(string), IList idxSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (limit > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 100); + } + if (limit < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "limit", 1); + } + if (searchInsideGeometryRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchInsideGeometryRequestBody"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("limit", limit); + tracingParameters.Add("language", language); + tracingParameters.Add("categorySet", categorySet); + tracingParameters.Add("extendedPostalCodesFor", extendedPostalCodesFor); + tracingParameters.Add("idxSet", idxSet); + tracingParameters.Add("searchInsideGeometryRequestBody", searchInsideGeometryRequestBody); + tracingParameters.Add("view", view); + tracingParameters.Add("openingHours", openingHours); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchInsideGeometry", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/geometry/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (categorySet != null) + { + _queryParameters.Add(string.Format("categorySet={0}", System.Uri.EscapeDataString(string.Join(",", categorySet)))); + } + if (extendedPostalCodesFor != null) + { + _queryParameters.Add(string.Format("extendedPostalCodesFor={0}", System.Uri.EscapeDataString(extendedPostalCodesFor))); + } + if (idxSet != null) + { + _queryParameters.Add(string.Format("idxSet={0}", System.Uri.EscapeDataString(string.Join(",", idxSet)))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (openingHours != null) + { + _queryParameters.Add(string.Format("openingHours={0}", System.Uri.EscapeDataString(openingHours))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchInsideGeometryRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchInsideGeometryRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The Search Along Route endpoint allows you to perform a fuzzy search for + /// POIs along a specified route. This search is constrained by specifying the + /// `maxDetourTime` limiting measure.<br><br>To send the + /// route-points you will use a `POST` request where the request body will + /// contain the `route` object represented as a `GeoJSON LineString` type and + /// the `Content-Type` header will be set to `application/json`. Each + /// route-point in `route` is represented as a `GeoJSON Position` type i.e. an + /// array where the _longitude_ value is followed by the _latitude_ value and + /// the _altitude_ value is ignored. The `route` should contain at least 2 + /// route-points.<br><br>It is possible that original route will be + /// altered, some of it's points may be skipped. If the route that passes + /// through the found point is faster than the original one, the `detourTime` + /// value in the response is negative. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks", + /// "pizza"). Must be properly URL encoded. + /// + /// + /// Maximum detour time of the point of interest in seconds. Max value is 3600 + /// seconds + /// + /// + /// This represents the route to search along and should be a valid `GeoJSON + /// LineString` type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Maximum number of responses that will be returned. Default value is 10. Max + /// value is 20 + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchAlongRouteWithHttpMessagesAsync(string format, string query, int maxDetourTime, SearchAlongRouteRequestBody searchAlongRouteRequestBody, IList categorySet = default(IList), int? limit = default(int?), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "query"); + } + if (maxDetourTime > 3600) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "maxDetourTime", 3600); + } + if (limit > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "limit", 20); + } + if (searchAlongRouteRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchAlongRouteRequestBody"); + } + if (searchAlongRouteRequestBody != null) + { + searchAlongRouteRequestBody.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("query", query); + tracingParameters.Add("categorySet", categorySet); + tracingParameters.Add("maxDetourTime", maxDetourTime); + tracingParameters.Add("limit", limit); + tracingParameters.Add("brandSet", brandSet); + tracingParameters.Add("connectorSet", connectorSet); + tracingParameters.Add("view", view); + tracingParameters.Add("openingHours", openingHours); + tracingParameters.Add("searchAlongRouteRequestBody", searchAlongRouteRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchAlongRoute", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/alongRoute/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (query != null) + { + _queryParameters.Add(string.Format("query={0}", System.Uri.EscapeDataString(query))); + } + if (categorySet != null) + { + _queryParameters.Add(string.Format("categorySet={0}", System.Uri.EscapeDataString(string.Join(",", categorySet)))); + } + _queryParameters.Add(string.Format("maxDetourTime={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxDetourTime, Client.SerializationSettings).Trim('"')))); + if (limit != null) + { + _queryParameters.Add(string.Format("limit={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"')))); + } + if (brandSet != null) + { + _queryParameters.Add(string.Format("brandSet={0}", System.Uri.EscapeDataString(string.Join(",", brandSet)))); + } + if (connectorSet != null) + { + _queryParameters.Add(string.Format("connectorSet={0}", System.Uri.EscapeDataString(string.Join(",", connectorSet)))); + } + if (view != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(view))); + } + if (openingHours != null) + { + _queryParameters.Add(string.Format("openingHours={0}", System.Uri.EscapeDataString(openingHours))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchAlongRouteRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchAlongRouteRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request where the + /// request body will contain the `batchItems` array in `json` format and the + /// `Content-Type` header will be set to `application/json`. Here's a sample + /// request body containing 5 _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of search fuzzy queries/requests to process. The list can contain + /// a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchFuzzyBatchSyncWithHttpMessagesAsync(BatchRequestBody searchFuzzyBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (searchFuzzyBatchRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchFuzzyBatchRequestBody"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("searchFuzzyBatchRequestBody", searchFuzzyBatchRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchFuzzyBatchSync", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/fuzzy/batch/sync/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchFuzzyBatchRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchFuzzyBatchRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 408) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 408) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request where the + /// request body will contain the `batchItems` array in `json` format and the + /// `Content-Type` header will be set to `application/json`. Here's a sample + /// request body containing 5 _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of search fuzzy queries/requests to process. The list can contain + /// a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchFuzzyBatchWithHttpMessagesAsync(BatchRequestBody searchFuzzyBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (searchFuzzyBatchRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchFuzzyBatchRequestBody"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("searchFuzzyBatchRequestBody", searchFuzzyBatchRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchFuzzyBatch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/fuzzy/batch/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchFuzzyBatchRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchFuzzyBatchRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request where the + /// request body will contain the `batchItems` array in `json` format and the + /// `Content-Type` header will be set to `application/json`. Here's a sample + /// request body containing 5 _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchFuzzyBatchWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchFuzzyBatch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/fuzzy/batch/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API to run + /// either asynchronously (async) or synchronously (sync). The async API allows + /// caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + /// France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of address geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchAddressBatchSyncWithHttpMessagesAsync(BatchRequestBody searchAddressBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (searchAddressBatchRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchAddressBatchRequestBody"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("searchAddressBatchRequestBody", searchAddressBatchRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchAddressBatchSync", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/batch/sync/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchAddressBatchRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchAddressBatchRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 408) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 408) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API to run + /// either asynchronously (async) or synchronously (sync). The async API allows + /// caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + /// France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of address geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchAddressBatchWithHttpMessagesAsync(BatchRequestBody searchAddressBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (searchAddressBatchRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchAddressBatchRequestBody"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("searchAddressBatchRequestBody", searchAddressBatchRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchAddressBatch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/batch/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchAddressBatchRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchAddressBatchRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API to run + /// either asynchronously (async) or synchronously (sync). The async API allows + /// caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + /// France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchAddressBatchWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchAddressBatch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/batch/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in `json` format + /// and the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It can + /// accept any of the supported _search address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of reverse geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchAddressReverseBatchSyncWithHttpMessagesAsync(BatchRequestBody searchAddressReverseBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (searchAddressReverseBatchRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchAddressReverseBatchRequestBody"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("searchAddressReverseBatchRequestBody", searchAddressReverseBatchRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchAddressReverseBatchSync", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/reverse/batch/sync/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchAddressReverseBatchRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchAddressReverseBatchRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 408) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 408) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in `json` format + /// and the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It can + /// accept any of the supported _search address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The list of reverse geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostSearchAddressReverseBatchWithHttpMessagesAsync(BatchRequestBody searchAddressReverseBatchRequestBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (searchAddressReverseBatchRequestBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "searchAddressReverseBatchRequestBody"); + } + string format = "json"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("searchAddressReverseBatchRequestBody", searchAddressReverseBatchRequestBody); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PostSearchAddressReverseBatch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/reverse/batch/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(searchAddressReverseBatchRequestBody != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(searchAddressReverseBatchRequestBody, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in `json` format + /// and the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It can + /// accept any of the supported _search address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// Batch id for querying the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSearchAddressReverseBatchWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Geography == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Geography"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSearchAddressReverseBatch", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "search/address/reverse/batch/{format}"; + _url = _url.Replace("{geography}", System.Uri.EscapeDataString(Client.Geography)); + _url = _url.Replace("{format}", System.Uri.EscapeDataString(format)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.XMsClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.XMsClientId); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/maps/Azure.Maps.Search/src/Generated/SearchOperationsExtensions.cs b/sdk/maps/Azure.Maps.Search/src/Generated/SearchOperationsExtensions.cs new file mode 100644 index 000000000000..0527a33e6760 --- /dev/null +++ b/sdk/maps/Azure.Maps.Search/src/Generated/SearchOperationsExtensions.cs @@ -0,0 +1,3756 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Azure.Maps.Search +{ + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SearchOperations. + /// + public static partial class SearchOperationsExtensions + { + /// + /// **Get Polygon** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// The Get Polygon service allows you to request the geometry data such as a + /// city or country outline for a set of entities, previously retrieved from + /// an Online Search request in GeoJSON format. The geometry ID is returned in + /// the dataSources object under "geometry" and "id" in either a Search Address + /// or Search Fuzzy call. + /// + /// Please note that any geometry ID retrieved from an Online Search endpoint + /// has a limited lifetime. The client should not store geometry IDs in + /// persistent storage for later referral, as the stability of these + /// identifiers is not guaranteed for a long period of time. It is expected + /// that a request to the Polygon method is made within a few minutes of the + /// request to the Online Search method that provided the ID. The service + /// allows for batch requests up to 20 identifiers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Comma separated list of geometry UUIDs, previously retrieved from an Online + /// Search request. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchPolygonAsync(this ISearchOperations operations, IList geometries, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchPolygonWithHttpMessagesAsync(geometries, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// + /// **Free Form Search** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The basic default API is Free Form Search which handles the most fuzzy of + /// inputs handling any combination of address or POI tokens. This search API + /// is the canonical 'single line search'. The Free Form Search API is a + /// seamless combination of POI search and geocoding. The API can also be + /// weighted with a contextual position (lat./lon. pair), or fully constrained + /// by a coordinate and radius, or it can be executed more generally without + /// any geo biasing anchor point.<br><br>We strongly advise you to + /// use the 'countrySet' parameter to specify only the countries for which your + /// application needs coverage, as the default behavior will be to search the + /// entire world, potentially returning unnecessary + /// results.<br><br> E.g.: `countrySet`=US,FR + /// <br><br>Please see [Search + /// Coverage](https://docs.microsoft.com/azure/location-based-services/geocoding-coverage) + /// for a complete list of all the supported countries.<br><br>Most + /// Search queries default to `maxFuzzyLevel`=2 to gain performance and also + /// reduce unusual results. This new default can be overridden as needed per + /// request by passing in the query param `maxFuzzyLevel`=3 or 4. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The applicable query string (e.g., "seattle", "pizza"). Can _also_ be + /// specified as a comma separated string composed by latitude followed by + /// longitude (e.g., "47.641268, -122.125679"). Must be properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum: 4 + /// + /// * Level 1 has no spell checking. + /// + /// * Level 2 uses normal n-gram spell checking. For example, query "restrant" + /// can be matched to "restaurant." + /// + /// * Level 3 uses sound-like spell checking, and shingle spell checking. + /// Sound-like spell checking is for "rstrnt" to "restaurant" matching. Shingle + /// spell checking is for "mountainview" to "mountain view" matching. + /// + /// * Level 4 doesn’t add any more spell checking functions. + /// + /// + /// + /// The search engine will start looking for a match on the level defined by + /// minFuzzyLevel, and will stop searching at the level specified by + /// maxFuzzyLevel. + /// + /// + /// Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum: 4 + /// + /// * Level 1 has no spell checking. + /// + /// * Level 2 uses normal n-gram spell checking. For example, query "restrant" + /// can be matched to "restaurant." + /// + /// * Level 3 uses sound-like spell checking, and shingle spell checking. + /// Sound-like spell checking is for "rstrnt" to "restaurant" matching. Shingle + /// spell checking is for "mountainview" to "mountain view" matching. + /// + /// * Level 4 doesn’t add any more spell checking functions. + /// + /// + /// + /// The search engine will start looking for a match on the level defined by + /// minFuzzyLevel, and will stop searching at the level specified by + /// maxFuzzyLevel. + /// + /// + /// A comma separated list of indexes which should be utilized for the search. + /// Item order does not matter. Available indexes are: Addr = Address range + /// interpolation, Geo = Geographies, PAD = Point Addresses, POI = Points of + /// interest, Str = Streets, Xstr = Cross Streets (intersections) + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchFuzzyAsync(this ISearchOperations operations, string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), int? minFuzzyLevel = default(int?), int? maxFuzzyLevel = default(int?), IList idxSet = default(IList), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchFuzzyWithHttpMessagesAsync(format, query, typeahead, limit, ofs, categorySet, countrySet, lat, lon, radius, topLeft, btmRight, language, extendedPostalCodesFor, minFuzzyLevel, maxFuzzyLevel, idxSet, brandSet, connectorSet, view, openingHours, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get POI by Name** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Points of Interest (POI) Search allows you to request POI results by name. + /// Search supports additional query parameters such as language and filtering + /// results by area of interest driven by country or bounding box. Endpoint + /// will return only POI results matching the query string. Response includes + /// POI details such as address, coordinate location and category. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks"), must + /// be properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **POI** = Points of Interest + /// + /// Value should be **POI** or **None** to disable extended postal codes. + /// + /// By default extended postal codes are included. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchPOIAsync(this ISearchOperations operations, string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchPOIWithHttpMessagesAsync(format, query, typeahead, limit, ofs, categorySet, countrySet, lat, lon, radius, topLeft, btmRight, language, extendedPostalCodesFor, brandSet, connectorSet, view, openingHours, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Nearby Search** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// If you have a use case for only retrieving POI results around a specific + /// location, the nearby search method may be the right choice. This endpoint + /// will only return POI results, and does not take in a search query + /// parameter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Latitude where results should be biased. E.g. 37.337. + /// + /// + /// Longitude where results should be biased. E.g. -121.89. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area, Min value is 1, Max Value is 50000. + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchNearbyAsync(this ISearchOperations operations, string format, double lat, double lon, int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? radius = default(double?), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchNearbyWithHttpMessagesAsync(format, lat, lon, limit, ofs, categorySet, countrySet, radius, language, extendedPostalCodesFor, brandSet, connectorSet, view, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get POI by Category** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Points of Interest (POI) Category Search allows you to request POI results + /// from given category. Search allows to query POIs from one category at a + /// time. Endpoint will only return POI results which are categorized as + /// specified. Response includes POI details such as address, coordinate + /// location and classification. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI category to search for (e.g., "AIRPORT", "RESTAURANT"), must be + /// properly URL encoded. Supported main categories can be requested by calling + /// [Get Search POI Category Tree + /// API](https://aka.ms/AzureMapsPOICategoryTree). List of available categories + /// can also be found + /// [here](https://docs.microsoft.com/azure/azure-maps/supported-search-categories). + /// We recommend to use POI Search Category Tree API to request the supported + /// categories. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchPOICategoryAsync(this ISearchOperations operations, string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList categorySet = default(IList), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchPOICategoryWithHttpMessagesAsync(format, query, typeahead, limit, ofs, categorySet, countrySet, lat, lon, radius, topLeft, btmRight, language, extendedPostalCodesFor, brandSet, connectorSet, view, openingHours, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Get POI Category Tree** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// POI Category API provides a full list of supported Points of Interest (POI) + /// categories and subcategories together with their translations and synonyms. + /// The returned content can be used to provide more meaningful results through + /// other Search Service APIs, like [Get Search + /// POI](https://docs.microsoft.com/rest/api/maps/search/getsearchpoi). + /// + /// + /// The operations group for this extension method. + /// + /// + /// 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. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchPOICategoryTreePreviewAsync(this ISearchOperations operations, string language = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchPOICategoryTreePreviewWithHttpMessagesAsync(language, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Address Geocoding** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// In many cases, the complete search service might be too much, for instance + /// if you are only interested in traditional geocoding. Search can also be + /// accessed for address look up exclusively. The geocoding is performed by + /// hitting the geocode endpoint with just the address or partial address in + /// question. The geocoding search index will be queried for everything above + /// the street level data. No POIs will be returned. Note that the geocoder is + /// very tolerant of typos and incomplete addresses. It will also handle + /// everything from exact street addresses or street or intersections as well + /// as higher level geographies such as city centers, counties, states etc. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The address to search for (e.g., "1 Microsoft way, Redmond, WA"), must be + /// properly URL encoded. + /// + /// + /// Boolean. If the typeahead flag is set, the query will be interpreted as a + /// partial input and the search will enter predictive mode + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// Comma separated string of country codes, e.g. FR,ES. This will limit the + /// search to the specified countries + /// + /// + /// Latitude where results should be biased. E.g. 37.337 + /// + /// + /// Longitude where results should be biased. E.g. -121.89 + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Top left position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Bottom right position of the bounding box. E.g. 37.553,-122.453 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchAddressAsync(this ISearchOperations operations, string format, string query, bool? typeahead = default(bool?), int? limit = default(int?), int? ofs = default(int?), IList countrySet = default(IList), double? lat = default(double?), double? lon = default(double?), double? radius = default(double?), string topLeft = default(string), string btmRight = default(string), string language = default(string), string extendedPostalCodesFor = default(string), string view = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchAddressWithHttpMessagesAsync(format, query, typeahead, limit, ofs, countrySet, lat, lon, radius, topLeft, btmRight, language, extendedPostalCodesFor, view, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Reverse Geocode to an Address** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// There may be times when you need to translate a coordinate (example: + /// 37.786505, -122.3862) into a human understandable street address. Most + /// often this is needed in tracking applications where you receive a GPS + /// feed from the device or asset and wish to know what address where the + /// coordinate is located. This endpoint will return address information for + /// a given coordinate. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// Boolean. To enable return of the posted speed limit + /// + /// + /// The directional heading of the vehicle in degrees, for travel along a + /// segment of roadway. 0 is North, 90 is East and so on, values range from + /// -360 to 360. The precision can include upto one decimal place + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// If a number is sent in along with the request, the response may include the + /// side of the street (Left/Right) and also an offset position for that number + /// + /// + /// Boolean. To enable return of the road use array for reverse geocodes at + /// street level + /// + /// + /// To restrict reverse geocodes to a certain type of road use. The road use + /// array for reverse geocodes can be one or more of LimitedAccess, Arterial, + /// Terminal, Ramp, Rotary, LocalStreet + /// + /// + /// Format of newlines in the formatted address. + /// + /// If true, the address will contain newlines. + /// If false, newlines will be converted to commas. + /// + /// + /// Include information on the type of match the geocoder achieved in the + /// response. + /// + /// + /// Specifies the level of filtering performed on geographies. Narrows the + /// search for specified geography entity types, e.g. return only municipality. + /// The resulting response will contain the geography ID as well as the entity + /// type matched. If you provide more than one entity as a comma separated + /// list, endpoint will return the 'smallest entity available'. Returned + /// Geometry ID can be used to get the geometry of that geography via [Get + /// Search + /// Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) + /// API. The following parameters are ignored when entityType is set: + /// + /// * heading + /// * number + /// * returnRoadUse + /// * returnSpeedLimit + /// * roadUse + /// * returnMatchType. Possible values include: 'Country', + /// 'CountrySubdivision', 'CountrySecondarySubdivision', + /// 'CountryTertiarySubdivision', 'Municipality', 'MunicipalitySubdivision', + /// 'Neighbourhood', 'PostalCodeArea' + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchAddressReverseAsync(this ISearchOperations operations, string format, string query, string language = default(string), bool? returnSpeedLimit = default(bool?), double? heading = default(double?), double? radius = default(double?), string number = default(string), bool? returnRoadUse = default(bool?), string roadUse = default(string), bool? allowFreeformNewline = default(bool?), bool? returnMatchType = default(bool?), string entityType = default(string), string view = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchAddressReverseWithHttpMessagesAsync(format, query, language, returnSpeedLimit, heading, radius, number, returnRoadUse, roadUse, allowFreeformNewline, returnMatchType, entityType, view, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Reverse Geocode to a Cross Street** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// There may be times when you need to translate a coordinate (example: + /// 37.786505, -122.3862) into a human understandable cross street. Most often + /// this is needed in tracking applications where you receive a GPS feed from + /// the device or asset and wish to know what address where the coordinate is + /// located. + /// This endpoint will return cross street information for a given coordinate. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The applicable query specified as a comma separated string composed by + /// latitude followed by longitude e.g. "47.641268,-122.125679". + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// The directional heading of the vehicle in degrees, for travel along a + /// segment of roadway. 0 is North, 90 is East and so on, values range from + /// -360 to 360. The precision can include upto one decimal place + /// + /// + /// The radius in meters to for the results to be constrained to the defined + /// area + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchAddressReverseCrossStreetAsync(this ISearchOperations operations, string format, string query, int? limit = default(int?), double? heading = default(double?), double? radius = default(double?), string language = default(string), string view = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchAddressReverseCrossStreetWithHttpMessagesAsync(format, query, limit, heading, radius, language, view, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Structured Address Geocoding** + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Azure Address Geocoding can also be accessed for structured address look + /// up exclusively. The geocoding search index will be queried for everything + /// above the street level data. No POIs will be returned. Note that the + /// geocoder is very tolerant of typos and incomplete addresses. It will also + /// handle everything from exact street addresses or street or intersections + /// as well as higher level geographies such as city centers, counties, states + /// etc. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The 2 or 3 letter + /// [ISO3166-1](https://www.iso.org/iso-3166-country-codes.html) country code + /// portion of an address. E.g. US. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Starting offset of the returned results within the full result set. + /// Default: 0, minimum: 0 and maximum: 1900 + /// + /// + /// The street number portion of an address + /// + /// + /// The street name portion of an address + /// + /// + /// The cross street name for the structured address + /// + /// + /// The municipality portion of an address + /// + /// + /// The municipality subdivision (sub/super city) for the structured address + /// + /// + /// The named area for the structured address + /// + /// + /// The county for the structured address + /// + /// + /// The country subdivision portion of an address + /// + /// + /// The postal code portion of an address + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchAddressStructuredAsync(this ISearchOperations operations, string format, string language = default(string), string countryCode = "US", int? limit = default(int?), int? ofs = default(int?), string streetNumber = default(string), string streetName = default(string), string crossStreet = default(string), string municipality = default(string), string municipalitySubdivision = default(string), string countryTertiarySubdivision = default(string), string countrySecondarySubdivision = default(string), string countrySubdivision = default(string), string postalCode = default(string), string extendedPostalCodesFor = default(string), string view = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchAddressStructuredWithHttpMessagesAsync(format, language, countryCode, limit, ofs, streetNumber, streetName, crossStreet, municipality, municipalitySubdivision, countryTertiarySubdivision, countrySecondarySubdivision, countrySubdivision, postalCode, extendedPostalCodesFor, view, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Search Geometry endpoint allows you to perform a free form search + /// inside a single geometry or many of them. The search results that fall + /// inside the geometry/geometries will be returned.<br><br>To send + /// the geometry you will use a `POST` request where the request body will + /// contain the `geometry` object represented as a `GeoJSON` type and the + /// `Content-Type` header will be set to `application/json`. The geographical + /// features to be searched can be modeled as Polygon and/or Circle geometries + /// represented using any one of the following `GeoJSON` + /// types:<ul><li>**GeoJSON FeatureCollection** <br>The + /// `geometry` can be represented as a `GeoJSON FeatureCollection` object. This + /// is the recommended option if the geometry contains both Polygons and + /// Circles. The `FeatureCollection` can contain a max of 50 `GeoJSON Feature` + /// objects. Each `Feature` object should represent either a Polygon or a + /// Circle with the following conditions:<ul + /// style="list-style-type:none"><li>A `Feature` object for the + /// Polygon geometry can have a max of 50 coordinates and it's properties must + /// be empty.</li><li>A `Feature` object for the Circle geometry is + /// composed of a _center_ represented using a `GeoJSON Point` type and a + /// _radius_ value (in meters) which must be specified in the object's + /// properties along with the _subType_ property whose value should be + /// 'Circle'.</li></ul><br> Please see the Examples section + /// below for a sample `FeatureCollection` + /// representation.<br><br></li><li>**GeoJSON + /// GeometryCollection**<br>The `geometry` can be represented as a + /// `GeoJSON GeometryCollection` object. This is the recommended option if the + /// geometry contains a list of Polygons only. The `GeometryCollection` can + /// contain a max of 50 `GeoJSON Polygon` objects. Each `Polygon` object can + /// have a max of 50 coordinates. Please see the Examples section below for a + /// sample `GeometryCollection` + /// representation.<br><br></li><li>**GeoJSON + /// Polygon**<br>The `geometry` can be represented as a `GeoJSON Polygon` + /// object. This is the recommended option if the geometry contains a single + /// Polygon. The `Polygon` object can have a max of 50 coordinates. Please see + /// the Examples section below for a sample `Polygon` + /// representation.<br><br></li></ul>.<br><br> + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks", + /// "pizza"). Must be properly URL encoded. + /// + /// + /// This represents the geometry for one or more geographical features (parks, + /// state boundary etc.) to search in and should be a GeoJSON compliant type. + /// Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946) for + /// details. + /// + /// + /// Maximum number of responses that will be returned. Default: 10, minimum: 1 + /// and maximum: 100 + /// + /// + /// Language in which search results should be returned. Should be one of + /// supported IETF language tags, case insensitive. When data in specified + /// language is not available for a specific field, default language is used. + /// + /// Please refer to [Supported + /// Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Indexes for which extended postal codes should be included in the results. + /// + /// Available indexes are: + /// + /// **Addr** = Address ranges + /// + /// **Geo** = Geographies + /// + /// **PAD** = Point Addresses + /// + /// **POI** = Points of Interest + /// + /// **Str** = Streets + /// + /// **XStr** = Cross Streets (intersections) + /// + /// Value should be a comma separated list of index types (in any order) or + /// **None** for no indexes. + /// + /// By default extended postal codes are included for all indexes except Geo. + /// Extended postal code lists for geographies can be quite long so they have + /// to be explicitly requested when needed. + /// + /// Usage examples: + /// + /// extendedPostalCodesFor=POI + /// + /// extendedPostalCodesFor=PAD,Addr,POI + /// + /// extendedPostalCodesFor=None + /// + /// Extended postal code is returned as an **extendedPostalCode** property of + /// an address. Availability is region-dependent. + /// + /// + /// A comma separated list of indexes which should be utilized for the search. + /// Item order does not matter. Available indexes are: Addr = Address range + /// interpolation, Geo = Geographies, PAD = Point Addresses, POI = Points of + /// interest, Str = Streets, Xstr = Cross Streets (intersections) + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchInsideGeometryAsync(this ISearchOperations operations, string format, string query, SearchInsideGeometryRequestBody searchInsideGeometryRequestBody, int? limit = default(int?), string language = default(string), IList categorySet = default(IList), string extendedPostalCodesFor = default(string), IList idxSet = default(IList), string view = default(string), string openingHours = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchInsideGeometryWithHttpMessagesAsync(format, query, searchInsideGeometryRequestBody, limit, language, categorySet, extendedPostalCodesFor, idxSet, view, openingHours, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The Search Along Route endpoint allows you to perform a fuzzy search for + /// POIs along a specified route. This search is constrained by specifying the + /// `maxDetourTime` limiting measure.<br><br>To send the + /// route-points you will use a `POST` request where the request body will + /// contain the `route` object represented as a `GeoJSON LineString` type and + /// the `Content-Type` header will be set to `application/json`. Each + /// route-point in `route` is represented as a `GeoJSON Position` type i.e. an + /// array where the _longitude_ value is followed by the _latitude_ value and + /// the _altitude_ value is ignored. The `route` should contain at least 2 + /// route-points.<br><br>It is possible that original route will be + /// altered, some of it's points may be skipped. If the route that passes + /// through the found point is faster than the original one, the `detourTime` + /// value in the response is negative. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// The POI name to search for (e.g., "statue of liberty", "starbucks", + /// "pizza"). Must be properly URL encoded. + /// + /// + /// Maximum detour time of the point of interest in seconds. Max value is 3600 + /// seconds + /// + /// + /// This represents the route to search along and should be a valid `GeoJSON + /// LineString` type. Please refer to [RFC + /// 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. + /// + /// + /// A comma-separated list of category set IDs which could be used to restrict + /// the result to specific Points of Interest categories. ID order does not + /// matter. When multiple category identifiers are provided, only POIs that + /// belong to (at least) one of the categories from the provided list will be + /// returned. The list of supported categories can be discovered using  [POI + /// Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples: + /// + /// * **categorySet=7315** (Search Points of Interest from category Restaurant) + /// + /// * **categorySet=7315025,7315017** (Search Points of Interest of category + /// either Italian or French Restaurant) + /// + /// + /// Maximum number of responses that will be returned. Default value is 10. Max + /// value is 20 + /// + /// + /// A comma-separated list of brand names which could be used to restrict the + /// result to specific brands. Item order does not matter. When multiple brands + /// are provided, only results that belong to (at least) one of the provided + /// list will be returned. Brands that contain a "," in their name should be + /// put into quotes. + /// + /// Usage examples: + /// + /// brandSet=Foo + /// + /// brandSet=Foo,Bar + /// + /// brandSet="A,B,C Comma",Bar + /// + /// + /// A comma-separated list of connector types which could be used to restrict + /// the result to Electric Vehicle Station supporting specific connector types. + /// Item order does not matter. When multiple connector types are provided, + /// only results that belong to (at least) one of the provided list will be + /// returned. + /// + /// Available connector types are: + /// * `StandardHouseholdCountrySpecific` - These are the standard household + /// connectors for a certain region. They are all AC single phase and the + /// standard Voltage and standard Amperage. See also: [Plug & socket types + /// - World + /// Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets). + /// * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 + /// standard. Also called Yazaki after the original manufacturer or SAE J1772 + /// after the standard that first published it. Mostly used in combination with + /// 120V single phase or up to 240V single phase infrastructure. + /// * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 1 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC + /// 62196-2 standard. Provided as a cable and plug attached to the charging + /// point. + /// * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 + /// standard. Provided as a socket set into the charging point. + /// * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC + /// 62196-3 standard. The connector is based on the Type 2 connector – as + /// defined in the IEC 62196-2 standard – with two additional direct current + /// (DC) contacts to allow DC fast charging. + /// * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 + /// standard. Also called Scame after the original manufacturer. Mostly used in + /// combination with up to 240V single phase or up to 420V three phase + /// infrastructure. + /// * `Chademo` - CHAdeMO connector named after an association formed by the + /// Tokyo Electric Power Company and industrial partners. Because of this is is + /// also known as the TEPCO's connector. It supports fast DC charging. + /// * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined + /// in the IEC 60309 standard. It is sometime referred to as by some + /// combination of the standard, the color and the fact that is a single phase + /// connector. The connector usually has the "P+N+E, 6h" configuration. + /// * `IEC60309DCWhite` - Industrial White connector is a DC connector defined + /// in the IEC 60309 standard. + /// * `Tesla` - The Tesla connector is the regionally specific Tesla + /// Supercharger connector. I.e. it refers to either Tesla's proprietary + /// connector, sometimes referred to as Tesla Port mostly limited to North + /// America or the modified Type 2 (DC over Type 2) in Europe. + /// + /// Usage examples: + /// + /// connectorSet=IEC62196Type2CableAttached + /// connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached + /// + /// + /// The View parameter specifies which set of geopolitically disputed content + /// is returned via Azure Maps services, including borders and labels + /// displayed on the map. The View parameter (also referred to as “user region + /// parameter”) will show the correct maps for that country/region. By + /// default, the View parameter is set to “Unified” even if you haven’t defined + /// it in the request. It is your responsibility to determine the location of + /// your users, and then set the View parameter correctly for that location. + /// Alternatively, you have the option to set ‘View=Auto’, which will return + /// the map data based on the IP address of the request. The View parameter in + /// Azure Maps must be used in compliance with applicable laws, including those + /// regarding mapping, of the country where maps, images and other data and + /// third party content that you are authorized to access via Azure Maps is + /// made available. Example: view=IN. + /// + /// Please refer to [Supported + /// Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see + /// the available Views. + /// + /// + /// Hours of operation for a POI (Points of Interest). The availability of + /// hours of operation will vary based on the data available. + /// Supported value: nextSevenDays. Possible values include: 'nextSevenDays' + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchAlongRouteAsync(this ISearchOperations operations, string format, string query, int maxDetourTime, SearchAlongRouteRequestBody searchAlongRouteRequestBody, IList categorySet = default(IList), int? limit = default(int?), IList brandSet = default(IList), IList connectorSet = default(IList), string view = default(string), string openingHours = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchAlongRouteWithHttpMessagesAsync(format, query, maxDetourTime, searchAlongRouteRequestBody, categorySet, limit, brandSet, connectorSet, view, openingHours, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request where the + /// request body will contain the `batchItems` array in `json` format and the + /// `Content-Type` header will be set to `application/json`. Here's a sample + /// request body containing 5 _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of search fuzzy queries/requests to process. The list can contain + /// a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchFuzzyBatchSyncAsync(this ISearchOperations operations, BatchRequestBody searchFuzzyBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchFuzzyBatchSyncWithHttpMessagesAsync(searchFuzzyBatchRequestBody, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request where the + /// request body will contain the `batchItems` array in `json` format and the + /// `Content-Type` header will be set to `application/json`. Here's a sample + /// request body containing 5 _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of search fuzzy queries/requests to process. The list can contain + /// a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchFuzzyBatchAsync(this ISearchOperations operations, BatchRequestBody searchFuzzyBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchFuzzyBatchWithHttpMessagesAsync(searchFuzzyBatchRequestBody, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Fuzzy Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Fuzzy + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy) + /// using just a single API call. You can call Search Address Fuzzy Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search fuzzy_ queries you will use a `POST` request where the + /// request body will contain the `batchItems` array in `json` format and the + /// `Content-Type` header will be set to `application/json`. Here's a sample + /// request body containing 5 _search fuzzy_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": + /// "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + /// {"query": "?query=Statue Of Liberty&limit=2"}, + /// {"query": + /// "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + /// {"query": "?query=Space Needle"}, + /// {"query": "?query=pizza&limit=10"} + /// ] + /// } + /// ``` + /// + /// A _search fuzzy_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search fuzzy_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters). + /// The string values in the _search fuzzy_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "atm" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "ATM at Wells Fargo" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "statue of liberty" + /// }, + /// "results": [ + /// { + /// "type": "POI", + /// "poi": { + /// "name": "Statue of Liberty" + /// }, + /// "address": { + /// "country": "United States Of America", + /// "freeformAddress": "New York, NY 10004" + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchFuzzyBatchAsync(this ISearchOperations operations, string format, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchFuzzyBatchWithHttpMessagesAsync(format, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API to run + /// either asynchronously (async) or synchronously (sync). The async API allows + /// caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + /// France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of address geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchAddressBatchSyncAsync(this ISearchOperations operations, BatchRequestBody searchAddressBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchAddressBatchSyncWithHttpMessagesAsync(searchAddressBatchRequestBody, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API to run + /// either asynchronously (async) or synchronously (sync). The async API allows + /// caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + /// France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of address geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchAddressBatchAsync(this ISearchOperations operations, BatchRequestBody searchAddressBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchAddressBatchWithHttpMessagesAsync(searchAddressBatchRequestBody, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Address Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress) + /// using just a single API call. You can call Search Address Batch API to run + /// either asynchronously (async) or synchronously (sync). The async API allows + /// caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address_ queries you will use a `POST` request where + /// the request body will contain the `batchItems` array in `json` format and + /// the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + /// {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + /// {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + /// {"query": "?query=Pike Pl, Seattle, WA + /// 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + /// {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + /// France&limit=1"} + /// ] + /// } + /// ``` + /// + /// A _search address_ query in a batch is just a partial URL _without_ the + /// protocol, base URL, path, api-version and subscription-key. It can accept + /// any of the supported _search address_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters). + /// The string values in the _search address_ query must be properly escaped + /// (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchCommonResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "one microsoft way redmond wa 98052" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.63989, + /// "lon": -122.12509 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "query": "pike pl seattle wa 98101" + /// }, + /// "results": [ + /// { + /// "position": { + /// "lat": 47.60963, + /// "lon": -122.34215 + /// } + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchAddressBatchAsync(this ISearchOperations operations, string format, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchAddressBatchWithHttpMessagesAsync(format, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in `json` format + /// and the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It can + /// accept any of the supported _search address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of reverse geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchAddressReverseBatchSyncAsync(this ISearchOperations operations, BatchRequestBody searchAddressReverseBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchAddressReverseBatchSyncWithHttpMessagesAsync(searchAddressReverseBatchRequestBody, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in `json` format + /// and the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It can + /// accept any of the supported _search address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// The list of reverse geocoding queries/requests to process. The list can + /// contain a max of 10,000 queries and must contain at least 1 query. + /// + /// + /// The cancellation token. + /// + public static async Task PostSearchAddressReverseBatchAsync(this ISearchOperations operations, BatchRequestBody searchAddressReverseBatchRequestBody, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostSearchAddressReverseBatchWithHttpMessagesAsync(searchAddressReverseBatchRequestBody, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Search Address Reverse Batch API** + /// + /// + /// **Applies to**: S1 pricing tier. + /// + /// + /// + /// The Search Address Batch API sends batches of queries to [Search Address + /// Reverse + /// API](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse) + /// using just a single API call. You can call Search Address Reverse Batch API + /// to run either asynchronously (async) or synchronously (sync). The async API + /// allows caller to batch up to **10,000** queries and sync API up to **100** + /// queries. + /// ### Submit Synchronous Batch Request + /// The Synchronous API is recommended for lightweight batch requests. When the + /// service receives a request, it will respond as soon as the batch items are + /// calculated and there will be no possibility to retrieve the results later. + /// The Synchronous API will return a timeout error (a 408 response) if the + /// request takes longer than 60 seconds. The number of batch items is limited + /// to **100** for this API. + /// ``` + /// POST + /// https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// ### Submit Asynchronous Batch Request + /// The Asynchronous API is appropriate for processing big volumes of + /// relatively complex search requests + /// - It allows the retrieval of results in a separate call (multiple downloads + /// are possible). + /// - The asynchronous API is optimized for reliability and is not expected to + /// run into a timeout. + /// - The number of batch items is limited to **10,000** for this API. + /// + /// When you make a request by using async request, by default the service + /// returns a 202 response code along a redirect URL in the Location field of + /// the response header. This URL should be checked periodically until the + /// response data or error information is available. + /// The asynchronous responses are stored for **14** days. The redirect URL + /// returns a 404 response if used after the expiration period. + /// + /// Please note that asynchronous batch request is a long-running request. + /// Here's a typical sequence of operations: + /// 1. Client sends a Search Address Batch `POST` request to Azure Maps + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request has been accepted. + /// + /// > HTTP `Error` - There was an error processing your Batch request. This + /// could either be a `400 Bad Request` or any other `Error` status code. + /// + /// 3. If the batch request was accepted successfully, the `Location` header in + /// the response contains the URL to download the results of the batch request. + /// This status URI looks like following: + /// + /// ``` + /// GET + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// 4. Client issues a `GET` request on the _download URL_ obtained in Step 3 + /// to download the batch results. + /// + /// ### POST Body for Batch Request + /// To send the _search address reverse_ queries you will use a `POST` request + /// where the request body will contain the `batchItems` array in `json` format + /// and the `Content-Type` header will be set to `application/json`. Here's a + /// sample request body containing 5 _search address reverse_ queries: + /// + /// + /// ```json + /// { + /// "batchItems": [ + /// {"query": "?query=48.858561,2.294911"}, + /// {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + /// {"query": "?query=47.621028,-122.348170"}, + /// {"query": "?query=43.722990,10.396695"}, + /// {"query": "?query=40.750958,-73.982336"} + /// ] + /// } + /// ``` + /// + /// A _search address reverse_ query in a batch is just a partial URL _without_ + /// the protocol, base URL, path, api-version and subscription-key. It can + /// accept any of the supported _search address reverse_ [URI + /// parameters](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters). + /// The string values in the _search address reverse_ query must be properly + /// escaped (e.g. " character should be escaped with \\ ) and it should also be + /// properly URL-encoded. + /// + /// + /// The async API allows caller to batch up to **10,000** queries and sync API + /// up to **100** queries, and the batch should contain at least **1** query. + /// + /// + /// ### Download Asynchronous Batch Results + /// To download the async batch results you will issue a `GET` request to the + /// batch download endpoint. This _download URL_ can be obtained from the + /// `Location` header of a successful `POST` batch request and looks like the + /// following: + /// + /// ``` + /// https://atlas.microsoft.com/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + /// ``` + /// Here's the typical sequence of operations for downloading the batch + /// results: + /// 1. Client sends a `GET` request using the _download URL_. + /// 2. The server will respond with one of the following: + /// + /// > HTTP `202 Accepted` - Batch request was accepted but is still being + /// processed. Please try again in some time. + /// + /// > HTTP `200 OK` - Batch request successfully processed. The response + /// body contains all the batch results. + /// + /// + /// + /// ### Batch Response Model + /// The returned data content is similar for async and sync requests. When + /// downloading the results of an async batch request, if the batch has + /// finished processing, the response body contains the batch response. This + /// batch response contains a `summary` component that indicates the + /// `totalRequests` that were part of the original batch request and + /// `successfulRequests`i.e. queries which were executed successfully. The + /// batch response also includes a `batchItems` array which contains a response + /// for each and every query in the batch request. The `batchItems` will + /// contain the results in the exact same order the original queries were sent + /// in the batch request. Each item in `batchItems` contains `statusCode` and + /// `response` fields. Each `response` in `batchItems` is of one of the + /// following types: + /// + /// - + /// [`SearchAddressReverseResponse`](https://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse) + /// - If the query completed successfully. + /// + /// - `Error` - If the query failed. The response will contain a `code` and a + /// `message` in this case. + /// + /// + /// Here's a sample Batch Response with 2 _successful_ and 1 _failed_ result: + /// + /// + /// ```json + /// { + /// "summary": { + /// "successfulRequests": 2, + /// "totalRequests": 3 + /// }, + /// "batchItems": [ + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 11 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "France", + /// "freeformAddress": "Avenue Anatole France, 75007 Paris" + /// }, + /// "position": "48.858490,2.294820" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 200, + /// "response": + /// { + /// "summary": { + /// "queryTime": 1 + /// }, + /// "addresses": [ + /// { + /// "address": { + /// "country": "United States of America", + /// "freeformAddress": "157th Pl NE, Redmond WA 98052" + /// }, + /// "position": "47.640470,-122.129430" + /// } + /// ] + /// } + /// }, + /// { + /// "statusCode": 400, + /// "response": + /// { + /// "error": + /// { + /// "code": "400 BadRequest", + /// "message": "Bad request: one or more parameters were incorrectly specified + /// or are mutually exclusive." + /// } + /// } + /// } + /// ] + /// } + /// ``` + /// + /// + /// The operations group for this extension method. + /// + /// + /// Batch id for querying the operation. + /// + /// + /// The cancellation token. + /// + public static async Task GetSearchAddressReverseBatchAsync(this ISearchOperations operations, string format, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSearchAddressReverseBatchWithHttpMessagesAsync(format, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}