diff --git a/sdk/maps/azure-maps-render/CHANGELOG.md b/sdk/maps/azure-maps-render/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-render/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-render/LICENSE.txt b/sdk/maps/azure-maps-render/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/maps/azure-maps-render/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/maps/azure-maps-render/MANIFEST.in b/sdk/maps/azure-maps-render/MANIFEST.in new file mode 100644 index 000000000000..b954cce330c9 --- /dev/null +++ b/sdk/maps/azure-maps-render/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/maps/__init__.py +include LICENSE.txt diff --git a/sdk/maps/azure-maps-render/README.md b/sdk/maps/azure-maps-render/README.md new file mode 100644 index 000000000000..22991385eec9 --- /dev/null +++ b/sdk/maps/azure-maps-render/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.6+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-maps-render%2FREADME.png) diff --git a/sdk/maps/azure-maps-render/_meta.json b/sdk/maps/azure-maps-render/_meta.json new file mode 100644 index 000000000000..7e446a1c4455 --- /dev/null +++ b/sdk/maps/azure-maps-render/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "3b93a15c977fe2c855eb5eda5bc909c2d3f4d684", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/Render/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/maps/data-plane/Render/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-render/azure/__init__.py b/sdk/maps/azure-maps-render/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-render/azure/maps/__init__.py b/sdk/maps/azure-maps-render/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-render/azure/maps/render/__init__.py b/sdk/maps/azure-maps-render/azure/maps/render/__init__.py new file mode 100644 index 000000000000..a0b70a50399c --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from ._render_client import RenderClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['RenderClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-render/azure/maps/render/_configuration.py b/sdk/maps/azure-maps-render/azure/maps/render/_configuration.py new file mode 100644 index 000000000000..07b4fe48d838 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/_configuration.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + + +class RenderClientConfiguration(Configuration): + """Configuration for RenderClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param client_id: 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 `_ for guidance. + :type client_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + client_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(RenderClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "2.1" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-render/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/maps/azure-maps-render/azure/maps/render/_metadata.json b/sdk/maps/azure-maps-render/azure/maps/render/_metadata.json new file mode 100644 index 000000000000..bea9784682bd --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/_metadata.json @@ -0,0 +1,216 @@ +{ + "chosen_version": "2.1", + "total_api_version_list": ["2.1"], + "client": { + "name": "RenderClient", + "filename": "_render_client", + "description": "Azure Maps Render REST APIs.", + "base_url": "\u0027https://atlas.microsoft.com\u0027", + "custom_base_url": null, + "azure_arm": false, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"RenderClientConfiguration\"], \"._operations_mixin\": [\"RenderClientOperationsMixin\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"RenderClientConfiguration\"], \"._operations_mixin\": [\"RenderClientOperationsMixin\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "client_id": { + "signature": "client_id=None, # type: Optional[str]", + "description": "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 \u003chttps://aka.ms/amauthdetails\u003e`_ for guidance.", + "docstring_type": "str", + "required": false + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "client_id": { + "signature": "client_id: Optional[str] = None,", + "description": "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 \u003chttps://aka.ms/amauthdetails\u003e`_ for guidance.", + "docstring_type": "str", + "required": false + } + }, + "constant": { + }, + "call": "credential, client_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://atlas.microsoft.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + }, + "operation_mixins": { + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"datetime\": [null], \"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"IO\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"datetime\": [null], \"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"IO\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_map_tile_v21" : { + "sync": { + "signature": "def get_map_tile_v21(\n self,\n tileset_id, # type: Union[str, \"_models.TilesetID\"]\n tile_index, # type: \"_models.TileIndex\"\n time_stamp=None, # type: Optional[datetime.datetime]\n tile_size=None, # type: Optional[Union[str, \"_models.MapTileSize\"]]\n language=None, # type: Optional[str]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Get Map Tiles API allows users to request map tiles in vector or raster formats typically\nto be integrated into a map control or SDK. Some example tiles that can be requested are Azure\nMaps road tiles, real-time Weather Radar tiles or the map tiles created using `Azure Maps\nCreator \u003chttps://aka.ms/amcreator\u003e`_. By default, Azure Maps uses vector tiles for its web map\ncontrol (Web SDK) and Android SDK.\n\n:param tileset_id: A tileset is a collection of raster or vector data broken up into a uniform\n grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when\n making requests. The **tilesetId** for tilesets created using `Azure Maps Creator\n \u003chttps://aka.ms/amcreator\u003e`_ are generated through the `Tileset Create API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/tileset\u003e`_. The ready-to-use tilesets supplied\n by Azure Maps are listed below. For example, microsoft.base.\n:type tileset_id: str or ~azure.maps.render.models.TilesetID\n:param tile_index: Parameter group.\n:type tile_index: ~azure.maps.render.models.TileIndex\n:param time_stamp: The desired date and time of the requested tile. This parameter must be\n specified in the standard date-time format (e.g. 2019-11-14T16:03:00-08:00), as defined by `ISO\n 8601 \u003chttps://en.wikipedia.org/wiki/ISO_8601\u003e`_. This parameter is only supported when\n tilesetId parameter is set to one of the values below.\n\n\n * microsoft.weather.infrared.main: We provide tiles up to 3 hours in the past. Tiles are\n available in 10-minute intervals. We round the timeStamp value to the nearest 10-minute time\n frame.\n * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in the past and up to 2 hours\n in the future. Tiles are available in 5-minute intervals. We round the timeStamp value to the\n nearest 5-minute time frame.\n:type time_stamp: ~datetime.datetime\n:param tile_size: The size of the returned map tile in pixels.\n:type tile_size: str or ~azure.maps.render.models.MapTileSize\n:param language: Language in which search results should be returned. Should be one of\n supported IETF language tags, case insensitive. When data in specified language is not\n available for a specific field, default language is used.\n\n Please refer to `Supported Languages\n \u003chttps://docs.microsoft.com/azure/azure-maps/supported-languages\u003e`_ for details.\n:type language: str\n:param localized_map_view: The View parameter (also called the \"user region\" parameter) allows\n you to show the correct maps for a certain country/region for geopolitically disputed regions.\n Different countries have different views of such regions, and the View parameter allows your\n application to comply with the view required by the country your application will be serving.\n By default, the View parameter is set to \u201cUnified\u201d even if you haven\u2019t defined it in the\n request. It is your responsibility to determine the location of your users, and then set the\n View parameter correctly for that location. Alternatively, you have the option to set\n \u2018View=Auto\u2019, which will return the map data based on the IP address of the request. The View\n parameter in Azure Maps must be used in compliance with applicable laws, including those\n regarding mapping, of the country where maps, images and other data and third party content\n that you are authorized to access via Azure Maps is made available. Example: view=IN.\n\n Please refer to `Supported Views \u003chttps://aka.ms/AzureMapsLocalizationViews\u003e`_ for details and\n to see the available Views.\n:type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IO, or the result of cls(response)\n:rtype: IO\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_map_tile_v21(\n self,\n tileset_id: Union[str, \"_models.TilesetID\"],\n tile_index: \"_models.TileIndex\",\n time_stamp: Optional[datetime.datetime] = None,\n tile_size: Optional[Union[str, \"_models.MapTileSize\"]] = None,\n language: Optional[str] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n **kwargs: Any\n) -\u003e IO:\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Get Map Tiles API allows users to request map tiles in vector or raster formats typically\nto be integrated into a map control or SDK. Some example tiles that can be requested are Azure\nMaps road tiles, real-time Weather Radar tiles or the map tiles created using `Azure Maps\nCreator \u003chttps://aka.ms/amcreator\u003e`_. By default, Azure Maps uses vector tiles for its web map\ncontrol (Web SDK) and Android SDK.\n\n:param tileset_id: A tileset is a collection of raster or vector data broken up into a uniform\n grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when\n making requests. The **tilesetId** for tilesets created using `Azure Maps Creator\n \u003chttps://aka.ms/amcreator\u003e`_ are generated through the `Tileset Create API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/tileset\u003e`_. The ready-to-use tilesets supplied\n by Azure Maps are listed below. For example, microsoft.base.\n:type tileset_id: str or ~azure.maps.render.models.TilesetID\n:param tile_index: Parameter group.\n:type tile_index: ~azure.maps.render.models.TileIndex\n:param time_stamp: The desired date and time of the requested tile. This parameter must be\n specified in the standard date-time format (e.g. 2019-11-14T16:03:00-08:00), as defined by `ISO\n 8601 \u003chttps://en.wikipedia.org/wiki/ISO_8601\u003e`_. This parameter is only supported when\n tilesetId parameter is set to one of the values below.\n\n\n * microsoft.weather.infrared.main: We provide tiles up to 3 hours in the past. Tiles are\n available in 10-minute intervals. We round the timeStamp value to the nearest 10-minute time\n frame.\n * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in the past and up to 2 hours\n in the future. Tiles are available in 5-minute intervals. We round the timeStamp value to the\n nearest 5-minute time frame.\n:type time_stamp: ~datetime.datetime\n:param tile_size: The size of the returned map tile in pixels.\n:type tile_size: str or ~azure.maps.render.models.MapTileSize\n:param language: Language in which search results should be returned. Should be one of\n supported IETF language tags, case insensitive. When data in specified language is not\n available for a specific field, default language is used.\n\n Please refer to `Supported Languages\n \u003chttps://docs.microsoft.com/azure/azure-maps/supported-languages\u003e`_ for details.\n:type language: str\n:param localized_map_view: The View parameter (also called the \"user region\" parameter) allows\n you to show the correct maps for a certain country/region for geopolitically disputed regions.\n Different countries have different views of such regions, and the View parameter allows your\n application to comply with the view required by the country your application will be serving.\n By default, the View parameter is set to \u201cUnified\u201d even if you haven\u2019t defined it in the\n request. It is your responsibility to determine the location of your users, and then set the\n View parameter correctly for that location. Alternatively, you have the option to set\n \u2018View=Auto\u2019, which will return the map data based on the IP address of the request. The View\n parameter in Azure Maps must be used in compliance with applicable laws, including those\n regarding mapping, of the country where maps, images and other data and third party content\n that you are authorized to access via Azure Maps is made available. Example: view=IN.\n\n Please refer to `Supported Views \u003chttps://aka.ms/AzureMapsLocalizationViews\u003e`_ for details and\n to see the available Views.\n:type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IO, or the result of cls(response)\n:rtype: IO\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "tileset_id, tile_index, time_stamp, tile_size, language, localized_map_view" + }, + "get_map_tileset" : { + "sync": { + "signature": "def get_map_tileset(\n self,\n tileset_id, # type: Union[str, \"_models.TilesetID\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Get Map Tileset API allows users to request metadata for a tileset.\n\n:param tileset_id: A tileset is a collection of raster or vector data broken up into a uniform\n grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when\n making requests. The **tilesetId** for tilesets created using `Azure Maps Creator\n \u003chttps://aka.ms/amcreator\u003e`_ are generated through the `Tileset Create API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/tileset\u003e`_. The ready-to-use tilesets supplied\n by Azure Maps are listed below. For example, microsoft.base.\n:type tileset_id: str or ~azure.maps.render.models.TilesetID\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: MapTileset, or the result of cls(response)\n:rtype: ~azure.maps.render.models.MapTileset\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_map_tileset(\n self,\n tileset_id: Union[str, \"_models.TilesetID\"],\n **kwargs: Any\n) -\u003e \"_models.MapTileset\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Get Map Tileset API allows users to request metadata for a tileset.\n\n:param tileset_id: A tileset is a collection of raster or vector data broken up into a uniform\n grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when\n making requests. The **tilesetId** for tilesets created using `Azure Maps Creator\n \u003chttps://aka.ms/amcreator\u003e`_ are generated through the `Tileset Create API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/tileset\u003e`_. The ready-to-use tilesets supplied\n by Azure Maps are listed below. For example, microsoft.base.\n:type tileset_id: str or ~azure.maps.render.models.TilesetID\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: MapTileset, or the result of cls(response)\n:rtype: ~azure.maps.render.models.MapTileset\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "tileset_id" + }, + "get_map_attribution" : { + "sync": { + "signature": "def get_map_attribution(\n self,\n tileset_id, # type: Union[str, \"_models.TilesetID\"]\n zoom, # type: int\n bounds, # type: List[float]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Get Map Attribution API allows users to request map copyright attribution information for a\nsection of a tileset.\n\n:param tileset_id: A tileset is a collection of raster or vector data broken up into a uniform\n grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when\n making requests. The **tilesetId** for tilesets created using `Azure Maps Creator\n \u003chttps://aka.ms/amcreator\u003e`_ are generated through the `Tileset Create API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/tileset\u003e`_. The ready-to-use tilesets supplied\n by Azure Maps are listed below. For example, microsoft.base.\n:type tileset_id: str or ~azure.maps.render.models.TilesetID\n:param zoom: Zoom level for the desired map attribution.\n:type zoom: int\n:param bounds: The string that represents the rectangular area of a bounding box. The bounds\n parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of\n the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The\n string is presented in the following format: ``[SouthwestCorner_Longitude,\n SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]``.\n:type bounds: list[float]\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: MapAttribution, or the result of cls(response)\n:rtype: ~azure.maps.render.models.MapAttribution\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_map_attribution(\n self,\n tileset_id: Union[str, \"_models.TilesetID\"],\n zoom: int,\n bounds: List[float],\n **kwargs: Any\n) -\u003e \"_models.MapAttribution\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Get Map Attribution API allows users to request map copyright attribution information for a\nsection of a tileset.\n\n:param tileset_id: A tileset is a collection of raster or vector data broken up into a uniform\n grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when\n making requests. The **tilesetId** for tilesets created using `Azure Maps Creator\n \u003chttps://aka.ms/amcreator\u003e`_ are generated through the `Tileset Create API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/tileset\u003e`_. The ready-to-use tilesets supplied\n by Azure Maps are listed below. For example, microsoft.base.\n:type tileset_id: str or ~azure.maps.render.models.TilesetID\n:param zoom: Zoom level for the desired map attribution.\n:type zoom: int\n:param bounds: The string that represents the rectangular area of a bounding box. The bounds\n parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of\n the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The\n string is presented in the following format: ``[SouthwestCorner_Longitude,\n SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]``.\n:type bounds: list[float]\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: MapAttribution, or the result of cls(response)\n:rtype: ~azure.maps.render.models.MapAttribution\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "tileset_id, zoom, bounds" + }, + "get_map_state_tile_v21" : { + "sync": { + "signature": "def get_map_state_tile_v21(\n self,\n stateset_id, # type: str\n tile_index, # type: \"_models.TileIndex\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nFetches state tiles in vector format typically to be integrated into indoor maps module of map\ncontrol or SDK. The map control will call this API after user turns on dynamic styling (see\n`Zoom Levels and Tile Grid\n\u003chttps://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_\\\n).\n\n:param stateset_id: The stateset id.\n:type stateset_id: str\n:param tile_index: Parameter group.\n:type tile_index: ~azure.maps.render.models.TileIndex\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IO, or the result of cls(response)\n:rtype: IO\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_map_state_tile_v21(\n self,\n stateset_id: str,\n tile_index: \"_models.TileIndex\",\n **kwargs: Any\n) -\u003e IO:\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nFetches state tiles in vector format typically to be integrated into indoor maps module of map\ncontrol or SDK. The map control will call this API after user turns on dynamic styling (see\n`Zoom Levels and Tile Grid\n\u003chttps://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_\\\n).\n\n:param stateset_id: The stateset id.\n:type stateset_id: str\n:param tile_index: Parameter group.\n:type tile_index: ~azure.maps.render.models.TileIndex\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IO, or the result of cls(response)\n:rtype: IO\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "stateset_id, tile_index" + }, + "get_copyright_caption_v21" : { + "sync": { + "signature": "def get_copyright_caption_v21(\n self,\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nCopyrights API is designed to serve copyright information for Render Tile\nservice. In addition to basic copyright for the whole map, API is serving\nspecific groups of copyrights for some countries.\n\nAs an alternative to copyrights for map request, one can receive captions\nfor displaying the map provider information on the map.\n\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyrightCaption, or the result of cls(response)\n:rtype: ~azure.maps.render.models.CopyrightCaption\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_copyright_caption_v21(\n self,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.CopyrightCaption\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nCopyrights API is designed to serve copyright information for Render Tile\nservice. In addition to basic copyright for the whole map, API is serving\nspecific groups of copyrights for some countries.\n\nAs an alternative to copyrights for map request, one can receive captions\nfor displaying the map provider information on the map.\n\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CopyrightCaption, or the result of cls(response)\n:rtype: ~azure.maps.render.models.CopyrightCaption\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format" + }, + "get_map_static_image_v21" : { + "sync": { + "signature": "def get_map_static_image_v21(\n self,\n format=\"png\", # type: Union[str, \"_models.RasterTileFormat\"]\n layer=None, # type: Optional[Union[str, \"_models.StaticMapLayer\"]]\n style=None, # type: Optional[Union[str, \"_models.MapImageStyle\"]]\n zoom=None, # type: Optional[int]\n center=None, # type: Optional[List[float]]\n bounding_box=None, # type: Optional[List[float]]\n height=None, # type: Optional[int]\n width=None, # type: Optional[int]\n language=None, # type: Optional[str]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n pins=None, # type: Optional[List[str]]\n path=None, # type: Optional[List[str]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe static image service renders a user-defined, rectangular image containing a map section\nusing a zoom level from 0 to 20. The static image service renders a user-defined, rectangular\nimage containing a map section using a zoom level from 0 to 20. The supported resolution range\nfor the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image\nservice over the map tile service, you may want to consider how you would like to interact with\nthe rendered map. If the map contents will be relatively unchanging, a static map is a good\nchoice. If you want to support a lot of zooming, panning and changing of the map content, the\nmap tile service would be a better choice.\n\nService also provides Image Composition functionality to get a static image back with\nadditional data like; pushpins and geometry overlays with following S0 and S1 capabilities.\n\nIn S0 you can:\n\n\n* Render up to 5 pushpins specified in the request\n* Provide one custom image for the pins referenced in the request\n* Add labels to the pushpins\n\nIn S1 you can:\n\n\n* Render pushpins through `Azure Maps Data Service \u003chttps://aka.ms/AzureMapsMapDataService\u003e`_\n* Specify multiple pushpin styles\n* Render circle, polyline and polygon geometry types.\n* Render of supported GeoJSON geometry types uploaded through `Azure Maps Data Service\n\u003chttps://aka.ms/AzureMapsMapDataService\u003e`_\n\nPlease see `How-to-Guide \u003chttps://aka.ms/AzureMapsHowToGuideImageCompositor\u003e`_ for detailed\nexamples.\n\n*Note* : Either **center** or **bbox** parameter must be supplied to the\nAPI.\n:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`\nThe supported Lat and Lon ranges when using the **bbox** parameter, are as follows:\n:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`\n\n.. list-table::\n :header-rows: 1\n\n * - Zoom Level\n - Max Lon Range\n - Max Lat Range\n * - 0\n - 360.0\n - 170.0\n * - 1\n - 360.0\n - 170.0\n * - 2\n - 360.0\n - 170.0\n * - 3\n - 360.0\n - 170.0\n * - 4\n - 360.0\n - 170.0\n * - 5\n - 180.0\n - 85.0\n * - 6\n - 90.0\n - 42.5\n * - 7\n - 45.0\n - 21.25\n * - 8\n - 22.5\n - 10.625\n * - 9\n - 11.25\n - 5.3125\n * - 10\n - 5.625\n - 2.62625\n * - 11\n - 2.8125\n - 1.328125\n * - 12\n - 1.40625\n - 0.6640625\n * - 13\n - 0.703125\n - 0.33203125\n * - 14\n - 0.3515625\n - 0.166015625\n * - 15\n - 0.17578125\n - 0.0830078125\n * - 16\n - 0.087890625\n - 0.0415039063\n * - 17\n - 0.0439453125\n - 0.0207519531\n * - 18\n - 0.0219726563\n - 0.0103759766\n * - 19\n - 0.0109863281\n - 0.0051879883\n * - 20\n - 0.0054931641\n - 0.0025939941.\n\n:param format: Desired format of the response. Possible value: png.\n:type format: str or ~azure.maps.render.models.RasterTileFormat\n:param layer: Map layer requested. If layer is set to labels or hybrid, the format should be\n png.\n:type layer: str or ~azure.maps.render.models.StaticMapLayer\n:param style: Map style to be returned. Possible values are main and dark.\n:type style: str or ~azure.maps.render.models.MapImageStyle\n:param zoom: Desired zoom level of the map. Zoom value must be in the range: 0-20 (inclusive).\n Default value is 12.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_\n for details.\n:type zoom: int\n:param center: Coordinates of the center point. Format: \u0027lon,lat\u0027. Projection used\n\n\n * EPSG:3857. Longitude range: -180 to 180. Latitude range: -85 to 85.\n\n Note: Either center or bbox are required parameters. They are\n mutually exclusive.\n:type center: list[float]\n:param bounding_box: Bounding box. Projection used - EPSG:3857. Format : \u0027minLon, minLat,\n maxLon, maxLat\u0027.\n\n Note: Either bbox or center are required\n parameters. They are mutually exclusive. It shouldn\u2019t be used with\n height or width.\n\n The maximum allowed ranges for Lat and Lon are defined for each zoom level\n in the table at the top of this page.\n:type bounding_box: list[float]\n:param height: Height of the resulting image in pixels. Range is 1 to 8192. Default\n is 512. It shouldn\u2019t be used with bbox.\n:type height: int\n:param width: Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. It\n shouldn\u2019t be used with bbox.\n:type width: int\n:param language: Language in which search results should be returned. Should be one of\n supported IETF language tags, case insensitive. When data in specified language is not\n available for a specific field, default language is used.\n\n Please refer to `Supported Languages\n \u003chttps://docs.microsoft.com/azure/azure-maps/supported-languages\u003e`_ for details.\n:type language: str\n:param localized_map_view: The View parameter (also called the \"user region\" parameter) allows\n you to show the correct maps for a certain country/region for geopolitically disputed regions.\n Different countries have different views of such regions, and the View parameter allows your\n application to comply with the view required by the country your application will be serving.\n By default, the View parameter is set to \u201cUnified\u201d even if you haven\u2019t defined it in the\n request. It is your responsibility to determine the location of your users, and then set the\n View parameter correctly for that location. Alternatively, you have the option to set\n \u2018View=Auto\u2019, which will return the map data based on the IP address of the request. The View\n parameter in Azure Maps must be used in compliance with applicable laws, including those\n regarding mapping, of the country where maps, images and other data and third party content\n that you are authorized to access via Azure Maps is made available. Example: view=IN.\n\n Please refer to `Supported Views \u003chttps://aka.ms/AzureMapsLocalizationViews\u003e`_ for details and\n to see the available Views.\n:type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView\n:param pins: Pushpin style and instances. Use this parameter to optionally add pushpins to the\n image.\n The pushpin style describes the appearance of the pushpins, and the instances specify\n the coordinates of the pushpins and optional labels for each pin. (Be sure to properly\n URL-encode values of this\n parameter since it will contain reserved characters such as pipes and punctuation.)\n\n The Azure Maps account S0 SKU only supports a single instance of the pins parameter. Other\n SKUs\n allow multiple instances of the pins parameter to specify multiple pin styles.\n\n To render a pushpin at latitude 45\u00b0N and longitude 122\u00b0W using the default built-in pushpin\n style, add the\n querystring parameter\n\n ``pins=default||-122 45``\n\n Note that the longitude comes before the latitude.\n After URL encoding this will look like\n\n ``pins=default%7C%7C-122+45``\n\n All of the examples here show the pins\n parameter without URL encoding, for clarity.\n\n To render a pin at multiple locations, separate each location with a pipe character. For\n example, use\n\n ``pins=default||-122 45|-119.5 43.2|-121.67 47.12``\n\n The S0 Azure Maps account SKU only allows five pushpins. Other account SKUs do not have this\n limitation.\n\n Style Modifiers\n ^^^^^^^^^^^^^^^\n\n You can modify the appearance of the pins by adding style modifiers. These are added after the\n style but before\n the locations and labels. Style modifiers each have a two-letter name. These abbreviated names\n are used to help\n reduce the length of the URL.\n\n To change the color of the pushpin, use the \u0027co\u0027 style modifier and specify the color using\n the HTML/CSS RGB color\n format which is a six-digit hexadecimal number (the three-digit form is not supported). For\n example, to use\n a deep pink color which you would specify as #FF1493 in CSS, use\n\n ``pins=default|coFF1493||-122 45``\n\n Pushpin Labels\n ^^^^^^^^^^^^^^\n\n To add a label to the pins, put the label in single quotes just before the coordinates. For\n example, to label\n three pins with the values \u00271\u0027, \u00272\u0027, and \u00273\u0027, use\n\n ``pins=default||\u00271\u0027-122 45|\u00272\u0027-119.5 43.2|\u00273\u0027-121.67 47.12``\n\n There is a built in pushpin style called \u0027none\u0027 that does not display a pushpin image. You can\n use this if\n you want to display labels without any pin image. For example,\n\n ``pins=none||\u0027A\u0027-122 45|\u0027B\u0027-119.5 43.2``\n\n To change the color of the pushpin labels, use the \u0027lc\u0027 label color style modifier. For\n example, to use pink\n pushpins with black labels, use\n\n ``pins=default|coFF1493|lc000000||-122 45``\n\n To change the size of the labels, use the \u0027ls\u0027 label size style modifier. The label size\n represents the approximate\n height of the label text in pixels. For example, to increase the label size to 12, use\n\n ``pins=default|ls12||\u0027A\u0027-122 45|\u0027B\u0027-119 43``\n\n The labels are centered at the pushpin \u0027label anchor.\u0027 The anchor location is predefined for\n built-in pushpins and\n is at the top center of custom pushpins (see below). To override the label anchor, using the\n \u0027la\u0027 style modifier\n and provide X and Y pixel coordinates for the anchor. These coordinates are relative to the\n top left corner of the\n pushpin image. Positive X values move the anchor to the right, and positive Y values move the\n anchor down. For example,\n to position the label anchor 10 pixels right and 4 pixels above the top left corner of the\n pushpin image,\n use\n\n ``pins=default|la10 -4||\u0027A\u0027-122 45|\u0027B\u0027-119 43``\n\n Custom Pushpins\n ^^^^^^^^^^^^^^^\n\n To use a custom pushpin image, use the word \u0027custom\u0027 as the pin style name, and then specify a\n URL after the\n location and label information. Use two pipe characters to indicate that you\u0027re done\n specifying locations and are\n starting the URL. For example,\n\n ``pins=custom||-122 45||http://contoso.com/pushpins/red.png``\n\n After URL encoding, this would look like\n\n ``pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png``\n\n By default, custom pushpin images are drawn centered at the pin coordinates. This usually\n isn\u0027t ideal as it obscures\n the location that you\u0027re trying to highlight. To override the anchor location of the pin\n image, use the \u0027an\u0027\n style modifier. This uses the same format as the \u0027la\u0027 label anchor style modifier. For\n example, if your custom\n pin image has the tip of the pin at the top left corner of the image, you can set the anchor\n to that spot by\n using\n\n ``pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png``\n\n Note: If you use the \u0027co\u0027 color modifier with a custom pushpin image, the specified color will\n replace the RGB\n channels of the pixels in the image but will leave the alpha (opacity) channel unchanged. This\n would usually\n only be done with a solid-color custom image.\n\n Getting Pushpins from Azure Maps Data Storage\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n For all Azure Maps account SKUs other than S0,\n the pushpin location information can be obtained from Azure Maps Data Storage. After uploading\n a GeoJSON document containing pin locations, the Data Storage service returns a Unique Data ID\n (UDID) that you can use\n to reference the data in the pins parameter.\n\n To use the point geometry from an uploaded GeoJSON document as the pin locations, specify the\n UDID in the locations\n section of the pins parameter. For example,\n\n ``pins=default||udid-29dc105a-dee7-409f-a3f9-22b066ae4713``\n\n Note that\n only point and multipoint geometry, points and multipoints from geometry collections, and\n point geometry from features\n will be used. Linestring and polygon geometry will be ignored. If the point comes from a\n feature and the feature\n has a string property called \"label\", the value of that property will be used as the label for\n the pin.\n\n You can mix pin locations from Data Storage and pin locations specified in the pins parameter.\n Any of the pipe-delimited\n pin locations can be a longitude and latitude or a UDID. For example,\n\n ``pins=default||-122 45|udid-29dc105a-dee7-409f-a3f9-22b066ae4713|-119 43``\n\n Scale, Rotation, and Opacity\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n You can make pushpins and their labels larger or smaller by using the \u0027sc\u0027 scale style\n modifier. This is a\n value greater than zero. A value of 1 is the standard scale. Values larger than 1 will make\n the pins larger, and\n values smaller than 1 will make them smaller. For example, to draw the pushpins 50% larger\n than normal, use\n\n ``pins=default|sc1.5||-122 45``\n\n You can rotate pushpins and their labels by using the \u0027ro\u0027 rotation style modifier. This is a\n number of degrees\n of clockwise rotation. Use a negative number to rotate counter-clockwise. For example, to\n rotate the pushpins\n 90 degrees clockwise and double their size, use\n\n ``pins=default|ro90|sc2||-122 45``\n\n You can make pushpins and their labels partially transparent by specifying the \u0027al\u0027 alpha\n style modifier.\n This is a number between 0 and 1 indicating the opacity of the pushpins. Zero makes them\n completely transparent\n (and not visible) and 1 makes them completely opaque (which is the default). For example, to\n make pushpins\n and their labels only 67% opaque, use\n\n ``pins=default|al.67||-122 45``\n\n Style Modifier Summary\n ^^^^^^^^^^^^^^^^^^^^^^\n\n .. list-table::\n :header-rows: 1\n\n * - Modifier\n - Description\n - Range\n * - al\n - Alpha (opacity)\n - 0 to 1\n * - an\n - Pin anchor\n - *\n * - co\n - Pin color\n - 000000 to FFFFFF\n * - la\n - Label anchor\n - *\n * - lc\n - Label color\n - 000000 to FFFFFF\n * - ls\n - Label size\n - Greater than 0\n * - ro\n - Rotation\n - -360 to 360\n * - sc\n - Scale\n - Greater than 0\n\n\n\n * X and Y coordinates can be anywhere within pin image or a margin around it.\n The margin size is the minimum of the pin width and height.\n:type pins: list[str]\n:param path: Path style and locations. Use this parameter to optionally add lines, polygons or\n circles to the image.\n The path style describes the appearance of the line and fill. (Be sure to properly URL-encode\n values of this\n parameter since it will contain reserved characters such as pipes and punctuation.)\n\n Path parameter is supported in Azure Maps account SKU starting with S1. Multiple instances of\n the path parameter\n allow to specify multiple geometries with their styles. Number of parameters per request is\n limited to 10 and\n number of locations is limited to 100 per path.\n\n To render a circle with radius 100 meters and center point at latitude 45\u00b0N and longitude\n 122\u00b0W using the default style, add the\n querystring parameter\n\n ``path=ra100||-122 45``\n\n Note that the longitude comes before the latitude.\n After URL encoding this will look like\n\n ``path=ra100%7C%7C-122+45``\n\n All of the examples here show the path parameter without URL encoding, for clarity.\n\n To render a line, separate each location with a pipe character. For example, use\n\n ``path=||-122 45|-119.5 43.2|-121.67 47.12``\n\n To render a polygon, last location must be equal to the start location. For example, use\n\n ``path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45``\n\n Longitude and latitude values for locations of lines and polygons can be in the range from\n -360 to 360 to allow for rendering of geometries crossing the anti-meridian.\n\n Style Modifiers\n ^^^^^^^^^^^^^^^\n\n You can modify the appearance of the path by adding style modifiers. These are added before\n the locations.\n Style modifiers each have a two-letter name. These abbreviated names are used to help reduce\n the length\n of the URL.\n\n To change the color of the outline, use the \u0027lc\u0027 style modifier and specify the color using\n the HTML/CSS RGB color\n format which is a six-digit hexadecimal number (the three-digit form is not supported). For\n example, to use\n a deep pink color which you would specify as #FF1493 in CSS, use\n\n ``path=lcFF1493||-122 45|-119.5 43.2``\n\n Multiple style modifiers may be combined together to create a more complex visual style.\n\n ``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``\n\n Getting Path locations from Azure Maps Data Storage\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n For all Azure Maps account SKUs other than S0, the path location information can be obtained\n from Azure Maps Data Storage.\n After uploading a GeoJSON document containing path locations, the Data Storage service returns\n a Unique Data ID (UDID) that you can use\n to reference the data in the path parameter.\n\n To use the point geometry from an uploaded GeoJSON document as the path locations, specify the\n UDID in the locations\n section of the path parameter. For example,\n\n ``path=||udid-29dc105a-dee7-409f-a3f9-22b066ae4713``\n\n Note the it is not allowed to mix path locations from Data Storage with locations specified in\n the path parameter.\n\n Style Modifier Summary\n ^^^^^^^^^^^^^^^^^^^^^^\n\n .. list-table::\n :header-rows: 1\n\n * - Modifier\n - Description\n - Range\n * - lc\n - Line color\n - 000000 to FFFFFF\n * - fc\n - Fill color\n - 000000 to FFFFFF\n * - la\n - Line alpha (opacity)\n - 0 to 1\n * - fa\n - Fill alpha (opacity)\n - 0 to 1\n * - lw\n - Line width\n - Greater than 0\n * - ra\n - Circle radius (meters)\n - Greater than 0.\n:type path: list[str]\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IO, or the result of cls(response)\n:rtype: IO\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_map_static_image_v21(\n self,\n format: Union[str, \"_models.RasterTileFormat\"] = \"png\",\n layer: Optional[Union[str, \"_models.StaticMapLayer\"]] = None,\n style: Optional[Union[str, \"_models.MapImageStyle\"]] = None,\n zoom: Optional[int] = None,\n center: Optional[List[float]] = None,\n bounding_box: Optional[List[float]] = None,\n height: Optional[int] = None,\n width: Optional[int] = None,\n language: Optional[str] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n pins: Optional[List[str]] = None,\n path: Optional[List[str]] = None,\n **kwargs: Any\n) -\u003e IO:\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe static image service renders a user-defined, rectangular image containing a map section\nusing a zoom level from 0 to 20. The static image service renders a user-defined, rectangular\nimage containing a map section using a zoom level from 0 to 20. The supported resolution range\nfor the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image\nservice over the map tile service, you may want to consider how you would like to interact with\nthe rendered map. If the map contents will be relatively unchanging, a static map is a good\nchoice. If you want to support a lot of zooming, panning and changing of the map content, the\nmap tile service would be a better choice.\n\nService also provides Image Composition functionality to get a static image back with\nadditional data like; pushpins and geometry overlays with following S0 and S1 capabilities.\n\nIn S0 you can:\n\n\n* Render up to 5 pushpins specified in the request\n* Provide one custom image for the pins referenced in the request\n* Add labels to the pushpins\n\nIn S1 you can:\n\n\n* Render pushpins through `Azure Maps Data Service \u003chttps://aka.ms/AzureMapsMapDataService\u003e`_\n* Specify multiple pushpin styles\n* Render circle, polyline and polygon geometry types.\n* Render of supported GeoJSON geometry types uploaded through `Azure Maps Data Service\n\u003chttps://aka.ms/AzureMapsMapDataService\u003e`_\n\nPlease see `How-to-Guide \u003chttps://aka.ms/AzureMapsHowToGuideImageCompositor\u003e`_ for detailed\nexamples.\n\n*Note* : Either **center** or **bbox** parameter must be supplied to the\nAPI.\n:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`\nThe supported Lat and Lon ranges when using the **bbox** parameter, are as follows:\n:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`\n\n.. list-table::\n :header-rows: 1\n\n * - Zoom Level\n - Max Lon Range\n - Max Lat Range\n * - 0\n - 360.0\n - 170.0\n * - 1\n - 360.0\n - 170.0\n * - 2\n - 360.0\n - 170.0\n * - 3\n - 360.0\n - 170.0\n * - 4\n - 360.0\n - 170.0\n * - 5\n - 180.0\n - 85.0\n * - 6\n - 90.0\n - 42.5\n * - 7\n - 45.0\n - 21.25\n * - 8\n - 22.5\n - 10.625\n * - 9\n - 11.25\n - 5.3125\n * - 10\n - 5.625\n - 2.62625\n * - 11\n - 2.8125\n - 1.328125\n * - 12\n - 1.40625\n - 0.6640625\n * - 13\n - 0.703125\n - 0.33203125\n * - 14\n - 0.3515625\n - 0.166015625\n * - 15\n - 0.17578125\n - 0.0830078125\n * - 16\n - 0.087890625\n - 0.0415039063\n * - 17\n - 0.0439453125\n - 0.0207519531\n * - 18\n - 0.0219726563\n - 0.0103759766\n * - 19\n - 0.0109863281\n - 0.0051879883\n * - 20\n - 0.0054931641\n - 0.0025939941.\n\n:param format: Desired format of the response. Possible value: png.\n:type format: str or ~azure.maps.render.models.RasterTileFormat\n:param layer: Map layer requested. If layer is set to labels or hybrid, the format should be\n png.\n:type layer: str or ~azure.maps.render.models.StaticMapLayer\n:param style: Map style to be returned. Possible values are main and dark.\n:type style: str or ~azure.maps.render.models.MapImageStyle\n:param zoom: Desired zoom level of the map. Zoom value must be in the range: 0-20 (inclusive).\n Default value is 12.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_\n for details.\n:type zoom: int\n:param center: Coordinates of the center point. Format: \u0027lon,lat\u0027. Projection used\n\n\n * EPSG:3857. Longitude range: -180 to 180. Latitude range: -85 to 85.\n\n Note: Either center or bbox are required parameters. They are\n mutually exclusive.\n:type center: list[float]\n:param bounding_box: Bounding box. Projection used - EPSG:3857. Format : \u0027minLon, minLat,\n maxLon, maxLat\u0027.\n\n Note: Either bbox or center are required\n parameters. They are mutually exclusive. It shouldn\u2019t be used with\n height or width.\n\n The maximum allowed ranges for Lat and Lon are defined for each zoom level\n in the table at the top of this page.\n:type bounding_box: list[float]\n:param height: Height of the resulting image in pixels. Range is 1 to 8192. Default\n is 512. It shouldn\u2019t be used with bbox.\n:type height: int\n:param width: Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. It\n shouldn\u2019t be used with bbox.\n:type width: int\n:param language: Language in which search results should be returned. Should be one of\n supported IETF language tags, case insensitive. When data in specified language is not\n available for a specific field, default language is used.\n\n Please refer to `Supported Languages\n \u003chttps://docs.microsoft.com/azure/azure-maps/supported-languages\u003e`_ for details.\n:type language: str\n:param localized_map_view: The View parameter (also called the \"user region\" parameter) allows\n you to show the correct maps for a certain country/region for geopolitically disputed regions.\n Different countries have different views of such regions, and the View parameter allows your\n application to comply with the view required by the country your application will be serving.\n By default, the View parameter is set to \u201cUnified\u201d even if you haven\u2019t defined it in the\n request. It is your responsibility to determine the location of your users, and then set the\n View parameter correctly for that location. Alternatively, you have the option to set\n \u2018View=Auto\u2019, which will return the map data based on the IP address of the request. The View\n parameter in Azure Maps must be used in compliance with applicable laws, including those\n regarding mapping, of the country where maps, images and other data and third party content\n that you are authorized to access via Azure Maps is made available. Example: view=IN.\n\n Please refer to `Supported Views \u003chttps://aka.ms/AzureMapsLocalizationViews\u003e`_ for details and\n to see the available Views.\n:type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView\n:param pins: Pushpin style and instances. Use this parameter to optionally add pushpins to the\n image.\n The pushpin style describes the appearance of the pushpins, and the instances specify\n the coordinates of the pushpins and optional labels for each pin. (Be sure to properly\n URL-encode values of this\n parameter since it will contain reserved characters such as pipes and punctuation.)\n\n The Azure Maps account S0 SKU only supports a single instance of the pins parameter. Other\n SKUs\n allow multiple instances of the pins parameter to specify multiple pin styles.\n\n To render a pushpin at latitude 45\u00b0N and longitude 122\u00b0W using the default built-in pushpin\n style, add the\n querystring parameter\n\n ``pins=default||-122 45``\n\n Note that the longitude comes before the latitude.\n After URL encoding this will look like\n\n ``pins=default%7C%7C-122+45``\n\n All of the examples here show the pins\n parameter without URL encoding, for clarity.\n\n To render a pin at multiple locations, separate each location with a pipe character. For\n example, use\n\n ``pins=default||-122 45|-119.5 43.2|-121.67 47.12``\n\n The S0 Azure Maps account SKU only allows five pushpins. Other account SKUs do not have this\n limitation.\n\n Style Modifiers\n ^^^^^^^^^^^^^^^\n\n You can modify the appearance of the pins by adding style modifiers. These are added after the\n style but before\n the locations and labels. Style modifiers each have a two-letter name. These abbreviated names\n are used to help\n reduce the length of the URL.\n\n To change the color of the pushpin, use the \u0027co\u0027 style modifier and specify the color using\n the HTML/CSS RGB color\n format which is a six-digit hexadecimal number (the three-digit form is not supported). For\n example, to use\n a deep pink color which you would specify as #FF1493 in CSS, use\n\n ``pins=default|coFF1493||-122 45``\n\n Pushpin Labels\n ^^^^^^^^^^^^^^\n\n To add a label to the pins, put the label in single quotes just before the coordinates. For\n example, to label\n three pins with the values \u00271\u0027, \u00272\u0027, and \u00273\u0027, use\n\n ``pins=default||\u00271\u0027-122 45|\u00272\u0027-119.5 43.2|\u00273\u0027-121.67 47.12``\n\n There is a built in pushpin style called \u0027none\u0027 that does not display a pushpin image. You can\n use this if\n you want to display labels without any pin image. For example,\n\n ``pins=none||\u0027A\u0027-122 45|\u0027B\u0027-119.5 43.2``\n\n To change the color of the pushpin labels, use the \u0027lc\u0027 label color style modifier. For\n example, to use pink\n pushpins with black labels, use\n\n ``pins=default|coFF1493|lc000000||-122 45``\n\n To change the size of the labels, use the \u0027ls\u0027 label size style modifier. The label size\n represents the approximate\n height of the label text in pixels. For example, to increase the label size to 12, use\n\n ``pins=default|ls12||\u0027A\u0027-122 45|\u0027B\u0027-119 43``\n\n The labels are centered at the pushpin \u0027label anchor.\u0027 The anchor location is predefined for\n built-in pushpins and\n is at the top center of custom pushpins (see below). To override the label anchor, using the\n \u0027la\u0027 style modifier\n and provide X and Y pixel coordinates for the anchor. These coordinates are relative to the\n top left corner of the\n pushpin image. Positive X values move the anchor to the right, and positive Y values move the\n anchor down. For example,\n to position the label anchor 10 pixels right and 4 pixels above the top left corner of the\n pushpin image,\n use\n\n ``pins=default|la10 -4||\u0027A\u0027-122 45|\u0027B\u0027-119 43``\n\n Custom Pushpins\n ^^^^^^^^^^^^^^^\n\n To use a custom pushpin image, use the word \u0027custom\u0027 as the pin style name, and then specify a\n URL after the\n location and label information. Use two pipe characters to indicate that you\u0027re done\n specifying locations and are\n starting the URL. For example,\n\n ``pins=custom||-122 45||http://contoso.com/pushpins/red.png``\n\n After URL encoding, this would look like\n\n ``pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png``\n\n By default, custom pushpin images are drawn centered at the pin coordinates. This usually\n isn\u0027t ideal as it obscures\n the location that you\u0027re trying to highlight. To override the anchor location of the pin\n image, use the \u0027an\u0027\n style modifier. This uses the same format as the \u0027la\u0027 label anchor style modifier. For\n example, if your custom\n pin image has the tip of the pin at the top left corner of the image, you can set the anchor\n to that spot by\n using\n\n ``pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png``\n\n Note: If you use the \u0027co\u0027 color modifier with a custom pushpin image, the specified color will\n replace the RGB\n channels of the pixels in the image but will leave the alpha (opacity) channel unchanged. This\n would usually\n only be done with a solid-color custom image.\n\n Getting Pushpins from Azure Maps Data Storage\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n For all Azure Maps account SKUs other than S0,\n the pushpin location information can be obtained from Azure Maps Data Storage. After uploading\n a GeoJSON document containing pin locations, the Data Storage service returns a Unique Data ID\n (UDID) that you can use\n to reference the data in the pins parameter.\n\n To use the point geometry from an uploaded GeoJSON document as the pin locations, specify the\n UDID in the locations\n section of the pins parameter. For example,\n\n ``pins=default||udid-29dc105a-dee7-409f-a3f9-22b066ae4713``\n\n Note that\n only point and multipoint geometry, points and multipoints from geometry collections, and\n point geometry from features\n will be used. Linestring and polygon geometry will be ignored. If the point comes from a\n feature and the feature\n has a string property called \"label\", the value of that property will be used as the label for\n the pin.\n\n You can mix pin locations from Data Storage and pin locations specified in the pins parameter.\n Any of the pipe-delimited\n pin locations can be a longitude and latitude or a UDID. For example,\n\n ``pins=default||-122 45|udid-29dc105a-dee7-409f-a3f9-22b066ae4713|-119 43``\n\n Scale, Rotation, and Opacity\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n You can make pushpins and their labels larger or smaller by using the \u0027sc\u0027 scale style\n modifier. This is a\n value greater than zero. A value of 1 is the standard scale. Values larger than 1 will make\n the pins larger, and\n values smaller than 1 will make them smaller. For example, to draw the pushpins 50% larger\n than normal, use\n\n ``pins=default|sc1.5||-122 45``\n\n You can rotate pushpins and their labels by using the \u0027ro\u0027 rotation style modifier. This is a\n number of degrees\n of clockwise rotation. Use a negative number to rotate counter-clockwise. For example, to\n rotate the pushpins\n 90 degrees clockwise and double their size, use\n\n ``pins=default|ro90|sc2||-122 45``\n\n You can make pushpins and their labels partially transparent by specifying the \u0027al\u0027 alpha\n style modifier.\n This is a number between 0 and 1 indicating the opacity of the pushpins. Zero makes them\n completely transparent\n (and not visible) and 1 makes them completely opaque (which is the default). For example, to\n make pushpins\n and their labels only 67% opaque, use\n\n ``pins=default|al.67||-122 45``\n\n Style Modifier Summary\n ^^^^^^^^^^^^^^^^^^^^^^\n\n .. list-table::\n :header-rows: 1\n\n * - Modifier\n - Description\n - Range\n * - al\n - Alpha (opacity)\n - 0 to 1\n * - an\n - Pin anchor\n - *\n * - co\n - Pin color\n - 000000 to FFFFFF\n * - la\n - Label anchor\n - *\n * - lc\n - Label color\n - 000000 to FFFFFF\n * - ls\n - Label size\n - Greater than 0\n * - ro\n - Rotation\n - -360 to 360\n * - sc\n - Scale\n - Greater than 0\n\n\n\n * X and Y coordinates can be anywhere within pin image or a margin around it.\n The margin size is the minimum of the pin width and height.\n:type pins: list[str]\n:param path: Path style and locations. Use this parameter to optionally add lines, polygons or\n circles to the image.\n The path style describes the appearance of the line and fill. (Be sure to properly URL-encode\n values of this\n parameter since it will contain reserved characters such as pipes and punctuation.)\n\n Path parameter is supported in Azure Maps account SKU starting with S1. Multiple instances of\n the path parameter\n allow to specify multiple geometries with their styles. Number of parameters per request is\n limited to 10 and\n number of locations is limited to 100 per path.\n\n To render a circle with radius 100 meters and center point at latitude 45\u00b0N and longitude\n 122\u00b0W using the default style, add the\n querystring parameter\n\n ``path=ra100||-122 45``\n\n Note that the longitude comes before the latitude.\n After URL encoding this will look like\n\n ``path=ra100%7C%7C-122+45``\n\n All of the examples here show the path parameter without URL encoding, for clarity.\n\n To render a line, separate each location with a pipe character. For example, use\n\n ``path=||-122 45|-119.5 43.2|-121.67 47.12``\n\n To render a polygon, last location must be equal to the start location. For example, use\n\n ``path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45``\n\n Longitude and latitude values for locations of lines and polygons can be in the range from\n -360 to 360 to allow for rendering of geometries crossing the anti-meridian.\n\n Style Modifiers\n ^^^^^^^^^^^^^^^\n\n You can modify the appearance of the path by adding style modifiers. These are added before\n the locations.\n Style modifiers each have a two-letter name. These abbreviated names are used to help reduce\n the length\n of the URL.\n\n To change the color of the outline, use the \u0027lc\u0027 style modifier and specify the color using\n the HTML/CSS RGB color\n format which is a six-digit hexadecimal number (the three-digit form is not supported). For\n example, to use\n a deep pink color which you would specify as #FF1493 in CSS, use\n\n ``path=lcFF1493||-122 45|-119.5 43.2``\n\n Multiple style modifiers may be combined together to create a more complex visual style.\n\n ``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``\n\n Getting Path locations from Azure Maps Data Storage\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n For all Azure Maps account SKUs other than S0, the path location information can be obtained\n from Azure Maps Data Storage.\n After uploading a GeoJSON document containing path locations, the Data Storage service returns\n a Unique Data ID (UDID) that you can use\n to reference the data in the path parameter.\n\n To use the point geometry from an uploaded GeoJSON document as the path locations, specify the\n UDID in the locations\n section of the path parameter. For example,\n\n ``path=||udid-29dc105a-dee7-409f-a3f9-22b066ae4713``\n\n Note the it is not allowed to mix path locations from Data Storage with locations specified in\n the path parameter.\n\n Style Modifier Summary\n ^^^^^^^^^^^^^^^^^^^^^^\n\n .. list-table::\n :header-rows: 1\n\n * - Modifier\n - Description\n - Range\n * - lc\n - Line color\n - 000000 to FFFFFF\n * - fc\n - Fill color\n - 000000 to FFFFFF\n * - la\n - Line alpha (opacity)\n - 0 to 1\n * - fa\n - Fill alpha (opacity)\n - 0 to 1\n * - lw\n - Line width\n - Greater than 0\n * - ra\n - Circle radius (meters)\n - Greater than 0.\n:type path: list[str]\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IO, or the result of cls(response)\n:rtype: IO\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format, layer, style, zoom, center, bounding_box, height, width, language, localized_map_view, pins, path" + }, + "get_copyright_from_bounding_box_v21" : { + "sync": { + "signature": "def get_copyright_from_bounding_box_v21(\n self,\n bounding_box, # type: \"_models.BoundingBox\"\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n include_text=None, # type: Optional[Union[str, \"_models.IncludeText\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nReturns copyright information for a given bounding box. Bounding-box requests should specify\nthe minimum and maximum longitude and latitude (EPSG-3857) coordinates.\n\n:param bounding_box: Parameter group.\n:type bounding_box: ~azure.maps.render.models.BoundingBox\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:param include_text: Yes/no value to exclude textual data from response. Only images and\n country names will be in response.\n:type include_text: str or ~azure.maps.render.models.IncludeText\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Copyright, or the result of cls(response)\n:rtype: ~azure.maps.render.models.Copyright\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_copyright_from_bounding_box_v21(\n self,\n bounding_box: \"_models.BoundingBox\",\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n include_text: Optional[Union[str, \"_models.IncludeText\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.Copyright\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nReturns copyright information for a given bounding box. Bounding-box requests should specify\nthe minimum and maximum longitude and latitude (EPSG-3857) coordinates.\n\n:param bounding_box: Parameter group.\n:type bounding_box: ~azure.maps.render.models.BoundingBox\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:param include_text: Yes/no value to exclude textual data from response. Only images and\n country names will be in response.\n:type include_text: str or ~azure.maps.render.models.IncludeText\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Copyright, or the result of cls(response)\n:rtype: ~azure.maps.render.models.Copyright\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "bounding_box, format, include_text" + }, + "get_copyright_for_tile_v21" : { + "sync": { + "signature": "def get_copyright_for_tile_v21(\n self,\n tile_index, # type: \"_models.TileIndex\"\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n include_text=None, # type: Optional[Union[str, \"_models.IncludeText\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nCopyrights API is designed to serve copyright information for Render Tile service. In addition\nto basic copyright for the whole map, API is serving specific groups of copyrights for some\ncountries.\nReturns the copyright information for a given tile. To obtain the copyright information for a\nparticular tile, the request should specify the tile\u0027s zoom level and x and y coordinates (see:\nZoom Levels and Tile Grid).\n\n:param tile_index: Parameter group.\n:type tile_index: ~azure.maps.render.models.TileIndex\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:param include_text: Yes/no value to exclude textual data from response. Only images and\n country names will be in response.\n:type include_text: str or ~azure.maps.render.models.IncludeText\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Copyright, or the result of cls(response)\n:rtype: ~azure.maps.render.models.Copyright\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_copyright_for_tile_v21(\n self,\n tile_index: \"_models.TileIndex\",\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n include_text: Optional[Union[str, \"_models.IncludeText\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.Copyright\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nCopyrights API is designed to serve copyright information for Render Tile service. In addition\nto basic copyright for the whole map, API is serving specific groups of copyrights for some\ncountries.\nReturns the copyright information for a given tile. To obtain the copyright information for a\nparticular tile, the request should specify the tile\u0027s zoom level and x and y coordinates (see:\nZoom Levels and Tile Grid).\n\n:param tile_index: Parameter group.\n:type tile_index: ~azure.maps.render.models.TileIndex\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:param include_text: Yes/no value to exclude textual data from response. Only images and\n country names will be in response.\n:type include_text: str or ~azure.maps.render.models.IncludeText\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Copyright, or the result of cls(response)\n:rtype: ~azure.maps.render.models.Copyright\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "tile_index, format, include_text" + }, + "get_copyright_for_world_v21" : { + "sync": { + "signature": "def get_copyright_for_world_v21(\n self,\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n include_text=None, # type: Optional[Union[str, \"_models.IncludeText\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nCopyrights API is designed to serve copyright information for Render Tile service. In addition\nto basic copyright for the whole map, API is serving specific groups of copyrights for some\ncountries.\nReturns the copyright information for the world. To obtain the default copyright information\nfor the whole world, do not specify a tile or bounding box.\n\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:param include_text: Yes/no value to exclude textual data from response. Only images and\n country names will be in response.\n:type include_text: str or ~azure.maps.render.models.IncludeText\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Copyright, or the result of cls(response)\n:rtype: ~azure.maps.render.models.Copyright\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_copyright_for_world_v21(\n self,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n include_text: Optional[Union[str, \"_models.IncludeText\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.Copyright\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nCopyrights API is designed to serve copyright information for Render Tile service. In addition\nto basic copyright for the whole map, API is serving specific groups of copyrights for some\ncountries.\nReturns the copyright information for the world. To obtain the default copyright information\nfor the whole world, do not specify a tile or bounding box.\n\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.render.models.ResponseFormat\n:param include_text: Yes/no value to exclude textual data from response. Only images and\n country names will be in response.\n:type include_text: str or ~azure.maps.render.models.IncludeText\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Copyright, or the result of cls(response)\n:rtype: ~azure.maps.render.models.Copyright\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format, include_text" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-render/azure/maps/render/_render_client.py b/sdk/maps/azure-maps-render/azure/maps/render/_render_client.py new file mode 100644 index 000000000000..baa27949339e --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/_render_client.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import RenderClientConfiguration +from .operations import RenderClientOperationsMixin +from . import models + + +class RenderClient(RenderClientOperationsMixin): + """Azure Maps Render REST APIs. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param client_id: 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 `_ for guidance. + :type client_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + client_id=None, # type: Optional[str] + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://atlas.microsoft.com' + self._config = RenderClientConfiguration(credential, client_id, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + http_request.url = self._client.format_url(http_request.url) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> RenderClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/maps/azure-maps-render/azure/maps/render/_version.py b/sdk/maps/azure-maps-render/azure/maps/render/_version.py new file mode 100644 index 000000000000..d6cbe1e7868a --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2.1-preview" diff --git a/sdk/maps/azure-maps-render/azure/maps/render/aio/__init__.py b/sdk/maps/azure-maps-render/azure/maps/render/aio/__init__.py new file mode 100644 index 000000000000..e7d8ef7f38d6 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from ._render_client import RenderClient +__all__ = ['RenderClient'] diff --git a/sdk/maps/azure-maps-render/azure/maps/render/aio/_configuration.py b/sdk/maps/azure-maps-render/azure/maps/render/aio/_configuration.py new file mode 100644 index 000000000000..cd4a9439ae24 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/aio/_configuration.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class RenderClientConfiguration(Configuration): + """Configuration for RenderClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param client_id: 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 `_ for guidance. + :type client_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + client_id: Optional[str] = None, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(RenderClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "2.1" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-render/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/maps/azure-maps-render/azure/maps/render/aio/_render_client.py b/sdk/maps/azure-maps-render/azure/maps/render/aio/_render_client.py new file mode 100644 index 000000000000..381c8f9314e1 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/aio/_render_client.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import RenderClientConfiguration +from .operations import RenderClientOperationsMixin +from .. import models + + +class RenderClient(RenderClientOperationsMixin): + """Azure Maps Render REST APIs. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param client_id: 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 `_ for guidance. + :type client_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + client_id: Optional[str] = None, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://atlas.microsoft.com' + self._config = RenderClientConfiguration(credential, client_id, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + http_request.url = self._client.format_url(http_request.url) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "RenderClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/__init__.py b/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/__init__.py new file mode 100644 index 000000000000..b4ec14d1317a --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from ._render_client_operations import RenderClientOperationsMixin + +__all__ = [ + 'RenderClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_render_client_operations.py b/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_render_client_operations.py new file mode 100644 index 000000000000..69334ef7330e --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/aio/operations/_render_client_operations.py @@ -0,0 +1,1227 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, IO, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RenderClientOperationsMixin: + + async def get_map_tile_v21( + self, + tileset_id: Union[str, "_models.TilesetID"], + tile_index: "_models.TileIndex", + time_stamp: Optional[datetime.datetime] = None, + tile_size: Optional[Union[str, "_models.MapTileSize"]] = None, + language: Optional[str] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + **kwargs: Any + ) -> IO: + """**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 `_. By default, Azure Maps uses vector tiles for its web map + control (Web SDK) and Android SDK. + + :param tileset_id: 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 + `_ are generated through the `Tileset Create API + `_. The ready-to-use tilesets supplied + by Azure Maps are listed below. For example, microsoft.base. + :type tileset_id: str or ~azure.maps.render.models.TilesetID + :param tile_index: Parameter group. + :type tile_index: ~azure.maps.render.models.TileIndex + :param time_stamp: 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 `_. 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. + :type time_stamp: ~datetime.datetime + :param tile_size: The size of the returned map tile in pixels. + :type tile_size: str or ~azure.maps.render.models.MapTileSize + :param language: 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 + `_ for details. + :type language: str + :param localized_map_view: 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 `_ for details and + to see the available Views. + :type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _z = None + _x = None + _y = None + if tile_index is not None: + _z = tile_index.z + _x = tile_index.x + _y = tile_index.y + api_version = "2.1" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_map_tile_v21.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['tilesetId'] = self._serialize.query("tileset_id", tileset_id, 'str') + query_parameters['zoom'] = self._serialize.query("z", _z, 'int') + query_parameters['x'] = self._serialize.query("x", _x, 'int') + query_parameters['y'] = self._serialize.query("y", _y, 'int') + if time_stamp is not None: + query_parameters['timeStamp'] = self._serialize.query("time_stamp", time_stamp, 'iso-8601') + if tile_size is not None: + query_parameters['tileSize'] = self._serialize.query("tile_size", tile_size, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type')) + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_map_tile_v21.metadata = {'url': '/map/tile'} # type: ignore + + async def get_map_tileset( + self, + tileset_id: Union[str, "_models.TilesetID"], + **kwargs: Any + ) -> "_models.MapTileset": + """**Applies to**\ : S0 and S1 pricing tiers. + + The Get Map Tileset API allows users to request metadata for a tileset. + + :param tileset_id: 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 + `_ are generated through the `Tileset Create API + `_. The ready-to-use tilesets supplied + by Azure Maps are listed below. For example, microsoft.base. + :type tileset_id: str or ~azure.maps.render.models.TilesetID + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MapTileset, or the result of cls(response) + :rtype: ~azure.maps.render.models.MapTileset + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MapTileset"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_map_tileset.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['tilesetId'] = self._serialize.query("tileset_id", tileset_id, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('MapTileset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_map_tileset.metadata = {'url': '/map/tileset'} # type: ignore + + async def get_map_attribution( + self, + tileset_id: Union[str, "_models.TilesetID"], + zoom: int, + bounds: List[float], + **kwargs: Any + ) -> "_models.MapAttribution": + """**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. + + :param tileset_id: 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 + `_ are generated through the `Tileset Create API + `_. The ready-to-use tilesets supplied + by Azure Maps are listed below. For example, microsoft.base. + :type tileset_id: str or ~azure.maps.render.models.TilesetID + :param zoom: Zoom level for the desired map attribution. + :type zoom: int + :param bounds: 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]``. + :type bounds: list[float] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MapAttribution, or the result of cls(response) + :rtype: ~azure.maps.render.models.MapAttribution + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MapAttribution"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_map_attribution.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['tilesetId'] = self._serialize.query("tileset_id", tileset_id, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['bounds'] = self._serialize.query("bounds", bounds, '[float]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('MapAttribution', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_map_attribution.metadata = {'url': '/map/attribution'} # type: ignore + + async def get_map_state_tile_v21( + self, + stateset_id: str, + tile_index: "_models.TileIndex", + **kwargs: Any + ) -> IO: + """**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 + `_\ + ). + + :param stateset_id: The stateset id. + :type stateset_id: str + :param tile_index: Parameter group. + :type tile_index: ~azure.maps.render.models.TileIndex + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _z = None + _x = None + _y = None + if tile_index is not None: + _z = tile_index.z + _x = tile_index.x + _y = tile_index.y + api_version = "2.1" + accept = "application/vnd.mapbox-vector-tile, application/json" + + # Construct URL + url = self.get_map_state_tile_v21.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['zoom'] = self._serialize.query("z", _z, 'int') + query_parameters['x'] = self._serialize.query("x", _x, 'int') + query_parameters['y'] = self._serialize.query("y", _y, 'int') + query_parameters['statesetId'] = self._serialize.query("stateset_id", stateset_id, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type')) + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_map_state_tile_v21.metadata = {'url': '/map/statetile'} # type: ignore + + async def get_copyright_caption_v21( + self, + format: Union[str, "_models.ResponseFormat"] = "json", + **kwargs: Any + ) -> "_models.CopyrightCaption": + """**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. + + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CopyrightCaption, or the result of cls(response) + :rtype: ~azure.maps.render.models.CopyrightCaption + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyrightCaption"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_caption_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('CopyrightCaption', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_caption_v21.metadata = {'url': '/map/copyright/caption/{format}'} # type: ignore + + async def get_map_static_image_v21( + self, + format: Union[str, "_models.RasterTileFormat"] = "png", + layer: Optional[Union[str, "_models.StaticMapLayer"]] = None, + style: Optional[Union[str, "_models.MapImageStyle"]] = None, + zoom: Optional[int] = None, + center: Optional[List[float]] = None, + bounding_box: Optional[List[float]] = None, + height: Optional[int] = None, + width: Optional[int] = None, + language: Optional[str] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + pins: Optional[List[str]] = None, + path: Optional[List[str]] = None, + **kwargs: Any + ) -> IO: + """**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 `_ + * Specify multiple pushpin styles + * Render circle, polyline and polygon geometry types. + * Render of supported GeoJSON geometry types uploaded through `Azure Maps Data Service + `_ + + Please see `How-to-Guide `_ for detailed + examples. + + *Note* : Either **center** or **bbox** parameter must be supplied to the + API. + :code:`
`:code:`
` + The supported Lat and Lon ranges when using the **bbox** parameter, are as follows: + :code:`
`:code:`
` + + .. list-table:: + :header-rows: 1 + + * - 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. + + :param format: Desired format of the response. Possible value: png. + :type format: str or ~azure.maps.render.models.RasterTileFormat + :param layer: Map layer requested. If layer is set to labels or hybrid, the format should be + png. + :type layer: str or ~azure.maps.render.models.StaticMapLayer + :param style: Map style to be returned. Possible values are main and dark. + :type style: str or ~azure.maps.render.models.MapImageStyle + :param zoom: Desired zoom level of the map. Zoom value must be in the range: 0-20 (inclusive). + Default value is 12.:code:`
`:code:`
`Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param center: 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. + :type center: list[float] + :param bounding_box: 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. + :type bounding_box: list[float] + :param height: Height of the resulting image in pixels. Range is 1 to 8192. Default + is 512. It shouldn’t be used with bbox. + :type height: int + :param width: Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. It + shouldn’t be used with bbox. + :type width: int + :param language: 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 + `_ for details. + :type language: str + :param localized_map_view: 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 `_ for details and + to see the available Views. + :type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView + :param pins: 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 + ^^^^^^^^^^^^^^^^^^^^^^ + + .. list-table:: + :header-rows: 1 + + * - 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. + :type pins: list[str] + :param path: 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 + ^^^^^^^^^^^^^^^^^^^^^^ + + .. list-table:: + :header-rows: 1 + + * - 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. + :type path: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_map_static_image_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if layer is not None: + query_parameters['layer'] = self._serialize.query("layer", layer, 'str') + if style is not None: + query_parameters['style'] = self._serialize.query("style", style, 'str') + if zoom is not None: + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int', maximum=20, minimum=0) + if center is not None: + query_parameters['center'] = self._serialize.query("center", center, '[float]', div=',') + if bounding_box is not None: + query_parameters['bbox'] = self._serialize.query("bounding_box", bounding_box, '[float]', div=',') + if height is not None: + query_parameters['height'] = self._serialize.query("height", height, 'int', maximum=8192, minimum=1) + if width is not None: + query_parameters['width'] = self._serialize.query("width", width, 'int', maximum=8192, minimum=1) + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if pins is not None: + query_parameters['pins'] = [self._serialize.query("pins", q, 'str') if q is not None else '' for q in pins] + if path is not None: + query_parameters['path'] = [self._serialize.query("path", q, 'str') if q is not None else '' for q in path] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type')) + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_map_static_image_v21.metadata = {'url': '/map/static/{format}'} # type: ignore + + async def get_copyright_from_bounding_box_v21( + self, + bounding_box: "_models.BoundingBox", + format: Union[str, "_models.ResponseFormat"] = "json", + include_text: Optional[Union[str, "_models.IncludeText"]] = None, + **kwargs: Any + ) -> "_models.Copyright": + """**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. + + :param bounding_box: Parameter group. + :type bounding_box: ~azure.maps.render.models.BoundingBox + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :param include_text: Yes/no value to exclude textual data from response. Only images and + country names will be in response. + :type include_text: str or ~azure.maps.render.models.IncludeText + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Copyright, or the result of cls(response) + :rtype: ~azure.maps.render.models.Copyright + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Copyright"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _south_west = None + _north_east = None + if bounding_box is not None: + _south_west = bounding_box.south_west + _north_east = bounding_box.north_east + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_from_bounding_box_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['mincoordinates'] = self._serialize.query("south_west", _south_west, '[float]', div=',') + query_parameters['maxcoordinates'] = self._serialize.query("north_east", _north_east, '[float]', div=',') + if include_text is not None: + query_parameters['text'] = self._serialize.query("include_text", include_text, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Copyright', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_from_bounding_box_v21.metadata = {'url': '/map/copyright/bounding/{format}'} # type: ignore + + async def get_copyright_for_tile_v21( + self, + tile_index: "_models.TileIndex", + format: Union[str, "_models.ResponseFormat"] = "json", + include_text: Optional[Union[str, "_models.IncludeText"]] = None, + **kwargs: Any + ) -> "_models.Copyright": + """**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). + + :param tile_index: Parameter group. + :type tile_index: ~azure.maps.render.models.TileIndex + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :param include_text: Yes/no value to exclude textual data from response. Only images and + country names will be in response. + :type include_text: str or ~azure.maps.render.models.IncludeText + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Copyright, or the result of cls(response) + :rtype: ~azure.maps.render.models.Copyright + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Copyright"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _z = None + _x = None + _y = None + if tile_index is not None: + _z = tile_index.z + _x = tile_index.x + _y = tile_index.y + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_for_tile_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['zoom'] = self._serialize.query("z", _z, 'int') + query_parameters['x'] = self._serialize.query("x", _x, 'int') + query_parameters['y'] = self._serialize.query("y", _y, 'int') + if include_text is not None: + query_parameters['text'] = self._serialize.query("include_text", include_text, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Copyright', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_for_tile_v21.metadata = {'url': '/map/copyright/tile/{format}'} # type: ignore + + async def get_copyright_for_world_v21( + self, + format: Union[str, "_models.ResponseFormat"] = "json", + include_text: Optional[Union[str, "_models.IncludeText"]] = None, + **kwargs: Any + ) -> "_models.Copyright": + """**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. + + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :param include_text: Yes/no value to exclude textual data from response. Only images and + country names will be in response. + :type include_text: str or ~azure.maps.render.models.IncludeText + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Copyright, or the result of cls(response) + :rtype: ~azure.maps.render.models.Copyright + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Copyright"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_for_world_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if include_text is not None: + query_parameters['text'] = self._serialize.query("include_text", include_text, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Copyright', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_for_world_v21.metadata = {'url': '/map/copyright/world/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-render/azure/maps/render/models/__init__.py b/sdk/maps/azure-maps-render/azure/maps/render/models/__init__.py new file mode 100644 index 000000000000..665c3583ee97 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/models/__init__.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import BoundingBox + from ._models_py3 import Copyright + from ._models_py3 import CopyrightCaption + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import MapAttribution + from ._models_py3 import MapTileset + from ._models_py3 import RegionCopyrights + from ._models_py3 import RegionCopyrightsCountry + from ._models_py3 import TileIndex +except (SyntaxError, ImportError): + from ._models import BoundingBox # type: ignore + from ._models import Copyright # type: ignore + from ._models import CopyrightCaption # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import MapAttribution # type: ignore + from ._models import MapTileset # type: ignore + from ._models import RegionCopyrights # type: ignore + from ._models import RegionCopyrightsCountry # type: ignore + from ._models import TileIndex # type: ignore + +from ._render_client_enums import ( + IncludeText, + LocalizedMapView, + MapImageStyle, + MapTileSize, + RasterTileFormat, + ResponseFormat, + StaticMapLayer, + TilesetID, +) + +__all__ = [ + 'BoundingBox', + 'Copyright', + 'CopyrightCaption', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'MapAttribution', + 'MapTileset', + 'RegionCopyrights', + 'RegionCopyrightsCountry', + 'TileIndex', + 'IncludeText', + 'LocalizedMapView', + 'MapImageStyle', + 'MapTileSize', + 'RasterTileFormat', + 'ResponseFormat', + 'StaticMapLayer', + 'TilesetID', +] diff --git a/sdk/maps/azure-maps-render/azure/maps/render/models/_models.py b/sdk/maps/azure-maps-render/azure/maps/render/models/_models.py new file mode 100644 index 000000000000..de6e91ba4b55 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/models/_models.py @@ -0,0 +1,426 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class BoundingBox(msrest.serialization.Model): + """Parameter group. + + All required parameters must be populated in order to send to Azure. + + :param south_west: Required. Minimum coordinates (south-west point) of bounding box in latitude + longitude coordinate system. E.g. 52.41064,4.84228. + :type south_west: list[float] + :param north_east: Required. Maximum coordinates (north-east point) of bounding box in latitude + longitude coordinate system. E.g. 52.41064,4.84228. + :type north_east: list[float] + """ + + _validation = { + 'south_west': {'required': True}, + 'north_east': {'required': True}, + } + + _attribute_map = { + 'south_west': {'key': 'southWest', 'type': '[float]'}, + 'north_east': {'key': 'northEast', 'type': '[float]'}, + } + + def __init__( + self, + **kwargs + ): + super(BoundingBox, self).__init__(**kwargs) + self.south_west = kwargs['south_west'] + self.north_east = kwargs['north_east'] + + +class Copyright(msrest.serialization.Model): + """This object is returned from a successful copyright request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar format_version: Format Version property. + :vartype format_version: str + :ivar general_copyrights: General Copyrights array. + :vartype general_copyrights: list[str] + :ivar regions: Regions array. + :vartype regions: list[~azure.maps.render.models.RegionCopyrights] + """ + + _validation = { + 'format_version': {'readonly': True}, + 'general_copyrights': {'readonly': True}, + 'regions': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'general_copyrights': {'key': 'generalCopyrights', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[RegionCopyrights]'}, + } + + def __init__( + self, + **kwargs + ): + super(Copyright, self).__init__(**kwargs) + self.format_version = None + self.general_copyrights = None + self.regions = None + + +class CopyrightCaption(msrest.serialization.Model): + """This object is returned from a successful copyright call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar format_version: Format Version property. + :vartype format_version: str + :ivar copyrights_caption: Copyrights Caption property. + :vartype copyrights_caption: str + """ + + _validation = { + 'format_version': {'readonly': True}, + 'copyrights_caption': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'copyrights_caption': {'key': 'copyrightsCaption', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CopyrightCaption, self).__init__(**kwargs) + self.format_version = None + self.copyrights_caption = None + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.maps.render.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.render.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.maps.render.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class MapAttribution(msrest.serialization.Model): + """Copyright attribution for the requested section of a tileset. + + :param copyrights: A list of copyright strings. + :type copyrights: list[str] + """ + + _attribute_map = { + 'copyrights': {'key': 'copyrights', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MapAttribution, self).__init__(**kwargs) + self.copyrights = kwargs.get('copyrights', None) + + +class MapTileset(msrest.serialization.Model): + """Metadata for a tileset in the TileJSON format. + + :param tilejson: Describes the version of the TileJSON spec that is implemented by this JSON + object. + :type tilejson: str + :param name: A name describing the tileset. The name can contain any legal character. + Implementations SHOULD NOT interpret the name as HTML. + :type name: str + :param description: Text description of the tileset. The description can contain any legal + character. Implementations SHOULD NOT interpret the description as HTML. + :type description: str + :param version: A semver.org style version number for the tiles contained within the tileset. + When changes across tiles are introduced, the minor version MUST change. + :type version: str + :param attribution: 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. + :type attribution: str + :param template: A mustache template to be used to format data from grids for interaction. + :type template: str + :param legend: 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. + :type legend: str + :param scheme: Default: "xyz". Either "xyz" or "tms". Influences the y direction of the tile + coordinates. The global-mercator (aka Spherical Mercator) profile is assumed. + :type scheme: str + :param tiles: 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. + :type tiles: list[str] + :param grids: An array of interactivity endpoints. + :type grids: list[str] + :param data: An array of data files in GeoJSON format. + :type data: list[str] + :param min_zoom: The minimum zoom level. + :type min_zoom: int + :param max_zoom: The maximum zoom level. + :type max_zoom: int + :param bounds: 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. + :type bounds: list[float] + :param center: 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. + :type center: list[float] + """ + + _validation = { + 'tilejson': {'pattern': r'\d+\.\d+\.\d+\w?[\w\d]*'}, + 'version': {'pattern': r'\d+\.\d+\.\d+\w?[\w\d]*'}, + 'min_zoom': {'maximum': 30, 'minimum': 0}, + 'max_zoom': {'maximum': 30, 'minimum': 0}, + } + + _attribute_map = { + 'tilejson': {'key': 'tilejson', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'attribution': {'key': 'attribution', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'str'}, + 'legend': {'key': 'legend', 'type': 'str'}, + 'scheme': {'key': 'scheme', 'type': 'str'}, + 'tiles': {'key': 'tiles', 'type': '[str]'}, + 'grids': {'key': 'grids', 'type': '[str]'}, + 'data': {'key': 'data', 'type': '[str]'}, + 'min_zoom': {'key': 'minzoom', 'type': 'int'}, + 'max_zoom': {'key': 'maxzoom', 'type': 'int'}, + 'bounds': {'key': 'bounds', 'type': '[float]'}, + 'center': {'key': 'center', 'type': '[float]'}, + } + + def __init__( + self, + **kwargs + ): + super(MapTileset, self).__init__(**kwargs) + self.tilejson = kwargs.get('tilejson', None) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.version = kwargs.get('version', None) + self.attribution = kwargs.get('attribution', None) + self.template = kwargs.get('template', None) + self.legend = kwargs.get('legend', None) + self.scheme = kwargs.get('scheme', None) + self.tiles = kwargs.get('tiles', None) + self.grids = kwargs.get('grids', None) + self.data = kwargs.get('data', None) + self.min_zoom = kwargs.get('min_zoom', None) + self.max_zoom = kwargs.get('max_zoom', None) + self.bounds = kwargs.get('bounds', None) + self.center = kwargs.get('center', None) + + +class RegionCopyrights(msrest.serialization.Model): + """RegionCopyrights. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar copyrights: Copyrights array. + :vartype copyrights: list[str] + :ivar country: Country property. + :vartype country: ~azure.maps.render.models.RegionCopyrightsCountry + """ + + _validation = { + 'copyrights': {'readonly': True}, + 'country': {'readonly': True}, + } + + _attribute_map = { + 'copyrights': {'key': 'copyrights', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'RegionCopyrightsCountry'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionCopyrights, self).__init__(**kwargs) + self.copyrights = None + self.country = None + + +class RegionCopyrightsCountry(msrest.serialization.Model): + """Country property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar iso3: ISO3 property. + :vartype iso3: str + :ivar label: Label property. + :vartype label: str + """ + + _validation = { + 'iso3': {'readonly': True}, + 'label': {'readonly': True}, + } + + _attribute_map = { + 'iso3': {'key': 'ISO3', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionCopyrightsCountry, self).__init__(**kwargs) + self.iso3 = None + self.label = None + + +class TileIndex(msrest.serialization.Model): + """Parameter group. + + All required parameters must be populated in order to send to Azure. + + :param z: Required. Zoom level for the desired tile. + + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type z: int + :param x: Required. X coordinate of the tile on zoom grid. Value must be in the range [0, + 2:code:``zoom`` -1]. + + Please see `Zoom Levels and Tile Grid + `_ for + details. + :type x: int + :param y: Required. Y coordinate of the tile on zoom grid. Value must be in the range [0, + 2:code:``zoom`` -1]. + + Please see `Zoom Levels and Tile Grid + `_ for + details. + :type y: int + """ + + _validation = { + 'z': {'required': True}, + 'x': {'required': True}, + 'y': {'required': True}, + } + + _attribute_map = { + 'z': {'key': 'z', 'type': 'int'}, + 'x': {'key': 'x', 'type': 'int'}, + 'y': {'key': 'y', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(TileIndex, self).__init__(**kwargs) + self.z = kwargs['z'] + self.x = kwargs['x'] + self.y = kwargs['y'] diff --git a/sdk/maps/azure-maps-render/azure/maps/render/models/_models_py3.py b/sdk/maps/azure-maps-render/azure/maps/render/models/_models_py3.py new file mode 100644 index 000000000000..ed700951b599 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/models/_models_py3.py @@ -0,0 +1,455 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from typing import List, Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class BoundingBox(msrest.serialization.Model): + """Parameter group. + + All required parameters must be populated in order to send to Azure. + + :param south_west: Required. Minimum coordinates (south-west point) of bounding box in latitude + longitude coordinate system. E.g. 52.41064,4.84228. + :type south_west: list[float] + :param north_east: Required. Maximum coordinates (north-east point) of bounding box in latitude + longitude coordinate system. E.g. 52.41064,4.84228. + :type north_east: list[float] + """ + + _validation = { + 'south_west': {'required': True}, + 'north_east': {'required': True}, + } + + _attribute_map = { + 'south_west': {'key': 'southWest', 'type': '[float]'}, + 'north_east': {'key': 'northEast', 'type': '[float]'}, + } + + def __init__( + self, + *, + south_west: List[float], + north_east: List[float], + **kwargs + ): + super(BoundingBox, self).__init__(**kwargs) + self.south_west = south_west + self.north_east = north_east + + +class Copyright(msrest.serialization.Model): + """This object is returned from a successful copyright request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar format_version: Format Version property. + :vartype format_version: str + :ivar general_copyrights: General Copyrights array. + :vartype general_copyrights: list[str] + :ivar regions: Regions array. + :vartype regions: list[~azure.maps.render.models.RegionCopyrights] + """ + + _validation = { + 'format_version': {'readonly': True}, + 'general_copyrights': {'readonly': True}, + 'regions': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'general_copyrights': {'key': 'generalCopyrights', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[RegionCopyrights]'}, + } + + def __init__( + self, + **kwargs + ): + super(Copyright, self).__init__(**kwargs) + self.format_version = None + self.general_copyrights = None + self.regions = None + + +class CopyrightCaption(msrest.serialization.Model): + """This object is returned from a successful copyright call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar format_version: Format Version property. + :vartype format_version: str + :ivar copyrights_caption: Copyrights Caption property. + :vartype copyrights_caption: str + """ + + _validation = { + 'format_version': {'readonly': True}, + 'copyrights_caption': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'copyrights_caption': {'key': 'copyrightsCaption', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CopyrightCaption, self).__init__(**kwargs) + self.format_version = None + self.copyrights_caption = None + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.maps.render.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.render.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.maps.render.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class MapAttribution(msrest.serialization.Model): + """Copyright attribution for the requested section of a tileset. + + :param copyrights: A list of copyright strings. + :type copyrights: list[str] + """ + + _attribute_map = { + 'copyrights': {'key': 'copyrights', 'type': '[str]'}, + } + + def __init__( + self, + *, + copyrights: Optional[List[str]] = None, + **kwargs + ): + super(MapAttribution, self).__init__(**kwargs) + self.copyrights = copyrights + + +class MapTileset(msrest.serialization.Model): + """Metadata for a tileset in the TileJSON format. + + :param tilejson: Describes the version of the TileJSON spec that is implemented by this JSON + object. + :type tilejson: str + :param name: A name describing the tileset. The name can contain any legal character. + Implementations SHOULD NOT interpret the name as HTML. + :type name: str + :param description: Text description of the tileset. The description can contain any legal + character. Implementations SHOULD NOT interpret the description as HTML. + :type description: str + :param version: A semver.org style version number for the tiles contained within the tileset. + When changes across tiles are introduced, the minor version MUST change. + :type version: str + :param attribution: 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. + :type attribution: str + :param template: A mustache template to be used to format data from grids for interaction. + :type template: str + :param legend: 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. + :type legend: str + :param scheme: Default: "xyz". Either "xyz" or "tms". Influences the y direction of the tile + coordinates. The global-mercator (aka Spherical Mercator) profile is assumed. + :type scheme: str + :param tiles: 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. + :type tiles: list[str] + :param grids: An array of interactivity endpoints. + :type grids: list[str] + :param data: An array of data files in GeoJSON format. + :type data: list[str] + :param min_zoom: The minimum zoom level. + :type min_zoom: int + :param max_zoom: The maximum zoom level. + :type max_zoom: int + :param bounds: 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. + :type bounds: list[float] + :param center: 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. + :type center: list[float] + """ + + _validation = { + 'tilejson': {'pattern': r'\d+\.\d+\.\d+\w?[\w\d]*'}, + 'version': {'pattern': r'\d+\.\d+\.\d+\w?[\w\d]*'}, + 'min_zoom': {'maximum': 30, 'minimum': 0}, + 'max_zoom': {'maximum': 30, 'minimum': 0}, + } + + _attribute_map = { + 'tilejson': {'key': 'tilejson', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'attribution': {'key': 'attribution', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'str'}, + 'legend': {'key': 'legend', 'type': 'str'}, + 'scheme': {'key': 'scheme', 'type': 'str'}, + 'tiles': {'key': 'tiles', 'type': '[str]'}, + 'grids': {'key': 'grids', 'type': '[str]'}, + 'data': {'key': 'data', 'type': '[str]'}, + 'min_zoom': {'key': 'minzoom', 'type': 'int'}, + 'max_zoom': {'key': 'maxzoom', 'type': 'int'}, + 'bounds': {'key': 'bounds', 'type': '[float]'}, + 'center': {'key': 'center', 'type': '[float]'}, + } + + def __init__( + self, + *, + tilejson: Optional[str] = None, + name: Optional[str] = None, + description: Optional[str] = None, + version: Optional[str] = None, + attribution: Optional[str] = None, + template: Optional[str] = None, + legend: Optional[str] = None, + scheme: Optional[str] = None, + tiles: Optional[List[str]] = None, + grids: Optional[List[str]] = None, + data: Optional[List[str]] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + bounds: Optional[List[float]] = None, + center: Optional[List[float]] = None, + **kwargs + ): + super(MapTileset, self).__init__(**kwargs) + self.tilejson = tilejson + self.name = name + self.description = description + self.version = version + self.attribution = attribution + self.template = template + self.legend = legend + self.scheme = scheme + self.tiles = tiles + self.grids = grids + self.data = data + self.min_zoom = min_zoom + self.max_zoom = max_zoom + self.bounds = bounds + self.center = center + + +class RegionCopyrights(msrest.serialization.Model): + """RegionCopyrights. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar copyrights: Copyrights array. + :vartype copyrights: list[str] + :ivar country: Country property. + :vartype country: ~azure.maps.render.models.RegionCopyrightsCountry + """ + + _validation = { + 'copyrights': {'readonly': True}, + 'country': {'readonly': True}, + } + + _attribute_map = { + 'copyrights': {'key': 'copyrights', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'RegionCopyrightsCountry'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionCopyrights, self).__init__(**kwargs) + self.copyrights = None + self.country = None + + +class RegionCopyrightsCountry(msrest.serialization.Model): + """Country property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar iso3: ISO3 property. + :vartype iso3: str + :ivar label: Label property. + :vartype label: str + """ + + _validation = { + 'iso3': {'readonly': True}, + 'label': {'readonly': True}, + } + + _attribute_map = { + 'iso3': {'key': 'ISO3', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionCopyrightsCountry, self).__init__(**kwargs) + self.iso3 = None + self.label = None + + +class TileIndex(msrest.serialization.Model): + """Parameter group. + + All required parameters must be populated in order to send to Azure. + + :param z: Required. Zoom level for the desired tile. + + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type z: int + :param x: Required. X coordinate of the tile on zoom grid. Value must be in the range [0, + 2:code:``zoom`` -1]. + + Please see `Zoom Levels and Tile Grid + `_ for + details. + :type x: int + :param y: Required. Y coordinate of the tile on zoom grid. Value must be in the range [0, + 2:code:``zoom`` -1]. + + Please see `Zoom Levels and Tile Grid + `_ for + details. + :type y: int + """ + + _validation = { + 'z': {'required': True}, + 'x': {'required': True}, + 'y': {'required': True}, + } + + _attribute_map = { + 'z': {'key': 'z', 'type': 'int'}, + 'x': {'key': 'x', 'type': 'int'}, + 'y': {'key': 'y', 'type': 'int'}, + } + + def __init__( + self, + *, + z: int, + x: int, + y: int, + **kwargs + ): + super(TileIndex, self).__init__(**kwargs) + self.z = z + self.x = x + self.y = y diff --git a/sdk/maps/azure-maps-render/azure/maps/render/models/_render_client_enums.py b/sdk/maps/azure-maps-render/azure/maps/render/models/_render_client_enums.py new file mode 100644 index 000000000000..28e09308dfaa --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/models/_render_client_enums.py @@ -0,0 +1,225 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class IncludeText(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Include all textual data in response. + YES = "yes" + #: Exclude textual data from response. Only images and country names will be in response. + NO = "no" + +class LocalizedMapView(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: United Arab Emirates (Arabic View). + AE = "AE" + #: Argentina (Argentinian View). + AR = "AR" + #: Bahrain (Arabic View). + BH = "BH" + #: India (Indian View). + IN_ENUM = "IN" + #: Iraq (Arabic View). + IQ = "IQ" + #: Jordan (Arabic View). + JO = "JO" + #: Kuwait (Arabic View). + KW = "KW" + #: Lebanon (Arabic View). + LB = "LB" + #: Morocco (Moroccan View). + MA = "MA" + #: Oman (Arabic View). + OM = "OM" + #: Pakistan (Pakistani View). + PK = "PK" + #: Palestinian Authority (Arabic View). + PS = "PS" + #: Qatar (Arabic View). + QA = "QA" + #: Saudi Arabia (Arabic View). + SA = "SA" + #: Syria (Arabic View). + SY = "SY" + #: Yemen (Arabic View). + YE = "YE" + #: Return the map data based on the IP address of the request. + AUTO = "Auto" + #: Unified View (Others). + UNIFIED = "Unified" + +class MapImageStyle(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Azure Maps main style. + MAIN = "main" + #: Dark grey version of the Azure Maps main style. + DARK = "dark" + +class MapTileSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Return a 256 by 256 pixel tile. + SIZE256 = "256" + #: Return a 512 by 512 pixel tile. + SIZE512 = "512" + +class RasterTileFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: An image in the png format. Supports zoom levels 0 through 18. + PNG = "png" + +class ResponseFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + #: `The Extensible Markup Language `_. + XML = "xml" + +class StaticMapLayer(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Returns an image containing all map features including polygons, borders, roads and labels. + 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. + HYBRID = "hybrid" + #: Returns an image of just the map's label information. + LABELS = "labels" + +class TilesetID(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: 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.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: vector (pbf). + MICROSOFT_BASE = "microsoft.base" + #: Displays labels for roads, natural and artificial features in a vector tile.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: vector (pbf). + MICROSOFT_BASE_LABELS = "microsoft.base.labels" + #: Displays road, boundary and label data in a vector tile.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: vector (pbf). + MICROSOFT_BASE_HYBRID = "microsoft.base.hybrid" + #: Shaded relief and terra layers.:code:`
` + #: + #: Supports zoom levels 0 through 6. Format: raster (png). + MICROSOFT_TERRA_MAIN = "microsoft.terra.main" + #: All layers with our main style.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: raster (png). + MICROSOFT_BASE_ROAD = "microsoft.base.road" + #: All layers with our dark grey style.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: raster (png). + MICROSOFT_BASE_DARKGREY = "microsoft.base.darkgrey" + #: Label data in our main style.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: raster (png). + MICROSOFT_BASE_LABELS_ROAD = "microsoft.base.labels.road" + #: Label data in our dark grey style.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: raster (png). + MICROSOFT_BASE_LABELS_DARKGREY = "microsoft.base.labels.darkgrey" + #: Road, boundary and label data in our main style.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: raster (png). + MICROSOFT_BASE_HYBRID_ROAD = "microsoft.base.hybrid.road" + #: Road, boundary and label data in our dark grey style.:code:`
` + #: + #: Supports zoom levels 0 through 22. Format: raster (png). + MICROSOFT_BASE_HYBRID_DARKGREY = "microsoft.base.hybrid.darkgrey" + #: A combination of satellite and aerial imagery. Only available in S1 pricing SKU.:code:`
` + #: + #: Supports zoom levels 1 through 19. Format: raster (jpeg). + MICROSOFT_IMAGERY = "microsoft.imagery" + #: Weather radar tiles. Latest weather radar images including areas of rain, snow, ice and mixed + #: conditions. Please see `coverage information `_ for + #: Azure Maps Weather service. To learn more about the Radar data, please see `Weather concepts + #: `_.:code:`
` + #: + #: Supports zoom levels 0 through 15. Format: raster (png). + MICROSOFT_WEATHER_RADAR_MAIN = "microsoft.weather.radar.main" + #: Weather infrared tiles. Latest Infrared Satellite images shows clouds by their temperature. + #: Please see `coverage information `_ for Azure Maps + #: Weather service. To learn more about the returned Satellite data, please see `Weather concepts + #: `_.:code:`
` + #: + #: Supports zoom levels 0 through 15. Format: raster (png). + MICROSOFT_WEATHER_INFRARED_MAIN = "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.:code:`
` + #: + #: + #: * 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).:code:`
` + #: * The horizontal reference datum is the World Geodetic System 1984 (WGS84-G1150) and the + #: vertical reference datum is the Earth Gravitational Model 2008 (EGM2008).:code:`
` + #: * 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.:code:`
` + #: * Tile data comes from the `Airbus WorldDEM4Ortho product + #: `_. Urban areas are approximately + #: leveled down to ground level. All other areas are represented by the object surface level + #: (e.g., trees). :code:`
` + #: + #: Supports zoom level 13 only. Format: raster (tiff). + MICROSOFT_DEM = "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.:code:`
` + #: + #: + #: * The vertical unit for measurement of elevation height is meters.:code:`
` + #: * The horizontal reference datum is the World Geodetic System 1984 (WGS84-G1150) and the + #: vertical reference datum is the Earth Gravitational Model 2008 (EGM2008).:code:`
` + #: * Tile data comes from the `Airbus WorldDEM4Ortho product + #: `_. Urban areas are approximately + #: leveled down to ground level. All other areas are represented by the object surface level + #: (e.g., trees).:code:`
` + #: + #: Supports zoom levels 9 through 14. Format: vector (pbf). + MICROSOFT_DEM_CONTOURS = "microsoft.dem.contours" + #: absolute traffic tiles in vector. + MICROSOFT_TRAFFIC_ABSOLUTE = "microsoft.traffic.absolute" + #: absolute traffic tiles in raster in our main style. + MICROSOFT_TRAFFIC_ABSOLUTE_MAIN = "microsoft.traffic.absolute.main" + #: relative traffic tiles in vector. + MICROSOFT_TRAFFIC_RELATIVE = "microsoft.traffic.relative" + #: relative traffic tiles in raster in our main style. + MICROSOFT_TRAFFIC_RELATIVE_MAIN = "microsoft.traffic.relative.main" + #: relative traffic tiles in raster in our dark style. + MICROSOFT_TRAFFIC_RELATIVE_DARK = "microsoft.traffic.relative.dark" + #: traffic tiles in vector. + MICROSOFT_TRAFFIC_DELAY = "microsoft.traffic.delay" + #: traffic tiles in raster in our main style. + MICROSOFT_TRAFFIC_DELAY_MAIN = "microsoft.traffic.delay.main" + #: reduced traffic tiles in raster in our main style. + MICROSOFT_TRAFFIC_REDUCED_MAIN = "microsoft.traffic.reduced.main" + #: incident tiles in vector. + MICROSOFT_TRAFFIC_INCIDENT = "microsoft.traffic.incident" diff --git a/sdk/maps/azure-maps-render/azure/maps/render/operations/__init__.py b/sdk/maps/azure-maps-render/azure/maps/render/operations/__init__.py new file mode 100644 index 000000000000..b4ec14d1317a --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from ._render_client_operations import RenderClientOperationsMixin + +__all__ = [ + 'RenderClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-render/azure/maps/render/operations/_render_client_operations.py b/sdk/maps/azure-maps-render/azure/maps/render/operations/_render_client_operations.py new file mode 100644 index 000000000000..d4e176867586 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/operations/_render_client_operations.py @@ -0,0 +1,1240 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RenderClientOperationsMixin(object): + + def get_map_tile_v21( + self, + tileset_id, # type: Union[str, "_models.TilesetID"] + tile_index, # type: "_models.TileIndex" + time_stamp=None, # type: Optional[datetime.datetime] + tile_size=None, # type: Optional[Union[str, "_models.MapTileSize"]] + language=None, # type: Optional[str] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + **kwargs # type: Any + ): + # type: (...) -> IO + """**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 `_. By default, Azure Maps uses vector tiles for its web map + control (Web SDK) and Android SDK. + + :param tileset_id: 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 + `_ are generated through the `Tileset Create API + `_. The ready-to-use tilesets supplied + by Azure Maps are listed below. For example, microsoft.base. + :type tileset_id: str or ~azure.maps.render.models.TilesetID + :param tile_index: Parameter group. + :type tile_index: ~azure.maps.render.models.TileIndex + :param time_stamp: 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 `_. 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. + :type time_stamp: ~datetime.datetime + :param tile_size: The size of the returned map tile in pixels. + :type tile_size: str or ~azure.maps.render.models.MapTileSize + :param language: 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 + `_ for details. + :type language: str + :param localized_map_view: 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 `_ for details and + to see the available Views. + :type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _z = None + _x = None + _y = None + if tile_index is not None: + _z = tile_index.z + _x = tile_index.x + _y = tile_index.y + api_version = "2.1" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_map_tile_v21.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['tilesetId'] = self._serialize.query("tileset_id", tileset_id, 'str') + query_parameters['zoom'] = self._serialize.query("z", _z, 'int') + query_parameters['x'] = self._serialize.query("x", _x, 'int') + query_parameters['y'] = self._serialize.query("y", _y, 'int') + if time_stamp is not None: + query_parameters['timeStamp'] = self._serialize.query("time_stamp", time_stamp, 'iso-8601') + if tile_size is not None: + query_parameters['tileSize'] = self._serialize.query("tile_size", tile_size, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type')) + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_map_tile_v21.metadata = {'url': '/map/tile'} # type: ignore + + def get_map_tileset( + self, + tileset_id, # type: Union[str, "_models.TilesetID"] + **kwargs # type: Any + ): + # type: (...) -> "_models.MapTileset" + """**Applies to**\ : S0 and S1 pricing tiers. + + The Get Map Tileset API allows users to request metadata for a tileset. + + :param tileset_id: 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 + `_ are generated through the `Tileset Create API + `_. The ready-to-use tilesets supplied + by Azure Maps are listed below. For example, microsoft.base. + :type tileset_id: str or ~azure.maps.render.models.TilesetID + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MapTileset, or the result of cls(response) + :rtype: ~azure.maps.render.models.MapTileset + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MapTileset"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_map_tileset.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['tilesetId'] = self._serialize.query("tileset_id", tileset_id, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('MapTileset', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_map_tileset.metadata = {'url': '/map/tileset'} # type: ignore + + def get_map_attribution( + self, + tileset_id, # type: Union[str, "_models.TilesetID"] + zoom, # type: int + bounds, # type: List[float] + **kwargs # type: Any + ): + # type: (...) -> "_models.MapAttribution" + """**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. + + :param tileset_id: 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 + `_ are generated through the `Tileset Create API + `_. The ready-to-use tilesets supplied + by Azure Maps are listed below. For example, microsoft.base. + :type tileset_id: str or ~azure.maps.render.models.TilesetID + :param zoom: Zoom level for the desired map attribution. + :type zoom: int + :param bounds: 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]``. + :type bounds: list[float] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MapAttribution, or the result of cls(response) + :rtype: ~azure.maps.render.models.MapAttribution + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MapAttribution"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_map_attribution.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['tilesetId'] = self._serialize.query("tileset_id", tileset_id, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['bounds'] = self._serialize.query("bounds", bounds, '[float]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('MapAttribution', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_map_attribution.metadata = {'url': '/map/attribution'} # type: ignore + + def get_map_state_tile_v21( + self, + stateset_id, # type: str + tile_index, # type: "_models.TileIndex" + **kwargs # type: Any + ): + # type: (...) -> IO + """**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 + `_\ + ). + + :param stateset_id: The stateset id. + :type stateset_id: str + :param tile_index: Parameter group. + :type tile_index: ~azure.maps.render.models.TileIndex + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _z = None + _x = None + _y = None + if tile_index is not None: + _z = tile_index.z + _x = tile_index.x + _y = tile_index.y + api_version = "2.1" + accept = "application/vnd.mapbox-vector-tile, application/json" + + # Construct URL + url = self.get_map_state_tile_v21.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['zoom'] = self._serialize.query("z", _z, 'int') + query_parameters['x'] = self._serialize.query("x", _x, 'int') + query_parameters['y'] = self._serialize.query("y", _y, 'int') + query_parameters['statesetId'] = self._serialize.query("stateset_id", stateset_id, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type')) + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_map_state_tile_v21.metadata = {'url': '/map/statetile'} # type: ignore + + def get_copyright_caption_v21( + self, + format="json", # type: Union[str, "_models.ResponseFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.CopyrightCaption" + """**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. + + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CopyrightCaption, or the result of cls(response) + :rtype: ~azure.maps.render.models.CopyrightCaption + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CopyrightCaption"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_caption_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('CopyrightCaption', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_caption_v21.metadata = {'url': '/map/copyright/caption/{format}'} # type: ignore + + def get_map_static_image_v21( + self, + format="png", # type: Union[str, "_models.RasterTileFormat"] + layer=None, # type: Optional[Union[str, "_models.StaticMapLayer"]] + style=None, # type: Optional[Union[str, "_models.MapImageStyle"]] + zoom=None, # type: Optional[int] + center=None, # type: Optional[List[float]] + bounding_box=None, # type: Optional[List[float]] + height=None, # type: Optional[int] + width=None, # type: Optional[int] + language=None, # type: Optional[str] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + pins=None, # type: Optional[List[str]] + path=None, # type: Optional[List[str]] + **kwargs # type: Any + ): + # type: (...) -> IO + """**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 `_ + * Specify multiple pushpin styles + * Render circle, polyline and polygon geometry types. + * Render of supported GeoJSON geometry types uploaded through `Azure Maps Data Service + `_ + + Please see `How-to-Guide `_ for detailed + examples. + + *Note* : Either **center** or **bbox** parameter must be supplied to the + API. + :code:`
`:code:`
` + The supported Lat and Lon ranges when using the **bbox** parameter, are as follows: + :code:`
`:code:`
` + + .. list-table:: + :header-rows: 1 + + * - 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. + + :param format: Desired format of the response. Possible value: png. + :type format: str or ~azure.maps.render.models.RasterTileFormat + :param layer: Map layer requested. If layer is set to labels or hybrid, the format should be + png. + :type layer: str or ~azure.maps.render.models.StaticMapLayer + :param style: Map style to be returned. Possible values are main and dark. + :type style: str or ~azure.maps.render.models.MapImageStyle + :param zoom: Desired zoom level of the map. Zoom value must be in the range: 0-20 (inclusive). + Default value is 12.:code:`
`:code:`
`Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param center: 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. + :type center: list[float] + :param bounding_box: 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. + :type bounding_box: list[float] + :param height: Height of the resulting image in pixels. Range is 1 to 8192. Default + is 512. It shouldn’t be used with bbox. + :type height: int + :param width: Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. It + shouldn’t be used with bbox. + :type width: int + :param language: 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 + `_ for details. + :type language: str + :param localized_map_view: 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 `_ for details and + to see the available Views. + :type localized_map_view: str or ~azure.maps.render.models.LocalizedMapView + :param pins: 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 + ^^^^^^^^^^^^^^^^^^^^^^ + + .. list-table:: + :header-rows: 1 + + * - 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. + :type pins: list[str] + :param path: 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 + ^^^^^^^^^^^^^^^^^^^^^^ + + .. list-table:: + :header-rows: 1 + + * - 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. + :type path: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_map_static_image_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if layer is not None: + query_parameters['layer'] = self._serialize.query("layer", layer, 'str') + if style is not None: + query_parameters['style'] = self._serialize.query("style", style, 'str') + if zoom is not None: + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int', maximum=20, minimum=0) + if center is not None: + query_parameters['center'] = self._serialize.query("center", center, '[float]', div=',') + if bounding_box is not None: + query_parameters['bbox'] = self._serialize.query("bounding_box", bounding_box, '[float]', div=',') + if height is not None: + query_parameters['height'] = self._serialize.query("height", height, 'int', maximum=8192, minimum=1) + if width is not None: + query_parameters['width'] = self._serialize.query("width", width, 'int', maximum=8192, minimum=1) + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if pins is not None: + query_parameters['pins'] = [self._serialize.query("pins", q, 'str') if q is not None else '' for q in pins] + if path is not None: + query_parameters['path'] = [self._serialize.query("path", q, 'str') if q is not None else '' for q in path] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type')) + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_map_static_image_v21.metadata = {'url': '/map/static/{format}'} # type: ignore + + def get_copyright_from_bounding_box_v21( + self, + bounding_box, # type: "_models.BoundingBox" + format="json", # type: Union[str, "_models.ResponseFormat"] + include_text=None, # type: Optional[Union[str, "_models.IncludeText"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.Copyright" + """**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. + + :param bounding_box: Parameter group. + :type bounding_box: ~azure.maps.render.models.BoundingBox + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :param include_text: Yes/no value to exclude textual data from response. Only images and + country names will be in response. + :type include_text: str or ~azure.maps.render.models.IncludeText + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Copyright, or the result of cls(response) + :rtype: ~azure.maps.render.models.Copyright + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Copyright"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _south_west = None + _north_east = None + if bounding_box is not None: + _south_west = bounding_box.south_west + _north_east = bounding_box.north_east + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_from_bounding_box_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['mincoordinates'] = self._serialize.query("south_west", _south_west, '[float]', div=',') + query_parameters['maxcoordinates'] = self._serialize.query("north_east", _north_east, '[float]', div=',') + if include_text is not None: + query_parameters['text'] = self._serialize.query("include_text", include_text, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Copyright', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_from_bounding_box_v21.metadata = {'url': '/map/copyright/bounding/{format}'} # type: ignore + + def get_copyright_for_tile_v21( + self, + tile_index, # type: "_models.TileIndex" + format="json", # type: Union[str, "_models.ResponseFormat"] + include_text=None, # type: Optional[Union[str, "_models.IncludeText"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.Copyright" + """**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). + + :param tile_index: Parameter group. + :type tile_index: ~azure.maps.render.models.TileIndex + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :param include_text: Yes/no value to exclude textual data from response. Only images and + country names will be in response. + :type include_text: str or ~azure.maps.render.models.IncludeText + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Copyright, or the result of cls(response) + :rtype: ~azure.maps.render.models.Copyright + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Copyright"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _z = None + _x = None + _y = None + if tile_index is not None: + _z = tile_index.z + _x = tile_index.x + _y = tile_index.y + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_for_tile_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['zoom'] = self._serialize.query("z", _z, 'int') + query_parameters['x'] = self._serialize.query("x", _x, 'int') + query_parameters['y'] = self._serialize.query("y", _y, 'int') + if include_text is not None: + query_parameters['text'] = self._serialize.query("include_text", include_text, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Copyright', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_for_tile_v21.metadata = {'url': '/map/copyright/tile/{format}'} # type: ignore + + def get_copyright_for_world_v21( + self, + format="json", # type: Union[str, "_models.ResponseFormat"] + include_text=None, # type: Optional[Union[str, "_models.IncludeText"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.Copyright" + """**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. + + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.render.models.ResponseFormat + :param include_text: Yes/no value to exclude textual data from response. Only images and + country names will be in response. + :type include_text: str or ~azure.maps.render.models.IncludeText + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Copyright, or the result of cls(response) + :rtype: ~azure.maps.render.models.Copyright + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Copyright"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2.1" + accept = "application/json" + + # Construct URL + url = self.get_copyright_for_world_v21.metadata['url'] # type: ignore + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if include_text is not None: + query_parameters['text'] = self._serialize.query("include_text", include_text, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if self._config.client_id is not None: + header_parameters['x-ms-client-id'] = self._serialize.header("self._config.client_id", self._config.client_id, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Copyright', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_copyright_for_world_v21.metadata = {'url': '/map/copyright/world/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-render/azure/maps/render/py.typed b/sdk/maps/azure-maps-render/azure/maps/render/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-render/azure/maps/render/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-render/sdk_packaging.toml b/sdk/maps/azure-maps-render/sdk_packaging.toml new file mode 100644 index 000000000000..417cb6307241 --- /dev/null +++ b/sdk/maps/azure-maps-render/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-render" +package_nspkg = "azure-maps-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/maps/azure-maps-render/setup.cfg b/sdk/maps/azure-maps-render/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-render/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-render/setup.py b/sdk/maps/azure-maps-render/setup.py new file mode 100644 index 000000000000..4683b6c69286 --- /dev/null +++ b/sdk/maps/azure-maps-render/setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-maps-render" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.maps', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', + ], + extras_require={ + ":python_version<'3.0'": ['azure-maps-nspkg'], + } +)