diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/IRenderClient.cs b/sdk/maps/Azure.Maps.Render/src/Generated/IRenderClient.cs new file mode 100644 index 0000000000000..8b920798d8d6c --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/IRenderClient.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.Render +{ + using Microsoft.Rest; + using Models; + using Newtonsoft.Json; + + /// + /// Azure Maps Render REST APIs + /// + public partial interface IRenderClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Version number of Azure Maps API. Current version is 2.1 + /// + 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 ClientId { get; set; } + + /// + /// Subscription credentials which uniquely identify client + /// subscription. + /// + ServiceClientCredentials Credentials { get; } + + + /// + /// Gets the IRenderV2. + /// + IRenderV2 RenderV2 { get; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/IRenderV2.cs b/sdk/maps/Azure.Maps.Render/src/Generated/IRenderV2.cs new file mode 100644 index 0000000000000..2f2d1f36bbfd5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/IRenderV2.cs @@ -0,0 +1,879 @@ +// +// 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.Render +{ + using Microsoft.Rest; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RenderV2 operations. + /// + public partial interface IRenderV2 + { + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Tiles API allows users to request map tiles in vector + /// or raster formats typically to be integrated into a map control or + /// SDK. Some example tiles that can be requested are Azure Maps road + /// tiles, real-time Weather Radar tiles or the map tiles created + /// using [Azure Maps Creator](https://aka.ms/amcreator). By default, + /// Azure Maps uses vector tiles for its web map control (Web SDK) and + /// Android SDK. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a + /// uniform grid of square tiles at preset zoom levels. Every tileset + /// has a **tilesetId** to use when making requests. The **tilesetId** + /// for tilesets created using [Azure Maps + /// Creator](https://aka.ms/amcreator) are generated through the + /// [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', + /// 'microsoft.terra.main', 'microsoft.base.road', + /// 'microsoft.base.darkgrey', 'microsoft.base.labels.road', + /// 'microsoft.base.labels.darkgrey', 'microsoft.base.hybrid.road', + /// 'microsoft.base.hybrid.darkgrey', 'microsoft.imagery', + /// 'microsoft.weather.radar.main', 'microsoft.weather.infrared.main', + /// 'microsoft.dem', 'microsoft.dem.contours', + /// 'microsoft.traffic.absolute', 'microsoft.traffic.absolute.main', + /// 'microsoft.traffic.relative', 'microsoft.traffic.relative.main', + /// 'microsoft.traffic.relative.dark', 'microsoft.traffic.delay', + /// 'microsoft.traffic.delay.main', 'microsoft.traffic.reduced.main', + /// 'microsoft.traffic.incident' + /// + /// + /// Additional parameters for the operation + /// + /// + /// The desired date and time of the requested tile. This parameter + /// must be specified in the standard date-time format (e.g. + /// 2019-11-14T16:03:00-08:00), as defined by [ISO + /// 8601](https://en.wikipedia.org/wiki/ISO_8601). This parameter is + /// only supported when tilesetId parameter is set to one of the values + /// below. + /// + /// * microsoft.weather.infrared.main: We provide tiles up to 3 hours + /// in the past. Tiles are available in 10-minute intervals. We round + /// the timeStamp value to the nearest 10-minute time frame. + /// * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in + /// the past and up to 2 hours in the future. Tiles are available in + /// 5-minute intervals. We round the timeStamp value to the nearest + /// 5-minute time frame. + /// + /// + /// The size of the returned map tile in pixels. Possible values + /// include: 'size256', 'size512' + /// + /// + /// 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/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter (also called the "user region" parameter) allows + /// you to show the correct maps for a certain country/region for + /// geopolitically disputed regions. Different countries have different + /// views of such regions, and the View parameter allows your + /// application to comply with the view required by the country your + /// application will be serving. 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. Possible values include: 'AE', 'AR', + /// 'BH', 'IN', 'IQ', 'JO', 'KW', 'LB', 'MA', 'OM', 'PK', 'PS', 'QA', + /// 'SA', 'SY', 'YE', 'Auto', 'Unified' + /// + /// + /// 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> GetMapTileWithHttpMessagesAsync(string tilesetId, TileIndex tileIndex, System.DateTime? timeStamp = default(System.DateTime?), string tileSize = default(string), string language = default(string), string localizedMapView = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Tileset API allows users to request metadata for a + /// tileset. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a + /// uniform grid of square tiles at preset zoom levels. Every tileset + /// has a **tilesetId** to use when making requests. The **tilesetId** + /// for tilesets created using [Azure Maps + /// Creator](https://aka.ms/amcreator) are generated through the + /// [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', + /// 'microsoft.terra.main', 'microsoft.base.road', + /// 'microsoft.base.darkgrey', 'microsoft.base.labels.road', + /// 'microsoft.base.labels.darkgrey', 'microsoft.base.hybrid.road', + /// 'microsoft.base.hybrid.darkgrey', 'microsoft.imagery', + /// 'microsoft.weather.radar.main', 'microsoft.weather.infrared.main', + /// 'microsoft.dem', 'microsoft.dem.contours', + /// 'microsoft.traffic.absolute', 'microsoft.traffic.absolute.main', + /// 'microsoft.traffic.relative', 'microsoft.traffic.relative.main', + /// 'microsoft.traffic.relative.dark', 'microsoft.traffic.delay', + /// 'microsoft.traffic.delay.main', 'microsoft.traffic.reduced.main', + /// 'microsoft.traffic.incident' + /// + /// + /// 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> GetMapTilesetWithHttpMessagesAsync(string tilesetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Attribution API allows users to request map copyright + /// attribution information for a section of a tileset. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a + /// uniform grid of square tiles at preset zoom levels. Every tileset + /// has a **tilesetId** to use when making requests. The **tilesetId** + /// for tilesets created using [Azure Maps + /// Creator](https://aka.ms/amcreator) are generated through the + /// [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', + /// 'microsoft.terra.main', 'microsoft.base.road', + /// 'microsoft.base.darkgrey', 'microsoft.base.labels.road', + /// 'microsoft.base.labels.darkgrey', 'microsoft.base.hybrid.road', + /// 'microsoft.base.hybrid.darkgrey', 'microsoft.imagery', + /// 'microsoft.weather.radar.main', 'microsoft.weather.infrared.main', + /// 'microsoft.dem', 'microsoft.dem.contours', + /// 'microsoft.traffic.absolute', 'microsoft.traffic.absolute.main', + /// 'microsoft.traffic.relative', 'microsoft.traffic.relative.main', + /// 'microsoft.traffic.relative.dark', 'microsoft.traffic.delay', + /// 'microsoft.traffic.delay.main', 'microsoft.traffic.reduced.main', + /// 'microsoft.traffic.incident' + /// + /// + /// Zoom level for the desired map attribution. + /// + /// + /// The string that represents the rectangular area of a bounding box. + /// The bounds parameter is defined by the 4 bounding box coordinates, + /// with WGS84 longitude and latitude of the southwest corner followed + /// by WGS84 longitude and latitude of the northeast corner. The + /// string is presented in the following format: + /// `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, + /// NortheastCorner_Longitude, NortheastCorner_Latitude]`. + /// + /// + /// 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> GetMapAttributionWithHttpMessagesAsync(string tilesetId, int zoom, IList bounds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Fetches state tiles in vector format typically to be integrated + /// into indoor maps module of map control or SDK. The map control will + /// call this API after user turns on dynamic styling (see [Zoom Levels + /// and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid)) + /// + /// + /// The stateset id. + /// + /// + /// Additional parameters for 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> GetMapStateTileWithHttpMessagesAsync(string statesetId, TileIndex tileIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// + /// Copyrights API is designed to serve copyright information for + /// Render Tile + /// service. In addition to basic copyright for the whole map, API is + /// serving + /// specific groups of copyrights for some countries. + /// + /// As an alternative to copyrights for map request, one can receive + /// captions + /// for displaying the map provider information on the map. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// 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> GetCopyrightCaptionWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The static image service renders a user-defined, rectangular image + /// containing a map section using a zoom level from 0 to 20. The + /// static image service renders a user-defined, rectangular image + /// containing a map section using a zoom level from 0 to 20. The + /// supported resolution range for the map image is from 1x1 to + /// 8192x8192. If you are deciding when to use the static image service + /// over the map tile service, you may want to consider how you would + /// like to interact with the rendered map. If the map contents will be + /// relatively unchanging, a static map is a good choice. If you want + /// to support a lot of zooming, panning and changing of the map + /// content, the map tile service would be a better choice. + /// + /// Service also provides Image Composition functionality to get a + /// static image back with additional data like; pushpins and geometry + /// overlays with following S0 and S1 capabilities. + /// + /// In S0 you can: + /// - Render up to 5 pushpins specified in the request + /// - Provide one custom image for the pins referenced in the request + /// - Add labels to the pushpins + /// + /// In S1 you can: + /// - Render pushpins through [Azure Maps Data + /// Service](https://aka.ms/AzureMapsMapDataService) + /// - Specify multiple pushpin styles + /// - Render circle, polyline and polygon geometry types. + /// - Render of supported GeoJSON geometry types uploaded through + /// [Azure Maps Data Service](https://aka.ms/AzureMapsMapDataService) + /// + /// Please see + /// [How-to-Guide](https://aka.ms/AzureMapsHowToGuideImageCompositor) + /// for detailed examples. + /// + /// _Note_ : Either **center** or **bbox** parameter must be supplied + /// to the + /// API. + /// <br><br> + /// The supported Lat and Lon ranges when using the **bbox** parameter, + /// are as follows: + /// <br><br> + /// + /// |Zoom Level | Max Lon Range | Max Lat Range| + /// |:----------|:----------------|:-------------| + /// |0 | 360.0 | 170.0 | + /// |1 | 360.0 | 170.0 | + /// |2 | 360.0 | 170.0 | + /// |3 | 360.0 | 170.0 | + /// |4 | 360.0 | 170.0 | + /// |5 | 180.0 | 85.0 | + /// |6 | 90.0 | 42.5 | + /// |7 | 45.0 | 21.25 | + /// |8 | 22.5 | 10.625 | + /// |9 | 11.25 | 5.3125 | + /// |10 | 5.625 | 2.62625 | + /// |11 | 2.8125 | 1.328125 | + /// |12 | 1.40625 | 0.6640625 | + /// |13 | 0.703125 | 0.33203125 | + /// |14 | 0.3515625 | 0.166015625 | + /// |15 | 0.17578125 | 0.0830078125 | + /// |16 | 0.087890625 | 0.0415039063 | + /// |17 | 0.0439453125 | 0.0207519531 | + /// |18 | 0.0219726563 | 0.0103759766 | + /// |19 | 0.0109863281 | 0.0051879883 | + /// |20 | 0.0054931641 | 0.0025939941 | + /// + /// + /// Map layer requested. If layer is set to labels or hybrid, the + /// format should be png. Possible values include: 'basic', 'hybrid', + /// 'labels' + /// + /// + /// Map style to be returned. Possible values are main and dark. + /// Possible values include: 'main', 'dark' + /// + /// + /// Desired zoom level of the map. Zoom value must be in the range: + /// 0-20 (inclusive). Default value is 12.<br><br>Please + /// see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// + /// + /// Coordinates of the center point. Format: 'lon,lat'. Projection used + /// - EPSG:3857. Longitude range: -180 to 180. Latitude range: -85 to + /// 85. + /// + /// Note: Either center or bbox are required parameters. They are + /// mutually exclusive. + /// + /// + /// Bounding box. Projection used - EPSG:3857. Format : 'minLon, + /// minLat, + /// maxLon, maxLat'. + /// + /// Note: Either bbox or center are required + /// parameters. They are mutually exclusive. It shouldn’t be used with + /// height or width. + /// + /// The maximum allowed ranges for Lat and Lon are defined for each + /// zoom level + /// in the table at the top of this page. + /// + /// + /// Height of the resulting image in pixels. Range is 1 to 8192. + /// Default + /// is 512. It shouldn’t be used with bbox. + /// + /// + /// Width of the resulting image in pixels. Range is 1 to 8192. Default + /// is 512. It shouldn’t be used with bbox. + /// + /// + /// 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/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter (also called the "user region" parameter) allows + /// you to show the correct maps for a certain country/region for + /// geopolitically disputed regions. Different countries have different + /// views of such regions, and the View parameter allows your + /// application to comply with the view required by the country your + /// application will be serving. 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. Possible values include: 'AE', 'AR', + /// 'BH', 'IN', 'IQ', 'JO', 'KW', 'LB', 'MA', 'OM', 'PK', 'PS', 'QA', + /// 'SA', 'SY', 'YE', 'Auto', 'Unified' + /// + /// + /// Pushpin style and instances. Use this parameter to optionally add + /// pushpins to the image. + /// The pushpin style describes the appearance of the pushpins, and the + /// instances specify + /// the coordinates of the pushpins and optional labels for each pin. + /// (Be sure to properly URL-encode values of this + /// parameter since it will contain reserved characters such as pipes + /// and punctuation.) + /// + /// The Azure Maps account S0 SKU only supports a single instance of + /// the pins parameter. Other SKUs + /// allow multiple instances of the pins parameter to specify multiple + /// pin styles. + /// + /// To render a pushpin at latitude 45°N and longitude 122°W using the + /// default built-in pushpin style, add the + /// querystring parameter + /// + /// `pins=default||-122 45` + /// + /// Note that the longitude comes before the latitude. + /// After URL encoding this will look like + /// + /// `pins=default%7C%7C-122+45` + /// + /// All of the examples here show the pins + /// parameter without URL encoding, for clarity. + /// + /// To render a pin at multiple locations, separate each location with + /// a pipe character. For example, use + /// + /// `pins=default||-122 45|-119.5 43.2|-121.67 47.12` + /// + /// The S0 Azure Maps account SKU only allows five pushpins. Other + /// account SKUs do not have this limitation. + /// + /// ### Style Modifiers + /// + /// You can modify the appearance of the pins by adding style + /// modifiers. These are added after the style but before + /// the locations and labels. Style modifiers each have a two-letter + /// name. These abbreviated names are used to help + /// reduce the length of the URL. + /// + /// To change the color of the pushpin, use the 'co' style modifier and + /// specify the color using the HTML/CSS RGB color + /// format which is a six-digit hexadecimal number (the three-digit + /// form is not supported). For example, to use + /// a deep pink color which you would specify as #FF1493 in CSS, use + /// + /// `pins=default|coFF1493||-122 45` + /// + /// ### Pushpin Labels + /// + /// To add a label to the pins, put the label in single quotes just + /// before the coordinates. For example, to label + /// three pins with the values '1', '2', and '3', use + /// + /// `pins=default||'1'-122 45|'2'-119.5 43.2|'3'-121.67 47.12` + /// + /// There is a built in pushpin style called 'none' that does not + /// display a pushpin image. You can use this if + /// you want to display labels without any pin image. For example, + /// + /// `pins=none||'A'-122 45|'B'-119.5 43.2` + /// + /// To change the color of the pushpin labels, use the 'lc' label color + /// style modifier. For example, to use pink + /// pushpins with black labels, use + /// + /// `pins=default|coFF1493|lc000000||-122 45` + /// + /// To change the size of the labels, use the 'ls' label size style + /// modifier. The label size represents the approximate + /// height of the label text in pixels. For example, to increase the + /// label size to 12, use + /// + /// `pins=default|ls12||'A'-122 45|'B'-119 43` + /// + /// The labels are centered at the pushpin 'label anchor.' The anchor + /// location is predefined for built-in pushpins and + /// is at the top center of custom pushpins (see below). To override + /// the label anchor, using the 'la' style modifier + /// and provide X and Y pixel coordinates for the anchor. These + /// coordinates are relative to the top left corner of the + /// pushpin image. Positive X values move the anchor to the right, and + /// positive Y values move the anchor down. For example, + /// to position the label anchor 10 pixels right and 4 pixels above the + /// top left corner of the pushpin image, + /// use + /// + /// `pins=default|la10 -4||'A'-122 45|'B'-119 43` + /// + /// ### Custom Pushpins + /// + /// To use a custom pushpin image, use the word 'custom' as the pin + /// style name, and then specify a URL after the + /// location and label information. Use two pipe characters to indicate + /// that you're done specifying locations and are + /// starting the URL. For example, + /// + /// `pins=custom||-122 45||http://contoso.com/pushpins/red.png` + /// + /// After URL encoding, this would look like + /// + /// `pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png` + /// + /// By default, custom pushpin images are drawn centered at the pin + /// coordinates. This usually isn't ideal as it obscures + /// the location that you're trying to highlight. To override the + /// anchor location of the pin image, use the 'an' + /// style modifier. This uses the same format as the 'la' label anchor + /// style modifier. For example, if your custom + /// pin image has the tip of the pin at the top left corner of the + /// image, you can set the anchor to that spot by + /// using + /// + /// `pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png` + /// + /// Note: If you use the 'co' color modifier with a custom pushpin + /// image, the specified color will replace the RGB + /// channels of the pixels in the image but will leave the alpha + /// (opacity) channel unchanged. This would usually + /// only be done with a solid-color custom image. + /// + /// ### Getting Pushpins from Azure Maps Data Storage + /// + /// For all Azure Maps account SKUs other than S0, + /// the pushpin location information can be obtained from Azure Maps + /// Data Storage. After uploading a GeoJSON document containing pin + /// locations, the Data Storage service returns a Unique Data ID (UDID) + /// that you can use + /// to reference the data in the pins parameter. + /// + /// To use the point geometry from an uploaded GeoJSON document as the + /// pin locations, specify the UDID in the locations + /// section of the pins parameter. For example, + /// + /// `pins=default||udid-29dc105a-dee7-409f-a3f9-22b066ae4713` + /// + /// Note that + /// only point and multipoint geometry, points and multipoints from + /// geometry collections, and point geometry from features + /// will be used. Linestring and polygon geometry will be ignored. If + /// the point comes from a feature and the feature + /// has a string property called "label", the value of that property + /// will be used as the label for the pin. + /// + /// You can mix pin locations from Data Storage and pin locations + /// specified in the pins parameter. Any of the pipe-delimited + /// pin locations can be a longitude and latitude or a UDID. For + /// example, + /// + /// `pins=default||-122 + /// 45|udid-29dc105a-dee7-409f-a3f9-22b066ae4713|-119 43` + /// + /// ### Scale, Rotation, and Opacity + /// + /// You can make pushpins and their labels larger or smaller by using + /// the 'sc' scale style modifier. This is a + /// value greater than zero. A value of 1 is the standard scale. Values + /// larger than 1 will make the pins larger, and + /// values smaller than 1 will make them smaller. For example, to draw + /// the pushpins 50% larger than normal, use + /// + /// `pins=default|sc1.5||-122 45` + /// + /// You can rotate pushpins and their labels by using the 'ro' rotation + /// style modifier. This is a number of degrees + /// of clockwise rotation. Use a negative number to rotate + /// counter-clockwise. For example, to rotate the pushpins + /// 90 degrees clockwise and double their size, use + /// + /// `pins=default|ro90|sc2||-122 45` + /// + /// You can make pushpins and their labels partially transparent by + /// specifying the 'al' alpha style modifier. + /// This is a number between 0 and 1 indicating the opacity of the + /// pushpins. Zero makes them completely transparent + /// (and not visible) and 1 makes them completely opaque (which is the + /// default). For example, to make pushpins + /// and their labels only 67% opaque, use + /// + /// `pins=default|al.67||-122 45` + /// + /// ### Style Modifier Summary + /// + /// Modifier | Description | Range + /// :--------:|-----------------|------------------ + /// al | Alpha (opacity) | 0 to 1 + /// an | Pin anchor | * + /// co | Pin color | 000000 to FFFFFF + /// la | Label anchor | * + /// lc | Label color | 000000 to FFFFFF + /// ls | Label size | Greater than 0 + /// ro | Rotation | -360 to 360 + /// sc | Scale | Greater than 0 + /// + /// * X and Y coordinates can be anywhere within pin image or a margin + /// around it. + /// The margin size is the minimum of the pin width and height. + /// + /// + /// Path style and locations. Use this parameter to optionally add + /// lines, polygons or circles to the image. + /// The path style describes the appearance of the line and fill. (Be + /// sure to properly URL-encode values of this + /// parameter since it will contain reserved characters such as pipes + /// and punctuation.) + /// + /// Path parameter is supported in Azure Maps account SKU starting with + /// S1. Multiple instances of the path parameter + /// allow to specify multiple geometries with their styles. Number of + /// parameters per request is limited to 10 and + /// number of locations is limited to 100 per path. + /// + /// To render a circle with radius 100 meters and center point at + /// latitude 45°N and longitude 122°W using the default style, add the + /// querystring parameter + /// + /// `path=ra100||-122 45` + /// + /// Note that the longitude comes before the latitude. + /// After URL encoding this will look like + /// + /// `path=ra100%7C%7C-122+45` + /// + /// All of the examples here show the path parameter without URL + /// encoding, for clarity. + /// + /// To render a line, separate each location with a pipe character. For + /// example, use + /// + /// `path=||-122 45|-119.5 43.2|-121.67 47.12` + /// + /// To render a polygon, last location must be equal to the start + /// location. For example, use + /// + /// `path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45` + /// + /// Longitude and latitude values for locations of lines and polygons + /// can be in the range from -360 to 360 to allow for rendering of + /// geometries crossing the anti-meridian. + /// + /// ### Style Modifiers + /// + /// You can modify the appearance of the path by adding style + /// modifiers. These are added before the locations. + /// Style modifiers each have a two-letter name. These abbreviated + /// names are used to help reduce the length + /// of the URL. + /// + /// To change the color of the outline, use the 'lc' style modifier and + /// specify the color using the HTML/CSS RGB color + /// format which is a six-digit hexadecimal number (the three-digit + /// form is not supported). For example, to use + /// a deep pink color which you would specify as #FF1493 in CSS, use + /// + /// `path=lcFF1493||-122 45|-119.5 43.2` + /// + /// Multiple style modifiers may be combined together to create a more + /// complex visual style. + /// + /// `lc0000FF|lw3|la0.60|fa0.50||-122.2 47.6|-122.2 47.7|-122.3 + /// 47.7|-122.3 47.6|-122.2 47.6` + /// + /// ### Getting Path locations from Azure Maps Data Storage + /// + /// For all Azure Maps account SKUs other than S0, the path location + /// information can be obtained from Azure Maps Data Storage. + /// After uploading a GeoJSON document containing path locations, the + /// Data Storage service returns a Unique Data ID (UDID) that you can + /// use + /// to reference the data in the path parameter. + /// + /// To use the point geometry from an uploaded GeoJSON document as the + /// path locations, specify the UDID in the locations + /// section of the path parameter. For example, + /// + /// `path=||udid-29dc105a-dee7-409f-a3f9-22b066ae4713` + /// + /// Note the it is not allowed to mix path locations from Data Storage + /// with locations specified in the path parameter. + /// + /// ### Style Modifier Summary + /// + /// Modifier | Description | Range + /// :--------:|------------------------|------------------ + /// lc | Line color | 000000 to FFFFFF + /// fc | Fill color | 000000 to FFFFFF + /// la | Line alpha (opacity) | 0 to 1 + /// fa | Fill alpha (opacity) | 0 to 1 + /// lw | Line width | Greater than 0 + /// ra | Circle radius (meters) | Greater than 0 + /// + /// + /// 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> GetMapStaticImageWithHttpMessagesAsync(string layer = default(string), string style = default(string), int? zoom = default(int?), IList center = default(IList), IList boundingBoxPrivate = default(IList), int? height = default(int?), int? width = default(int?), string language = default(string), string localizedMapView = default(string), IList pins = default(IList), IList path = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns copyright information for a given bounding box. + /// Bounding-box requests should specify the minimum and maximum + /// longitude and latitude (EPSG-3857) coordinates + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// Additional parameters for the operation + /// + /// + /// Yes/no value to exclude textual data from response. Only images and + /// country names will be in response. Possible values include: 'yes', + /// 'no' + /// + /// + /// 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> GetCopyrightFromBoundingBoxWithHttpMessagesAsync(string format, BoundingBox boundingBox, string includeText = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// + /// Copyrights API is designed to serve copyright information for + /// Render Tile service. In addition to basic copyright for the whole + /// map, API is serving specific groups of copyrights for some + /// countries. + /// Returns the copyright information for a given tile. To obtain the + /// copyright information for a particular tile, the request should + /// specify the tile's zoom level and x and y coordinates (see: Zoom + /// Levels and Tile Grid). + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// Additional parameters for the operation + /// + /// + /// Yes/no value to exclude textual data from response. Only images and + /// country names will be in response. Possible values include: 'yes', + /// 'no' + /// + /// + /// 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> GetCopyrightForTileWithHttpMessagesAsync(string format, TileIndex tileIndex, string includeText = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Copyrights API is designed to serve copyright information for + /// Render Tile service. In addition to basic copyright for the whole + /// map, API is serving specific groups of copyrights for some + /// countries. + /// Returns the copyright information for the world. To obtain the + /// default copyright information for the whole world, do not specify a + /// tile or bounding box. + /// + /// + /// Desired format of the response. Value can be either _json_ or + /// _xml_. Possible values include: 'json', 'xml' + /// + /// + /// Yes/no value to exclude textual data from response. Only images and + /// country names will be in response. Possible values include: 'yes', + /// 'no' + /// + /// + /// 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> GetCopyrightForWorldWithHttpMessagesAsync(string format, string includeText = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/BoundingBox.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/BoundingBox.cs new file mode 100644 index 0000000000000..8accdd9f6c3c6 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/BoundingBox.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.Render.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional parameters for GetCopyrightFromBoundingBox operation. + /// + public partial class BoundingBox + { + /// + /// Initializes a new instance of the BoundingBox class. + /// + public BoundingBox() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BoundingBox class. + /// + /// Minimum coordinates (south-west point) of + /// bounding box in latitude longitude coordinate system. E.g. + /// 52.41064,4.84228 + /// Maximum coordinates (north-east point) of + /// bounding box in latitude longitude coordinate system. E.g. + /// 52.41064,4.84228 + public BoundingBox(IList southWest, IList northEast) + { + SouthWest = southWest; + NorthEast = northEast; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets minimum coordinates (south-west point) of bounding box + /// in latitude longitude coordinate system. E.g. 52.41064,4.84228 + /// + [Newtonsoft.Json.JsonIgnore] + public IList SouthWest { get; set; } + + /// + /// Gets or sets maximum coordinates (north-east point) of bounding box + /// in latitude longitude coordinate system. E.g. 52.41064,4.84228 + /// + [Newtonsoft.Json.JsonIgnore] + public IList NorthEast { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SouthWest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SouthWest"); + } + if (NorthEast == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NorthEast"); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/Copyright.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/Copyright.cs new file mode 100644 index 0000000000000..28565d3cd7292 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/Copyright.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.Render.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This object is returned from a successful copyright request + /// + public partial class Copyright + { + /// + /// Initializes a new instance of the Copyright class. + /// + public Copyright() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Copyright class. + /// + /// Format Version property + /// General Copyrights array + /// Regions array + public Copyright(string formatVersion = default(string), IList generalCopyrights = default(IList), IList regions = default(IList)) + { + FormatVersion = formatVersion; + GeneralCopyrights = generalCopyrights; + Regions = regions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets format Version property + /// + [JsonProperty(PropertyName = "formatVersion")] + public string FormatVersion { get; private set; } + + /// + /// Gets general Copyrights array + /// + [JsonProperty(PropertyName = "generalCopyrights")] + public IList GeneralCopyrights { get; private set; } + + /// + /// Gets regions array + /// + [JsonProperty(PropertyName = "regions")] + public IList Regions { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/CopyrightCaption.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/CopyrightCaption.cs new file mode 100644 index 0000000000000..7d823eabe30c3 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/CopyrightCaption.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.Render.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This object is returned from a successful copyright call + /// + public partial class CopyrightCaption + { + /// + /// Initializes a new instance of the CopyrightCaption class. + /// + public CopyrightCaption() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CopyrightCaption class. + /// + /// Format Version property + /// Copyrights Caption property + public CopyrightCaption(string formatVersion = default(string), string copyrightsCaption = default(string)) + { + FormatVersion = formatVersion; + CopyrightsCaption = copyrightsCaption; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets format Version property + /// + [JsonProperty(PropertyName = "formatVersion")] + public string FormatVersion { get; private set; } + + /// + /// Gets copyrights Caption property + /// + [JsonProperty(PropertyName = "copyrightsCaption")] + public string CopyrightsCaption { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 0000000000000..37aabe98bcc38 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/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.Render.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.Render/src/Generated/Models/ErrorDetail.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..ff8f3bb3afd7b --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/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.Render.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.Render/src/Generated/Models/ErrorResponse.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..f42cd8ab30a6a --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/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.Render.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.Render/src/Generated/Models/ErrorResponseException.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 0000000000000..963ec946112ab --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/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.Render.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.Render/src/Generated/Models/IncludeText.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/IncludeText.cs new file mode 100644 index 0000000000000..8069eda95a83d --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/IncludeText.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.Render.Models +{ + + /// + /// Defines values for IncludeText. + /// + public static class IncludeText + { + /// + /// Include all textual data in response. + /// + public const string Yes = "yes"; + /// + /// Exclude textual data from response. Only images and country names + /// will be in response. + /// + public const string No = "no"; + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/LocalizedMapView.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/LocalizedMapView.cs new file mode 100644 index 0000000000000..48ffa9396daff --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/LocalizedMapView.cs @@ -0,0 +1,92 @@ +// +// 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.Render.Models +{ + + /// + /// Defines values for LocalizedMapView. + /// + public static class LocalizedMapView + { + /// + /// United Arab Emirates (Arabic View) + /// + public const string AE = "AE"; + /// + /// Argentina (Argentinian View) + /// + public const string AR = "AR"; + /// + /// Bahrain (Arabic View) + /// + public const string BH = "BH"; + /// + /// India (Indian View) + /// + public const string IN = "IN"; + /// + /// Iraq (Arabic View) + /// + public const string IQ = "IQ"; + /// + /// Jordan (Arabic View) + /// + public const string JO = "JO"; + /// + /// Kuwait (Arabic View) + /// + public const string KW = "KW"; + /// + /// Lebanon (Arabic View) + /// + public const string LB = "LB"; + /// + /// Morocco (Moroccan View) + /// + public const string MA = "MA"; + /// + /// Oman (Arabic View) + /// + public const string OM = "OM"; + /// + /// Pakistan (Pakistani View) + /// + public const string PK = "PK"; + /// + /// Palestinian Authority (Arabic View) + /// + public const string PS = "PS"; + /// + /// Qatar (Arabic View) + /// + public const string QA = "QA"; + /// + /// Saudi Arabia (Arabic View) + /// + public const string SA = "SA"; + /// + /// Syria (Arabic View) + /// + public const string SY = "SY"; + /// + /// Yemen (Arabic View) + /// + public const string YE = "YE"; + /// + /// Return the map data based on the IP address of the request. + /// + public const string Auto = "Auto"; + /// + /// Unified View (Others) + /// + public const string Unified = "Unified"; + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapAttribution.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapAttribution.cs new file mode 100644 index 0000000000000..a1078b58d14e8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapAttribution.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.Render.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Copyright attribution for the requested section of a tileset. + /// + public partial class MapAttribution + { + /// + /// Initializes a new instance of the MapAttribution class. + /// + public MapAttribution() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MapAttribution class. + /// + /// A list of copyright strings. + public MapAttribution(IList copyrights = default(IList)) + { + Copyrights = copyrights; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of copyright strings. + /// + [JsonProperty(PropertyName = "copyrights")] + public IList Copyrights { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapImageStyle.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapImageStyle.cs new file mode 100644 index 0000000000000..43f967dac343e --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapImageStyle.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.Render.Models +{ + + /// + /// Defines values for MapImageStyle. + /// + public static class MapImageStyle + { + /// + /// Azure Maps main style + /// + public const string Main = "main"; + /// + /// Dark grey version of the Azure Maps main style + /// + public const string Dark = "dark"; + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapTileSize.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapTileSize.cs new file mode 100644 index 0000000000000..1a89faf509c3b --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapTileSize.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.Render.Models +{ + + /// + /// Defines values for MapTileSize. + /// + public static class MapTileSize + { + /// + /// Return a 256 by 256 pixel tile. + /// + public const string Size256 = "256"; + /// + /// Return a 512 by 512 pixel tile. + /// + public const string Size512 = "512"; + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapTileset.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapTileset.cs new file mode 100644 index 0000000000000..27789a51fcdc8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/MapTileset.cs @@ -0,0 +1,260 @@ +// +// 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.Render.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Metadata for a tileset in the TileJSON format. + /// + public partial class MapTileset + { + /// + /// Initializes a new instance of the MapTileset class. + /// + public MapTileset() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MapTileset class. + /// + /// Describes the version of the TileJSON spec + /// that is implemented by this JSON object. + /// A name describing the tileset. The name can + /// contain any legal character. Implementations SHOULD NOT interpret + /// the name as HTML. + /// Text description of the tileset. The + /// description can contain any legal character. Implementations SHOULD + /// NOT interpret the description as HTML. + /// A semver.org style version number for the + /// tiles contained within the tileset. When changes across tiles are + /// introduced, the minor version MUST change. + /// Copyright attribution to be displayed on + /// the map. Implementations MAY decide to treat this as HTML or + /// literal text. For security reasons, make absolutely sure that this + /// field can't be abused as a vector for XSS or beacon + /// tracking. + /// A mustache template to be used to format + /// data from grids for interaction. + /// A legend to be displayed with the map. + /// Implementations MAY decide to treat this as HTML or literal text. + /// For security reasons, make absolutely sure that this field can't be + /// abused as a vector for XSS or beacon tracking. + /// Default: "xyz". Either "xyz" or "tms". + /// Influences the y direction of the tile coordinates. The + /// global-mercator (aka Spherical Mercator) profile is + /// assumed. + /// An array of tile endpoints. If multiple + /// endpoints are specified, clients may use any combination of + /// endpoints. All endpoints MUST return the same content for the same + /// URL. The array MUST contain at least one endpoint. + /// An array of interactivity endpoints. + /// An array of data files in GeoJSON + /// format. + /// The minimum zoom level. + /// The maximum zoom level. + /// The maximum extent of available map tiles. + /// Bounds MUST define an area covered by all zoom levels. The bounds + /// are represented in WGS:84 latitude and longitude values, in the + /// order left, bottom, right, top. Values may be integers or floating + /// point numbers. + /// The default location of the tileset in the + /// form [longitude, latitude, zoom]. The zoom level MUST be between + /// minzoom and maxzoom. Implementations can use this value to set the + /// default location. + public MapTileset(string tilejson = default(string), string name = default(string), string description = default(string), string version = default(string), string attribution = default(string), string template = default(string), string legend = default(string), string scheme = default(string), IList tiles = default(IList), IList grids = default(IList), IList data = default(IList), int? minZoom = default(int?), int? maxZoom = default(int?), IList bounds = default(IList), IList center = default(IList)) + { + Tilejson = tilejson; + Name = name; + Description = description; + Version = version; + Attribution = attribution; + Template = template; + Legend = legend; + Scheme = scheme; + Tiles = tiles; + Grids = grids; + Data = data; + MinZoom = minZoom; + MaxZoom = maxZoom; + Bounds = bounds; + Center = center; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets describes the version of the TileJSON spec that is + /// implemented by this JSON object. + /// + [JsonProperty(PropertyName = "tilejson")] + public string Tilejson { get; set; } + + /// + /// Gets or sets a name describing the tileset. The name can contain + /// any legal character. Implementations SHOULD NOT interpret the name + /// as HTML. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets text description of the tileset. The description can + /// contain any legal character. Implementations SHOULD NOT interpret + /// the description as HTML. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a semver.org style version number for the tiles + /// contained within the tileset. When changes across tiles are + /// introduced, the minor version MUST change. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + /// + /// Gets or sets copyright attribution to be displayed on the map. + /// Implementations MAY decide to treat this as HTML or literal text. + /// For security reasons, make absolutely sure that this field can't be + /// abused as a vector for XSS or beacon tracking. + /// + [JsonProperty(PropertyName = "attribution")] + public string Attribution { get; set; } + + /// + /// Gets or sets a mustache template to be used to format data from + /// grids for interaction. + /// + [JsonProperty(PropertyName = "template")] + public string Template { get; set; } + + /// + /// Gets or sets a legend to be displayed with the map. Implementations + /// MAY decide to treat this as HTML or literal text. For security + /// reasons, make absolutely sure that this field can't be abused as a + /// vector for XSS or beacon tracking. + /// + [JsonProperty(PropertyName = "legend")] + public string Legend { get; set; } + + /// + /// Gets or sets default: "xyz". Either "xyz" or "tms". Influences the + /// y direction of the tile coordinates. The global-mercator (aka + /// Spherical Mercator) profile is assumed. + /// + [JsonProperty(PropertyName = "scheme")] + public string Scheme { get; set; } + + /// + /// Gets or sets an array of tile endpoints. If multiple endpoints are + /// specified, clients may use any combination of endpoints. All + /// endpoints MUST return the same content for the same URL. The array + /// MUST contain at least one endpoint. + /// + [JsonProperty(PropertyName = "tiles")] + public IList Tiles { get; set; } + + /// + /// Gets or sets an array of interactivity endpoints. + /// + [JsonProperty(PropertyName = "grids")] + public IList Grids { get; set; } + + /// + /// Gets or sets an array of data files in GeoJSON format. + /// + [JsonProperty(PropertyName = "data")] + public IList Data { get; set; } + + /// + /// Gets or sets the minimum zoom level. + /// + [JsonProperty(PropertyName = "minzoom")] + public int? MinZoom { get; set; } + + /// + /// Gets or sets the maximum zoom level. + /// + [JsonProperty(PropertyName = "maxzoom")] + public int? MaxZoom { get; set; } + + /// + /// Gets or sets the maximum extent of available map tiles. Bounds MUST + /// define an area covered by all zoom levels. The bounds are + /// represented in WGS:84 latitude and longitude values, in the order + /// left, bottom, right, top. Values may be integers or floating point + /// numbers. + /// + [JsonProperty(PropertyName = "bounds")] + public IList Bounds { get; set; } + + /// + /// Gets or sets the default location of the tileset in the form + /// [longitude, latitude, zoom]. The zoom level MUST be between minzoom + /// and maxzoom. Implementations can use this value to set the default + /// location. + /// + [JsonProperty(PropertyName = "center")] + public IList Center { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Tilejson != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Tilejson, "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*")) + { + throw new ValidationException(ValidationRules.Pattern, "Tilejson", "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*"); + } + } + if (Version != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Version, "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*")) + { + throw new ValidationException(ValidationRules.Pattern, "Version", "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*"); + } + } + if (MinZoom > 30) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MinZoom", 30); + } + if (MinZoom < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinZoom", 0); + } + if (MaxZoom > 30) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxZoom", 30); + } + if (MaxZoom < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxZoom", 0); + } + } + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/RegionCopyrights.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RegionCopyrights.cs new file mode 100644 index 0000000000000..5f14667913309 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RegionCopyrights.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.Render.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class RegionCopyrights + { + /// + /// Initializes a new instance of the RegionCopyrights class. + /// + public RegionCopyrights() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegionCopyrights class. + /// + /// Copyrights array + /// Country property + public RegionCopyrights(IList copyrights = default(IList), RegionCopyrightsCountry country = default(RegionCopyrightsCountry)) + { + Copyrights = copyrights; + Country = country; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets copyrights array + /// + [JsonProperty(PropertyName = "copyrights")] + public IList Copyrights { get; private set; } + + /// + /// Gets country property + /// + [JsonProperty(PropertyName = "country")] + public RegionCopyrightsCountry Country { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/RegionCopyrightsCountry.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RegionCopyrightsCountry.cs new file mode 100644 index 0000000000000..3846254481f3b --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RegionCopyrightsCountry.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.Render.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Country property + /// + public partial class RegionCopyrightsCountry + { + /// + /// Initializes a new instance of the RegionCopyrightsCountry class. + /// + public RegionCopyrightsCountry() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegionCopyrightsCountry class. + /// + /// ISO3 property + /// Label property + public RegionCopyrightsCountry(string iSO3 = default(string), string label = default(string)) + { + ISO3 = iSO3; + Label = label; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets ISO3 property + /// + [JsonProperty(PropertyName = "ISO3")] + public string ISO3 { get; private set; } + + /// + /// Gets label property + /// + [JsonProperty(PropertyName = "label")] + public string Label { get; private set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapStateTileHeaders.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapStateTileHeaders.cs new file mode 100644 index 0000000000000..5e54fd9d28187 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapStateTileHeaders.cs @@ -0,0 +1,54 @@ +// +// 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.Render.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetMapStateTile operation. + /// + public partial class RenderV2GetMapStateTileHeaders + { + /// + /// Initializes a new instance of the RenderV2GetMapStateTileHeaders + /// class. + /// + public RenderV2GetMapStateTileHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RenderV2GetMapStateTileHeaders + /// class. + /// + /// The content-type for the + /// response. + public RenderV2GetMapStateTileHeaders(string contentType = default(string)) + { + ContentType = contentType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the content-type for the response. + /// + [JsonProperty(PropertyName = "Content-Type")] + public string ContentType { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapStaticImageHeaders.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapStaticImageHeaders.cs new file mode 100644 index 0000000000000..4f95f19fae1e4 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapStaticImageHeaders.cs @@ -0,0 +1,54 @@ +// +// 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.Render.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetMapStaticImage operation. + /// + public partial class RenderV2GetMapStaticImageHeaders + { + /// + /// Initializes a new instance of the RenderV2GetMapStaticImageHeaders + /// class. + /// + public RenderV2GetMapStaticImageHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RenderV2GetMapStaticImageHeaders + /// class. + /// + /// The content-type for the + /// response. + public RenderV2GetMapStaticImageHeaders(string contentType = default(string)) + { + ContentType = contentType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the content-type for the response. + /// + [JsonProperty(PropertyName = "Content-Type")] + public string ContentType { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapTileHeaders.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapTileHeaders.cs new file mode 100644 index 0000000000000..a432f4bdc37e5 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/RenderV2GetMapTileHeaders.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.Render.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for GetMapTile operation. + /// + public partial class RenderV2GetMapTileHeaders + { + /// + /// Initializes a new instance of the RenderV2GetMapTileHeaders class. + /// + public RenderV2GetMapTileHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RenderV2GetMapTileHeaders class. + /// + /// The content-type for the + /// response. + public RenderV2GetMapTileHeaders(string contentType = default(string)) + { + ContentType = contentType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the content-type for the response. + /// + [JsonProperty(PropertyName = "Content-Type")] + public string ContentType { get; set; } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/ResponseFormat.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/ResponseFormat.cs new file mode 100644 index 0000000000000..1f96c210c1891 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/ResponseFormat.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.Render.Models +{ + + /// + /// Defines values for ResponseFormat. + /// + public static class ResponseFormat + { + /// + /// [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.Render/src/Generated/Models/StaticMapLayer.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/StaticMapLayer.cs new file mode 100644 index 0000000000000..6387c70d157f8 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/StaticMapLayer.cs @@ -0,0 +1,35 @@ +// +// 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.Render.Models +{ + + /// + /// Defines values for StaticMapLayer. + /// + public static class StaticMapLayer + { + /// + /// Returns an image containing all map features including polygons, + /// borders, roads and labels. + /// + public const string Basic = "basic"; + /// + /// Returns an image containing borders, roads, and labels, and can be + /// overlaid on other tiles (such as satellite imagery) to produce + /// hybrid tiles. + /// + public const string Hybrid = "hybrid"; + /// + /// Returns an image of just the map's label information. + /// + public const string Labels = "labels"; + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/TileIndex.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/TileIndex.cs new file mode 100644 index 0000000000000..956b92c79017d --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/TileIndex.cs @@ -0,0 +1,109 @@ +// +// 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.Render.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional parameters for a set of operations, such as: + /// RenderV2_GetMapTile, RenderV2_GetMapStateTile, + /// RenderV2_GetCopyrightForTile. + /// + public partial class TileIndex + { + /// + /// Initializes a new instance of the TileIndex class. + /// + public TileIndex() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TileIndex class. + /// + /// Zoom level for the desired tile. + /// + /// Please see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// X coordinate of the tile on zoom grid. Value must + /// be in the range [0, 2<sup>`zoom`</sup> -1]. + /// + /// Please see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// Y coordinate of the tile on zoom grid. Value must + /// be in the range [0, 2<sup>`zoom`</sup> -1]. + /// + /// Please see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + public TileIndex(int z, int x, int y) + { + Z = z; + X = x; + Y = y; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets zoom level for the desired tile. + /// + /// Please see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// + [Newtonsoft.Json.JsonIgnore] + public int Z { get; set; } + + /// + /// Gets or sets x coordinate of the tile on zoom grid. Value must be + /// in the range [0, 2&lt;sup&gt;`zoom`&lt;/sup&gt; + /// -1]. + /// + /// Please see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// + [Newtonsoft.Json.JsonIgnore] + public int X { get; set; } + + /// + /// Gets or sets y coordinate of the tile on zoom grid. Value must be + /// in the range [0, 2&lt;sup&gt;`zoom`&lt;/sup&gt; + /// -1]. + /// + /// Please see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// + [Newtonsoft.Json.JsonIgnore] + public int Y { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/Models/TilesetID.cs b/sdk/maps/Azure.Maps.Render/src/Generated/Models/TilesetID.cs new file mode 100644 index 0000000000000..ba0e21ce7a692 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/Models/TilesetID.cs @@ -0,0 +1,193 @@ +// +// 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.Render.Models +{ + + /// + /// Defines values for TilesetID. + /// + public static class TilesetID + { + /// + /// A base map is a standard map that displays roads, natural and + /// artificial features along with the labels for those features in a + /// vector tile.
+ /// + /// Supports zoom levels 0 through 22. Format: vector (pbf). + ///
+ public const string Microsoftbase = "microsoft.base"; + /// + /// Displays labels for roads, natural and artificial features in a + /// vector tile.
+ /// + /// Supports zoom levels 0 through 22. Format: vector (pbf). + ///
+ public const string Microsoftbaselabels = "microsoft.base.labels"; + /// + /// Displays road, boundary and label data in a vector tile.
+ /// + /// Supports zoom levels 0 through 22. Format: vector (pbf). + ///
+ public const string Microsoftbasehybrid = "microsoft.base.hybrid"; + /// + /// Shaded relief and terra layers.
+ /// + /// Supports zoom levels 0 through 6. Format: raster (png). + ///
+ public const string Microsoftterramain = "microsoft.terra.main"; + /// + /// All layers with our main style.
+ /// + /// Supports zoom levels 0 through 22. Format: raster (png). + ///
+ public const string Microsoftbaseroad = "microsoft.base.road"; + /// + /// All layers with our dark grey style.
+ /// + /// Supports zoom levels 0 through 22. Format: raster (png). + ///
+ public const string Microsoftbasedarkgrey = "microsoft.base.darkgrey"; + /// + /// Label data in our main style.
+ /// + /// Supports zoom levels 0 through 22. Format: raster (png). + ///
+ public const string Microsoftbaselabelsroad = "microsoft.base.labels.road"; + /// + /// Label data in our dark grey style.
+ /// + /// Supports zoom levels 0 through 22. Format: raster (png). + ///
+ public const string Microsoftbaselabelsdarkgrey = "microsoft.base.labels.darkgrey"; + /// + /// Road, boundary and label data in our main style.
+ /// + /// Supports zoom levels 0 through 22. Format: raster (png). + ///
+ public const string Microsoftbasehybridroad = "microsoft.base.hybrid.road"; + /// + /// Road, boundary and label data in our dark grey style.
+ /// + /// Supports zoom levels 0 through 22. Format: raster (png). + ///
+ public const string Microsoftbasehybriddarkgrey = "microsoft.base.hybrid.darkgrey"; + /// + /// A combination of satellite and aerial imagery. Only available in S1 + /// pricing SKU.
+ /// + /// Supports zoom levels 1 through 19. Format: raster (jpeg). + ///
+ public const string Microsoftimagery = "microsoft.imagery"; + /// + /// Weather radar tiles. Latest weather radar images including areas of + /// rain, snow, ice and mixed conditions. Please see [coverage + /// information](https://aka.ms/AzureMapsWeatherCoverage) for Azure + /// Maps Weather service. To learn more about the Radar data, please + /// see [Weather + /// concepts](https://aka.ms/AzureMapsWeatherConcepts).
+ /// + /// Supports zoom levels 0 through 15. Format: raster (png). + ///
+ public const string Microsoftweatherradarmain = "microsoft.weather.radar.main"; + /// + /// Weather infrared tiles. Latest Infrared Satellite images shows + /// clouds by their temperature. Please see [coverage + /// information](https://aka.ms/AzureMapsWeatherCoverage) for Azure + /// Maps Weather service. To learn more about the returned Satellite + /// data, please see [Weather + /// concepts](https://aka.ms/AzureMapsWeatherConcepts).
+ /// + /// Supports zoom levels 0 through 15. Format: raster (png). + ///
+ public const string Microsoftweatherinfraredmain = "microsoft.weather.infrared.main"; + /// + /// Digital Elevation Model tiles. The tiles are in the GeoTIFF format + /// with a single 32-bit floating point band. The tiles cover the whole + /// landmass of Earth. Some small islands (e.g., atolls) might not be + /// represented accurately.
+ /// * The vertical unit for measurement of elevation height is meters. + /// An elevation value of -32767.0 is used for points that have no data + /// value, most often returned where there isn't landmass (i.e. + /// water).
+ /// * The horizontal reference datum is the World Geodetic System 1984 + /// (WGS84-G1150) and the vertical reference datum is the Earth + /// Gravitational Model 2008 (EGM2008).
+ /// * Tiles are 258x258 pixel squares rather than the standard 256 x + /// 256. This is done to allow for accurate interpolation of values at + /// the tile edges. As such adjacent tiles overlap by 1 pixel along all + /// edges.
+ /// * Tile data comes from the [Airbus WorldDEM4Ortho + /// product](https://www.intelligence-airbusds.com/worlddem-streaming/). + /// Urban areas are approximately leveled down to ground level. All + /// other areas are represented by the object surface level (e.g., + /// trees).
+ /// + /// Supports zoom level 13 only. Format: raster (tiff). + ///
+ public const string Microsoftdem = "microsoft.dem"; + /// + /// Digital elevation contour line tiles. Compared to the microsoft.dem + /// option, these tiles are in vector format and intended for + /// visualization purpose. The tiles cover the whole landmass of Earth. + /// Some small islands (e.g., atolls) might not be represented + /// accurately.
+ /// * The vertical unit for measurement of elevation height is + /// meters.
+ /// * The horizontal reference datum is the World Geodetic System 1984 + /// (WGS84-G1150) and the vertical reference datum is the Earth + /// Gravitational Model 2008 (EGM2008).
+ /// * Tile data comes from the [Airbus WorldDEM4Ortho + /// product](https://www.intelligence-airbusds.com/worlddem-streaming/). + /// Urban areas are approximately leveled down to ground level. All + /// other areas are represented by the object surface level (e.g., + /// trees).
+ /// + /// Supports zoom levels 9 through 14. Format: vector (pbf). + ///
+ public const string Microsoftdemcontours = "microsoft.dem.contours"; + /// + /// absolute traffic tiles in vector + /// + public const string Microsofttrafficabsolute = "microsoft.traffic.absolute"; + /// + /// absolute traffic tiles in raster in our main style. + /// + public const string Microsofttrafficabsolutemain = "microsoft.traffic.absolute.main"; + /// + /// relative traffic tiles in vector + /// + public const string Microsofttrafficrelative = "microsoft.traffic.relative"; + /// + /// relative traffic tiles in raster in our main style. + /// + public const string Microsofttrafficrelativemain = "microsoft.traffic.relative.main"; + /// + /// relative traffic tiles in raster in our dark style. + /// + public const string Microsofttrafficrelativedark = "microsoft.traffic.relative.dark"; + /// + /// traffic tiles in vector + /// + public const string Microsofttrafficdelay = "microsoft.traffic.delay"; + /// + /// traffic tiles in raster in our main style + /// + public const string Microsofttrafficdelaymain = "microsoft.traffic.delay.main"; + /// + /// reduced traffic tiles in raster in our main style + /// + public const string Microsofttrafficreducedmain = "microsoft.traffic.reduced.main"; + /// + /// incident tiles in vector + /// + public const string Microsofttrafficincident = "microsoft.traffic.incident"; + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/RenderClient.cs b/sdk/maps/Azure.Maps.Render/src/Generated/RenderClient.cs new file mode 100644 index 0000000000000..10e9233fd5d89 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/RenderClient.cs @@ -0,0 +1,338 @@ +// +// 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.Render +{ + 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 Render REST APIs + /// + public partial class RenderClient : ServiceClient, IRenderClient + { + /// + /// The base URI of the service. + /// + public System.Uri 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. Current version is 2.1 + /// + 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 ClientId { get; set; } + + /// + /// Subscription credentials which uniquely identify client subscription. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Gets the IRenderV2. + /// + public virtual IRenderV2 RenderV2 { get; private set; } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling RenderClient.Dispose(). False: will not dispose provided httpClient + protected RenderClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected RenderClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected RenderClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected RenderClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// 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 + /// + protected RenderClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the RenderClient 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 RenderClient(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 RenderClient class. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling RenderClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public RenderClient(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 RenderClient 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 RenderClient(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); + } + } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// 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 RenderClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the RenderClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// 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 RenderClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + 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() + { + RenderV2 = new RenderV2(this); + BaseUri = new System.Uri("https://atlas.microsoft.com"); + ApiVersion = "2.1"; + 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() + } + }; + CustomInitialize(); + } + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/RenderV2.cs b/sdk/maps/Azure.Maps.Render/src/Generated/RenderV2.cs new file mode 100644 index 0000000000000..b00736561d481 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/RenderV2.cs @@ -0,0 +1,2460 @@ +// +// 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.Render +{ + 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; + + /// + /// RenderV2 operations. + /// + public partial class RenderV2 : IServiceOperations, IRenderV2 + { + /// + /// Initializes a new instance of the RenderV2 class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + public RenderV2(RenderClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RenderClient + /// + public RenderClient Client { get; private set; } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Tiles API allows users to request map tiles in vector or raster + /// formats typically to be integrated into a map control or SDK. Some example + /// tiles that can be requested are Azure Maps road tiles, real-time Weather + /// Radar tiles or the map tiles created using [Azure Maps + /// Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector + /// tiles for its web map control (Web SDK) and Android SDK. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a uniform + /// grid of square tiles at preset zoom levels. Every tileset has a + /// **tilesetId** to use when making requests. The **tilesetId** for tilesets + /// created using [Azure Maps Creator](https://aka.ms/amcreator) are generated + /// through the [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', 'microsoft.terra.main', + /// 'microsoft.base.road', 'microsoft.base.darkgrey', + /// 'microsoft.base.labels.road', 'microsoft.base.labels.darkgrey', + /// 'microsoft.base.hybrid.road', 'microsoft.base.hybrid.darkgrey', + /// 'microsoft.imagery', 'microsoft.weather.radar.main', + /// 'microsoft.weather.infrared.main', 'microsoft.dem', + /// 'microsoft.dem.contours', 'microsoft.traffic.absolute', + /// 'microsoft.traffic.absolute.main', 'microsoft.traffic.relative', + /// 'microsoft.traffic.relative.main', 'microsoft.traffic.relative.dark', + /// 'microsoft.traffic.delay', 'microsoft.traffic.delay.main', + /// 'microsoft.traffic.reduced.main', 'microsoft.traffic.incident' + /// + /// + /// Additional parameters for the operation + /// + /// + /// The desired date and time of the requested tile. This parameter must be + /// specified in the standard date-time format (e.g. + /// 2019-11-14T16:03:00-08:00), as defined by [ISO + /// 8601](https://en.wikipedia.org/wiki/ISO_8601). This parameter is only + /// supported when tilesetId parameter is set to one of the values below. + /// + /// * microsoft.weather.infrared.main: We provide tiles up to 3 hours in the + /// past. Tiles are available in 10-minute intervals. We round the timeStamp + /// value to the nearest 10-minute time frame. + /// * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in the + /// past and up to 2 hours in the future. Tiles are available in 5-minute + /// intervals. We round the timeStamp value to the nearest 5-minute time frame. + /// + /// + /// The size of the returned map tile in pixels. Possible values include: + /// 'size256', 'size512' + /// + /// + /// 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/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter (also called the "user region" parameter) allows you to + /// show the correct maps for a certain country/region for geopolitically + /// disputed regions. Different countries have different views of such regions, + /// and the View parameter allows your application to comply with the view + /// required by the country your application will be serving. 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. Possible values include: 'AE', 'AR', 'BH', 'IN', 'IQ', + /// 'JO', 'KW', 'LB', 'MA', 'OM', 'PK', 'PS', 'QA', 'SA', 'SY', 'YE', 'Auto', + /// 'Unified' + /// + /// + /// 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> GetMapTileWithHttpMessagesAsync(string tilesetId, TileIndex tileIndex, System.DateTime? timeStamp = default(System.DateTime?), string tileSize = default(string), string language = default(string), string localizedMapView = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (tilesetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tilesetId"); + } + if (tileIndex == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tileIndex"); + } + if (tileIndex != null) + { + tileIndex.Validate(); + } + int z = default(int); + if (tileIndex != null) + { + z = tileIndex.Z; + } + int x = default(int); + if (tileIndex != null) + { + x = tileIndex.X; + } + int y = default(int); + if (tileIndex != null) + { + y = tileIndex.Y; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("tilesetId", tilesetId); + tracingParameters.Add("timeStamp", timeStamp); + tracingParameters.Add("tileSize", tileSize); + tracingParameters.Add("language", language); + tracingParameters.Add("localizedMapView", localizedMapView); + tracingParameters.Add("z", z); + tracingParameters.Add("x", x); + tracingParameters.Add("y", y); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetMapTile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/tile").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (tilesetId != null) + { + _queryParameters.Add(string.Format("tilesetId={0}", System.Uri.EscapeDataString(tilesetId))); + } + if (timeStamp != null) + { + _queryParameters.Add(string.Format("timeStamp={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(timeStamp, Client.SerializationSettings).Trim('"')))); + } + if (tileSize != null) + { + _queryParameters.Add(string.Format("tileSize={0}", System.Uri.EscapeDataString(tileSize))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (localizedMapView != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(localizedMapView))); + } + _queryParameters.Add(string.Format("zoom={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(z, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("x={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(x, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("y={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(y, Client.SerializationSettings).Trim('"')))); + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + 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; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Tileset API allows users to request metadata for a tileset. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a uniform + /// grid of square tiles at preset zoom levels. Every tileset has a + /// **tilesetId** to use when making requests. The **tilesetId** for tilesets + /// created using [Azure Maps Creator](https://aka.ms/amcreator) are generated + /// through the [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', 'microsoft.terra.main', + /// 'microsoft.base.road', 'microsoft.base.darkgrey', + /// 'microsoft.base.labels.road', 'microsoft.base.labels.darkgrey', + /// 'microsoft.base.hybrid.road', 'microsoft.base.hybrid.darkgrey', + /// 'microsoft.imagery', 'microsoft.weather.radar.main', + /// 'microsoft.weather.infrared.main', 'microsoft.dem', + /// 'microsoft.dem.contours', 'microsoft.traffic.absolute', + /// 'microsoft.traffic.absolute.main', 'microsoft.traffic.relative', + /// 'microsoft.traffic.relative.main', 'microsoft.traffic.relative.dark', + /// 'microsoft.traffic.delay', 'microsoft.traffic.delay.main', + /// 'microsoft.traffic.reduced.main', 'microsoft.traffic.incident' + /// + /// + /// 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> GetMapTilesetWithHttpMessagesAsync(string tilesetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (tilesetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tilesetId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("tilesetId", tilesetId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetMapTileset", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/tileset").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (tilesetId != null) + { + _queryParameters.Add(string.Format("tilesetId={0}", System.Uri.EscapeDataString(tilesetId))); + } + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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 Get Map Attribution API allows users to request map copyright + /// attribution information for a section of a tileset. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a uniform + /// grid of square tiles at preset zoom levels. Every tileset has a + /// **tilesetId** to use when making requests. The **tilesetId** for tilesets + /// created using [Azure Maps Creator](https://aka.ms/amcreator) are generated + /// through the [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', 'microsoft.terra.main', + /// 'microsoft.base.road', 'microsoft.base.darkgrey', + /// 'microsoft.base.labels.road', 'microsoft.base.labels.darkgrey', + /// 'microsoft.base.hybrid.road', 'microsoft.base.hybrid.darkgrey', + /// 'microsoft.imagery', 'microsoft.weather.radar.main', + /// 'microsoft.weather.infrared.main', 'microsoft.dem', + /// 'microsoft.dem.contours', 'microsoft.traffic.absolute', + /// 'microsoft.traffic.absolute.main', 'microsoft.traffic.relative', + /// 'microsoft.traffic.relative.main', 'microsoft.traffic.relative.dark', + /// 'microsoft.traffic.delay', 'microsoft.traffic.delay.main', + /// 'microsoft.traffic.reduced.main', 'microsoft.traffic.incident' + /// + /// + /// Zoom level for the desired map attribution. + /// + /// + /// The string that represents the rectangular area of a bounding box. The + /// bounds parameter is defined by the 4 bounding box coordinates, with WGS84 + /// longitude and latitude of the southwest corner followed by WGS84 longitude + /// and latitude of the northeast corner. The string is presented in the + /// following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, + /// NortheastCorner_Longitude, NortheastCorner_Latitude]`. + /// + /// + /// 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> GetMapAttributionWithHttpMessagesAsync(string tilesetId, int zoom, IList bounds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (tilesetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tilesetId"); + } + if (bounds == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "bounds"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("tilesetId", tilesetId); + tracingParameters.Add("zoom", zoom); + tracingParameters.Add("bounds", bounds); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetMapAttribution", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/attribution").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (tilesetId != null) + { + _queryParameters.Add(string.Format("tilesetId={0}", System.Uri.EscapeDataString(tilesetId))); + } + _queryParameters.Add(string.Format("zoom={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(zoom, Client.SerializationSettings).Trim('"')))); + if (bounds != null) + { + _queryParameters.Add(string.Format("bounds={0}", System.Uri.EscapeDataString(string.Join(",", bounds)))); + } + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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. + /// + /// + /// Fetches state tiles in vector format typically to be integrated into indoor + /// maps module of map control or SDK. The map control will call this API after + /// user turns on dynamic styling (see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid)) + /// + /// + /// The stateset id. + /// + /// + /// Additional parameters for 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> GetMapStateTileWithHttpMessagesAsync(string statesetId, TileIndex tileIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (statesetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "statesetId"); + } + if (tileIndex == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tileIndex"); + } + if (tileIndex != null) + { + tileIndex.Validate(); + } + int z = default(int); + if (tileIndex != null) + { + z = tileIndex.Z; + } + int x = default(int); + if (tileIndex != null) + { + x = tileIndex.X; + } + int y = default(int); + if (tileIndex != null) + { + y = tileIndex.Y; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("statesetId", statesetId); + tracingParameters.Add("z", z); + tracingParameters.Add("x", x); + tracingParameters.Add("y", y); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetMapStateTile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/statetile").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (statesetId != null) + { + _queryParameters.Add(string.Format("statesetId={0}", System.Uri.EscapeDataString(statesetId))); + } + _queryParameters.Add(string.Format("zoom={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(z, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("x={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(x, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("y={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(y, Client.SerializationSettings).Trim('"')))); + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + 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; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// + /// Copyrights API is designed to serve copyright information for Render Tile + /// service. In addition to basic copyright for the whole map, API is serving + /// specific groups of copyrights for some countries. + /// + /// As an alternative to copyrights for map request, one can receive captions + /// for displaying the map provider information on the map. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// 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> GetCopyrightCaptionWithHttpMessagesAsync(string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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, "GetCopyrightCaption", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/copyright/caption/{format}").ToString(); + _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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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 static image service renders a user-defined, rectangular image + /// containing a map section using a zoom level from 0 to 20. The static image + /// service renders a user-defined, rectangular image containing a map section + /// using a zoom level from 0 to 20. The supported resolution range for the map + /// image is from 1x1 to 8192x8192. If you are deciding when to use the static + /// image service over the map tile service, you may want to consider how you + /// would like to interact with the rendered map. If the map contents will be + /// relatively unchanging, a static map is a good choice. If you want to + /// support a lot of zooming, panning and changing of the map content, the map + /// tile service would be a better choice. + /// + /// Service also provides Image Composition functionality to get a static image + /// back with additional data like; pushpins and geometry overlays with + /// following S0 and S1 capabilities. + /// + /// In S0 you can: + /// - Render up to 5 pushpins specified in the request + /// - Provide one custom image for the pins referenced in the request + /// - Add labels to the pushpins + /// + /// In S1 you can: + /// - Render pushpins through [Azure Maps Data + /// Service](https://aka.ms/AzureMapsMapDataService) + /// - Specify multiple pushpin styles + /// - Render circle, polyline and polygon geometry types. + /// - Render of supported GeoJSON geometry types uploaded through [Azure Maps + /// Data Service](https://aka.ms/AzureMapsMapDataService) + /// + /// Please see + /// [How-to-Guide](https://aka.ms/AzureMapsHowToGuideImageCompositor) for + /// detailed examples. + /// + /// _Note_ : Either **center** or **bbox** parameter must be supplied to the + /// API. + /// <br><br> + /// The supported Lat and Lon ranges when using the **bbox** parameter, are as + /// follows: + /// <br><br> + /// + /// |Zoom Level | Max Lon Range | Max Lat Range| + /// |:----------|:----------------|:-------------| + /// |0 | 360.0 | 170.0 | + /// |1 | 360.0 | 170.0 | + /// |2 | 360.0 | 170.0 | + /// |3 | 360.0 | 170.0 | + /// |4 | 360.0 | 170.0 | + /// |5 | 180.0 | 85.0 | + /// |6 | 90.0 | 42.5 | + /// |7 | 45.0 | 21.25 | + /// |8 | 22.5 | 10.625 | + /// |9 | 11.25 | 5.3125 | + /// |10 | 5.625 | 2.62625 | + /// |11 | 2.8125 | 1.328125 | + /// |12 | 1.40625 | 0.6640625 | + /// |13 | 0.703125 | 0.33203125 | + /// |14 | 0.3515625 | 0.166015625 | + /// |15 | 0.17578125 | 0.0830078125 | + /// |16 | 0.087890625 | 0.0415039063 | + /// |17 | 0.0439453125 | 0.0207519531 | + /// |18 | 0.0219726563 | 0.0103759766 | + /// |19 | 0.0109863281 | 0.0051879883 | + /// |20 | 0.0054931641 | 0.0025939941 | + /// + /// + /// Map layer requested. If layer is set to labels or hybrid, the format should + /// be png. Possible values include: 'basic', 'hybrid', 'labels' + /// + /// + /// Map style to be returned. Possible values are main and dark. Possible + /// values include: 'main', 'dark' + /// + /// + /// Desired zoom level of the map. Zoom value must be in the range: 0-20 + /// (inclusive). Default value is 12.<br><br>Please see [Zoom + /// Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// + /// + /// Coordinates of the center point. Format: 'lon,lat'. Projection used + /// - EPSG:3857. Longitude range: -180 to 180. Latitude range: -85 to 85. + /// + /// Note: Either center or bbox are required parameters. They are + /// mutually exclusive. + /// + /// + /// Bounding box. Projection used - EPSG:3857. Format : 'minLon, minLat, + /// maxLon, maxLat'. + /// + /// Note: Either bbox or center are required + /// parameters. They are mutually exclusive. It shouldn’t be used with + /// height or width. + /// + /// The maximum allowed ranges for Lat and Lon are defined for each zoom level + /// in the table at the top of this page. + /// + /// + /// Height of the resulting image in pixels. Range is 1 to 8192. Default + /// is 512. It shouldn’t be used with bbox. + /// + /// + /// Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. + /// It shouldn’t be used with bbox. + /// + /// + /// 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/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter (also called the "user region" parameter) allows you to + /// show the correct maps for a certain country/region for geopolitically + /// disputed regions. Different countries have different views of such regions, + /// and the View parameter allows your application to comply with the view + /// required by the country your application will be serving. 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. Possible values include: 'AE', 'AR', 'BH', 'IN', 'IQ', + /// 'JO', 'KW', 'LB', 'MA', 'OM', 'PK', 'PS', 'QA', 'SA', 'SY', 'YE', 'Auto', + /// 'Unified' + /// + /// + /// Pushpin style and instances. Use this parameter to optionally add pushpins + /// to the image. + /// The pushpin style describes the appearance of the pushpins, and the + /// instances specify + /// the coordinates of the pushpins and optional labels for each pin. (Be sure + /// to properly URL-encode values of this + /// parameter since it will contain reserved characters such as pipes and + /// punctuation.) + /// + /// The Azure Maps account S0 SKU only supports a single instance of the pins + /// parameter. Other SKUs + /// allow multiple instances of the pins parameter to specify multiple pin + /// styles. + /// + /// To render a pushpin at latitude 45°N and longitude 122°W using the default + /// built-in pushpin style, add the + /// querystring parameter + /// + /// `pins=default||-122 45` + /// + /// Note that the longitude comes before the latitude. + /// After URL encoding this will look like + /// + /// `pins=default%7C%7C-122+45` + /// + /// All of the examples here show the pins + /// parameter without URL encoding, for clarity. + /// + /// To render a pin at multiple locations, separate each location with a pipe + /// character. For example, use + /// + /// `pins=default||-122 45|-119.5 43.2|-121.67 47.12` + /// + /// The S0 Azure Maps account SKU only allows five pushpins. Other account SKUs + /// do not have this limitation. + /// + /// ### Style Modifiers + /// + /// You can modify the appearance of the pins by adding style modifiers. These + /// are added after the style but before + /// the locations and labels. Style modifiers each have a two-letter name. + /// These abbreviated names are used to help + /// reduce the length of the URL. + /// + /// To change the color of the pushpin, use the 'co' style modifier and specify + /// the color using the HTML/CSS RGB color + /// format which is a six-digit hexadecimal number (the three-digit form is not + /// supported). For example, to use + /// a deep pink color which you would specify as #FF1493 in CSS, use + /// + /// `pins=default|coFF1493||-122 45` + /// + /// ### Pushpin Labels + /// + /// To add a label to the pins, put the label in single quotes just before the + /// coordinates. For example, to label + /// three pins with the values '1', '2', and '3', use + /// + /// `pins=default||'1'-122 45|'2'-119.5 43.2|'3'-121.67 47.12` + /// + /// There is a built in pushpin style called 'none' that does not display a + /// pushpin image. You can use this if + /// you want to display labels without any pin image. For example, + /// + /// `pins=none||'A'-122 45|'B'-119.5 43.2` + /// + /// To change the color of the pushpin labels, use the 'lc' label color style + /// modifier. For example, to use pink + /// pushpins with black labels, use + /// + /// `pins=default|coFF1493|lc000000||-122 45` + /// + /// To change the size of the labels, use the 'ls' label size style modifier. + /// The label size represents the approximate + /// height of the label text in pixels. For example, to increase the label size + /// to 12, use + /// + /// `pins=default|ls12||'A'-122 45|'B'-119 43` + /// + /// The labels are centered at the pushpin 'label anchor.' The anchor location + /// is predefined for built-in pushpins and + /// is at the top center of custom pushpins (see below). To override the label + /// anchor, using the 'la' style modifier + /// and provide X and Y pixel coordinates for the anchor. These coordinates are + /// relative to the top left corner of the + /// pushpin image. Positive X values move the anchor to the right, and positive + /// Y values move the anchor down. For example, + /// to position the label anchor 10 pixels right and 4 pixels above the top + /// left corner of the pushpin image, + /// use + /// + /// `pins=default|la10 -4||'A'-122 45|'B'-119 43` + /// + /// ### Custom Pushpins + /// + /// To use a custom pushpin image, use the word 'custom' as the pin style name, + /// and then specify a URL after the + /// location and label information. Use two pipe characters to indicate that + /// you're done specifying locations and are + /// starting the URL. For example, + /// + /// `pins=custom||-122 45||http://contoso.com/pushpins/red.png` + /// + /// After URL encoding, this would look like + /// + /// `pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png` + /// + /// By default, custom pushpin images are drawn centered at the pin + /// coordinates. This usually isn't ideal as it obscures + /// the location that you're trying to highlight. To override the anchor + /// location of the pin image, use the 'an' + /// style modifier. This uses the same format as the 'la' label anchor style + /// modifier. For example, if your custom + /// pin image has the tip of the pin at the top left corner of the image, you + /// can set the anchor to that spot by + /// using + /// + /// `pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png` + /// + /// Note: If you use the 'co' color modifier with a custom pushpin image, the + /// specified color will replace the RGB + /// channels of the pixels in the image but will leave the alpha (opacity) + /// channel unchanged. This would usually + /// only be done with a solid-color custom image. + /// + /// ### Getting Pushpins from Azure Maps Data Storage + /// + /// For all Azure Maps account SKUs other than S0, + /// the pushpin location information can be obtained from Azure Maps Data + /// Storage. After uploading a GeoJSON document containing pin locations, the + /// Data Storage service returns a Unique Data ID (UDID) that you can use + /// to reference the data in the pins parameter. + /// + /// To use the point geometry from an uploaded GeoJSON document as the pin + /// locations, specify the UDID in the locations + /// section of the pins parameter. For example, + /// + /// `pins=default||udid-29dc105a-dee7-409f-a3f9-22b066ae4713` + /// + /// Note that + /// only point and multipoint geometry, points and multipoints from geometry + /// collections, and point geometry from features + /// will be used. Linestring and polygon geometry will be ignored. If the point + /// comes from a feature and the feature + /// has a string property called "label", the value of that property will be + /// used as the label for the pin. + /// + /// You can mix pin locations from Data Storage and pin locations specified in + /// the pins parameter. Any of the pipe-delimited + /// pin locations can be a longitude and latitude or a UDID. For example, + /// + /// `pins=default||-122 45|udid-29dc105a-dee7-409f-a3f9-22b066ae4713|-119 43` + /// + /// ### Scale, Rotation, and Opacity + /// + /// You can make pushpins and their labels larger or smaller by using the 'sc' + /// scale style modifier. This is a + /// value greater than zero. A value of 1 is the standard scale. Values larger + /// than 1 will make the pins larger, and + /// values smaller than 1 will make them smaller. For example, to draw the + /// pushpins 50% larger than normal, use + /// + /// `pins=default|sc1.5||-122 45` + /// + /// You can rotate pushpins and their labels by using the 'ro' rotation style + /// modifier. This is a number of degrees + /// of clockwise rotation. Use a negative number to rotate counter-clockwise. + /// For example, to rotate the pushpins + /// 90 degrees clockwise and double their size, use + /// + /// `pins=default|ro90|sc2||-122 45` + /// + /// You can make pushpins and their labels partially transparent by specifying + /// the 'al' alpha style modifier. + /// This is a number between 0 and 1 indicating the opacity of the pushpins. + /// Zero makes them completely transparent + /// (and not visible) and 1 makes them completely opaque (which is the + /// default). For example, to make pushpins + /// and their labels only 67% opaque, use + /// + /// `pins=default|al.67||-122 45` + /// + /// ### Style Modifier Summary + /// + /// Modifier | Description | Range + /// :--------:|-----------------|------------------ + /// al | Alpha (opacity) | 0 to 1 + /// an | Pin anchor | * + /// co | Pin color | 000000 to FFFFFF + /// la | Label anchor | * + /// lc | Label color | 000000 to FFFFFF + /// ls | Label size | Greater than 0 + /// ro | Rotation | -360 to 360 + /// sc | Scale | Greater than 0 + /// + /// * X and Y coordinates can be anywhere within pin image or a margin around + /// it. + /// The margin size is the minimum of the pin width and height. + /// + /// + /// Path style and locations. Use this parameter to optionally add lines, + /// polygons or circles to the image. + /// The path style describes the appearance of the line and fill. (Be sure to + /// properly URL-encode values of this + /// parameter since it will contain reserved characters such as pipes and + /// punctuation.) + /// + /// Path parameter is supported in Azure Maps account SKU starting with S1. + /// Multiple instances of the path parameter + /// allow to specify multiple geometries with their styles. Number of + /// parameters per request is limited to 10 and + /// number of locations is limited to 100 per path. + /// + /// To render a circle with radius 100 meters and center point at latitude 45°N + /// and longitude 122°W using the default style, add the + /// querystring parameter + /// + /// `path=ra100||-122 45` + /// + /// Note that the longitude comes before the latitude. + /// After URL encoding this will look like + /// + /// `path=ra100%7C%7C-122+45` + /// + /// All of the examples here show the path parameter without URL encoding, for + /// clarity. + /// + /// To render a line, separate each location with a pipe character. For + /// example, use + /// + /// `path=||-122 45|-119.5 43.2|-121.67 47.12` + /// + /// To render a polygon, last location must be equal to the start location. For + /// example, use + /// + /// `path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45` + /// + /// Longitude and latitude values for locations of lines and polygons can be in + /// the range from -360 to 360 to allow for rendering of geometries crossing + /// the anti-meridian. + /// + /// ### Style Modifiers + /// + /// You can modify the appearance of the path by adding style modifiers. These + /// are added before the locations. + /// Style modifiers each have a two-letter name. These abbreviated names are + /// used to help reduce the length + /// of the URL. + /// + /// To change the color of the outline, use the 'lc' style modifier and specify + /// the color using the HTML/CSS RGB color + /// format which is a six-digit hexadecimal number (the three-digit form is not + /// supported). For example, to use + /// a deep pink color which you would specify as #FF1493 in CSS, use + /// + /// `path=lcFF1493||-122 45|-119.5 43.2` + /// + /// Multiple style modifiers may be combined together to create a more complex + /// visual style. + /// + /// `lc0000FF|lw3|la0.60|fa0.50||-122.2 47.6|-122.2 47.7|-122.3 47.7|-122.3 + /// 47.6|-122.2 47.6` + /// + /// ### Getting Path locations from Azure Maps Data Storage + /// + /// For all Azure Maps account SKUs other than S0, the path location + /// information can be obtained from Azure Maps Data Storage. + /// After uploading a GeoJSON document containing path locations, the Data + /// Storage service returns a Unique Data ID (UDID) that you can use + /// to reference the data in the path parameter. + /// + /// To use the point geometry from an uploaded GeoJSON document as the path + /// locations, specify the UDID in the locations + /// section of the path parameter. For example, + /// + /// `path=||udid-29dc105a-dee7-409f-a3f9-22b066ae4713` + /// + /// Note the it is not allowed to mix path locations from Data Storage with + /// locations specified in the path parameter. + /// + /// ### Style Modifier Summary + /// + /// Modifier | Description | Range + /// :--------:|------------------------|------------------ + /// lc | Line color | 000000 to FFFFFF + /// fc | Fill color | 000000 to FFFFFF + /// la | Line alpha (opacity) | 0 to 1 + /// fa | Fill alpha (opacity) | 0 to 1 + /// lw | Line width | Greater than 0 + /// ra | Circle radius (meters) | Greater than 0 + /// + /// + /// 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> GetMapStaticImageWithHttpMessagesAsync(string layer = default(string), string style = default(string), int? zoom = default(int?), IList center = default(IList), IList boundingBoxPrivate = default(IList), int? height = default(int?), int? width = default(int?), string language = default(string), string localizedMapView = default(string), IList pins = default(IList), IList path = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (zoom > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "zoom", 20); + } + if (zoom < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "zoom", 0); + } + if (height > 8192) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "height", 8192); + } + if (height < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "height", 1); + } + if (width > 8192) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "width", 8192); + } + if (width < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "width", 1); + } + string format = "png"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("layer", layer); + tracingParameters.Add("style", style); + tracingParameters.Add("zoom", zoom); + tracingParameters.Add("center", center); + tracingParameters.Add("boundingBoxPrivate", boundingBoxPrivate); + tracingParameters.Add("height", height); + tracingParameters.Add("width", width); + tracingParameters.Add("language", language); + tracingParameters.Add("localizedMapView", localizedMapView); + tracingParameters.Add("pins", pins); + tracingParameters.Add("path", path); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetMapStaticImage", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/static/{format}").ToString(); + _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 (layer != null) + { + _queryParameters.Add(string.Format("layer={0}", System.Uri.EscapeDataString(layer))); + } + if (style != null) + { + _queryParameters.Add(string.Format("style={0}", System.Uri.EscapeDataString(style))); + } + if (zoom != null) + { + _queryParameters.Add(string.Format("zoom={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(zoom, Client.SerializationSettings).Trim('"')))); + } + if (center != null) + { + _queryParameters.Add(string.Format("center={0}", System.Uri.EscapeDataString(string.Join(",", center)))); + } + if (boundingBoxPrivate != null) + { + _queryParameters.Add(string.Format("bbox={0}", System.Uri.EscapeDataString(string.Join(",", boundingBoxPrivate)))); + } + if (height != null) + { + _queryParameters.Add(string.Format("height={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(height, Client.SerializationSettings).Trim('"')))); + } + if (width != null) + { + _queryParameters.Add(string.Format("width={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(width, Client.SerializationSettings).Trim('"')))); + } + if (language != null) + { + _queryParameters.Add(string.Format("language={0}", System.Uri.EscapeDataString(language))); + } + if (localizedMapView != null) + { + _queryParameters.Add(string.Format("view={0}", System.Uri.EscapeDataString(localizedMapView))); + } + if (pins != null) + { + if (pins.Count == 0) + { + _queryParameters.Add(string.Format("pins={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in pins) + { + _queryParameters.Add(string.Format("pins={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + if (path != null) + { + if (path.Count == 0) + { + _queryParameters.Add(string.Format("path={0}", System.Uri.EscapeDataString(string.Empty))); + } + else + { + foreach (var _item in path) + { + _queryParameters.Add(string.Format("path={0}", System.Uri.EscapeDataString("" + _item))); + } + } + } + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + 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; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns copyright information for a given bounding box. Bounding-box + /// requests should specify the minimum and maximum longitude and latitude + /// (EPSG-3857) coordinates + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Additional parameters for the operation + /// + /// + /// Yes/no value to exclude textual data from response. Only images and country + /// names will be in response. Possible values include: 'yes', 'no' + /// + /// + /// 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> GetCopyrightFromBoundingBoxWithHttpMessagesAsync(string format, BoundingBox boundingBox, string includeText = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (boundingBox == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "boundingBox"); + } + if (boundingBox != null) + { + boundingBox.Validate(); + } + IList southWest = default(IList); + if (boundingBox != null) + { + southWest = boundingBox.SouthWest; + } + IList northEast = default(IList); + if (boundingBox != null) + { + northEast = boundingBox.NorthEast; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("includeText", includeText); + tracingParameters.Add("southWest", southWest); + tracingParameters.Add("northEast", northEast); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetCopyrightFromBoundingBox", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/copyright/bounding/{format}").ToString(); + _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 (includeText != null) + { + _queryParameters.Add(string.Format("text={0}", System.Uri.EscapeDataString(includeText))); + } + if (southWest != null) + { + _queryParameters.Add(string.Format("mincoordinates={0}", System.Uri.EscapeDataString(string.Join(",", southWest)))); + } + if (northEast != null) + { + _queryParameters.Add(string.Format("maxcoordinates={0}", System.Uri.EscapeDataString(string.Join(",", northEast)))); + } + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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. + /// + /// + /// + /// Copyrights API is designed to serve copyright information for Render Tile + /// service. In addition to basic copyright for the whole map, API is serving + /// specific groups of copyrights for some countries. + /// Returns the copyright information for a given tile. To obtain the copyright + /// information for a particular tile, the request should specify the tile's + /// zoom level and x and y coordinates (see: Zoom Levels and Tile Grid). + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Additional parameters for the operation + /// + /// + /// Yes/no value to exclude textual data from response. Only images and country + /// names will be in response. Possible values include: 'yes', 'no' + /// + /// + /// 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> GetCopyrightForTileWithHttpMessagesAsync(string format, TileIndex tileIndex, string includeText = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (format == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "format"); + } + if (tileIndex == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tileIndex"); + } + if (tileIndex != null) + { + tileIndex.Validate(); + } + int z = default(int); + if (tileIndex != null) + { + z = tileIndex.Z; + } + int x = default(int); + if (tileIndex != null) + { + x = tileIndex.X; + } + int y = default(int); + if (tileIndex != null) + { + y = tileIndex.Y; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("format", format); + tracingParameters.Add("includeText", includeText); + tracingParameters.Add("z", z); + tracingParameters.Add("x", x); + tracingParameters.Add("y", y); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetCopyrightForTile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/copyright/tile/{format}").ToString(); + _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 (includeText != null) + { + _queryParameters.Add(string.Format("text={0}", System.Uri.EscapeDataString(includeText))); + } + _queryParameters.Add(string.Format("zoom={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(z, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("x={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(x, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("y={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(y, Client.SerializationSettings).Trim('"')))); + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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. + /// + /// + /// Copyrights API is designed to serve copyright information for Render Tile + /// service. In addition to basic copyright for the whole map, API is serving + /// specific groups of copyrights for some countries. + /// Returns the copyright information for the world. To obtain the default + /// copyright information for the whole world, do not specify a tile or + /// bounding box. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Yes/no value to exclude textual data from response. Only images and country + /// names will be in response. Possible values include: 'yes', 'no' + /// + /// + /// 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> GetCopyrightForWorldWithHttpMessagesAsync(string format, string includeText = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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("includeText", includeText); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetCopyrightForWorld", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "map/copyright/world/{format}").ToString(); + _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 (includeText != null) + { + _queryParameters.Add(string.Format("text={0}", System.Uri.EscapeDataString(includeText))); + } + 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.ClientId != null) + { + if (_httpRequest.Headers.Contains("x-ms-client-id")) + { + _httpRequest.Headers.Remove("x-ms-client-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-id", Client.ClientId); + } + + + 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; + } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/RenderV2Extensions.cs b/sdk/maps/Azure.Maps.Render/src/Generated/RenderV2Extensions.cs new file mode 100644 index 0000000000000..c5825fdb6cc99 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/RenderV2Extensions.cs @@ -0,0 +1,819 @@ +// +// 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.Render +{ + using Models; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RenderV2. + /// + public static partial class RenderV2Extensions + { + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Tiles API allows users to request map tiles in vector or raster + /// formats typically to be integrated into a map control or SDK. Some example + /// tiles that can be requested are Azure Maps road tiles, real-time Weather + /// Radar tiles or the map tiles created using [Azure Maps + /// Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector + /// tiles for its web map control (Web SDK) and Android SDK. + /// + /// + /// The operations group for this extension method. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a uniform + /// grid of square tiles at preset zoom levels. Every tileset has a + /// **tilesetId** to use when making requests. The **tilesetId** for tilesets + /// created using [Azure Maps Creator](https://aka.ms/amcreator) are generated + /// through the [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', 'microsoft.terra.main', + /// 'microsoft.base.road', 'microsoft.base.darkgrey', + /// 'microsoft.base.labels.road', 'microsoft.base.labels.darkgrey', + /// 'microsoft.base.hybrid.road', 'microsoft.base.hybrid.darkgrey', + /// 'microsoft.imagery', 'microsoft.weather.radar.main', + /// 'microsoft.weather.infrared.main', 'microsoft.dem', + /// 'microsoft.dem.contours', 'microsoft.traffic.absolute', + /// 'microsoft.traffic.absolute.main', 'microsoft.traffic.relative', + /// 'microsoft.traffic.relative.main', 'microsoft.traffic.relative.dark', + /// 'microsoft.traffic.delay', 'microsoft.traffic.delay.main', + /// 'microsoft.traffic.reduced.main', 'microsoft.traffic.incident' + /// + /// + /// Additional parameters for the operation + /// + /// + /// The desired date and time of the requested tile. This parameter must be + /// specified in the standard date-time format (e.g. + /// 2019-11-14T16:03:00-08:00), as defined by [ISO + /// 8601](https://en.wikipedia.org/wiki/ISO_8601). This parameter is only + /// supported when tilesetId parameter is set to one of the values below. + /// + /// * microsoft.weather.infrared.main: We provide tiles up to 3 hours in the + /// past. Tiles are available in 10-minute intervals. We round the timeStamp + /// value to the nearest 10-minute time frame. + /// * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in the + /// past and up to 2 hours in the future. Tiles are available in 5-minute + /// intervals. We round the timeStamp value to the nearest 5-minute time frame. + /// + /// + /// The size of the returned map tile in pixels. Possible values include: + /// 'size256', 'size512' + /// + /// + /// 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/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter (also called the "user region" parameter) allows you to + /// show the correct maps for a certain country/region for geopolitically + /// disputed regions. Different countries have different views of such regions, + /// and the View parameter allows your application to comply with the view + /// required by the country your application will be serving. 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. Possible values include: 'AE', 'AR', 'BH', 'IN', 'IQ', + /// 'JO', 'KW', 'LB', 'MA', 'OM', 'PK', 'PS', 'QA', 'SA', 'SY', 'YE', 'Auto', + /// 'Unified' + /// + /// + /// The cancellation token. + /// + public static async Task GetMapTileAsync(this IRenderV2 operations, string tilesetId, TileIndex tileIndex, System.DateTime? timeStamp = default(System.DateTime?), string tileSize = default(string), string language = default(string), string localizedMapView = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.GetMapTileWithHttpMessagesAsync(tilesetId, tileIndex, timeStamp, tileSize, language, localizedMapView, null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Tileset API allows users to request metadata for a tileset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a uniform + /// grid of square tiles at preset zoom levels. Every tileset has a + /// **tilesetId** to use when making requests. The **tilesetId** for tilesets + /// created using [Azure Maps Creator](https://aka.ms/amcreator) are generated + /// through the [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', 'microsoft.terra.main', + /// 'microsoft.base.road', 'microsoft.base.darkgrey', + /// 'microsoft.base.labels.road', 'microsoft.base.labels.darkgrey', + /// 'microsoft.base.hybrid.road', 'microsoft.base.hybrid.darkgrey', + /// 'microsoft.imagery', 'microsoft.weather.radar.main', + /// 'microsoft.weather.infrared.main', 'microsoft.dem', + /// 'microsoft.dem.contours', 'microsoft.traffic.absolute', + /// 'microsoft.traffic.absolute.main', 'microsoft.traffic.relative', + /// 'microsoft.traffic.relative.main', 'microsoft.traffic.relative.dark', + /// 'microsoft.traffic.delay', 'microsoft.traffic.delay.main', + /// 'microsoft.traffic.reduced.main', 'microsoft.traffic.incident' + /// + /// + /// The cancellation token. + /// + public static async Task GetMapTilesetAsync(this IRenderV2 operations, string tilesetId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetMapTilesetWithHttpMessagesAsync(tilesetId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// The Get Map Attribution API allows users to request map copyright + /// attribution information for a section of a tileset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// A tileset is a collection of raster or vector data broken up into a uniform + /// grid of square tiles at preset zoom levels. Every tileset has a + /// **tilesetId** to use when making requests. The **tilesetId** for tilesets + /// created using [Azure Maps Creator](https://aka.ms/amcreator) are generated + /// through the [Tileset Create + /// API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The + /// ready-to-use tilesets supplied by Azure Maps are listed below. For + /// example, microsoft.base. Possible values include: 'microsoft.base', + /// 'microsoft.base.labels', 'microsoft.base.hybrid', 'microsoft.terra.main', + /// 'microsoft.base.road', 'microsoft.base.darkgrey', + /// 'microsoft.base.labels.road', 'microsoft.base.labels.darkgrey', + /// 'microsoft.base.hybrid.road', 'microsoft.base.hybrid.darkgrey', + /// 'microsoft.imagery', 'microsoft.weather.radar.main', + /// 'microsoft.weather.infrared.main', 'microsoft.dem', + /// 'microsoft.dem.contours', 'microsoft.traffic.absolute', + /// 'microsoft.traffic.absolute.main', 'microsoft.traffic.relative', + /// 'microsoft.traffic.relative.main', 'microsoft.traffic.relative.dark', + /// 'microsoft.traffic.delay', 'microsoft.traffic.delay.main', + /// 'microsoft.traffic.reduced.main', 'microsoft.traffic.incident' + /// + /// + /// Zoom level for the desired map attribution. + /// + /// + /// The string that represents the rectangular area of a bounding box. The + /// bounds parameter is defined by the 4 bounding box coordinates, with WGS84 + /// longitude and latitude of the southwest corner followed by WGS84 longitude + /// and latitude of the northeast corner. The string is presented in the + /// following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, + /// NortheastCorner_Longitude, NortheastCorner_Latitude]`. + /// + /// + /// The cancellation token. + /// + public static async Task GetMapAttributionAsync(this IRenderV2 operations, string tilesetId, int zoom, IList bounds, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetMapAttributionWithHttpMessagesAsync(tilesetId, zoom, bounds, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Fetches state tiles in vector format typically to be integrated into indoor + /// maps module of map control or SDK. The map control will call this API after + /// user turns on dynamic styling (see [Zoom Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid)) + /// + /// + /// The operations group for this extension method. + /// + /// + /// The stateset id. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The cancellation token. + /// + public static async Task GetMapStateTileAsync(this IRenderV2 operations, string statesetId, TileIndex tileIndex, CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.GetMapStateTileWithHttpMessagesAsync(statesetId, tileIndex, null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// + /// Copyrights API is designed to serve copyright information for Render Tile + /// service. In addition to basic copyright for the whole map, API is serving + /// specific groups of copyrights for some countries. + /// + /// As an alternative to copyrights for map request, one can receive captions + /// for displaying the map provider information on the map. + /// + /// + /// 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 cancellation token. + /// + public static async Task GetCopyrightCaptionAsync(this IRenderV2 operations, string format, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetCopyrightCaptionWithHttpMessagesAsync(format, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// The static image service renders a user-defined, rectangular image + /// containing a map section using a zoom level from 0 to 20. The static image + /// service renders a user-defined, rectangular image containing a map section + /// using a zoom level from 0 to 20. The supported resolution range for the map + /// image is from 1x1 to 8192x8192. If you are deciding when to use the static + /// image service over the map tile service, you may want to consider how you + /// would like to interact with the rendered map. If the map contents will be + /// relatively unchanging, a static map is a good choice. If you want to + /// support a lot of zooming, panning and changing of the map content, the map + /// tile service would be a better choice. + /// + /// Service also provides Image Composition functionality to get a static image + /// back with additional data like; pushpins and geometry overlays with + /// following S0 and S1 capabilities. + /// + /// In S0 you can: + /// - Render up to 5 pushpins specified in the request + /// - Provide one custom image for the pins referenced in the request + /// - Add labels to the pushpins + /// + /// In S1 you can: + /// - Render pushpins through [Azure Maps Data + /// Service](https://aka.ms/AzureMapsMapDataService) + /// - Specify multiple pushpin styles + /// - Render circle, polyline and polygon geometry types. + /// - Render of supported GeoJSON geometry types uploaded through [Azure Maps + /// Data Service](https://aka.ms/AzureMapsMapDataService) + /// + /// Please see + /// [How-to-Guide](https://aka.ms/AzureMapsHowToGuideImageCompositor) for + /// detailed examples. + /// + /// _Note_ : Either **center** or **bbox** parameter must be supplied to the + /// API. + /// <br><br> + /// The supported Lat and Lon ranges when using the **bbox** parameter, are as + /// follows: + /// <br><br> + /// + /// |Zoom Level | Max Lon Range | Max Lat Range| + /// |:----------|:----------------|:-------------| + /// |0 | 360.0 | 170.0 | + /// |1 | 360.0 | 170.0 | + /// |2 | 360.0 | 170.0 | + /// |3 | 360.0 | 170.0 | + /// |4 | 360.0 | 170.0 | + /// |5 | 180.0 | 85.0 | + /// |6 | 90.0 | 42.5 | + /// |7 | 45.0 | 21.25 | + /// |8 | 22.5 | 10.625 | + /// |9 | 11.25 | 5.3125 | + /// |10 | 5.625 | 2.62625 | + /// |11 | 2.8125 | 1.328125 | + /// |12 | 1.40625 | 0.6640625 | + /// |13 | 0.703125 | 0.33203125 | + /// |14 | 0.3515625 | 0.166015625 | + /// |15 | 0.17578125 | 0.0830078125 | + /// |16 | 0.087890625 | 0.0415039063 | + /// |17 | 0.0439453125 | 0.0207519531 | + /// |18 | 0.0219726563 | 0.0103759766 | + /// |19 | 0.0109863281 | 0.0051879883 | + /// |20 | 0.0054931641 | 0.0025939941 | + /// + /// + /// The operations group for this extension method. + /// + /// + /// Map layer requested. If layer is set to labels or hybrid, the format should + /// be png. Possible values include: 'basic', 'hybrid', 'labels' + /// + /// + /// Map style to be returned. Possible values are main and dark. Possible + /// values include: 'main', 'dark' + /// + /// + /// Desired zoom level of the map. Zoom value must be in the range: 0-20 + /// (inclusive). Default value is 12.<br><br>Please see [Zoom + /// Levels and Tile + /// Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) + /// for details. + /// + /// + /// Coordinates of the center point. Format: 'lon,lat'. Projection used + /// - EPSG:3857. Longitude range: -180 to 180. Latitude range: -85 to 85. + /// + /// Note: Either center or bbox are required parameters. They are + /// mutually exclusive. + /// + /// + /// Bounding box. Projection used - EPSG:3857. Format : 'minLon, minLat, + /// maxLon, maxLat'. + /// + /// Note: Either bbox or center are required + /// parameters. They are mutually exclusive. It shouldn’t be used with + /// height or width. + /// + /// The maximum allowed ranges for Lat and Lon are defined for each zoom level + /// in the table at the top of this page. + /// + /// + /// Height of the resulting image in pixels. Range is 1 to 8192. Default + /// is 512. It shouldn’t be used with bbox. + /// + /// + /// Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. + /// It shouldn’t be used with bbox. + /// + /// + /// 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/azure/azure-maps/supported-languages) + /// for details. + /// + /// + /// The View parameter (also called the "user region" parameter) allows you to + /// show the correct maps for a certain country/region for geopolitically + /// disputed regions. Different countries have different views of such regions, + /// and the View parameter allows your application to comply with the view + /// required by the country your application will be serving. 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. Possible values include: 'AE', 'AR', 'BH', 'IN', 'IQ', + /// 'JO', 'KW', 'LB', 'MA', 'OM', 'PK', 'PS', 'QA', 'SA', 'SY', 'YE', 'Auto', + /// 'Unified' + /// + /// + /// Pushpin style and instances. Use this parameter to optionally add pushpins + /// to the image. + /// The pushpin style describes the appearance of the pushpins, and the + /// instances specify + /// the coordinates of the pushpins and optional labels for each pin. (Be sure + /// to properly URL-encode values of this + /// parameter since it will contain reserved characters such as pipes and + /// punctuation.) + /// + /// The Azure Maps account S0 SKU only supports a single instance of the pins + /// parameter. Other SKUs + /// allow multiple instances of the pins parameter to specify multiple pin + /// styles. + /// + /// To render a pushpin at latitude 45°N and longitude 122°W using the default + /// built-in pushpin style, add the + /// querystring parameter + /// + /// `pins=default||-122 45` + /// + /// Note that the longitude comes before the latitude. + /// After URL encoding this will look like + /// + /// `pins=default%7C%7C-122+45` + /// + /// All of the examples here show the pins + /// parameter without URL encoding, for clarity. + /// + /// To render a pin at multiple locations, separate each location with a pipe + /// character. For example, use + /// + /// `pins=default||-122 45|-119.5 43.2|-121.67 47.12` + /// + /// The S0 Azure Maps account SKU only allows five pushpins. Other account SKUs + /// do not have this limitation. + /// + /// ### Style Modifiers + /// + /// You can modify the appearance of the pins by adding style modifiers. These + /// are added after the style but before + /// the locations and labels. Style modifiers each have a two-letter name. + /// These abbreviated names are used to help + /// reduce the length of the URL. + /// + /// To change the color of the pushpin, use the 'co' style modifier and specify + /// the color using the HTML/CSS RGB color + /// format which is a six-digit hexadecimal number (the three-digit form is not + /// supported). For example, to use + /// a deep pink color which you would specify as #FF1493 in CSS, use + /// + /// `pins=default|coFF1493||-122 45` + /// + /// ### Pushpin Labels + /// + /// To add a label to the pins, put the label in single quotes just before the + /// coordinates. For example, to label + /// three pins with the values '1', '2', and '3', use + /// + /// `pins=default||'1'-122 45|'2'-119.5 43.2|'3'-121.67 47.12` + /// + /// There is a built in pushpin style called 'none' that does not display a + /// pushpin image. You can use this if + /// you want to display labels without any pin image. For example, + /// + /// `pins=none||'A'-122 45|'B'-119.5 43.2` + /// + /// To change the color of the pushpin labels, use the 'lc' label color style + /// modifier. For example, to use pink + /// pushpins with black labels, use + /// + /// `pins=default|coFF1493|lc000000||-122 45` + /// + /// To change the size of the labels, use the 'ls' label size style modifier. + /// The label size represents the approximate + /// height of the label text in pixels. For example, to increase the label size + /// to 12, use + /// + /// `pins=default|ls12||'A'-122 45|'B'-119 43` + /// + /// The labels are centered at the pushpin 'label anchor.' The anchor location + /// is predefined for built-in pushpins and + /// is at the top center of custom pushpins (see below). To override the label + /// anchor, using the 'la' style modifier + /// and provide X and Y pixel coordinates for the anchor. These coordinates are + /// relative to the top left corner of the + /// pushpin image. Positive X values move the anchor to the right, and positive + /// Y values move the anchor down. For example, + /// to position the label anchor 10 pixels right and 4 pixels above the top + /// left corner of the pushpin image, + /// use + /// + /// `pins=default|la10 -4||'A'-122 45|'B'-119 43` + /// + /// ### Custom Pushpins + /// + /// To use a custom pushpin image, use the word 'custom' as the pin style name, + /// and then specify a URL after the + /// location and label information. Use two pipe characters to indicate that + /// you're done specifying locations and are + /// starting the URL. For example, + /// + /// `pins=custom||-122 45||http://contoso.com/pushpins/red.png` + /// + /// After URL encoding, this would look like + /// + /// `pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png` + /// + /// By default, custom pushpin images are drawn centered at the pin + /// coordinates. This usually isn't ideal as it obscures + /// the location that you're trying to highlight. To override the anchor + /// location of the pin image, use the 'an' + /// style modifier. This uses the same format as the 'la' label anchor style + /// modifier. For example, if your custom + /// pin image has the tip of the pin at the top left corner of the image, you + /// can set the anchor to that spot by + /// using + /// + /// `pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png` + /// + /// Note: If you use the 'co' color modifier with a custom pushpin image, the + /// specified color will replace the RGB + /// channels of the pixels in the image but will leave the alpha (opacity) + /// channel unchanged. This would usually + /// only be done with a solid-color custom image. + /// + /// ### Getting Pushpins from Azure Maps Data Storage + /// + /// For all Azure Maps account SKUs other than S0, + /// the pushpin location information can be obtained from Azure Maps Data + /// Storage. After uploading a GeoJSON document containing pin locations, the + /// Data Storage service returns a Unique Data ID (UDID) that you can use + /// to reference the data in the pins parameter. + /// + /// To use the point geometry from an uploaded GeoJSON document as the pin + /// locations, specify the UDID in the locations + /// section of the pins parameter. For example, + /// + /// `pins=default||udid-29dc105a-dee7-409f-a3f9-22b066ae4713` + /// + /// Note that + /// only point and multipoint geometry, points and multipoints from geometry + /// collections, and point geometry from features + /// will be used. Linestring and polygon geometry will be ignored. If the point + /// comes from a feature and the feature + /// has a string property called "label", the value of that property will be + /// used as the label for the pin. + /// + /// You can mix pin locations from Data Storage and pin locations specified in + /// the pins parameter. Any of the pipe-delimited + /// pin locations can be a longitude and latitude or a UDID. For example, + /// + /// `pins=default||-122 45|udid-29dc105a-dee7-409f-a3f9-22b066ae4713|-119 43` + /// + /// ### Scale, Rotation, and Opacity + /// + /// You can make pushpins and their labels larger or smaller by using the 'sc' + /// scale style modifier. This is a + /// value greater than zero. A value of 1 is the standard scale. Values larger + /// than 1 will make the pins larger, and + /// values smaller than 1 will make them smaller. For example, to draw the + /// pushpins 50% larger than normal, use + /// + /// `pins=default|sc1.5||-122 45` + /// + /// You can rotate pushpins and their labels by using the 'ro' rotation style + /// modifier. This is a number of degrees + /// of clockwise rotation. Use a negative number to rotate counter-clockwise. + /// For example, to rotate the pushpins + /// 90 degrees clockwise and double their size, use + /// + /// `pins=default|ro90|sc2||-122 45` + /// + /// You can make pushpins and their labels partially transparent by specifying + /// the 'al' alpha style modifier. + /// This is a number between 0 and 1 indicating the opacity of the pushpins. + /// Zero makes them completely transparent + /// (and not visible) and 1 makes them completely opaque (which is the + /// default). For example, to make pushpins + /// and their labels only 67% opaque, use + /// + /// `pins=default|al.67||-122 45` + /// + /// ### Style Modifier Summary + /// + /// Modifier | Description | Range + /// :--------:|-----------------|------------------ + /// al | Alpha (opacity) | 0 to 1 + /// an | Pin anchor | * + /// co | Pin color | 000000 to FFFFFF + /// la | Label anchor | * + /// lc | Label color | 000000 to FFFFFF + /// ls | Label size | Greater than 0 + /// ro | Rotation | -360 to 360 + /// sc | Scale | Greater than 0 + /// + /// * X and Y coordinates can be anywhere within pin image or a margin around + /// it. + /// The margin size is the minimum of the pin width and height. + /// + /// + /// Path style and locations. Use this parameter to optionally add lines, + /// polygons or circles to the image. + /// The path style describes the appearance of the line and fill. (Be sure to + /// properly URL-encode values of this + /// parameter since it will contain reserved characters such as pipes and + /// punctuation.) + /// + /// Path parameter is supported in Azure Maps account SKU starting with S1. + /// Multiple instances of the path parameter + /// allow to specify multiple geometries with their styles. Number of + /// parameters per request is limited to 10 and + /// number of locations is limited to 100 per path. + /// + /// To render a circle with radius 100 meters and center point at latitude 45°N + /// and longitude 122°W using the default style, add the + /// querystring parameter + /// + /// `path=ra100||-122 45` + /// + /// Note that the longitude comes before the latitude. + /// After URL encoding this will look like + /// + /// `path=ra100%7C%7C-122+45` + /// + /// All of the examples here show the path parameter without URL encoding, for + /// clarity. + /// + /// To render a line, separate each location with a pipe character. For + /// example, use + /// + /// `path=||-122 45|-119.5 43.2|-121.67 47.12` + /// + /// To render a polygon, last location must be equal to the start location. For + /// example, use + /// + /// `path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45` + /// + /// Longitude and latitude values for locations of lines and polygons can be in + /// the range from -360 to 360 to allow for rendering of geometries crossing + /// the anti-meridian. + /// + /// ### Style Modifiers + /// + /// You can modify the appearance of the path by adding style modifiers. These + /// are added before the locations. + /// Style modifiers each have a two-letter name. These abbreviated names are + /// used to help reduce the length + /// of the URL. + /// + /// To change the color of the outline, use the 'lc' style modifier and specify + /// the color using the HTML/CSS RGB color + /// format which is a six-digit hexadecimal number (the three-digit form is not + /// supported). For example, to use + /// a deep pink color which you would specify as #FF1493 in CSS, use + /// + /// `path=lcFF1493||-122 45|-119.5 43.2` + /// + /// Multiple style modifiers may be combined together to create a more complex + /// visual style. + /// + /// `lc0000FF|lw3|la0.60|fa0.50||-122.2 47.6|-122.2 47.7|-122.3 47.7|-122.3 + /// 47.6|-122.2 47.6` + /// + /// ### Getting Path locations from Azure Maps Data Storage + /// + /// For all Azure Maps account SKUs other than S0, the path location + /// information can be obtained from Azure Maps Data Storage. + /// After uploading a GeoJSON document containing path locations, the Data + /// Storage service returns a Unique Data ID (UDID) that you can use + /// to reference the data in the path parameter. + /// + /// To use the point geometry from an uploaded GeoJSON document as the path + /// locations, specify the UDID in the locations + /// section of the path parameter. For example, + /// + /// `path=||udid-29dc105a-dee7-409f-a3f9-22b066ae4713` + /// + /// Note the it is not allowed to mix path locations from Data Storage with + /// locations specified in the path parameter. + /// + /// ### Style Modifier Summary + /// + /// Modifier | Description | Range + /// :--------:|------------------------|------------------ + /// lc | Line color | 000000 to FFFFFF + /// fc | Fill color | 000000 to FFFFFF + /// la | Line alpha (opacity) | 0 to 1 + /// fa | Fill alpha (opacity) | 0 to 1 + /// lw | Line width | Greater than 0 + /// ra | Circle radius (meters) | Greater than 0 + /// + /// + /// The cancellation token. + /// + public static async Task GetMapStaticImageAsync(this IRenderV2 operations, string layer = default(string), string style = default(string), int? zoom = default(int?), IList center = default(IList), IList boundingBoxPrivate = default(IList), int? height = default(int?), int? width = default(int?), string language = default(string), string localizedMapView = default(string), IList pins = default(IList), IList path = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.GetMapStaticImageWithHttpMessagesAsync(layer, style, zoom, center, boundingBoxPrivate, height, width, language, localizedMapView, pins, path, null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Returns copyright information for a given bounding box. Bounding-box + /// requests should specify the minimum and maximum longitude and latitude + /// (EPSG-3857) coordinates + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Additional parameters for the operation + /// + /// + /// Yes/no value to exclude textual data from response. Only images and country + /// names will be in response. Possible values include: 'yes', 'no' + /// + /// + /// The cancellation token. + /// + public static async Task GetCopyrightFromBoundingBoxAsync(this IRenderV2 operations, string format, BoundingBox boundingBox, string includeText = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetCopyrightFromBoundingBoxWithHttpMessagesAsync(format, boundingBox, includeText, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// + /// Copyrights API is designed to serve copyright information for Render Tile + /// service. In addition to basic copyright for the whole map, API is serving + /// specific groups of copyrights for some countries. + /// Returns the copyright information for a given tile. To obtain the copyright + /// information for a particular tile, the request should specify the tile's + /// zoom level and x and y coordinates (see: Zoom Levels and Tile Grid). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Additional parameters for the operation + /// + /// + /// Yes/no value to exclude textual data from response. Only images and country + /// names will be in response. Possible values include: 'yes', 'no' + /// + /// + /// The cancellation token. + /// + public static async Task GetCopyrightForTileAsync(this IRenderV2 operations, string format, TileIndex tileIndex, string includeText = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetCopyrightForTileWithHttpMessagesAsync(format, tileIndex, includeText, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// **Applies to**: S0 and S1 pricing tiers. + /// + /// + /// Copyrights API is designed to serve copyright information for Render Tile + /// service. In addition to basic copyright for the whole map, API is serving + /// specific groups of copyrights for some countries. + /// Returns the copyright information for the world. To obtain the default + /// copyright information for the whole world, do not specify a tile or + /// bounding box. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Desired format of the response. Value can be either _json_ or _xml_. + /// Possible values include: 'json', 'xml' + /// + /// + /// Yes/no value to exclude textual data from response. Only images and country + /// names will be in response. Possible values include: 'yes', 'no' + /// + /// + /// The cancellation token. + /// + public static async Task GetCopyrightForWorldAsync(this IRenderV2 operations, string format, string includeText = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetCopyrightForWorldWithHttpMessagesAsync(format, includeText, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/maps/Azure.Maps.Render/src/Generated/SdkInfo_RenderClient.cs b/sdk/maps/Azure.Maps.Render/src/Generated/SdkInfo_RenderClient.cs new file mode 100644 index 0000000000000..81a9774770fd0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Render/src/Generated/SdkInfo_RenderClient.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.Render +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_RenderClient + { + get + { + return new Tuple[] + { + new Tuple("RenderClient", "RenderV2", "2.1"), + }.AsEnumerable(); + } + } + } +}