diff --git a/sdk/maps/azure-maps-elevation/CHANGELOG.md b/sdk/maps/azure-maps-elevation/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-elevation/MANIFEST.in b/sdk/maps/azure-maps-elevation/MANIFEST.in new file mode 100644 index 000000000000..cb7d3109cc06 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/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 + diff --git a/sdk/maps/azure-maps-elevation/README.md b/sdk/maps/azure-maps-elevation/README.md new file mode 100644 index 000000000000..6d1d1d5b8c70 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/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-elevation%2FREADME.png) diff --git a/sdk/maps/azure-maps-elevation/_meta.json b/sdk/maps/azure-maps-elevation/_meta.json new file mode 100644 index 000000000000..86abaa0a5519 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "fd01f0058f99a0d2b145abbb7ade2cd90d9d3a82", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/DEM/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/DEM/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-elevation/azure/__init__.py b/sdk/maps/azure-maps-elevation/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-elevation/azure/maps/__init__.py b/sdk/maps/azure-maps-elevation/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/__init__.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/__init__.py new file mode 100644 index 000000000000..f22a326f8b3a --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/__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 ._elevation_client import ElevationClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['ElevationClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/_configuration.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_configuration.py new file mode 100644 index 000000000000..fbeb08b2d299 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_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 ElevationClientConfiguration(Configuration): + """Configuration for ElevationClient. + + 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(ElevationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-elevation/{}'.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-elevation/azure/maps/elevation/_elevation_client.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_elevation_client.py new file mode 100644 index 000000000000..32bfd6517f6e --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_elevation_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 ElevationClientConfiguration +from .operations import ElevationClientOperationsMixin +from . import models + + +class ElevationClient(ElevationClientOperationsMixin): + """The Azure Maps Elevation API provides an HTTP interface to query elevation data on the surface of the Earth. Elevation data can be retrieved at specific locations by sending lat/lon coordinates, by defining an ordered set of vertices that form a Polyline and a number of sample points along the length of a Polyline, or by defining a bounding box that consists of equally spaced vertices as rows and columns. The vertical datum is EPSG:3855. This datum uses the EGM2008 geoid model applied to the WGS84 ellipsoid as its zero height reference surface. The vertical unit is measured in meters, the spatial resolution of the elevation data is 0.8 arc-second for global coverage (~24 meters). + + :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 = ElevationClientConfiguration(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: () -> ElevationClient + 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-elevation/azure/maps/elevation/_metadata.json b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_metadata.json new file mode 100644 index 000000000000..a53aade2c3c1 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_metadata.json @@ -0,0 +1,168 @@ +{ + "chosen_version": "1.0", + "total_api_version_list": ["1.0"], + "client": { + "name": "ElevationClient", + "filename": "_elevation_client", + "description": "The Azure Maps Elevation API provides an HTTP interface to query elevation data on the surface of the Earth. Elevation data can be retrieved at specific locations by sending lat/lon coordinates, by defining an ordered set of vertices that form a Polyline and a number of sample points along the length of a Polyline, or by defining a bounding box that consists of equally spaced vertices as rows and columns. The vertical datum is EPSG:3855. This datum uses the EGM2008 geoid model applied to the WGS84 ellipsoid as its zero height reference surface. The vertical unit is measured in meters, the spatial resolution of the elevation data is 0.8 arc-second for global coverage (~24 meters).", + "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\": [\"ElevationClientConfiguration\"], \"._operations_mixin\": [\"ElevationClientOperationsMixin\"]}}}", + "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\": [\"ElevationClientConfiguration\"], \"._operations_mixin\": [\"ElevationClientOperationsMixin\"]}}}" + }, + "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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_data_for_points" : { + "sync": { + "signature": "def get_data_for_points(\n self,\n points, # type: List[str]\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Elevation Data on One or More Points.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Get Data for Points API provides elevation data for one or more points. A point is\ndefined in lat,long coordinate format.\n\n Due to the URL character length limit of 2048, it\u0027s not possible to pass more than 100\ncoordinates as a pipeline delimited string in a URL GET request. If you intend to pass more\nthan 100 coordinates as a pipeline delimited string, use the `POST Data\n For Points \u003chttps://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints\u003e`_.\n\n The result will be in the same sequence of points listed in the request.\n\n:param points: The string representation of a list of points. A point is defined in lon/lat\n WGS84 coordinate reference system format. If multiple points are requested, each of the points\n in a list should be separated by the pipe (\u0027|\u0027) character. The maximum number of points that\n can be requested in a single request is 2,000. The resolution of the elevation data will be\n the highest for a single point and will decrease if multiple points are spread further apart.\n:type points: list[str]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_data_for_points(\n self,\n points: List[str],\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.ElevationResult\":\n", + "doc": "\"\"\"Get Elevation Data on One or More Points.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Get Data for Points API provides elevation data for one or more points. A point is\ndefined in lat,long coordinate format.\n\n Due to the URL character length limit of 2048, it\u0027s not possible to pass more than 100\ncoordinates as a pipeline delimited string in a URL GET request. If you intend to pass more\nthan 100 coordinates as a pipeline delimited string, use the `POST Data\n For Points \u003chttps://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints\u003e`_.\n\n The result will be in the same sequence of points listed in the request.\n\n:param points: The string representation of a list of points. A point is defined in lon/lat\n WGS84 coordinate reference system format. If multiple points are requested, each of the points\n in a list should be separated by the pipe (\u0027|\u0027) character. The maximum number of points that\n can be requested in a single request is 2,000. The resolution of the elevation data will be\n the highest for a single point and will decrease if multiple points are spread further apart.\n:type points: list[str]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "points, format" + }, + "post_data_for_points" : { + "sync": { + "signature": "def post_data_for_points(\n self,\n points, # type: List[\"_models.LatLongPairAbbreviated\"]\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Query Elevation Data for Multiple Points.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Post Data for Points API provides elevation data for multiple points. A point is defined\nlon/lat coordinate format.\n\n Use the POST endpoint only if you intend to pass multiple points in the request. If you intend\nto pass a single coordinate into the API, use the `GET Data For Points API\n\u003chttps://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints\u003e`_.\n\n The result will be in the same sequence of points listed in the request.\n\n:param points: The string representation of a list of points. A point is defined in lon/lat\n WGS84 coordinate reference system format. Each points in a list should be separated by the\n pipe (\u0027|\u0027) character. The number of points that can be requested in a POST request ranges from\n 2 to 2,000. The resolution of the elevation data will be the highest for a single point and\n will decrease if multiple points are spread further apart.\n:type points: list[~azure.maps.elevation.models.LatLongPairAbbreviated]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_data_for_points(\n self,\n points: List[\"_models.LatLongPairAbbreviated\"],\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.ElevationResult\":\n", + "doc": "\"\"\"Query Elevation Data for Multiple Points.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Post Data for Points API provides elevation data for multiple points. A point is defined\nlon/lat coordinate format.\n\n Use the POST endpoint only if you intend to pass multiple points in the request. If you intend\nto pass a single coordinate into the API, use the `GET Data For Points API\n\u003chttps://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints\u003e`_.\n\n The result will be in the same sequence of points listed in the request.\n\n:param points: The string representation of a list of points. A point is defined in lon/lat\n WGS84 coordinate reference system format. Each points in a list should be separated by the\n pipe (\u0027|\u0027) character. The number of points that can be requested in a POST request ranges from\n 2 to 2,000. The resolution of the elevation data will be the highest for a single point and\n will decrease if multiple points are spread further apart.\n:type points: list[~azure.maps.elevation.models.LatLongPairAbbreviated]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "points, format" + }, + "get_data_for_polyline" : { + "sync": { + "signature": "def get_data_for_polyline(\n self,\n lines, # type: List[str]\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n samples=None, # type: Optional[int]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Elevation Data Along a Polyline.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Get Data for Polyline API provides elevation data along a polyline.\n\n A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe\n(\u0027|\u0027) character. In addition to passing in endpoints, customers can specify the number of\nsample points that will be used to divide polyline into equally spaced segments.\n\n Elevation data at both start and endpoints, as well as equally spaced points along the\npolyline will be returned. The results will be listed in the direction from the first endpoint\ntowards the last endpoint. A line between two endpoints is a straight Cartesian line, the\nshortest line between those two points in the coordinate reference system. Note that the point\nis chosen based on Euclidean distance and may markedly differ from the geodesic path along the\ncurved surface of the reference ellipsoid.\n\n:param lines: The string representation of a polyline path. A polyline is defined by endpoint\n coordinates, with each endpoint separated by a pipe (\u0027|\u0027) character. The polyline should be\n defined in the following format: ``[longitude_point1, latitude_point1 | longitude_point2,\n latitude_point2, ..., longitude_pointN, latitude_pointN]``.\n\n The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate\n reference system. The resolution of the data used to compute the elevation depends on the\n distance between the endpoints.\n:type lines: list[str]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:param samples: The samples parameter specifies the number of equally spaced points at which\n elevation values should be provided along a polyline path. The number of samples should range\n from 2 to 2,000. Default value is 10.\n:type samples: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_data_for_polyline(\n self,\n lines: List[str],\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n samples: Optional[int] = None,\n **kwargs: Any\n) -\u003e \"_models.ElevationResult\":\n", + "doc": "\"\"\"Get Elevation Data Along a Polyline.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Get Data for Polyline API provides elevation data along a polyline.\n\n A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe\n(\u0027|\u0027) character. In addition to passing in endpoints, customers can specify the number of\nsample points that will be used to divide polyline into equally spaced segments.\n\n Elevation data at both start and endpoints, as well as equally spaced points along the\npolyline will be returned. The results will be listed in the direction from the first endpoint\ntowards the last endpoint. A line between two endpoints is a straight Cartesian line, the\nshortest line between those two points in the coordinate reference system. Note that the point\nis chosen based on Euclidean distance and may markedly differ from the geodesic path along the\ncurved surface of the reference ellipsoid.\n\n:param lines: The string representation of a polyline path. A polyline is defined by endpoint\n coordinates, with each endpoint separated by a pipe (\u0027|\u0027) character. The polyline should be\n defined in the following format: ``[longitude_point1, latitude_point1 | longitude_point2,\n latitude_point2, ..., longitude_pointN, latitude_pointN]``.\n\n The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate\n reference system. The resolution of the data used to compute the elevation depends on the\n distance between the endpoints.\n:type lines: list[str]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:param samples: The samples parameter specifies the number of equally spaced points at which\n elevation values should be provided along a polyline path. The number of samples should range\n from 2 to 2,000. Default value is 10.\n:type samples: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "lines, format, samples" + }, + "post_data_for_polyline" : { + "sync": { + "signature": "def post_data_for_polyline(\n self,\n polyline, # type: List[\"_models.LatLongPairAbbreviated\"]\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n samples=None, # type: Optional[int]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Query Elevation Data Along a Polyline.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Post Data for Polyline API provides elevation data along a polyline.\n\n A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe\n(\u0027|\u0027) character. In addition to passing in endpoints, customers can specify the number of\nsample points that will be used to divide polyline into equally spaced segments.\n\n Elevation data at both start and end points, as well as equally spaced points along the\npolyline will be returned. The results will be listed in the direction from the first endpoint\ntowards the last endpoint. A line between two endpoints is a straight Cartesian line, the\nshortest line between those two points in the coordinate reference system. Note that the point\nis chosen based on Euclidean distance and may markedly differ from the geodesic path along the\ncurved surface of the reference ellipsoid.\n\n:param polyline: The string representation of a polyline path. A polyline is defined by\n endpoint coordinates, with each endpoint separated by a pipe (\u0027|\u0027) character. The polyline\n should be defined in the following format: ``[longitude_point1, latitude_point1 |\n longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]``. The longitude\n and latitude values refer to the World Geodetic System (WGS84) coordinate reference system.\n The resolution of the data used to compute the elevation will depend on the distance between\n the endpoints.\n:type polyline: list[~azure.maps.elevation.models.LatLongPairAbbreviated]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:param samples: The samples parameter specifies the number of equally spaced points at which\n elevation values should be provided along a polyline path. The number of samples should range\n from 2 to 2,000. Default value is 10.\n:type samples: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_data_for_polyline(\n self,\n polyline: List[\"_models.LatLongPairAbbreviated\"],\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n samples: Optional[int] = None,\n **kwargs: Any\n) -\u003e \"_models.ElevationResult\":\n", + "doc": "\"\"\"Query Elevation Data Along a Polyline.\n\n**Applies to**\\ : S1 pricing tier.\n\n The Post Data for Polyline API provides elevation data along a polyline.\n\n A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe\n(\u0027|\u0027) character. In addition to passing in endpoints, customers can specify the number of\nsample points that will be used to divide polyline into equally spaced segments.\n\n Elevation data at both start and end points, as well as equally spaced points along the\npolyline will be returned. The results will be listed in the direction from the first endpoint\ntowards the last endpoint. A line between two endpoints is a straight Cartesian line, the\nshortest line between those two points in the coordinate reference system. Note that the point\nis chosen based on Euclidean distance and may markedly differ from the geodesic path along the\ncurved surface of the reference ellipsoid.\n\n:param polyline: The string representation of a polyline path. A polyline is defined by\n endpoint coordinates, with each endpoint separated by a pipe (\u0027|\u0027) character. The polyline\n should be defined in the following format: ``[longitude_point1, latitude_point1 |\n longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]``. The longitude\n and latitude values refer to the World Geodetic System (WGS84) coordinate reference system.\n The resolution of the data used to compute the elevation will depend on the distance between\n the endpoints.\n:type polyline: list[~azure.maps.elevation.models.LatLongPairAbbreviated]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:param samples: The samples parameter specifies the number of equally spaced points at which\n elevation values should be provided along a polyline path. The number of samples should range\n from 2 to 2,000. Default value is 10.\n:type samples: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "polyline, format, samples" + }, + "get_data_for_bounding_box" : { + "sync": { + "signature": "def get_data_for_bounding_box(\n self,\n bounds, # type: List[float]\n rows, # type: int\n columns, # type: int\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get Elevation Data at Equally Spaced Locations Within a Bounding Box.\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Get Data for Bounding Box API provides elevation data at equally spaced locations within a\nbounding box. A bounding box is defined by the coordinates for two corners (southwest,\nnortheast) and then subsequently divided into rows and columns.\n\n Elevations are returned for the vertices of the grid created by the rows and columns. Up to\n2,000 elevations can be returned in a single request. The returned elevation values are\nordered, starting at the southwest corner, and then proceeding west to east along the row. At\nthe end of the row, it moves north to the next row, and repeats the process until it reaches\nthe far northeast corner.\n\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:param rows: Specifies the number of rows to use to divide the bounding box area into a grid.\n The number of vertices (rows x columns) in the grid should be less than 2,000.\n:type rows: int\n:param columns: Specifies the number of columns to use to divide the bounding box area into a\n grid. The number of vertices (rows x columns) in the grid should be less than 2,000.\n:type columns: int\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_data_for_bounding_box(\n self,\n bounds: List[float],\n rows: int,\n columns: int,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.ElevationResult\":\n", + "doc": "\"\"\"Get Elevation Data at Equally Spaced Locations Within a Bounding Box.\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Get Data for Bounding Box API provides elevation data at equally spaced locations within a\nbounding box. A bounding box is defined by the coordinates for two corners (southwest,\nnortheast) and then subsequently divided into rows and columns.\n\n Elevations are returned for the vertices of the grid created by the rows and columns. Up to\n2,000 elevations can be returned in a single request. The returned elevation values are\nordered, starting at the southwest corner, and then proceeding west to east along the row. At\nthe end of the row, it moves north to the next row, and repeats the process until it reaches\nthe far northeast corner.\n\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:param rows: Specifies the number of rows to use to divide the bounding box area into a grid.\n The number of vertices (rows x columns) in the grid should be less than 2,000.\n:type rows: int\n:param columns: Specifies the number of columns to use to divide the bounding box area into a\n grid. The number of vertices (rows x columns) in the grid should be less than 2,000.\n:type columns: int\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.elevation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ElevationResult, or the result of cls(response)\n:rtype: ~azure.maps.elevation.models.ElevationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "bounds, rows, columns, format" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/_version.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_version.py new file mode 100644 index 000000000000..b9995fb385b0 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/_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 = "1.0-preview" diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/__init__.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/__init__.py new file mode 100644 index 000000000000..4dfcbb83c45c --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/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 ._elevation_client import ElevationClient +__all__ = ['ElevationClient'] diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/_configuration.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/_configuration.py new file mode 100644 index 000000000000..d9de0c93a76c --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/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 ElevationClientConfiguration(Configuration): + """Configuration for ElevationClient. + + 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(ElevationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-elevation/{}'.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-elevation/azure/maps/elevation/aio/_elevation_client.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/_elevation_client.py new file mode 100644 index 000000000000..a32d3bf39407 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/_elevation_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 ElevationClientConfiguration +from .operations import ElevationClientOperationsMixin +from .. import models + + +class ElevationClient(ElevationClientOperationsMixin): + """The Azure Maps Elevation API provides an HTTP interface to query elevation data on the surface of the Earth. Elevation data can be retrieved at specific locations by sending lat/lon coordinates, by defining an ordered set of vertices that form a Polyline and a number of sample points along the length of a Polyline, or by defining a bounding box that consists of equally spaced vertices as rows and columns. The vertical datum is EPSG:3855. This datum uses the EGM2008 geoid model applied to the WGS84 ellipsoid as its zero height reference surface. The vertical unit is measured in meters, the spatial resolution of the elevation data is 0.8 arc-second for global coverage (~24 meters). + + :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 = ElevationClientConfiguration(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) -> "ElevationClient": + 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-elevation/azure/maps/elevation/aio/operations/__init__.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/operations/__init__.py new file mode 100644 index 000000000000..7b55d6e49539 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/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 ._elevation_client_operations import ElevationClientOperationsMixin + +__all__ = [ + 'ElevationClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/operations/_elevation_client_operations.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/operations/_elevation_client_operations.py new file mode 100644 index 000000000000..a19250157c77 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/aio/operations/_elevation_client_operations.py @@ -0,0 +1,442 @@ +# 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, Callable, Dict, Generic, 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 ElevationClientOperationsMixin: + + async def get_data_for_points( + self, + points: List[str], + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.ElevationResult": + """Get Elevation Data on One or More Points. + + **Applies to**\ : S1 pricing tier. + + The Get Data for Points API provides elevation data for one or more points. A point is + defined in lat,long coordinate format. + + Due to the URL character length limit of 2048, it's not possible to pass more than 100 + coordinates as a pipeline delimited string in a URL GET request. If you intend to pass more + than 100 coordinates as a pipeline delimited string, use the `POST Data + For Points `_. + + The result will be in the same sequence of points listed in the request. + + :param points: The string representation of a list of points. A point is defined in lon/lat + WGS84 coordinate reference system format. If multiple points are requested, each of the points + in a list should be separated by the pipe ('|') character. The maximum number of points that + can be requested in a single request is 2,000. The resolution of the elevation data will be + the highest for a single point and will decrease if multiple points are spread further apart. + :type points: list[str] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_data_for_points.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['points'] = self._serialize.query("points", points, '[str]', skip_quote=True, 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_for_points.metadata = {'url': '/elevation/point/{format}'} # type: ignore + + async def post_data_for_points( + self, + points: List["_models.LatLongPairAbbreviated"], + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.ElevationResult": + """Query Elevation Data for Multiple Points. + + **Applies to**\ : S1 pricing tier. + + The Post Data for Points API provides elevation data for multiple points. A point is defined + lon/lat coordinate format. + + Use the POST endpoint only if you intend to pass multiple points in the request. If you intend + to pass a single coordinate into the API, use the `GET Data For Points API + `_. + + The result will be in the same sequence of points listed in the request. + + :param points: The string representation of a list of points. A point is defined in lon/lat + WGS84 coordinate reference system format. Each points in a list should be separated by the + pipe ('|') character. The number of points that can be requested in a POST request ranges from + 2 to 2,000. The resolution of the elevation data will be the highest for a single point and + will decrease if multiple points are spread further apart. + :type points: list[~azure.maps.elevation.models.LatLongPairAbbreviated] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_data_for_points.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(points, '[LatLongPairAbbreviated]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_data_for_points.metadata = {'url': '/elevation/point/{format}'} # type: ignore + + async def get_data_for_polyline( + self, + lines: List[str], + format: Union[str, "_models.JsonFormat"] = "json", + samples: Optional[int] = None, + **kwargs: Any + ) -> "_models.ElevationResult": + """Get Elevation Data Along a Polyline. + + **Applies to**\ : S1 pricing tier. + + The Get Data for Polyline API provides elevation data along a polyline. + + A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe + ('|') character. In addition to passing in endpoints, customers can specify the number of + sample points that will be used to divide polyline into equally spaced segments. + + Elevation data at both start and endpoints, as well as equally spaced points along the + polyline will be returned. The results will be listed in the direction from the first endpoint + towards the last endpoint. A line between two endpoints is a straight Cartesian line, the + shortest line between those two points in the coordinate reference system. Note that the point + is chosen based on Euclidean distance and may markedly differ from the geodesic path along the + curved surface of the reference ellipsoid. + + :param lines: The string representation of a polyline path. A polyline is defined by endpoint + coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be + defined in the following format: ``[longitude_point1, latitude_point1 | longitude_point2, + latitude_point2, ..., longitude_pointN, latitude_pointN]``. + + The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + reference system. The resolution of the data used to compute the elevation depends on the + distance between the endpoints. + :type lines: list[str] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :param samples: The samples parameter specifies the number of equally spaced points at which + elevation values should be provided along a polyline path. The number of samples should range + from 2 to 2,000. Default value is 10. + :type samples: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_data_for_polyline.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['lines'] = self._serialize.query("lines", lines, '[str]', skip_quote=True, div='|') + if samples is not None: + query_parameters['samples'] = self._serialize.query("samples", samples, 'int', maximum=2000, minimum=2) + + # 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_for_polyline.metadata = {'url': '/elevation/line/{format}'} # type: ignore + + async def post_data_for_polyline( + self, + polyline: List["_models.LatLongPairAbbreviated"], + format: Union[str, "_models.JsonFormat"] = "json", + samples: Optional[int] = None, + **kwargs: Any + ) -> "_models.ElevationResult": + """Query Elevation Data Along a Polyline. + + **Applies to**\ : S1 pricing tier. + + The Post Data for Polyline API provides elevation data along a polyline. + + A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe + ('|') character. In addition to passing in endpoints, customers can specify the number of + sample points that will be used to divide polyline into equally spaced segments. + + Elevation data at both start and end points, as well as equally spaced points along the + polyline will be returned. The results will be listed in the direction from the first endpoint + towards the last endpoint. A line between two endpoints is a straight Cartesian line, the + shortest line between those two points in the coordinate reference system. Note that the point + is chosen based on Euclidean distance and may markedly differ from the geodesic path along the + curved surface of the reference ellipsoid. + + :param polyline: The string representation of a polyline path. A polyline is defined by + endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline + should be defined in the following format: ``[longitude_point1, latitude_point1 | + longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]``. The longitude + and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. + The resolution of the data used to compute the elevation will depend on the distance between + the endpoints. + :type polyline: list[~azure.maps.elevation.models.LatLongPairAbbreviated] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :param samples: The samples parameter specifies the number of equally spaced points at which + elevation values should be provided along a polyline path. The number of samples should range + from 2 to 2,000. Default value is 10. + :type samples: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_data_for_polyline.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 samples is not None: + query_parameters['samples'] = self._serialize.query("samples", samples, 'int', maximum=2000, minimum=2) + + # 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(polyline, '[LatLongPairAbbreviated]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_data_for_polyline.metadata = {'url': '/elevation/line/{format}'} # type: ignore + + async def get_data_for_bounding_box( + self, + bounds: List[float], + rows: int, + columns: int, + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.ElevationResult": + """Get Elevation Data at Equally Spaced Locations Within a Bounding Box. + + **Applies to**\ : S1 pricing tier. + + The Get Data for Bounding Box API provides elevation data at equally spaced locations within a + bounding box. A bounding box is defined by the coordinates for two corners (southwest, + northeast) and then subsequently divided into rows and columns. + + Elevations are returned for the vertices of the grid created by the rows and columns. Up to + 2,000 elevations can be returned in a single request. The returned elevation values are + ordered, starting at the southwest corner, and then proceeding west to east along the row. At + the end of the row, it moves north to the next row, and repeats the process until it reaches + the far northeast corner. + + :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] + :param rows: Specifies the number of rows to use to divide the bounding box area into a grid. + The number of vertices (rows x columns) in the grid should be less than 2,000. + :type rows: int + :param columns: Specifies the number of columns to use to divide the bounding box area into a + grid. The number of vertices (rows x columns) in the grid should be less than 2,000. + :type columns: int + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_data_for_bounding_box.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['bounds'] = self._serialize.query("bounds", bounds, '[float]', div=',') + query_parameters['rows'] = self._serialize.query("rows", rows, 'int', maximum=1000, minimum=2) + query_parameters['columns'] = self._serialize.query("columns", columns, 'int', maximum=1000, minimum=2) + + # 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_for_bounding_box.metadata = {'url': '/elevation/lattice/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/__init__.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/__init__.py new file mode 100644 index 000000000000..2866af40aaaf --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/__init__.py @@ -0,0 +1,39 @@ +# 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 Elevation + from ._models_py3 import ElevationResult + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import LatLongPair + from ._models_py3 import LatLongPairAbbreviated +except (SyntaxError, ImportError): + from ._models import Elevation # type: ignore + from ._models import ElevationResult # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import LatLongPair # type: ignore + from ._models import LatLongPairAbbreviated # type: ignore + +from ._elevation_client_enums import ( + JsonFormat, +) + +__all__ = [ + 'Elevation', + 'ElevationResult', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'LatLongPair', + 'LatLongPairAbbreviated', + 'JsonFormat', +] diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_elevation_client_enums.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_elevation_client_enums.py new file mode 100644 index 000000000000..749ad50afe35 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_elevation_client_enums.py @@ -0,0 +1,33 @@ +# 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 JsonFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_models.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_models.py new file mode 100644 index 000000000000..679a783b755d --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_models.py @@ -0,0 +1,205 @@ +# 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 Elevation(msrest.serialization.Model): + """The elevation data. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param coordinate: A location represented as a latitude and longitude. + :type coordinate: ~azure.maps.elevation.models.LatLongPair + :ivar elevation_in_meter: The elevation value in meters. + :vartype elevation_in_meter: float + """ + + _validation = { + 'elevation_in_meter': {'readonly': True}, + } + + _attribute_map = { + 'coordinate': {'key': 'coordinate', 'type': 'LatLongPair'}, + 'elevation_in_meter': {'key': 'elevationInMeter', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(Elevation, self).__init__(**kwargs) + self.coordinate = kwargs.get('coordinate', None) + self.elevation_in_meter = None + + +class ElevationResult(msrest.serialization.Model): + """The response from a successful Get Data for Bounding Box API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar elevations: The response for point/points elevation API. The result will be in same + sequence of points listed in request. + :vartype elevations: list[~azure.maps.elevation.models.Elevation] + """ + + _validation = { + 'elevations': {'readonly': True}, + } + + _attribute_map = { + 'elevations': {'key': 'data', 'type': '[Elevation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ElevationResult, self).__init__(**kwargs) + self.elevations = 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.elevation.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.elevation.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.elevation.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 LatLongPair(msrest.serialization.Model): + """A location represented as a latitude and longitude. + + :param latitude: Latitude property. + :type latitude: float + :param longitude: Longitude property. + :type longitude: float + """ + + _attribute_map = { + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(LatLongPair, self).__init__(**kwargs) + self.latitude = kwargs.get('latitude', None) + self.longitude = kwargs.get('longitude', None) + + +class LatLongPairAbbreviated(msrest.serialization.Model): + """A location represented as a latitude and longitude using short names 'lat' & 'lon'. + + :param lat: Latitude property. + :type lat: float + :param lon: Longitude property. + :type lon: float + """ + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(LatLongPairAbbreviated, self).__init__(**kwargs) + self.lat = kwargs.get('lat', None) + self.lon = kwargs.get('lon', None) diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_models_py3.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_models_py3.py new file mode 100644 index 000000000000..8d6518cbd815 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/models/_models_py3.py @@ -0,0 +1,217 @@ +# 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 Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Elevation(msrest.serialization.Model): + """The elevation data. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param coordinate: A location represented as a latitude and longitude. + :type coordinate: ~azure.maps.elevation.models.LatLongPair + :ivar elevation_in_meter: The elevation value in meters. + :vartype elevation_in_meter: float + """ + + _validation = { + 'elevation_in_meter': {'readonly': True}, + } + + _attribute_map = { + 'coordinate': {'key': 'coordinate', 'type': 'LatLongPair'}, + 'elevation_in_meter': {'key': 'elevationInMeter', 'type': 'float'}, + } + + def __init__( + self, + *, + coordinate: Optional["LatLongPair"] = None, + **kwargs + ): + super(Elevation, self).__init__(**kwargs) + self.coordinate = coordinate + self.elevation_in_meter = None + + +class ElevationResult(msrest.serialization.Model): + """The response from a successful Get Data for Bounding Box API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar elevations: The response for point/points elevation API. The result will be in same + sequence of points listed in request. + :vartype elevations: list[~azure.maps.elevation.models.Elevation] + """ + + _validation = { + 'elevations': {'readonly': True}, + } + + _attribute_map = { + 'elevations': {'key': 'data', 'type': '[Elevation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ElevationResult, self).__init__(**kwargs) + self.elevations = 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.elevation.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.elevation.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.elevation.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 LatLongPair(msrest.serialization.Model): + """A location represented as a latitude and longitude. + + :param latitude: Latitude property. + :type latitude: float + :param longitude: Longitude property. + :type longitude: float + """ + + _attribute_map = { + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + } + + def __init__( + self, + *, + latitude: Optional[float] = None, + longitude: Optional[float] = None, + **kwargs + ): + super(LatLongPair, self).__init__(**kwargs) + self.latitude = latitude + self.longitude = longitude + + +class LatLongPairAbbreviated(msrest.serialization.Model): + """A location represented as a latitude and longitude using short names 'lat' & 'lon'. + + :param lat: Latitude property. + :type lat: float + :param lon: Longitude property. + :type lon: float + """ + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + *, + lat: Optional[float] = None, + lon: Optional[float] = None, + **kwargs + ): + super(LatLongPairAbbreviated, self).__init__(**kwargs) + self.lat = lat + self.lon = lon diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/operations/__init__.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/operations/__init__.py new file mode 100644 index 000000000000..7b55d6e49539 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/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 ._elevation_client_operations import ElevationClientOperationsMixin + +__all__ = [ + 'ElevationClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/operations/_elevation_client_operations.py b/sdk/maps/azure-maps-elevation/azure/maps/elevation/operations/_elevation_client_operations.py new file mode 100644 index 000000000000..88b77667242c --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/operations/_elevation_client_operations.py @@ -0,0 +1,451 @@ +# 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 +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, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ElevationClientOperationsMixin(object): + + def get_data_for_points( + self, + points, # type: List[str] + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ElevationResult" + """Get Elevation Data on One or More Points. + + **Applies to**\ : S1 pricing tier. + + The Get Data for Points API provides elevation data for one or more points. A point is + defined in lat,long coordinate format. + + Due to the URL character length limit of 2048, it's not possible to pass more than 100 + coordinates as a pipeline delimited string in a URL GET request. If you intend to pass more + than 100 coordinates as a pipeline delimited string, use the `POST Data + For Points `_. + + The result will be in the same sequence of points listed in the request. + + :param points: The string representation of a list of points. A point is defined in lon/lat + WGS84 coordinate reference system format. If multiple points are requested, each of the points + in a list should be separated by the pipe ('|') character. The maximum number of points that + can be requested in a single request is 2,000. The resolution of the elevation data will be + the highest for a single point and will decrease if multiple points are spread further apart. + :type points: list[str] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_data_for_points.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['points'] = self._serialize.query("points", points, '[str]', skip_quote=True, 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_for_points.metadata = {'url': '/elevation/point/{format}'} # type: ignore + + def post_data_for_points( + self, + points, # type: List["_models.LatLongPairAbbreviated"] + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ElevationResult" + """Query Elevation Data for Multiple Points. + + **Applies to**\ : S1 pricing tier. + + The Post Data for Points API provides elevation data for multiple points. A point is defined + lon/lat coordinate format. + + Use the POST endpoint only if you intend to pass multiple points in the request. If you intend + to pass a single coordinate into the API, use the `GET Data For Points API + `_. + + The result will be in the same sequence of points listed in the request. + + :param points: The string representation of a list of points. A point is defined in lon/lat + WGS84 coordinate reference system format. Each points in a list should be separated by the + pipe ('|') character. The number of points that can be requested in a POST request ranges from + 2 to 2,000. The resolution of the elevation data will be the highest for a single point and + will decrease if multiple points are spread further apart. + :type points: list[~azure.maps.elevation.models.LatLongPairAbbreviated] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_data_for_points.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(points, '[LatLongPairAbbreviated]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_data_for_points.metadata = {'url': '/elevation/point/{format}'} # type: ignore + + def get_data_for_polyline( + self, + lines, # type: List[str] + format="json", # type: Union[str, "_models.JsonFormat"] + samples=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "_models.ElevationResult" + """Get Elevation Data Along a Polyline. + + **Applies to**\ : S1 pricing tier. + + The Get Data for Polyline API provides elevation data along a polyline. + + A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe + ('|') character. In addition to passing in endpoints, customers can specify the number of + sample points that will be used to divide polyline into equally spaced segments. + + Elevation data at both start and endpoints, as well as equally spaced points along the + polyline will be returned. The results will be listed in the direction from the first endpoint + towards the last endpoint. A line between two endpoints is a straight Cartesian line, the + shortest line between those two points in the coordinate reference system. Note that the point + is chosen based on Euclidean distance and may markedly differ from the geodesic path along the + curved surface of the reference ellipsoid. + + :param lines: The string representation of a polyline path. A polyline is defined by endpoint + coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be + defined in the following format: ``[longitude_point1, latitude_point1 | longitude_point2, + latitude_point2, ..., longitude_pointN, latitude_pointN]``. + + The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + reference system. The resolution of the data used to compute the elevation depends on the + distance between the endpoints. + :type lines: list[str] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :param samples: The samples parameter specifies the number of equally spaced points at which + elevation values should be provided along a polyline path. The number of samples should range + from 2 to 2,000. Default value is 10. + :type samples: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_data_for_polyline.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['lines'] = self._serialize.query("lines", lines, '[str]', skip_quote=True, div='|') + if samples is not None: + query_parameters['samples'] = self._serialize.query("samples", samples, 'int', maximum=2000, minimum=2) + + # 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_for_polyline.metadata = {'url': '/elevation/line/{format}'} # type: ignore + + def post_data_for_polyline( + self, + polyline, # type: List["_models.LatLongPairAbbreviated"] + format="json", # type: Union[str, "_models.JsonFormat"] + samples=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "_models.ElevationResult" + """Query Elevation Data Along a Polyline. + + **Applies to**\ : S1 pricing tier. + + The Post Data for Polyline API provides elevation data along a polyline. + + A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe + ('|') character. In addition to passing in endpoints, customers can specify the number of + sample points that will be used to divide polyline into equally spaced segments. + + Elevation data at both start and end points, as well as equally spaced points along the + polyline will be returned. The results will be listed in the direction from the first endpoint + towards the last endpoint. A line between two endpoints is a straight Cartesian line, the + shortest line between those two points in the coordinate reference system. Note that the point + is chosen based on Euclidean distance and may markedly differ from the geodesic path along the + curved surface of the reference ellipsoid. + + :param polyline: The string representation of a polyline path. A polyline is defined by + endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline + should be defined in the following format: ``[longitude_point1, latitude_point1 | + longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]``. The longitude + and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. + The resolution of the data used to compute the elevation will depend on the distance between + the endpoints. + :type polyline: list[~azure.maps.elevation.models.LatLongPairAbbreviated] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :param samples: The samples parameter specifies the number of equally spaced points at which + elevation values should be provided along a polyline path. The number of samples should range + from 2 to 2,000. Default value is 10. + :type samples: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_data_for_polyline.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 samples is not None: + query_parameters['samples'] = self._serialize.query("samples", samples, 'int', maximum=2000, minimum=2) + + # 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(polyline, '[LatLongPairAbbreviated]') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_data_for_polyline.metadata = {'url': '/elevation/line/{format}'} # type: ignore + + def get_data_for_bounding_box( + self, + bounds, # type: List[float] + rows, # type: int + columns, # type: int + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ElevationResult" + """Get Elevation Data at Equally Spaced Locations Within a Bounding Box. + + **Applies to**\ : S1 pricing tier. + + The Get Data for Bounding Box API provides elevation data at equally spaced locations within a + bounding box. A bounding box is defined by the coordinates for two corners (southwest, + northeast) and then subsequently divided into rows and columns. + + Elevations are returned for the vertices of the grid created by the rows and columns. Up to + 2,000 elevations can be returned in a single request. The returned elevation values are + ordered, starting at the southwest corner, and then proceeding west to east along the row. At + the end of the row, it moves north to the next row, and repeats the process until it reaches + the far northeast corner. + + :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] + :param rows: Specifies the number of rows to use to divide the bounding box area into a grid. + The number of vertices (rows x columns) in the grid should be less than 2,000. + :type rows: int + :param columns: Specifies the number of columns to use to divide the bounding box area into a + grid. The number of vertices (rows x columns) in the grid should be less than 2,000. + :type columns: int + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.elevation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElevationResult, or the result of cls(response) + :rtype: ~azure.maps.elevation.models.ElevationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ElevationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_data_for_bounding_box.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['bounds'] = self._serialize.query("bounds", bounds, '[float]', div=',') + query_parameters['rows'] = self._serialize.query("rows", rows, 'int', maximum=1000, minimum=2) + query_parameters['columns'] = self._serialize.query("columns", columns, 'int', maximum=1000, minimum=2) + + # 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('ElevationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_for_bounding_box.metadata = {'url': '/elevation/lattice/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-elevation/azure/maps/elevation/py.typed b/sdk/maps/azure-maps-elevation/azure/maps/elevation/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/azure/maps/elevation/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-elevation/sdk_packaging.toml b/sdk/maps/azure-maps-elevation/sdk_packaging.toml new file mode 100644 index 000000000000..8c222a12659f --- /dev/null +++ b/sdk/maps/azure-maps-elevation/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-elevation" +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-elevation/setup.cfg b/sdk/maps/azure-maps-elevation/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-elevation/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-elevation/setup.py b/sdk/maps/azure-maps-elevation/setup.py new file mode 100644 index 000000000000..3f30bbfc90e9 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/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-elevation" +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'], + } +) diff --git a/sdk/maps/azure-maps-geolocation/CHANGELOG.md b/sdk/maps/azure-maps-geolocation/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-geolocation/MANIFEST.in b/sdk/maps/azure-maps-geolocation/MANIFEST.in new file mode 100644 index 000000000000..cb7d3109cc06 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/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 + diff --git a/sdk/maps/azure-maps-geolocation/README.md b/sdk/maps/azure-maps-geolocation/README.md new file mode 100644 index 000000000000..1e2c4158ad4a --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/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-geolocation%2FREADME.png) diff --git a/sdk/maps/azure-maps-geolocation/_meta.json b/sdk/maps/azure-maps-geolocation/_meta.json new file mode 100644 index 000000000000..b70ab08b6c01 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "fd01f0058f99a0d2b145abbb7ade2cd90d9d3a82", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/Geolocation/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/Geolocation/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-geolocation/azure/__init__.py b/sdk/maps/azure-maps-geolocation/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/__init__.py b/sdk/maps/azure-maps-geolocation/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/__init__.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/__init__.py new file mode 100644 index 000000000000..830d400baca4 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/__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 ._geolocation_client import GeolocationClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['GeolocationClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_configuration.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_configuration.py new file mode 100644 index 000000000000..3dae55301f2f --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_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 GeolocationClientConfiguration(Configuration): + """Configuration for GeolocationClient. + + 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(GeolocationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-geolocation/{}'.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-geolocation/azure/maps/geolocation/_geolocation_client.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_geolocation_client.py new file mode 100644 index 000000000000..b28057a0e580 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_geolocation_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 GeolocationClientConfiguration +from .operations import GeolocationClientOperationsMixin +from . import models + + +class GeolocationClient(GeolocationClientOperationsMixin): + """Azure Maps Geolocation 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 = GeolocationClientConfiguration(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: () -> GeolocationClient + 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-geolocation/azure/maps/geolocation/_metadata.json b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_metadata.json new file mode 100644 index 000000000000..7aae240154f6 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_metadata.json @@ -0,0 +1,120 @@ +{ + "chosen_version": "1.0", + "total_api_version_list": ["1.0"], + "client": { + "name": "GeolocationClient", + "filename": "_geolocation_client", + "description": "Azure Maps Geolocation 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\": [\"GeolocationClientConfiguration\"], \"._operations_mixin\": [\"GeolocationClientOperationsMixin\"]}}}", + "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\": [\"GeolocationClientConfiguration\"], \"._operations_mixin\": [\"GeolocationClientOperationsMixin\"]}}}" + }, + "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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_location" : { + "sync": { + "signature": "def get_location(\n self,\n ip_address, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis service will return the ISO country code for the provided IP address. Developers can use\nthis information to block or alter certain content based on geographical locations where the\napplication is being viewed from.\n\n:param ip_address: The IP address. Both IPv4 and IPv6 are allowed.\n:type ip_address: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.geolocation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IpAddressToLocationResult, or the result of cls(response)\n:rtype: ~azure.maps.geolocation.models.IpAddressToLocationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_location(\n self,\n ip_address: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.IpAddressToLocationResult\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis service will return the ISO country code for the provided IP address. Developers can use\nthis information to block or alter certain content based on geographical locations where the\napplication is being viewed from.\n\n:param ip_address: The IP address. Both IPv4 and IPv6 are allowed.\n:type ip_address: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.geolocation.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: IpAddressToLocationResult, or the result of cls(response)\n:rtype: ~azure.maps.geolocation.models.IpAddressToLocationResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "ip_address, format" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_version.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_version.py new file mode 100644 index 000000000000..b9995fb385b0 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/_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 = "1.0-preview" diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/__init__.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/__init__.py new file mode 100644 index 000000000000..5c1605c3c8f8 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/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 ._geolocation_client import GeolocationClient +__all__ = ['GeolocationClient'] diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/_configuration.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/_configuration.py new file mode 100644 index 000000000000..95f9a42d4cd0 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/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 GeolocationClientConfiguration(Configuration): + """Configuration for GeolocationClient. + + 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(GeolocationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-geolocation/{}'.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-geolocation/azure/maps/geolocation/aio/_geolocation_client.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/_geolocation_client.py new file mode 100644 index 000000000000..cccec15b5a52 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/_geolocation_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 GeolocationClientConfiguration +from .operations import GeolocationClientOperationsMixin +from .. import models + + +class GeolocationClient(GeolocationClientOperationsMixin): + """Azure Maps Geolocation 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 = GeolocationClientConfiguration(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) -> "GeolocationClient": + 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-geolocation/azure/maps/geolocation/aio/operations/__init__.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/operations/__init__.py new file mode 100644 index 000000000000..c71bc8679d01 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/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 ._geolocation_client_operations import GeolocationClientOperationsMixin + +__all__ = [ + 'GeolocationClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/operations/_geolocation_client_operations.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/operations/_geolocation_client_operations.py new file mode 100644 index 000000000000..51bf14807932 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/aio/operations/_geolocation_client_operations.py @@ -0,0 +1,84 @@ +# 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, Callable, Dict, Generic, 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 GeolocationClientOperationsMixin: + + async def get_location( + self, + ip_address: str, + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.IpAddressToLocationResult": + """**Applies to**\ : S0 and S1 pricing tiers. + + This service will return the ISO country code for the provided IP address. Developers can use + this information to block or alter certain content based on geographical locations where the + application is being viewed from. + + :param ip_address: The IP address. Both IPv4 and IPv6 are allowed. + :type ip_address: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.geolocation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpAddressToLocationResult, or the result of cls(response) + :rtype: ~azure.maps.geolocation.models.IpAddressToLocationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAddressToLocationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_location.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['ip'] = self._serialize.query("ip_address", ip_address, '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('IpAddressToLocationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_location.metadata = {'url': '/geolocation/ip/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/__init__.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/__init__.py new file mode 100644 index 000000000000..2360da81c778 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/__init__.py @@ -0,0 +1,33 @@ +# 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 CountryRegion + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import IpAddressToLocationResult +except (SyntaxError, ImportError): + from ._models import CountryRegion # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import IpAddressToLocationResult # type: ignore + +from ._geolocation_client_enums import ( + JsonFormat, +) + +__all__ = [ + 'CountryRegion', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'IpAddressToLocationResult', + 'JsonFormat', +] diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_geolocation_client_enums.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_geolocation_client_enums.py new file mode 100644 index 000000000000..749ad50afe35 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_geolocation_client_enums.py @@ -0,0 +1,33 @@ +# 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 JsonFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_models.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_models.py new file mode 100644 index 000000000000..f457b728ca00 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_models.py @@ -0,0 +1,161 @@ +# 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 CountryRegion(msrest.serialization.Model): + """The object containing the country/region information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar iso_code: The IP Address's 2-character code `(ISO 3166-1) + `_ of the country or region. Please note, IP + address in ranges reserved for special purpose will return Null for country/region. + :vartype iso_code: str + """ + + _validation = { + 'iso_code': {'readonly': True}, + } + + _attribute_map = { + 'iso_code': {'key': 'isoCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CountryRegion, self).__init__(**kwargs) + self.iso_code = 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.geolocation.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.geolocation.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.geolocation.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 IpAddressToLocationResult(msrest.serialization.Model): + """This object is returned from a successful call to IP Address to country/region API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar country_region: The object containing the country/region information. + :vartype country_region: ~azure.maps.geolocation.models.CountryRegion + :ivar ip_address: The IP Address of the request. + :vartype ip_address: str + """ + + _validation = { + 'country_region': {'readonly': True}, + 'ip_address': {'readonly': True}, + } + + _attribute_map = { + 'country_region': {'key': 'countryRegion', 'type': 'CountryRegion'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAddressToLocationResult, self).__init__(**kwargs) + self.country_region = None + self.ip_address = None diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_models_py3.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_models_py3.py new file mode 100644 index 000000000000..57b37aefa462 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/models/_models_py3.py @@ -0,0 +1,165 @@ +# 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 Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class CountryRegion(msrest.serialization.Model): + """The object containing the country/region information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar iso_code: The IP Address's 2-character code `(ISO 3166-1) + `_ of the country or region. Please note, IP + address in ranges reserved for special purpose will return Null for country/region. + :vartype iso_code: str + """ + + _validation = { + 'iso_code': {'readonly': True}, + } + + _attribute_map = { + 'iso_code': {'key': 'isoCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CountryRegion, self).__init__(**kwargs) + self.iso_code = 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.geolocation.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.geolocation.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.geolocation.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 IpAddressToLocationResult(msrest.serialization.Model): + """This object is returned from a successful call to IP Address to country/region API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar country_region: The object containing the country/region information. + :vartype country_region: ~azure.maps.geolocation.models.CountryRegion + :ivar ip_address: The IP Address of the request. + :vartype ip_address: str + """ + + _validation = { + 'country_region': {'readonly': True}, + 'ip_address': {'readonly': True}, + } + + _attribute_map = { + 'country_region': {'key': 'countryRegion', 'type': 'CountryRegion'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAddressToLocationResult, self).__init__(**kwargs) + self.country_region = None + self.ip_address = None diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/operations/__init__.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/operations/__init__.py new file mode 100644 index 000000000000..c71bc8679d01 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/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 ._geolocation_client_operations import GeolocationClientOperationsMixin + +__all__ = [ + 'GeolocationClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/operations/_geolocation_client_operations.py b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/operations/_geolocation_client_operations.py new file mode 100644 index 000000000000..ad21e48acf33 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/operations/_geolocation_client_operations.py @@ -0,0 +1,89 @@ +# 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 +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, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GeolocationClientOperationsMixin(object): + + def get_location( + self, + ip_address, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.IpAddressToLocationResult" + """**Applies to**\ : S0 and S1 pricing tiers. + + This service will return the ISO country code for the provided IP address. Developers can use + this information to block or alter certain content based on geographical locations where the + application is being viewed from. + + :param ip_address: The IP address. Both IPv4 and IPv6 are allowed. + :type ip_address: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.geolocation.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpAddressToLocationResult, or the result of cls(response) + :rtype: ~azure.maps.geolocation.models.IpAddressToLocationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAddressToLocationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_location.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['ip'] = self._serialize.query("ip_address", ip_address, '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('IpAddressToLocationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_location.metadata = {'url': '/geolocation/ip/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/py.typed b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/azure/maps/geolocation/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-geolocation/sdk_packaging.toml b/sdk/maps/azure-maps-geolocation/sdk_packaging.toml new file mode 100644 index 000000000000..683b6ff1cfd5 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-geolocation" +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-geolocation/setup.cfg b/sdk/maps/azure-maps-geolocation/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-geolocation/setup.py b/sdk/maps/azure-maps-geolocation/setup.py new file mode 100644 index 000000000000..f9b681943dc3 --- /dev/null +++ b/sdk/maps/azure-maps-geolocation/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-geolocation" +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'], + } +) diff --git a/sdk/maps/azure-maps-route/CHANGELOG.md b/sdk/maps/azure-maps-route/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-route/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-route/MANIFEST.in b/sdk/maps/azure-maps-route/MANIFEST.in new file mode 100644 index 000000000000..cb7d3109cc06 --- /dev/null +++ b/sdk/maps/azure-maps-route/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 + diff --git a/sdk/maps/azure-maps-route/README.md b/sdk/maps/azure-maps-route/README.md new file mode 100644 index 000000000000..b8dd40a7bf1e --- /dev/null +++ b/sdk/maps/azure-maps-route/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-route%2FREADME.png) diff --git a/sdk/maps/azure-maps-route/_meta.json b/sdk/maps/azure-maps-route/_meta.json new file mode 100644 index 000000000000..d13b3db683c1 --- /dev/null +++ b/sdk/maps/azure-maps-route/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "fd01f0058f99a0d2b145abbb7ade2cd90d9d3a82", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/Route/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/Route/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-route/azure/__init__.py b/sdk/maps/azure-maps-route/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-route/azure/maps/__init__.py b/sdk/maps/azure-maps-route/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-route/azure/maps/route/__init__.py b/sdk/maps/azure-maps-route/azure/maps/route/__init__.py new file mode 100644 index 000000000000..616953f5de44 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/__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 ._route_client import RouteClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['RouteClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-route/azure/maps/route/_configuration.py b/sdk/maps/azure-maps-route/azure/maps/route/_configuration.py new file mode 100644 index 000000000000..30f925824ad6 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/_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 RouteClientConfiguration(Configuration): + """Configuration for RouteClient. + + 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(RouteClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-route/{}'.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-route/azure/maps/route/_metadata.json b/sdk/maps/azure-maps-route/azure/maps/route/_metadata.json new file mode 100644 index 000000000000..1fa9258abedd --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/_metadata.json @@ -0,0 +1,264 @@ +{ + "chosen_version": "1.0", + "total_api_version_list": ["1.0"], + "client": { + "name": "RouteClient", + "filename": "_route_client", + "description": "Azure Maps Route REST APIs.", + "base_url": "\u0027https://atlas.microsoft.com\u0027", + "custom_base_url": null, + "azure_arm": false, + "has_lro_operations": true, + "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\": [\"RouteClientConfiguration\"], \"._operations_mixin\": [\"RouteClientOperationsMixin\"]}}}", + "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\": [\"RouteClientConfiguration\"], \"._operations_mixin\": [\"RouteClientOperationsMixin\"]}}}" + }, + "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\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"]}, \"stdlib\": {\"datetime\": [null], \"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"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\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"]}, \"stdlib\": {\"datetime\": [null], \"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "_post_route_matrix_initial" : { + "sync": { + "signature": "def _post_route_matrix_initial(\n self,\n post_route_matrix_request_body, # type: \"_models.PostRouteMatrixRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n wait_for_results=None, # type: Optional[bool]\n compute_travel_time_for=None, # type: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]]\n section_type=None, # type: Optional[Union[str, \"_models.SectionType\"]]\n arrive_at=None, # type: Optional[datetime.datetime]\n depart_at=None, # type: Optional[datetime.datetime]\n vehicle_axle_weight=None, # type: Optional[int]\n vehicle_length=None, # type: Optional[float]\n vehicle_height=None, # type: Optional[float]\n vehicle_width=None, # type: Optional[float]\n vehicle_max_speed=None, # type: Optional[int]\n vehicle_weight=None, # type: Optional[int]\n windingness=None, # type: Optional[Union[str, \"_models.WindingnessLevel\"]]\n hilliness=None, # type: Optional[Union[str, \"_models.HillinessDegree\"]]\n travel_mode=None, # type: Optional[Union[str, \"_models.TravelMode\"]]\n avoid=None, # type: Optional[List[Union[str, \"_models.RouteAvoidType\"]]]\n traffic=None, # type: Optional[bool]\n route_type=None, # type: Optional[Union[str, \"_models.RouteType\"]]\n vehicle_load_type=None, # type: Optional[Union[str, \"_models.VehicleLoadType\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param post_route_matrix_request_body: The matrix of origin and destination coordinates to\n compute the route distance, travel time and other summary for each cell of the matrix based on\n the input parameters. The minimum and the maximum cell count supported are 1 and **700** for\n async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations\n or 25 origins and 25 destinations for async API.\n:type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:param wait_for_results: Boolean to indicate whether to execute the request synchronously. If\n set to true, user will get a 200 response if the request is finished under 120 seconds.\n Otherwise, user will get a 202 response right away. Please refer to the API description for\n more details on 202 response. **Supported only for async request**.\n:type wait_for_results: bool\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n:type vehicle_weight: int\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteMatrixResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteMatrixResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _post_route_matrix_initial(\n self,\n post_route_matrix_request_body: \"_models.PostRouteMatrixRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n wait_for_results: Optional[bool] = None,\n compute_travel_time_for: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]] = None,\n section_type: Optional[Union[str, \"_models.SectionType\"]] = None,\n arrive_at: Optional[datetime.datetime] = None,\n depart_at: Optional[datetime.datetime] = None,\n vehicle_axle_weight: Optional[int] = None,\n vehicle_length: Optional[float] = None,\n vehicle_height: Optional[float] = None,\n vehicle_width: Optional[float] = None,\n vehicle_max_speed: Optional[int] = None,\n vehicle_weight: Optional[int] = None,\n windingness: Optional[Union[str, \"_models.WindingnessLevel\"]] = None,\n hilliness: Optional[Union[str, \"_models.HillinessDegree\"]] = None,\n travel_mode: Optional[Union[str, \"_models.TravelMode\"]] = None,\n avoid: Optional[List[Union[str, \"_models.RouteAvoidType\"]]] = None,\n traffic: Optional[bool] = None,\n route_type: Optional[Union[str, \"_models.RouteType\"]] = None,\n vehicle_load_type: Optional[Union[str, \"_models.VehicleLoadType\"]] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.RouteMatrixResponse\"]:\n", + "doc": "\"\"\"\n\n:param post_route_matrix_request_body: The matrix of origin and destination coordinates to\n compute the route distance, travel time and other summary for each cell of the matrix based on\n the input parameters. The minimum and the maximum cell count supported are 1 and **700** for\n async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations\n or 25 origins and 25 destinations for async API.\n:type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:param wait_for_results: Boolean to indicate whether to execute the request synchronously. If\n set to true, user will get a 200 response if the request is finished under 120 seconds.\n Otherwise, user will get a 202 response right away. Please refer to the API description for\n more details on 202 response. **Supported only for async request**.\n:type wait_for_results: bool\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n:type vehicle_weight: int\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteMatrixResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteMatrixResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "post_route_matrix_request_body, format, wait_for_results, compute_travel_time_for, section_type, arrive_at, depart_at, vehicle_axle_weight, vehicle_length, vehicle_height, vehicle_width, vehicle_max_speed, vehicle_weight, windingness, hilliness, travel_mode, avoid, traffic, route_type, vehicle_load_type" + }, + "begin_post_route_matrix" : { + "sync": { + "signature": "def begin_post_route_matrix(\n self,\n post_route_matrix_request_body, # type: \"_models.PostRouteMatrixRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n wait_for_results=None, # type: Optional[bool]\n compute_travel_time_for=None, # type: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]]\n section_type=None, # type: Optional[Union[str, \"_models.SectionType\"]]\n arrive_at=None, # type: Optional[datetime.datetime]\n depart_at=None, # type: Optional[datetime.datetime]\n vehicle_axle_weight=None, # type: Optional[int]\n vehicle_length=None, # type: Optional[float]\n vehicle_height=None, # type: Optional[float]\n vehicle_width=None, # type: Optional[float]\n vehicle_max_speed=None, # type: Optional[int]\n vehicle_weight=None, # type: Optional[int]\n windingness=None, # type: Optional[Union[str, \"_models.WindingnessLevel\"]]\n hilliness=None, # type: Optional[Union[str, \"_models.HillinessDegree\"]]\n travel_mode=None, # type: Optional[Union[str, \"_models.TravelMode\"]]\n avoid=None, # type: Optional[List[Union[str, \"_models.RouteAvoidType\"]]]\n traffic=None, # type: Optional[bool]\n route_type=None, # type: Optional[Union[str, \"_models.RouteType\"]]\n vehicle_load_type=None, # type: Optional[Union[str, \"_models.VehicleLoadType\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S1 pricing tier.\n\nThe Matrix Routing service allows calculation of a matrix of route summaries for a set of\nroutes defined by origin and destination locations by using an asynchronous (async) or\nsynchronous (sync) POST request. For every given origin, the service calculates the cost of\nrouting from that origin to every given destination. The set of origins and the set of\ndestinations can be thought of as the column and row headers of a table and each cell in the\ntable contains the costs of routing from the origin to the destination for that cell. As an\nexample, let\u0027s say a food delivery company has 20 drivers and they need to find the closest\ndriver to pick up the delivery from the restaurant. To solve this use case, they can call\nMatrix Route API.\n\nFor each route, the travel times and distances are returned. You can use the computed costs to\ndetermine which detailed routes to calculate using the Route Directions API.\n\nThe maximum size of a matrix for async request is **700** and for sync request it\u0027s **100**\n(the number of origins multiplied by the number of destinations).\n\nSubmit Synchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf your scenario requires synchronous requests and the maximum size of the matrix is less than\nor equal to 100, you might want to make synchronous request. The maximum size of a matrix for\nthis API is **100** (the number of origins multiplied by the number of destinations). With that\nconstraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not\nneed to be square).\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex routing\nrequests. When you make a request by using async request, by default the service returns a 202\nresponse code along a redirect URL in the Location field of the response header. This URL\nshould be checked periodically until the response data or error information is available. If\n``waitForResults`` parameter in the request is set to true, user will get a 200 response if the\nrequest is finished under 120 seconds.\n\nThe maximum size of a matrix for this API is **700** (the number of origins multiplied by the\nnumber of destinations). With that constraint in mind, examples of possible matrix dimensions\nare: 50x10, 10x10, 28x25. 10x70 (it does not need to be square).\n\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s a typical sequence of asynchronous operations:\n\n\n#.\n Client sends a Route Matrix POST request to Azure Maps\n\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Route Matrix request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Route Matrix request. This could\neither be a 400 Bad Request or any other Error status code.\n\n\n\n#.\n If the Matrix Route request was accepted successfully, the Location header in the response\ncontains the URL to download the results of the request. This status URI looks like the\nfollowing:\n\n .. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\n\n#. Client issues a GET request on the download URL obtained in Step 3 to download the results\n\nDownload Sync Results\n^^^^^^^^^^^^^^^^^^^^^\n\nWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code\nfor successful request and a response array. The response body will contain the data and there\nwill be no possibility to retrieve the results later.\n\nDownload Async Results\n^^^^^^^^^^^^^^^^^^^^^^\n\nWhen a request issues a ``202 Accepted`` response, the request is being processed using our\nasync pipeline. You will be given a URL to check the progress of your async request in the\nlocation header of the response. This status URI looks like the following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\nThe URL provided by the location header will return the following responses when a ``GET``\nrequest is issued.\n\n..\n\n HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try\nagain in some time.\n\n HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of\nthe results.\n\n:param post_route_matrix_request_body: The matrix of origin and destination coordinates to\n compute the route distance, travel time and other summary for each cell of the matrix based on\n the input parameters. The minimum and the maximum cell count supported are 1 and **700** for\n async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations\n or 25 origins and 25 destinations for async API.\n:type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:param wait_for_results: Boolean to indicate whether to execute the request synchronously. If\n set to true, user will get a 200 response if the request is finished under 120 seconds.\n Otherwise, user will get a 202 response right away. Please refer to the API description for\n more details on 202 response. **Supported only for async request**.\n:type wait_for_results: bool\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n:type vehicle_weight: int\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either RouteMatrixResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteMatrixResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_post_route_matrix(\n self,\n post_route_matrix_request_body: \"_models.PostRouteMatrixRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n wait_for_results: Optional[bool] = None,\n compute_travel_time_for: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]] = None,\n section_type: Optional[Union[str, \"_models.SectionType\"]] = None,\n arrive_at: Optional[datetime.datetime] = None,\n depart_at: Optional[datetime.datetime] = None,\n vehicle_axle_weight: Optional[int] = None,\n vehicle_length: Optional[float] = None,\n vehicle_height: Optional[float] = None,\n vehicle_width: Optional[float] = None,\n vehicle_max_speed: Optional[int] = None,\n vehicle_weight: Optional[int] = None,\n windingness: Optional[Union[str, \"_models.WindingnessLevel\"]] = None,\n hilliness: Optional[Union[str, \"_models.HillinessDegree\"]] = None,\n travel_mode: Optional[Union[str, \"_models.TravelMode\"]] = None,\n avoid: Optional[List[Union[str, \"_models.RouteAvoidType\"]]] = None,\n traffic: Optional[bool] = None,\n route_type: Optional[Union[str, \"_models.RouteType\"]] = None,\n vehicle_load_type: Optional[Union[str, \"_models.VehicleLoadType\"]] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.RouteMatrixResponse\"]:\n", + "doc": "\"\"\"**Applies to**\\ : S1 pricing tier.\n\nThe Matrix Routing service allows calculation of a matrix of route summaries for a set of\nroutes defined by origin and destination locations by using an asynchronous (async) or\nsynchronous (sync) POST request. For every given origin, the service calculates the cost of\nrouting from that origin to every given destination. The set of origins and the set of\ndestinations can be thought of as the column and row headers of a table and each cell in the\ntable contains the costs of routing from the origin to the destination for that cell. As an\nexample, let\u0027s say a food delivery company has 20 drivers and they need to find the closest\ndriver to pick up the delivery from the restaurant. To solve this use case, they can call\nMatrix Route API.\n\nFor each route, the travel times and distances are returned. You can use the computed costs to\ndetermine which detailed routes to calculate using the Route Directions API.\n\nThe maximum size of a matrix for async request is **700** and for sync request it\u0027s **100**\n(the number of origins multiplied by the number of destinations).\n\nSubmit Synchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf your scenario requires synchronous requests and the maximum size of the matrix is less than\nor equal to 100, you might want to make synchronous request. The maximum size of a matrix for\nthis API is **100** (the number of origins multiplied by the number of destinations). With that\nconstraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not\nneed to be square).\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex routing\nrequests. When you make a request by using async request, by default the service returns a 202\nresponse code along a redirect URL in the Location field of the response header. This URL\nshould be checked periodically until the response data or error information is available. If\n``waitForResults`` parameter in the request is set to true, user will get a 200 response if the\nrequest is finished under 120 seconds.\n\nThe maximum size of a matrix for this API is **700** (the number of origins multiplied by the\nnumber of destinations). With that constraint in mind, examples of possible matrix dimensions\nare: 50x10, 10x10, 28x25. 10x70 (it does not need to be square).\n\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s a typical sequence of asynchronous operations:\n\n\n#.\n Client sends a Route Matrix POST request to Azure Maps\n\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Route Matrix request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Route Matrix request. This could\neither be a 400 Bad Request or any other Error status code.\n\n\n\n#.\n If the Matrix Route request was accepted successfully, the Location header in the response\ncontains the URL to download the results of the request. This status URI looks like the\nfollowing:\n\n .. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\n\n#. Client issues a GET request on the download URL obtained in Step 3 to download the results\n\nDownload Sync Results\n^^^^^^^^^^^^^^^^^^^^^\n\nWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code\nfor successful request and a response array. The response body will contain the data and there\nwill be no possibility to retrieve the results later.\n\nDownload Async Results\n^^^^^^^^^^^^^^^^^^^^^^\n\nWhen a request issues a ``202 Accepted`` response, the request is being processed using our\nasync pipeline. You will be given a URL to check the progress of your async request in the\nlocation header of the response. This status URI looks like the following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\nThe URL provided by the location header will return the following responses when a ``GET``\nrequest is issued.\n\n..\n\n HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try\nagain in some time.\n\n HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of\nthe results.\n\n:param post_route_matrix_request_body: The matrix of origin and destination coordinates to\n compute the route distance, travel time and other summary for each cell of the matrix based on\n the input parameters. The minimum and the maximum cell count supported are 1 and **700** for\n async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations\n or 25 origins and 25 destinations for async API.\n:type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:param wait_for_results: Boolean to indicate whether to execute the request synchronously. If\n set to true, user will get a 200 response if the request is finished under 120 seconds.\n Otherwise, user will get a 202 response right away. Please refer to the API description for\n more details on 202 response. **Supported only for async request**.\n:type wait_for_results: bool\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n:type vehicle_weight: int\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either RouteMatrixResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteMatrixResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "post_route_matrix_request_body, format, wait_for_results, compute_travel_time_for, section_type, arrive_at, depart_at, vehicle_axle_weight, vehicle_length, vehicle_height, vehicle_width, vehicle_max_speed, vehicle_weight, windingness, hilliness, travel_mode, avoid, traffic, route_type, vehicle_load_type" + }, + "_get_route_matrix_initial" : { + "sync": { + "signature": "def _get_route_matrix_initial(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param format: Matrix id received after the Matrix Route request was accepted successfully.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteMatrixResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteMatrixResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _get_route_matrix_initial(\n self,\n format: str,\n **kwargs: Any\n) -\u003e Optional[\"_models.RouteMatrixResponse\"]:\n", + "doc": "\"\"\"\n\n:param format: Matrix id received after the Matrix Route request was accepted successfully.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteMatrixResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteMatrixResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format" + }, + "begin_get_route_matrix" : { + "sync": { + "signature": "def begin_get_route_matrix(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"If the Matrix Route request was accepted successfully, the Location header in the response\ncontains the URL to download the results of the request. This status URI looks like the\nfollowing:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\n\n#. Client issues a GET request on the download URL obtained in Step 3 to download the results\n\nDownload Sync Results\n^^^^^^^^^^^^^^^^^^^^^\n\nWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code\nfor successful request and a response array. The response body will contain the data and there\nwill be no possibility to retrieve the results later.\n\nDownload Async Results\n^^^^^^^^^^^^^^^^^^^^^^\n\nWhen a request issues a ``202 Accepted`` response, the request is being processed using our\nasync pipeline. You will be given a URL to check the progress of your async request in the\nlocation header of the response. This status URI looks like the following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\nThe URL provided by the location header will return the following responses when a ``GET``\nrequest is issued.\n\n..\n\n HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try\nagain in some time.\n\n HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of\nthe results.\n\n:param format: Matrix id received after the Matrix Route request was accepted successfully.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either RouteMatrixResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteMatrixResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_get_route_matrix(\n self,\n format: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.RouteMatrixResponse\"]:\n", + "doc": "\"\"\"If the Matrix Route request was accepted successfully, the Location header in the response\ncontains the URL to download the results of the request. This status URI looks like the\nfollowing:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\n\n#. Client issues a GET request on the download URL obtained in Step 3 to download the results\n\nDownload Sync Results\n^^^^^^^^^^^^^^^^^^^^^\n\nWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code\nfor successful request and a response array. The response body will contain the data and there\nwill be no possibility to retrieve the results later.\n\nDownload Async Results\n^^^^^^^^^^^^^^^^^^^^^^\n\nWhen a request issues a ``202 Accepted`` response, the request is being processed using our\nasync pipeline. You will be given a URL to check the progress of your async request in the\nlocation header of the response. This status URI looks like the following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\nThe URL provided by the location header will return the following responses when a ``GET``\nrequest is issued.\n\n..\n\n HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try\nagain in some time.\n\n HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of\nthe results.\n\n:param format: Matrix id received after the Matrix Route request was accepted successfully.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either RouteMatrixResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteMatrixResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "format" + }, + "post_route_matrix_sync" : { + "sync": { + "signature": "def post_route_matrix_sync(\n self,\n post_route_matrix_request_body, # type: \"_models.PostRouteMatrixRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n wait_for_results=None, # type: Optional[bool]\n compute_travel_time_for=None, # type: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]]\n section_type=None, # type: Optional[Union[str, \"_models.SectionType\"]]\n arrive_at=None, # type: Optional[datetime.datetime]\n depart_at=None, # type: Optional[datetime.datetime]\n vehicle_axle_weight=None, # type: Optional[int]\n vehicle_length=None, # type: Optional[float]\n vehicle_height=None, # type: Optional[float]\n vehicle_width=None, # type: Optional[float]\n vehicle_max_speed=None, # type: Optional[int]\n vehicle_weight=None, # type: Optional[int]\n windingness=None, # type: Optional[Union[str, \"_models.WindingnessLevel\"]]\n hilliness=None, # type: Optional[Union[str, \"_models.HillinessDegree\"]]\n travel_mode=None, # type: Optional[Union[str, \"_models.TravelMode\"]]\n avoid=None, # type: Optional[List[Union[str, \"_models.RouteAvoidType\"]]]\n traffic=None, # type: Optional[bool]\n route_type=None, # type: Optional[Union[str, \"_models.RouteType\"]]\n vehicle_load_type=None, # type: Optional[Union[str, \"_models.VehicleLoadType\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S1 pricing tier.\n\nThe Matrix Routing service allows calculation of a matrix of route summaries for a set of\nroutes defined by origin and destination locations by using an asynchronous (async) or\nsynchronous (sync) POST request. For every given origin, the service calculates the cost of\nrouting from that origin to every given destination. The set of origins and the set of\ndestinations can be thought of as the column and row headers of a table and each cell in the\ntable contains the costs of routing from the origin to the destination for that cell. As an\nexample, let\u0027s say a food delivery company has 20 drivers and they need to find the closest\ndriver to pick up the delivery from the restaurant. To solve this use case, they can call\nMatrix Route API.\n\nFor each route, the travel times and distances are returned. You can use the computed costs to\ndetermine which detailed routes to calculate using the Route Directions API.\n\nThe maximum size of a matrix for async request is **700** and for sync request it\u0027s **100**\n(the number of origins multiplied by the number of destinations).\n\nSubmit Synchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf your scenario requires synchronous requests and the maximum size of the matrix is less than\nor equal to 100, you might want to make synchronous request. The maximum size of a matrix for\nthis API is **100** (the number of origins multiplied by the number of destinations). With that\nconstraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not\nneed to be square).\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex routing\nrequests. When you make a request by using async request, by default the service returns a 202\nresponse code along a redirect URL in the Location field of the response header. This URL\nshould be checked periodically until the response data or error information is available. If\n``waitForResults`` parameter in the request is set to true, user will get a 200 response if the\nrequest is finished under 120 seconds.\n\nThe maximum size of a matrix for this API is **700** (the number of origins multiplied by the\nnumber of destinations). With that constraint in mind, examples of possible matrix dimensions\nare: 50x10, 10x10, 28x25. 10x70 (it does not need to be square).\n\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s a typical sequence of asynchronous operations:\n\n\n#.\n Client sends a Route Matrix POST request to Azure Maps\n\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Route Matrix request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Route Matrix request. This could\neither be a 400 Bad Request or any other Error status code.\n\n\n\n#.\n If the Matrix Route request was accepted successfully, the Location header in the response\ncontains the URL to download the results of the request. This status URI looks like the\nfollowing:\n\n .. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\n\n#. Client issues a GET request on the download URL obtained in Step 3 to download the results\n\nDownload Sync Results\n^^^^^^^^^^^^^^^^^^^^^\n\nWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code\nfor successful request and a response array. The response body will contain the data and there\nwill be no possibility to retrieve the results later.\n\nDownload Async Results\n^^^^^^^^^^^^^^^^^^^^^^\n\nWhen a request issues a ``202 Accepted`` response, the request is being processed using our\nasync pipeline. You will be given a URL to check the progress of your async request in the\nlocation header of the response. This status URI looks like the following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\nThe URL provided by the location header will return the following responses when a ``GET``\nrequest is issued.\n\n..\n\n HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try\nagain in some time.\n\n HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of\nthe results.\n\n:param post_route_matrix_request_body: The matrix of origin and destination coordinates to\n compute the route distance, travel time and other summary for each cell of the matrix based on\n the input parameters. The minimum and the maximum cell count supported are 1 and **700** for\n async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations\n or 25 origins and 25 destinations for async API.\n:type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:param wait_for_results: Boolean to indicate whether to execute the request synchronously. If\n set to true, user will get a 200 response if the request is finished under 120 seconds.\n Otherwise, user will get a 202 response right away. Please refer to the API description for\n more details on 202 response. **Supported only for async request**.\n:type wait_for_results: bool\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n:type vehicle_weight: int\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteMatrixResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteMatrixResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_route_matrix_sync(\n self,\n post_route_matrix_request_body: \"_models.PostRouteMatrixRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n wait_for_results: Optional[bool] = None,\n compute_travel_time_for: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]] = None,\n section_type: Optional[Union[str, \"_models.SectionType\"]] = None,\n arrive_at: Optional[datetime.datetime] = None,\n depart_at: Optional[datetime.datetime] = None,\n vehicle_axle_weight: Optional[int] = None,\n vehicle_length: Optional[float] = None,\n vehicle_height: Optional[float] = None,\n vehicle_width: Optional[float] = None,\n vehicle_max_speed: Optional[int] = None,\n vehicle_weight: Optional[int] = None,\n windingness: Optional[Union[str, \"_models.WindingnessLevel\"]] = None,\n hilliness: Optional[Union[str, \"_models.HillinessDegree\"]] = None,\n travel_mode: Optional[Union[str, \"_models.TravelMode\"]] = None,\n avoid: Optional[List[Union[str, \"_models.RouteAvoidType\"]]] = None,\n traffic: Optional[bool] = None,\n route_type: Optional[Union[str, \"_models.RouteType\"]] = None,\n vehicle_load_type: Optional[Union[str, \"_models.VehicleLoadType\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.RouteMatrixResponse\":\n", + "doc": "\"\"\"**Applies to**\\ : S1 pricing tier.\n\nThe Matrix Routing service allows calculation of a matrix of route summaries for a set of\nroutes defined by origin and destination locations by using an asynchronous (async) or\nsynchronous (sync) POST request. For every given origin, the service calculates the cost of\nrouting from that origin to every given destination. The set of origins and the set of\ndestinations can be thought of as the column and row headers of a table and each cell in the\ntable contains the costs of routing from the origin to the destination for that cell. As an\nexample, let\u0027s say a food delivery company has 20 drivers and they need to find the closest\ndriver to pick up the delivery from the restaurant. To solve this use case, they can call\nMatrix Route API.\n\nFor each route, the travel times and distances are returned. You can use the computed costs to\ndetermine which detailed routes to calculate using the Route Directions API.\n\nThe maximum size of a matrix for async request is **700** and for sync request it\u0027s **100**\n(the number of origins multiplied by the number of destinations).\n\nSubmit Synchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf your scenario requires synchronous requests and the maximum size of the matrix is less than\nor equal to 100, you might want to make synchronous request. The maximum size of a matrix for\nthis API is **100** (the number of origins multiplied by the number of destinations). With that\nconstraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not\nneed to be square).\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Route Matrix Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex routing\nrequests. When you make a request by using async request, by default the service returns a 202\nresponse code along a redirect URL in the Location field of the response header. This URL\nshould be checked periodically until the response data or error information is available. If\n``waitForResults`` parameter in the request is set to true, user will get a 200 response if the\nrequest is finished under 120 seconds.\n\nThe maximum size of a matrix for this API is **700** (the number of origins multiplied by the\nnumber of destinations). With that constraint in mind, examples of possible matrix dimensions\nare: 50x10, 10x10, 28x25. 10x70 (it does not need to be square).\n\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/matrix/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s a typical sequence of asynchronous operations:\n\n\n#.\n Client sends a Route Matrix POST request to Azure Maps\n\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Route Matrix request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Route Matrix request. This could\neither be a 400 Bad Request or any other Error status code.\n\n\n\n#.\n If the Matrix Route request was accepted successfully, the Location header in the response\ncontains the URL to download the results of the request. This status URI looks like the\nfollowing:\n\n .. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\n\n#. Client issues a GET request on the download URL obtained in Step 3 to download the results\n\nDownload Sync Results\n^^^^^^^^^^^^^^^^^^^^^\n\nWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code\nfor successful request and a response array. The response body will contain the data and there\nwill be no possibility to retrieve the results later.\n\nDownload Async Results\n^^^^^^^^^^^^^^^^^^^^^^\n\nWhen a request issues a ``202 Accepted`` response, the request is being processed using our\nasync pipeline. You will be given a URL to check the progress of your async request in the\nlocation header of the response. This status URI looks like the following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key}\n\nThe URL provided by the location header will return the following responses when a ``GET``\nrequest is issued.\n\n..\n\n HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try\nagain in some time.\n\n HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of\nthe results.\n\n:param post_route_matrix_request_body: The matrix of origin and destination coordinates to\n compute the route distance, travel time and other summary for each cell of the matrix based on\n the input parameters. The minimum and the maximum cell count supported are 1 and **700** for\n async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations\n or 25 origins and 25 destinations for async API.\n:type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:param wait_for_results: Boolean to indicate whether to execute the request synchronously. If\n set to true, user will get a 200 response if the request is finished under 120 seconds.\n Otherwise, user will get a 202 response right away. Please refer to the API description for\n more details on 202 response. **Supported only for async request**.\n:type wait_for_results: bool\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n:type vehicle_weight: int\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteMatrixResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteMatrixResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "post_route_matrix_request_body, format, wait_for_results, compute_travel_time_for, section_type, arrive_at, depart_at, vehicle_axle_weight, vehicle_length, vehicle_height, vehicle_width, vehicle_max_speed, vehicle_weight, windingness, hilliness, travel_mode, avoid, traffic, route_type, vehicle_load_type" + }, + "get_route_directions" : { + "sync": { + "signature": "def get_route_directions(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n max_alternatives=None, # type: Optional[int]\n alternative_type=None, # type: Optional[Union[str, \"_models.AlternativeRouteType\"]]\n min_deviation_distance=None, # type: Optional[int]\n arrive_at=None, # type: Optional[datetime.datetime]\n depart_at=None, # type: Optional[datetime.datetime]\n min_deviation_time=None, # type: Optional[int]\n instructions_type=None, # type: Optional[Union[str, \"_models.RouteInstructionsType\"]]\n language=None, # type: Optional[str]\n compute_best_order=None, # type: Optional[bool]\n route_representation=None, # type: Optional[Union[str, \"_models.RouteRepresentation\"]]\n compute_travel_time_for=None, # type: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]]\n vehicle_heading=None, # type: Optional[int]\n report=None, # type: Optional[str]\n section_type=None, # type: Optional[Union[str, \"_models.SectionType\"]]\n vehicle_axle_weight=None, # type: Optional[int]\n vehicle_width=None, # type: Optional[float]\n vehicle_height=None, # type: Optional[float]\n vehicle_length=None, # type: Optional[float]\n vehicle_max_speed=None, # type: Optional[int]\n vehicle_weight=None, # type: Optional[int]\n vehicle_commercial=None, # type: Optional[bool]\n windingness=None, # type: Optional[Union[str, \"_models.WindingnessLevel\"]]\n hilliness=None, # type: Optional[Union[str, \"_models.HillinessDegree\"]]\n travel_mode=None, # type: Optional[Union[str, \"_models.TravelMode\"]]\n avoid=None, # type: Optional[List[Union[str, \"_models.RouteAvoidType\"]]]\n traffic=None, # type: Optional[bool]\n route_type=None, # type: Optional[Union[str, \"_models.RouteType\"]]\n vehicle_load_type=None, # type: Optional[Union[str, \"_models.VehicleLoadType\"]]\n vehicle_engine_type=None, # type: Optional[Union[str, \"_models.VehicleEngineType\"]]\n constant_speed_consumption_in_liters_per_hundredkm=None, # type: Optional[float]\n current_fuel_in_liters=None, # type: Optional[float]\n auxiliary_power_in_liters_per_hour=None, # type: Optional[float]\n fuel_energy_density_in_m_joules_per_liter=None, # type: Optional[float]\n acceleration_efficiency=None, # type: Optional[float]\n deceleration_efficiency=None, # type: Optional[float]\n uphill_efficiency=None, # type: Optional[float]\n downhill_efficiency=None, # type: Optional[float]\n constant_speed_consumption_ink_wh_per_hundredkm=None, # type: Optional[str]\n current_charge_ink_wh=None, # type: Optional[str]\n max_charge_ink_wh=None, # type: Optional[str]\n auxiliary_power_ink_w=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nReturns a route between an origin and a destination, passing through waypoints if they are\nspecified. The route will take into account factors such as current traffic and the typical\nroad speeds on the requested day of the week and time of day.\n\nInformation returned includes the distance, estimated travel time, and a representation of the\nroute geometry. Additional routing information such as optimized waypoint order or turn by turn\ninstructions is also available, depending on the options selected.\n\nRouting service provides a set of parameters for a detailed description of vehicle-specific\nConsumption Model. Please check `Consumption Model\n\u003chttps://docs.microsoft.com/azure/azure-maps/consumption-model\u003e`_ for detailed explanation of\nthe concepts and parameters involved.\n\n:param query: The Coordinates through which the route is calculated, delimited by a colon. A\n minimum of two coordinates is required. The first one is the origin and the last is the\n destination of the route. Optional coordinates in-between act as WayPoints in the route. You\n can pass up to 150 WayPoints.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.route.models.ResponseFormat\n:param max_alternatives: Number of desired alternative routes to be calculated. Default: 0,\n minimum: 0 and maximum: 5.\n:type max_alternatives: int\n:param alternative_type: Controls the optimality, with respect to the given planning criteria,\n of the calculated alternatives compared to the reference route.\n:type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType\n:param min_deviation_distance: All alternative routes returned will follow the reference route\n (see section POST Requests) from the origin point of the calculateRoute request for at least\n this number of meters. Can only be used when reconstructing a route. The minDeviationDistance\n parameter cannot be used in conjunction with arriveAt.\n:type min_deviation_distance: int\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param min_deviation_time: All alternative routes returned will follow the reference route (see\n section POST Requests) from the origin point of the calculateRoute request for at least this\n number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter\n cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to\n a value greater than zero has the following consequences:\n\n\n * The origin point of the *calculateRoute* Request must be on\n (or very near) the input reference route.\n\n * If this is not the case, an error is returned.\n * However, the origin point does not need to be at the beginning\n of the input reference route (it can be thought of as the current\n vehicle position on the reference route).\n\n * The reference route, returned as the first route in the *calculateRoute*\n Response, will start at the origin point specified in the *calculateRoute*\n Request. The initial part of the input reference route up until the origin\n point will be excluded from the Response.\n * The values of *minDeviationDistance* and *minDeviationTime* determine\n how far alternative routes will be guaranteed to follow the reference\n route from the origin point onwards.\n * The route must use *departAt*.\n * The *vehicleHeading* is ignored.\n:type min_deviation_time: int\n:param instructions_type: If specified, guidance instructions will be returned. Note that the\n instructionsType parameter cannot be used in conjunction with routeRepresentation=none.\n:type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType\n:param language: The language parameter determines the language of the guidance messages.\n Proper nouns (the names of streets, plazas, etc.) are returned in the specified language, or\n if that is not available, they are returned in an available language that is close to it.\n Allowed values are (a subset of) the IETF language tags. The currently supported languages are\n listed in the `Supported languages section\n \u003chttps://docs.microsoft.com/azure/azure-maps/supported-languages\u003e`_.\n\n Default value: en-GB.\n:type language: str\n:param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to\n reduce the route length. Yields best results when used in conjunction with routeType\n *shortest*. Notice that origin and destination are excluded from the optimized waypoint\n indices. To include origin and destination in the response, please increase all the indices by\n 1 to account for the origin, and then add the destination as the final index. Possible values\n are true or false. True computes a better order if possible, but is not allowed to be used in\n conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints.\n False will use the locations in the given order and not allowed to be used in conjunction with\n routeRepresentation *none*.\n:type compute_best_order: bool\n:param route_representation: Specifies the representation of the set of routes provided as\n response. This parameter value can only be used in conjunction with computeBestOrder=true.\n:type route_representation: str or ~azure.maps.route.models.RouteRepresentation\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param vehicle_heading: The directional heading of the vehicle in degrees starting at true\n North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is\n 180 degrees, west is 270 degrees. Possible values 0-359.\n:type vehicle_heading: int\n:param report: Specifies which data should be reported for diagnosis purposes. The only\n possible value is *effectiveSettings*. Reports the effective parameters or data used when\n calling the API. In the case of defaulted parameters the default will be reflected where the\n parameter was not specified by the caller.\n:type report: str\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n\n\n *\n It is mandatory if any of the *Efficiency parameters are set.\n\n *\n It must be strictly positive when used in the context of the Consumption Model. Weight\n restrictions are considered.\n\n *\n If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is\n non-zero, then weight restrictions are considered.\n\n *\n In all other cases, this parameter is ignored.\n\n Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900.\n:type vehicle_weight: int\n:param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed\n to drive on some roads.\n:type vehicle_commercial: bool\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is\n specified, it must be consistent with the value of **vehicleEngineType**.\n:type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType\n:param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent\n component of consumption.\n\n Provided as an unordered list of colon-delimited speed \u0026 consumption-rate pairs. The list\n defines points on a consumption curve. Consumption rates for speeds not in the list are found\n as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0.\n\n Sensible Values : 50,6.3:130,11.5\n\n **Note** : This parameter is required for **The Combustion Consumption Model**.\n:type constant_speed_consumption_in_liters_per_hundredkm: float\n:param current_fuel_in_liters: Specifies the current supply of fuel in liters.\n\n Sensible Values : 55.\n:type current_fuel_in_liters: float\n:param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining\n auxiliary systems of the vehicle, in liters per hour.\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 0.2.\n:type auxiliary_power_in_liters_per_hour: float\n:param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy\n stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the\n ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For\n example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel.\n\n This parameter is required if any ***Efficiency** parameter is set.\n\n Sensible Values : 34.2.\n:type fuel_energy_density_in_m_joules_per_liter: float\n:param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored\n in fuel to kinetic energy when the vehicle accelerates *(i.e.\n KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting\n consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **decelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **decelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66.\n:type acceleration_efficiency: float\n:param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved\n (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost).\n ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using\n **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **accelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **accelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91.\n:type deceleration_efficiency: float\n:param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel\n to potential energy when the vehicle gains elevation *(i.e.\n PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by\n converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **downhillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **downhillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74.\n:type uphill_efficiency: float\n:param downhill_efficiency: Specifies the efficiency of converting potential energy to saved\n (not consumed) fuel when the vehicle loses elevation *(i.e.\n ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved\n (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **uphillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **uphillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73.\n:type downhill_efficiency: float\n:param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component\n of consumption.\n\n Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a\n consumption curve. Consumption rates for speeds not in the list are found as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and\n 100000.0.\n\n Sensible Values : 50,8.2:130,21.3\n\n This parameter is required for **Electric consumption model**.\n:type constant_speed_consumption_ink_wh_per_hundredkm: str\n:param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours\n (kWh).\n\n This parameter co-exists with **maxChargeInkWh** parameter.\n\n The range of values allowed are 0.0 to **maxChargeInkWh**.\n\n Sensible Values : 43.\n:type current_charge_ink_wh: str\n:param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh)\n that may be stored in the vehicle\u0027s battery.\n\n This parameter co-exists with **currentChargeInkWh** parameter.\n\n Minimum value has to be greater than or equal to **currentChargeInkWh**.\n\n Sensible Values : 85.\n:type max_charge_ink_wh: str\n:param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary\n systems, in kilowatts (kW).\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 1.7.\n:type auxiliary_power_ink_w: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_route_directions(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n max_alternatives: Optional[int] = None,\n alternative_type: Optional[Union[str, \"_models.AlternativeRouteType\"]] = None,\n min_deviation_distance: Optional[int] = None,\n arrive_at: Optional[datetime.datetime] = None,\n depart_at: Optional[datetime.datetime] = None,\n min_deviation_time: Optional[int] = None,\n instructions_type: Optional[Union[str, \"_models.RouteInstructionsType\"]] = None,\n language: Optional[str] = None,\n compute_best_order: Optional[bool] = None,\n route_representation: Optional[Union[str, \"_models.RouteRepresentation\"]] = None,\n compute_travel_time_for: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]] = None,\n vehicle_heading: Optional[int] = None,\n report: Optional[str] = None,\n section_type: Optional[Union[str, \"_models.SectionType\"]] = None,\n vehicle_axle_weight: Optional[int] = None,\n vehicle_width: Optional[float] = None,\n vehicle_height: Optional[float] = None,\n vehicle_length: Optional[float] = None,\n vehicle_max_speed: Optional[int] = None,\n vehicle_weight: Optional[int] = None,\n vehicle_commercial: Optional[bool] = None,\n windingness: Optional[Union[str, \"_models.WindingnessLevel\"]] = None,\n hilliness: Optional[Union[str, \"_models.HillinessDegree\"]] = None,\n travel_mode: Optional[Union[str, \"_models.TravelMode\"]] = None,\n avoid: Optional[List[Union[str, \"_models.RouteAvoidType\"]]] = None,\n traffic: Optional[bool] = None,\n route_type: Optional[Union[str, \"_models.RouteType\"]] = None,\n vehicle_load_type: Optional[Union[str, \"_models.VehicleLoadType\"]] = None,\n vehicle_engine_type: Optional[Union[str, \"_models.VehicleEngineType\"]] = None,\n constant_speed_consumption_in_liters_per_hundredkm: Optional[float] = None,\n current_fuel_in_liters: Optional[float] = None,\n auxiliary_power_in_liters_per_hour: Optional[float] = None,\n fuel_energy_density_in_m_joules_per_liter: Optional[float] = None,\n acceleration_efficiency: Optional[float] = None,\n deceleration_efficiency: Optional[float] = None,\n uphill_efficiency: Optional[float] = None,\n downhill_efficiency: Optional[float] = None,\n constant_speed_consumption_ink_wh_per_hundredkm: Optional[str] = None,\n current_charge_ink_wh: Optional[str] = None,\n max_charge_ink_wh: Optional[str] = None,\n auxiliary_power_ink_w: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.RouteDirectionsResponse\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nReturns a route between an origin and a destination, passing through waypoints if they are\nspecified. The route will take into account factors such as current traffic and the typical\nroad speeds on the requested day of the week and time of day.\n\nInformation returned includes the distance, estimated travel time, and a representation of the\nroute geometry. Additional routing information such as optimized waypoint order or turn by turn\ninstructions is also available, depending on the options selected.\n\nRouting service provides a set of parameters for a detailed description of vehicle-specific\nConsumption Model. Please check `Consumption Model\n\u003chttps://docs.microsoft.com/azure/azure-maps/consumption-model\u003e`_ for detailed explanation of\nthe concepts and parameters involved.\n\n:param query: The Coordinates through which the route is calculated, delimited by a colon. A\n minimum of two coordinates is required. The first one is the origin and the last is the\n destination of the route. Optional coordinates in-between act as WayPoints in the route. You\n can pass up to 150 WayPoints.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.route.models.ResponseFormat\n:param max_alternatives: Number of desired alternative routes to be calculated. Default: 0,\n minimum: 0 and maximum: 5.\n:type max_alternatives: int\n:param alternative_type: Controls the optimality, with respect to the given planning criteria,\n of the calculated alternatives compared to the reference route.\n:type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType\n:param min_deviation_distance: All alternative routes returned will follow the reference route\n (see section POST Requests) from the origin point of the calculateRoute request for at least\n this number of meters. Can only be used when reconstructing a route. The minDeviationDistance\n parameter cannot be used in conjunction with arriveAt.\n:type min_deviation_distance: int\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param min_deviation_time: All alternative routes returned will follow the reference route (see\n section POST Requests) from the origin point of the calculateRoute request for at least this\n number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter\n cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to\n a value greater than zero has the following consequences:\n\n\n * The origin point of the *calculateRoute* Request must be on\n (or very near) the input reference route.\n\n * If this is not the case, an error is returned.\n * However, the origin point does not need to be at the beginning\n of the input reference route (it can be thought of as the current\n vehicle position on the reference route).\n\n * The reference route, returned as the first route in the *calculateRoute*\n Response, will start at the origin point specified in the *calculateRoute*\n Request. The initial part of the input reference route up until the origin\n point will be excluded from the Response.\n * The values of *minDeviationDistance* and *minDeviationTime* determine\n how far alternative routes will be guaranteed to follow the reference\n route from the origin point onwards.\n * The route must use *departAt*.\n * The *vehicleHeading* is ignored.\n:type min_deviation_time: int\n:param instructions_type: If specified, guidance instructions will be returned. Note that the\n instructionsType parameter cannot be used in conjunction with routeRepresentation=none.\n:type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType\n:param language: The language parameter determines the language of the guidance messages.\n Proper nouns (the names of streets, plazas, etc.) are returned in the specified language, or\n if that is not available, they are returned in an available language that is close to it.\n Allowed values are (a subset of) the IETF language tags. The currently supported languages are\n listed in the `Supported languages section\n \u003chttps://docs.microsoft.com/azure/azure-maps/supported-languages\u003e`_.\n\n Default value: en-GB.\n:type language: str\n:param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to\n reduce the route length. Yields best results when used in conjunction with routeType\n *shortest*. Notice that origin and destination are excluded from the optimized waypoint\n indices. To include origin and destination in the response, please increase all the indices by\n 1 to account for the origin, and then add the destination as the final index. Possible values\n are true or false. True computes a better order if possible, but is not allowed to be used in\n conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints.\n False will use the locations in the given order and not allowed to be used in conjunction with\n routeRepresentation *none*.\n:type compute_best_order: bool\n:param route_representation: Specifies the representation of the set of routes provided as\n response. This parameter value can only be used in conjunction with computeBestOrder=true.\n:type route_representation: str or ~azure.maps.route.models.RouteRepresentation\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param vehicle_heading: The directional heading of the vehicle in degrees starting at true\n North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is\n 180 degrees, west is 270 degrees. Possible values 0-359.\n:type vehicle_heading: int\n:param report: Specifies which data should be reported for diagnosis purposes. The only\n possible value is *effectiveSettings*. Reports the effective parameters or data used when\n calling the API. In the case of defaulted parameters the default will be reflected where the\n parameter was not specified by the caller.\n:type report: str\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n\n\n *\n It is mandatory if any of the *Efficiency parameters are set.\n\n *\n It must be strictly positive when used in the context of the Consumption Model. Weight\n restrictions are considered.\n\n *\n If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is\n non-zero, then weight restrictions are considered.\n\n *\n In all other cases, this parameter is ignored.\n\n Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900.\n:type vehicle_weight: int\n:param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed\n to drive on some roads.\n:type vehicle_commercial: bool\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is\n specified, it must be consistent with the value of **vehicleEngineType**.\n:type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType\n:param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent\n component of consumption.\n\n Provided as an unordered list of colon-delimited speed \u0026 consumption-rate pairs. The list\n defines points on a consumption curve. Consumption rates for speeds not in the list are found\n as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0.\n\n Sensible Values : 50,6.3:130,11.5\n\n **Note** : This parameter is required for **The Combustion Consumption Model**.\n:type constant_speed_consumption_in_liters_per_hundredkm: float\n:param current_fuel_in_liters: Specifies the current supply of fuel in liters.\n\n Sensible Values : 55.\n:type current_fuel_in_liters: float\n:param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining\n auxiliary systems of the vehicle, in liters per hour.\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 0.2.\n:type auxiliary_power_in_liters_per_hour: float\n:param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy\n stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the\n ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For\n example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel.\n\n This parameter is required if any ***Efficiency** parameter is set.\n\n Sensible Values : 34.2.\n:type fuel_energy_density_in_m_joules_per_liter: float\n:param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored\n in fuel to kinetic energy when the vehicle accelerates *(i.e.\n KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting\n consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **decelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **decelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66.\n:type acceleration_efficiency: float\n:param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved\n (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost).\n ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using\n **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **accelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **accelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91.\n:type deceleration_efficiency: float\n:param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel\n to potential energy when the vehicle gains elevation *(i.e.\n PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by\n converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **downhillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **downhillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74.\n:type uphill_efficiency: float\n:param downhill_efficiency: Specifies the efficiency of converting potential energy to saved\n (not consumed) fuel when the vehicle loses elevation *(i.e.\n ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved\n (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **uphillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **uphillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73.\n:type downhill_efficiency: float\n:param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component\n of consumption.\n\n Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a\n consumption curve. Consumption rates for speeds not in the list are found as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and\n 100000.0.\n\n Sensible Values : 50,8.2:130,21.3\n\n This parameter is required for **Electric consumption model**.\n:type constant_speed_consumption_ink_wh_per_hundredkm: str\n:param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours\n (kWh).\n\n This parameter co-exists with **maxChargeInkWh** parameter.\n\n The range of values allowed are 0.0 to **maxChargeInkWh**.\n\n Sensible Values : 43.\n:type current_charge_ink_wh: str\n:param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh)\n that may be stored in the vehicle\u0027s battery.\n\n This parameter co-exists with **currentChargeInkWh** parameter.\n\n Minimum value has to be greater than or equal to **currentChargeInkWh**.\n\n Sensible Values : 85.\n:type max_charge_ink_wh: str\n:param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary\n systems, in kilowatts (kW).\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 1.7.\n:type auxiliary_power_ink_w: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, max_alternatives, alternative_type, min_deviation_distance, arrive_at, depart_at, min_deviation_time, instructions_type, language, compute_best_order, route_representation, compute_travel_time_for, vehicle_heading, report, section_type, vehicle_axle_weight, vehicle_width, vehicle_height, vehicle_length, vehicle_max_speed, vehicle_weight, vehicle_commercial, windingness, hilliness, travel_mode, avoid, traffic, route_type, vehicle_load_type, vehicle_engine_type, constant_speed_consumption_in_liters_per_hundredkm, current_fuel_in_liters, auxiliary_power_in_liters_per_hour, fuel_energy_density_in_m_joules_per_liter, acceleration_efficiency, deceleration_efficiency, uphill_efficiency, downhill_efficiency, constant_speed_consumption_ink_wh_per_hundredkm, current_charge_ink_wh, max_charge_ink_wh, auxiliary_power_ink_w" + }, + "post_route_directions" : { + "sync": { + "signature": "def post_route_directions(\n self,\n query, # type: str\n post_route_directions_request_body, # type: \"_models.PostRouteDirectionsRequestBody\"\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n max_alternatives=None, # type: Optional[int]\n alternative_type=None, # type: Optional[Union[str, \"_models.AlternativeRouteType\"]]\n min_deviation_distance=None, # type: Optional[int]\n min_deviation_time=None, # type: Optional[int]\n instructions_type=None, # type: Optional[Union[str, \"_models.RouteInstructionsType\"]]\n language=None, # type: Optional[str]\n compute_best_order=None, # type: Optional[bool]\n route_representation=None, # type: Optional[Union[str, \"_models.RouteRepresentation\"]]\n compute_travel_time_for=None, # type: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]]\n vehicle_heading=None, # type: Optional[int]\n report=None, # type: Optional[str]\n section_type=None, # type: Optional[Union[str, \"_models.SectionType\"]]\n arrive_at=None, # type: Optional[datetime.datetime]\n depart_at=None, # type: Optional[datetime.datetime]\n vehicle_axle_weight=None, # type: Optional[int]\n vehicle_length=None, # type: Optional[float]\n vehicle_height=None, # type: Optional[float]\n vehicle_width=None, # type: Optional[float]\n vehicle_max_speed=None, # type: Optional[int]\n vehicle_weight=None, # type: Optional[int]\n vehicle_commercial=None, # type: Optional[bool]\n windingness=None, # type: Optional[Union[str, \"_models.WindingnessLevel\"]]\n hilliness=None, # type: Optional[Union[str, \"_models.HillinessDegree\"]]\n travel_mode=None, # type: Optional[Union[str, \"_models.TravelMode\"]]\n avoid=None, # type: Optional[List[Union[str, \"_models.RouteAvoidType\"]]]\n traffic=None, # type: Optional[bool]\n route_type=None, # type: Optional[Union[str, \"_models.RouteType\"]]\n vehicle_load_type=None, # type: Optional[Union[str, \"_models.VehicleLoadType\"]]\n vehicle_engine_type=None, # type: Optional[Union[str, \"_models.VehicleEngineType\"]]\n constant_speed_consumption_in_liters_per_hundredkm=None, # type: Optional[float]\n current_fuel_in_liters=None, # type: Optional[float]\n auxiliary_power_in_liters_per_hour=None, # type: Optional[float]\n fuel_energy_density_in_m_joules_per_liter=None, # type: Optional[float]\n acceleration_efficiency=None, # type: Optional[float]\n deceleration_efficiency=None, # type: Optional[float]\n uphill_efficiency=None, # type: Optional[float]\n downhill_efficiency=None, # type: Optional[float]\n constant_speed_consumption_ink_wh_per_hundredkm=None, # type: Optional[str]\n current_charge_ink_wh=None, # type: Optional[str]\n max_charge_ink_wh=None, # type: Optional[str]\n auxiliary_power_ink_w=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nReturns a route between an origin and a destination, passing through waypoints if they are\nspecified. The route will take into account factors such as current traffic and the typical\nroad speeds on the requested day of the week and time of day.\n\nInformation returned includes the distance, estimated travel time, and a representation of the\nroute geometry. Additional routing information such as optimized waypoint order or turn by turn\ninstructions is also available, depending on the options selected.\n\nRouting service provides a set of parameters for a detailed description of a vehicle-specific\nConsumption Model. Please check `Consumption Model\n\u003chttps://docs.microsoft.com/azure/azure-maps/consumption-model\u003e`_ for detailed explanation of\nthe concepts and parameters involved.\n\n:param query: The Coordinates through which the route is calculated. Needs two coordinates at\n least. Delimited by colon. First one is the origin and the last is the destination of the\n route. The coordinates are in a lat,long format. Optional coordinates in between act as\n WayPoints in the route.\n:type query: str\n:param post_route_directions_request_body: Used for reconstructing a route and for calculating\n zero or more alternative routes to this reference route. The provided sequence of coordinates\n is used as input for route reconstruction. The alternative routes are calculated between the\n origin and destination points specified in the base path parameter locations. If both\n minDeviationDistance and minDeviationTime are set to zero, then these origin and destination\n points are expected to be at (or very near) the beginning and end of the reference route,\n respectively. Intermediate locations (waypoints) are not supported when using\n supportingPoints.\n\n Setting at least one of minDeviationDistance or minDeviationTime to a value greater than zero\n has the following consequences:\n\n\n * The origin point of the calculateRoute request must be on (or very near) the input reference\n route. If this is not the case, an error is returned. However, the origin point does not need\n to be at the beginning of the input reference route (it can be thought of as the current\n vehicle position on the reference route).\n * The reference route, returned as the first route in the calculateRoute response, will start\n at the origin point specified in the calculateRoute request. The initial part of the input\n reference route up until the origin point will be excluded from the response.\n * The values of minDeviationDistance and minDeviationTime determine how far alternative routes\n will be guaranteed to follow the reference route from the origin point onwards.\n * The route must use departAt.\n * The vehicleHeading is ignored.\n:type post_route_directions_request_body: ~azure.maps.route.models.PostRouteDirectionsRequestBody\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.route.models.ResponseFormat\n:param max_alternatives: Number of desired alternative routes to be calculated. Default: 0,\n minimum: 0 and maximum: 5.\n:type max_alternatives: int\n:param alternative_type: Controls the optimality, with respect to the given planning criteria,\n of the calculated alternatives compared to the reference route.\n:type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType\n:param min_deviation_distance: All alternative routes returned will follow the reference route\n (see section POST Requests) from the origin point of the calculateRoute request for at least\n this number of meters. Can only be used when reconstructing a route. The minDeviationDistance\n parameter cannot be used in conjunction with arriveAt.\n:type min_deviation_distance: int\n:param min_deviation_time: All alternative routes returned will follow the reference route (see\n section POST Requests) from the origin point of the calculateRoute request for at least this\n number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter\n cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to\n a value greater than zero has the following consequences:\n\n\n * The origin point of the *calculateRoute* Request must be on\n (or very near) the input reference route.\n\n * If this is not the case, an error is returned.\n * However, the origin point does not need to be at the beginning\n of the input reference route (it can be thought of as the current\n vehicle position on the reference route).\n\n * The reference route, returned as the first route in the *calculateRoute*\n Response, will start at the origin point specified in the *calculateRoute*\n Request. The initial part of the input reference route up until the origin\n point will be excluded from the Response.\n * The values of *minDeviationDistance* and *minDeviationTime* determine\n how far alternative routes will be guaranteed to follow the reference\n route from the origin point onwards.\n * The route must use *departAt*.\n * The *vehicleHeading* is ignored.\n:type min_deviation_time: int\n:param instructions_type: If specified, guidance instructions will be returned. Note that the\n instructionsType parameter cannot be used in conjunction with routeRepresentation=none.\n:type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType\n:param language: The language parameter determines the language of the guidance messages. It\n does not affect proper nouns (the names of streets, plazas, etc.) It has no effect when\n instructionsType=coded. Allowed values are (a subset of) the IETF language tags described.\n:type language: str\n:param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to\n reduce the route length. Yields best results when used in conjunction with routeType\n *shortest*. Notice that origin and destination are excluded from the optimized waypoint\n indices. To include origin and destination in the response, please increase all the indices by\n 1 to account for the origin, and then add the destination as the final index. Possible values\n are true or false. True computes a better order if possible, but is not allowed to be used in\n conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints.\n False will use the locations in the given order and not allowed to be used in conjunction with\n routeRepresentation *none*.\n:type compute_best_order: bool\n:param route_representation: Specifies the representation of the set of routes provided as\n response. This parameter value can only be used in conjunction with computeBestOrder=true.\n:type route_representation: str or ~azure.maps.route.models.RouteRepresentation\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param vehicle_heading: The directional heading of the vehicle in degrees starting at true\n North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is\n 180 degrees, west is 270 degrees. Possible values 0-359.\n:type vehicle_heading: int\n:param report: Specifies which data should be reported for diagnosis purposes. The only\n possible value is *effectiveSettings*. Reports the effective parameters or data used when\n calling the API. In the case of defaulted parameters the default will be reflected where the\n parameter was not specified by the caller.\n:type report: str\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n\n\n *\n It is mandatory if any of the *Efficiency parameters are set.\n\n *\n It must be strictly positive when used in the context of the Consumption Model. Weight\n restrictions are considered.\n\n *\n If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is\n non-zero, then weight restrictions are considered.\n\n *\n In all other cases, this parameter is ignored.\n\n Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900.\n:type vehicle_weight: int\n:param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed\n to drive on some roads.\n:type vehicle_commercial: bool\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is\n specified, it must be consistent with the value of **vehicleEngineType**.\n:type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType\n:param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent\n component of consumption.\n\n Provided as an unordered list of colon-delimited speed \u0026 consumption-rate pairs. The list\n defines points on a consumption curve. Consumption rates for speeds not in the list are found\n as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0.\n\n Sensible Values : 50,6.3:130,11.5\n\n **Note** : This parameter is required for **The Combustion Consumption Model**.\n:type constant_speed_consumption_in_liters_per_hundredkm: float\n:param current_fuel_in_liters: Specifies the current supply of fuel in liters.\n\n Sensible Values : 55.\n:type current_fuel_in_liters: float\n:param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining\n auxiliary systems of the vehicle, in liters per hour.\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 0.2.\n:type auxiliary_power_in_liters_per_hour: float\n:param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy\n stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the\n ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For\n example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel.\n\n This parameter is required if any ***Efficiency** parameter is set.\n\n Sensible Values : 34.2.\n:type fuel_energy_density_in_m_joules_per_liter: float\n:param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored\n in fuel to kinetic energy when the vehicle accelerates *(i.e.\n KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting\n consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **decelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **decelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66.\n:type acceleration_efficiency: float\n:param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved\n (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost).\n ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using\n **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **accelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **accelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91.\n:type deceleration_efficiency: float\n:param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel\n to potential energy when the vehicle gains elevation *(i.e.\n PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by\n converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **downhillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **downhillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74.\n:type uphill_efficiency: float\n:param downhill_efficiency: Specifies the efficiency of converting potential energy to saved\n (not consumed) fuel when the vehicle loses elevation *(i.e.\n ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved\n (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **uphillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **uphillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73.\n:type downhill_efficiency: float\n:param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component\n of consumption.\n\n Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a\n consumption curve. Consumption rates for speeds not in the list are found as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and\n 100000.0.\n\n Sensible Values : 50,8.2:130,21.3\n\n This parameter is required for **Electric consumption model**.\n:type constant_speed_consumption_ink_wh_per_hundredkm: str\n:param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours\n (kWh).\n\n This parameter co-exists with **maxChargeInkWh** parameter.\n\n The range of values allowed are 0.0 to **maxChargeInkWh**.\n\n Sensible Values : 43.\n:type current_charge_ink_wh: str\n:param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh)\n that may be stored in the vehicle\u0027s battery.\n\n This parameter co-exists with **currentChargeInkWh** parameter.\n\n Minimum value has to be greater than or equal to **currentChargeInkWh**.\n\n Sensible Values : 85.\n:type max_charge_ink_wh: str\n:param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary\n systems, in kilowatts (kW).\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 1.7.\n:type auxiliary_power_ink_w: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_route_directions(\n self,\n query: str,\n post_route_directions_request_body: \"_models.PostRouteDirectionsRequestBody\",\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n max_alternatives: Optional[int] = None,\n alternative_type: Optional[Union[str, \"_models.AlternativeRouteType\"]] = None,\n min_deviation_distance: Optional[int] = None,\n min_deviation_time: Optional[int] = None,\n instructions_type: Optional[Union[str, \"_models.RouteInstructionsType\"]] = None,\n language: Optional[str] = None,\n compute_best_order: Optional[bool] = None,\n route_representation: Optional[Union[str, \"_models.RouteRepresentation\"]] = None,\n compute_travel_time_for: Optional[Union[str, \"_models.ComputeTravelTimeFor\"]] = None,\n vehicle_heading: Optional[int] = None,\n report: Optional[str] = None,\n section_type: Optional[Union[str, \"_models.SectionType\"]] = None,\n arrive_at: Optional[datetime.datetime] = None,\n depart_at: Optional[datetime.datetime] = None,\n vehicle_axle_weight: Optional[int] = None,\n vehicle_length: Optional[float] = None,\n vehicle_height: Optional[float] = None,\n vehicle_width: Optional[float] = None,\n vehicle_max_speed: Optional[int] = None,\n vehicle_weight: Optional[int] = None,\n vehicle_commercial: Optional[bool] = None,\n windingness: Optional[Union[str, \"_models.WindingnessLevel\"]] = None,\n hilliness: Optional[Union[str, \"_models.HillinessDegree\"]] = None,\n travel_mode: Optional[Union[str, \"_models.TravelMode\"]] = None,\n avoid: Optional[List[Union[str, \"_models.RouteAvoidType\"]]] = None,\n traffic: Optional[bool] = None,\n route_type: Optional[Union[str, \"_models.RouteType\"]] = None,\n vehicle_load_type: Optional[Union[str, \"_models.VehicleLoadType\"]] = None,\n vehicle_engine_type: Optional[Union[str, \"_models.VehicleEngineType\"]] = None,\n constant_speed_consumption_in_liters_per_hundredkm: Optional[float] = None,\n current_fuel_in_liters: Optional[float] = None,\n auxiliary_power_in_liters_per_hour: Optional[float] = None,\n fuel_energy_density_in_m_joules_per_liter: Optional[float] = None,\n acceleration_efficiency: Optional[float] = None,\n deceleration_efficiency: Optional[float] = None,\n uphill_efficiency: Optional[float] = None,\n downhill_efficiency: Optional[float] = None,\n constant_speed_consumption_ink_wh_per_hundredkm: Optional[str] = None,\n current_charge_ink_wh: Optional[str] = None,\n max_charge_ink_wh: Optional[str] = None,\n auxiliary_power_ink_w: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.RouteDirectionsResponse\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nReturns a route between an origin and a destination, passing through waypoints if they are\nspecified. The route will take into account factors such as current traffic and the typical\nroad speeds on the requested day of the week and time of day.\n\nInformation returned includes the distance, estimated travel time, and a representation of the\nroute geometry. Additional routing information such as optimized waypoint order or turn by turn\ninstructions is also available, depending on the options selected.\n\nRouting service provides a set of parameters for a detailed description of a vehicle-specific\nConsumption Model. Please check `Consumption Model\n\u003chttps://docs.microsoft.com/azure/azure-maps/consumption-model\u003e`_ for detailed explanation of\nthe concepts and parameters involved.\n\n:param query: The Coordinates through which the route is calculated. Needs two coordinates at\n least. Delimited by colon. First one is the origin and the last is the destination of the\n route. The coordinates are in a lat,long format. Optional coordinates in between act as\n WayPoints in the route.\n:type query: str\n:param post_route_directions_request_body: Used for reconstructing a route and for calculating\n zero or more alternative routes to this reference route. The provided sequence of coordinates\n is used as input for route reconstruction. The alternative routes are calculated between the\n origin and destination points specified in the base path parameter locations. If both\n minDeviationDistance and minDeviationTime are set to zero, then these origin and destination\n points are expected to be at (or very near) the beginning and end of the reference route,\n respectively. Intermediate locations (waypoints) are not supported when using\n supportingPoints.\n\n Setting at least one of minDeviationDistance or minDeviationTime to a value greater than zero\n has the following consequences:\n\n\n * The origin point of the calculateRoute request must be on (or very near) the input reference\n route. If this is not the case, an error is returned. However, the origin point does not need\n to be at the beginning of the input reference route (it can be thought of as the current\n vehicle position on the reference route).\n * The reference route, returned as the first route in the calculateRoute response, will start\n at the origin point specified in the calculateRoute request. The initial part of the input\n reference route up until the origin point will be excluded from the response.\n * The values of minDeviationDistance and minDeviationTime determine how far alternative routes\n will be guaranteed to follow the reference route from the origin point onwards.\n * The route must use departAt.\n * The vehicleHeading is ignored.\n:type post_route_directions_request_body: ~azure.maps.route.models.PostRouteDirectionsRequestBody\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.route.models.ResponseFormat\n:param max_alternatives: Number of desired alternative routes to be calculated. Default: 0,\n minimum: 0 and maximum: 5.\n:type max_alternatives: int\n:param alternative_type: Controls the optimality, with respect to the given planning criteria,\n of the calculated alternatives compared to the reference route.\n:type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType\n:param min_deviation_distance: All alternative routes returned will follow the reference route\n (see section POST Requests) from the origin point of the calculateRoute request for at least\n this number of meters. Can only be used when reconstructing a route. The minDeviationDistance\n parameter cannot be used in conjunction with arriveAt.\n:type min_deviation_distance: int\n:param min_deviation_time: All alternative routes returned will follow the reference route (see\n section POST Requests) from the origin point of the calculateRoute request for at least this\n number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter\n cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to\n a value greater than zero has the following consequences:\n\n\n * The origin point of the *calculateRoute* Request must be on\n (or very near) the input reference route.\n\n * If this is not the case, an error is returned.\n * However, the origin point does not need to be at the beginning\n of the input reference route (it can be thought of as the current\n vehicle position on the reference route).\n\n * The reference route, returned as the first route in the *calculateRoute*\n Response, will start at the origin point specified in the *calculateRoute*\n Request. The initial part of the input reference route up until the origin\n point will be excluded from the Response.\n * The values of *minDeviationDistance* and *minDeviationTime* determine\n how far alternative routes will be guaranteed to follow the reference\n route from the origin point onwards.\n * The route must use *departAt*.\n * The *vehicleHeading* is ignored.\n:type min_deviation_time: int\n:param instructions_type: If specified, guidance instructions will be returned. Note that the\n instructionsType parameter cannot be used in conjunction with routeRepresentation=none.\n:type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType\n:param language: The language parameter determines the language of the guidance messages. It\n does not affect proper nouns (the names of streets, plazas, etc.) It has no effect when\n instructionsType=coded. Allowed values are (a subset of) the IETF language tags described.\n:type language: str\n:param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to\n reduce the route length. Yields best results when used in conjunction with routeType\n *shortest*. Notice that origin and destination are excluded from the optimized waypoint\n indices. To include origin and destination in the response, please increase all the indices by\n 1 to account for the origin, and then add the destination as the final index. Possible values\n are true or false. True computes a better order if possible, but is not allowed to be used in\n conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints.\n False will use the locations in the given order and not allowed to be used in conjunction with\n routeRepresentation *none*.\n:type compute_best_order: bool\n:param route_representation: Specifies the representation of the set of routes provided as\n response. This parameter value can only be used in conjunction with computeBestOrder=true.\n:type route_representation: str or ~azure.maps.route.models.RouteRepresentation\n:param compute_travel_time_for: Specifies whether to return additional travel times using\n different types of traffic information (none, historic, live) as well as the default\n best-estimate travel time.\n:type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor\n:param vehicle_heading: The directional heading of the vehicle in degrees starting at true\n North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is\n 180 degrees, west is 270 degrees. Possible values 0-359.\n:type vehicle_heading: int\n:param report: Specifies which data should be reported for diagnosis purposes. The only\n possible value is *effectiveSettings*. Reports the effective parameters or data used when\n calling the API. In the case of defaulted parameters the default will be reflected where the\n parameter was not specified by the caller.\n:type report: str\n:param section_type: Specifies which of the section types is reported in the route response.\n :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`For example if sectionType = pedestrian the sections which are suited\n for pedestrians only are returned. Multiple types can be used. The default sectionType refers\n to the travelMode input. By default travelMode is set to car.\n:type section_type: str or ~azure.maps.route.models.SectionType\n:param arrive_at: The date and time of arrival at the destination point. It must be specified\n as a dateTime. When a time zone offset is not specified it will be assumed to be that of the\n destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be\n used in conjunction with departAt, minDeviationDistance or minDeviationTime.\n:type arrive_at: ~datetime.datetime\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n\n\n *\n It is mandatory if any of the *Efficiency parameters are set.\n\n *\n It must be strictly positive when used in the context of the Consumption Model. Weight\n restrictions are considered.\n\n *\n If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is\n non-zero, then weight restrictions are considered.\n\n *\n In all other cases, this parameter is ignored.\n\n Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900.\n:type vehicle_weight: int\n:param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed\n to drive on some roads.\n:type vehicle_commercial: bool\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is\n specified, it must be consistent with the value of **vehicleEngineType**.\n:type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType\n:param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent\n component of consumption.\n\n Provided as an unordered list of colon-delimited speed \u0026 consumption-rate pairs. The list\n defines points on a consumption curve. Consumption rates for speeds not in the list are found\n as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0.\n\n Sensible Values : 50,6.3:130,11.5\n\n **Note** : This parameter is required for **The Combustion Consumption Model**.\n:type constant_speed_consumption_in_liters_per_hundredkm: float\n:param current_fuel_in_liters: Specifies the current supply of fuel in liters.\n\n Sensible Values : 55.\n:type current_fuel_in_liters: float\n:param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining\n auxiliary systems of the vehicle, in liters per hour.\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 0.2.\n:type auxiliary_power_in_liters_per_hour: float\n:param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy\n stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the\n ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For\n example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel.\n\n This parameter is required if any ***Efficiency** parameter is set.\n\n Sensible Values : 34.2.\n:type fuel_energy_density_in_m_joules_per_liter: float\n:param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored\n in fuel to kinetic energy when the vehicle accelerates *(i.e.\n KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting\n consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **decelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **decelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66.\n:type acceleration_efficiency: float\n:param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved\n (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost).\n ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using\n **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **accelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **accelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91.\n:type deceleration_efficiency: float\n:param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel\n to potential energy when the vehicle gains elevation *(i.e.\n PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by\n converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **downhillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **downhillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74.\n:type uphill_efficiency: float\n:param downhill_efficiency: Specifies the efficiency of converting potential energy to saved\n (not consumed) fuel when the vehicle loses elevation *(i.e.\n ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved\n (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **uphillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **uphillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73.\n:type downhill_efficiency: float\n:param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component\n of consumption.\n\n Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a\n consumption curve. Consumption rates for speeds not in the list are found as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and\n 100000.0.\n\n Sensible Values : 50,8.2:130,21.3\n\n This parameter is required for **Electric consumption model**.\n:type constant_speed_consumption_ink_wh_per_hundredkm: str\n:param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours\n (kWh).\n\n This parameter co-exists with **maxChargeInkWh** parameter.\n\n The range of values allowed are 0.0 to **maxChargeInkWh**.\n\n Sensible Values : 43.\n:type current_charge_ink_wh: str\n:param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh)\n that may be stored in the vehicle\u0027s battery.\n\n This parameter co-exists with **currentChargeInkWh** parameter.\n\n Minimum value has to be greater than or equal to **currentChargeInkWh**.\n\n Sensible Values : 85.\n:type max_charge_ink_wh: str\n:param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary\n systems, in kilowatts (kW).\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 1.7.\n:type auxiliary_power_ink_w: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, post_route_directions_request_body, format, max_alternatives, alternative_type, min_deviation_distance, min_deviation_time, instructions_type, language, compute_best_order, route_representation, compute_travel_time_for, vehicle_heading, report, section_type, arrive_at, depart_at, vehicle_axle_weight, vehicle_length, vehicle_height, vehicle_width, vehicle_max_speed, vehicle_weight, vehicle_commercial, windingness, hilliness, travel_mode, avoid, traffic, route_type, vehicle_load_type, vehicle_engine_type, constant_speed_consumption_in_liters_per_hundredkm, current_fuel_in_liters, auxiliary_power_in_liters_per_hour, fuel_energy_density_in_m_joules_per_liter, acceleration_efficiency, deceleration_efficiency, uphill_efficiency, downhill_efficiency, constant_speed_consumption_ink_wh_per_hundredkm, current_charge_ink_wh, max_charge_ink_wh, auxiliary_power_ink_w" + }, + "get_route_range" : { + "sync": { + "signature": "def get_route_range(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n fuel_budget_in_liters=None, # type: Optional[float]\n energy_budget_ink_wh=None, # type: Optional[float]\n time_budget_in_sec=None, # type: Optional[float]\n distance_budget_in_meters=None, # type: Optional[float]\n depart_at=None, # type: Optional[datetime.datetime]\n route_type=None, # type: Optional[Union[str, \"_models.RouteType\"]]\n traffic=None, # type: Optional[bool]\n avoid=None, # type: Optional[List[Union[str, \"_models.RouteAvoidType\"]]]\n travel_mode=None, # type: Optional[Union[str, \"_models.TravelMode\"]]\n hilliness=None, # type: Optional[Union[str, \"_models.HillinessDegree\"]]\n windingness=None, # type: Optional[Union[str, \"_models.WindingnessLevel\"]]\n vehicle_axle_weight=None, # type: Optional[int]\n vehicle_width=None, # type: Optional[float]\n vehicle_height=None, # type: Optional[float]\n vehicle_length=None, # type: Optional[float]\n vehicle_max_speed=None, # type: Optional[int]\n vehicle_weight=None, # type: Optional[int]\n vehicle_commercial=None, # type: Optional[bool]\n vehicle_load_type=None, # type: Optional[Union[str, \"_models.VehicleLoadType\"]]\n vehicle_engine_type=None, # type: Optional[Union[str, \"_models.VehicleEngineType\"]]\n constant_speed_consumption_in_liters_per_hundredkm=None, # type: Optional[float]\n current_fuel_in_liters=None, # type: Optional[float]\n auxiliary_power_in_liters_per_hour=None, # type: Optional[float]\n fuel_energy_density_in_m_joules_per_liter=None, # type: Optional[float]\n acceleration_efficiency=None, # type: Optional[float]\n deceleration_efficiency=None, # type: Optional[float]\n uphill_efficiency=None, # type: Optional[float]\n downhill_efficiency=None, # type: Optional[float]\n constant_speed_consumption_ink_wh_per_hundredkm=None, # type: Optional[str]\n current_charge_ink_wh=None, # type: Optional[str]\n max_charge_ink_wh=None, # type: Optional[str]\n auxiliary_power_ink_w=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Route Range (Isochrone) API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThis service will calculate a set of locations that can be reached from the origin point based\non fuel, energy, time or distance budget that is specified. A polygon boundary (or Isochrone)\nis returned in a counterclockwise orientation as well as the precise polygon center which was\nthe result of the origin point.\n\nThe returned polygon can be used for further processing such as `Search Inside Geometry\n\u003chttps://docs.microsoft.com/rest/api/maps/search/postsearchinsidegeometry\u003e`_ to search for\nPOIs within the provided Isochrone.\n\n:param query: The Coordinate from which the range calculation should start.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.route.models.ResponseFormat\n:param fuel_budget_in_liters: Fuel budget in liters that determines maximal range which can be\n travelled using the specified Combustion Consumption Model.:code:`\u003cbr\u003e` When fuelBudgetInLiters\n is used, it is mandatory to specify a detailed Combustion Consumption Model.:code:`\u003cbr\u003e`\n Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or\n distanceBudgetInMeters) must be used.\n:type fuel_budget_in_liters: float\n:param energy_budget_ink_wh: Electric energy budget in kilowatt hours (kWh) that determines\n maximal range which can be travelled using the specified Electric Consumption\n Model.:code:`\u003cbr\u003e` When energyBudgetInkWh is used, it is mandatory to specify a detailed\n Electric Consumption Model.:code:`\u003cbr\u003e` Exactly one budget (fuelBudgetInLiters,\n energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must be used.\n:type energy_budget_ink_wh: float\n:param time_budget_in_sec: Time budget in seconds that determines maximal range which can be\n travelled using driving time. The Consumption Model will only affect the range when routeType\n is eco.:code:`\u003cbr\u003e` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec,\n or distanceBudgetInMeters) must be used.\n:type time_budget_in_sec: float\n:param distance_budget_in_meters: Distance budget in meters that determines maximal range which\n can be travelled using driving distance. The Consumption Model will only affect the range when\n routeType is eco.:code:`\u003cbr\u003e` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh,\n timeBudgetInSec, or distanceBudgetInMeters) must be used.\n:type distance_budget_in_meters: float\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n\n\n *\n It is mandatory if any of the *Efficiency parameters are set.\n\n *\n It must be strictly positive when used in the context of the Consumption Model. Weight\n restrictions are considered.\n\n *\n If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is\n non-zero, then weight restrictions are considered.\n\n *\n In all other cases, this parameter is ignored.\n\n Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900.\n:type vehicle_weight: int\n:param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed\n to drive on some roads.\n:type vehicle_commercial: bool\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is\n specified, it must be consistent with the value of **vehicleEngineType**.\n:type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType\n:param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent\n component of consumption.\n\n Provided as an unordered list of colon-delimited speed \u0026 consumption-rate pairs. The list\n defines points on a consumption curve. Consumption rates for speeds not in the list are found\n as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0.\n\n Sensible Values : 50,6.3:130,11.5\n\n **Note** : This parameter is required for **The Combustion Consumption Model**.\n:type constant_speed_consumption_in_liters_per_hundredkm: float\n:param current_fuel_in_liters: Specifies the current supply of fuel in liters.\n\n Sensible Values : 55.\n:type current_fuel_in_liters: float\n:param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining\n auxiliary systems of the vehicle, in liters per hour.\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 0.2.\n:type auxiliary_power_in_liters_per_hour: float\n:param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy\n stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the\n ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For\n example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel.\n\n This parameter is required if any ***Efficiency** parameter is set.\n\n Sensible Values : 34.2.\n:type fuel_energy_density_in_m_joules_per_liter: float\n:param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored\n in fuel to kinetic energy when the vehicle accelerates *(i.e.\n KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting\n consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **decelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **decelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66.\n:type acceleration_efficiency: float\n:param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved\n (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost).\n ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using\n **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **accelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **accelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91.\n:type deceleration_efficiency: float\n:param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel\n to potential energy when the vehicle gains elevation *(i.e.\n PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by\n converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **downhillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **downhillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74.\n:type uphill_efficiency: float\n:param downhill_efficiency: Specifies the efficiency of converting potential energy to saved\n (not consumed) fuel when the vehicle loses elevation *(i.e.\n ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved\n (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **uphillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **uphillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73.\n:type downhill_efficiency: float\n:param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component\n of consumption.\n\n Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a\n consumption curve. Consumption rates for speeds not in the list are found as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and\n 100000.0.\n\n Sensible Values : 50,8.2:130,21.3\n\n This parameter is required for **Electric consumption model**.\n:type constant_speed_consumption_ink_wh_per_hundredkm: str\n:param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours\n (kWh).\n\n This parameter co-exists with **maxChargeInkWh** parameter.\n\n The range of values allowed are 0.0 to **maxChargeInkWh**.\n\n Sensible Values : 43.\n:type current_charge_ink_wh: str\n:param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh)\n that may be stored in the vehicle\u0027s battery.\n\n This parameter co-exists with **currentChargeInkWh** parameter.\n\n Minimum value has to be greater than or equal to **currentChargeInkWh**.\n\n Sensible Values : 85.\n:type max_charge_ink_wh: str\n:param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary\n systems, in kilowatts (kW).\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 1.7.\n:type auxiliary_power_ink_w: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GetRouteRangeResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.GetRouteRangeResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_route_range(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n fuel_budget_in_liters: Optional[float] = None,\n energy_budget_ink_wh: Optional[float] = None,\n time_budget_in_sec: Optional[float] = None,\n distance_budget_in_meters: Optional[float] = None,\n depart_at: Optional[datetime.datetime] = None,\n route_type: Optional[Union[str, \"_models.RouteType\"]] = None,\n traffic: Optional[bool] = None,\n avoid: Optional[List[Union[str, \"_models.RouteAvoidType\"]]] = None,\n travel_mode: Optional[Union[str, \"_models.TravelMode\"]] = None,\n hilliness: Optional[Union[str, \"_models.HillinessDegree\"]] = None,\n windingness: Optional[Union[str, \"_models.WindingnessLevel\"]] = None,\n vehicle_axle_weight: Optional[int] = None,\n vehicle_width: Optional[float] = None,\n vehicle_height: Optional[float] = None,\n vehicle_length: Optional[float] = None,\n vehicle_max_speed: Optional[int] = None,\n vehicle_weight: Optional[int] = None,\n vehicle_commercial: Optional[bool] = None,\n vehicle_load_type: Optional[Union[str, \"_models.VehicleLoadType\"]] = None,\n vehicle_engine_type: Optional[Union[str, \"_models.VehicleEngineType\"]] = None,\n constant_speed_consumption_in_liters_per_hundredkm: Optional[float] = None,\n current_fuel_in_liters: Optional[float] = None,\n auxiliary_power_in_liters_per_hour: Optional[float] = None,\n fuel_energy_density_in_m_joules_per_liter: Optional[float] = None,\n acceleration_efficiency: Optional[float] = None,\n deceleration_efficiency: Optional[float] = None,\n uphill_efficiency: Optional[float] = None,\n downhill_efficiency: Optional[float] = None,\n constant_speed_consumption_ink_wh_per_hundredkm: Optional[str] = None,\n current_charge_ink_wh: Optional[str] = None,\n max_charge_ink_wh: Optional[str] = None,\n auxiliary_power_ink_w: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.GetRouteRangeResponse\":\n", + "doc": "\"\"\"**Route Range (Isochrone) API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThis service will calculate a set of locations that can be reached from the origin point based\non fuel, energy, time or distance budget that is specified. A polygon boundary (or Isochrone)\nis returned in a counterclockwise orientation as well as the precise polygon center which was\nthe result of the origin point.\n\nThe returned polygon can be used for further processing such as `Search Inside Geometry\n\u003chttps://docs.microsoft.com/rest/api/maps/search/postsearchinsidegeometry\u003e`_ to search for\nPOIs within the provided Isochrone.\n\n:param query: The Coordinate from which the range calculation should start.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.route.models.ResponseFormat\n:param fuel_budget_in_liters: Fuel budget in liters that determines maximal range which can be\n travelled using the specified Combustion Consumption Model.:code:`\u003cbr\u003e` When fuelBudgetInLiters\n is used, it is mandatory to specify a detailed Combustion Consumption Model.:code:`\u003cbr\u003e`\n Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or\n distanceBudgetInMeters) must be used.\n:type fuel_budget_in_liters: float\n:param energy_budget_ink_wh: Electric energy budget in kilowatt hours (kWh) that determines\n maximal range which can be travelled using the specified Electric Consumption\n Model.:code:`\u003cbr\u003e` When energyBudgetInkWh is used, it is mandatory to specify a detailed\n Electric Consumption Model.:code:`\u003cbr\u003e` Exactly one budget (fuelBudgetInLiters,\n energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must be used.\n:type energy_budget_ink_wh: float\n:param time_budget_in_sec: Time budget in seconds that determines maximal range which can be\n travelled using driving time. The Consumption Model will only affect the range when routeType\n is eco.:code:`\u003cbr\u003e` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec,\n or distanceBudgetInMeters) must be used.\n:type time_budget_in_sec: float\n:param distance_budget_in_meters: Distance budget in meters that determines maximal range which\n can be travelled using driving distance. The Consumption Model will only affect the range when\n routeType is eco.:code:`\u003cbr\u003e` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh,\n timeBudgetInSec, or distanceBudgetInMeters) must be used.\n:type distance_budget_in_meters: float\n:param depart_at: The date and time of departure from the origin point. Departure times apart\n from now must be specified as a dateTime. When a time zone offset is not specified, it will be\n assumed to be that of the origin point. The departAt value must be in the future in the\n date-time format (1996-12-19T16:39:57-08:00).\n:type depart_at: ~datetime.datetime\n:param route_type: The type of route requested.\n:type route_type: str or ~azure.maps.route.models.RouteType\n:param traffic: Possible values:\n\n\n * true - Do consider all available traffic information during routing\n * false - Ignore current traffic data during routing. Note that although the current traffic\n data is ignored\n during routing, the effect of historic traffic on effective road speeds is still\n incorporated.\n:type traffic: bool\n:param avoid: Specifies something that the route calculation should try to avoid when\n determining the route. Can be specified multiple times in one request, for example,\n \u0027\u0026avoid=motorways\u0026avoid=tollRoads\u0026avoid=ferries\u0027. In calculateReachableRange requests, the\n value alreadyUsedRoads must not be used.\n:type avoid: list[str or ~azure.maps.route.models.RouteAvoidType]\n:param travel_mode: The mode of travel for the requested route. If not defined, default is\n \u0027car\u0027. Note that the requested travelMode may not be available for the entire route. Where the\n requested travelMode is not available for a particular section, the travelMode element of the\n response for that section will be \"other\". Note that travel modes bus, motorcycle, taxi and van\n are BETA functionality. Full restriction data is not available in all areas. In\n **calculateReachableRange** requests, the values bicycle and pedestrian must not be used.\n:type travel_mode: str or ~azure.maps.route.models.TravelMode\n:param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type hilliness: str or ~azure.maps.route.models.HillinessDegree\n:param windingness: Level of turns for thrilling route. This parameter can only be used in\n conjunction with ``routeType``\\ =thrilling.\n:type windingness: str or ~azure.maps.route.models.WindingnessLevel\n:param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that\n weight restrictions per axle are not considered.\n:type vehicle_axle_weight: int\n:param vehicle_width: Width of the vehicle in meters. A value of 0 means that width\n restrictions are not considered.\n:type vehicle_width: float\n:param vehicle_height: Height of the vehicle in meters. A value of 0 means that height\n restrictions are not considered.\n:type vehicle_height: float\n:param vehicle_length: Length of the vehicle in meters. A value of 0 means that length\n restrictions are not considered.\n:type vehicle_length: float\n:param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle\n profile is used to check whether a vehicle is allowed on motorways.\n\n\n *\n A value of 0 means that an appropriate value for the vehicle will be determined and applied\n during route planning.\n\n *\n A non-zero value may be overridden during route planning. For example, the current traffic\n flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will\n consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is\n provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will\n again use 60 km/hour.\n:type vehicle_max_speed: int\n:param vehicle_weight: Weight of the vehicle in kilograms.\n\n\n *\n It is mandatory if any of the *Efficiency parameters are set.\n\n *\n It must be strictly positive when used in the context of the Consumption Model. Weight\n restrictions are considered.\n\n *\n If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is\n non-zero, then weight restrictions are considered.\n\n *\n In all other cases, this parameter is ignored.\n\n Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900.\n:type vehicle_weight: int\n:param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed\n to drive on some roads.\n:type vehicle_commercial: bool\n:param vehicle_load_type: Types of cargo that may be classified as hazardous materials and\n restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9,\n plus generic classifications for use in other countries. Values beginning with USHazmat are for\n US routing while otherHazmat should be used for all other countries. vehicleLoadType can be\n specified multiple times. This parameter is currently only considered for travelMode=truck.\n:type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType\n:param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is\n specified, it must be consistent with the value of **vehicleEngineType**.\n:type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType\n:param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent\n component of consumption.\n\n Provided as an unordered list of colon-delimited speed \u0026 consumption-rate pairs. The list\n defines points on a consumption curve. Consumption rates for speeds not in the list are found\n as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0.\n\n Sensible Values : 50,6.3:130,11.5\n\n **Note** : This parameter is required for **The Combustion Consumption Model**.\n:type constant_speed_consumption_in_liters_per_hundredkm: float\n:param current_fuel_in_liters: Specifies the current supply of fuel in liters.\n\n Sensible Values : 55.\n:type current_fuel_in_liters: float\n:param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining\n auxiliary systems of the vehicle, in liters per hour.\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 0.2.\n:type auxiliary_power_in_liters_per_hour: float\n:param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy\n stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the\n ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For\n example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel.\n\n This parameter is required if any ***Efficiency** parameter is set.\n\n Sensible Values : 34.2.\n:type fuel_energy_density_in_m_joules_per_liter: float\n:param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored\n in fuel to kinetic energy when the vehicle accelerates *(i.e.\n KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting\n consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **decelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **decelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66.\n:type acceleration_efficiency: float\n:param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved\n (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost).\n ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using\n **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **accelerationEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **accelerationEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91.\n:type deceleration_efficiency: float\n:param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel\n to potential energy when the vehicle gains elevation *(i.e.\n PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by\n converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **downhillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **downhillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74.\n:type uphill_efficiency: float\n:param downhill_efficiency: Specifies the efficiency of converting potential energy to saved\n (not consumed) fuel when the vehicle loses elevation *(i.e.\n ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved\n (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**.\n\n Must be paired with **uphillEfficiency**.\n\n The range of values allowed are 0.0 to 1/\\ **uphillEfficiency**.\n\n Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73.\n:type downhill_efficiency: float\n:param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component\n of consumption.\n\n Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a\n consumption curve. Consumption rates for speeds not in the list are found as follows:\n\n\n *\n by linear interpolation, if the given speed lies in between two speeds in the list\n\n *\n by linear extrapolation otherwise, assuming a constant (\u0394Consumption/\u0394Speed) determined by\n the nearest two points in the list\n\n The list must contain between 1 and 25 points (inclusive), and may not contain duplicate\n points for the same speed. If it only contains a single point, then the consumption rate of\n that point is used without further processing.\n\n Consumption specified for the largest speed must be greater than or equal to that of the\n penultimate largest speed. This ensures that extrapolation does not lead to negative\n consumption rates.\n\n Similarly, consumption values specified for the two smallest speeds in the list cannot lead to\n a negative consumption rate for any smaller speed.\n\n The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and\n 100000.0.\n\n Sensible Values : 50,8.2:130,21.3\n\n This parameter is required for **Electric consumption model**.\n:type constant_speed_consumption_ink_wh_per_hundredkm: str\n:param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours\n (kWh).\n\n This parameter co-exists with **maxChargeInkWh** parameter.\n\n The range of values allowed are 0.0 to **maxChargeInkWh**.\n\n Sensible Values : 43.\n:type current_charge_ink_wh: str\n:param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh)\n that may be stored in the vehicle\u0027s battery.\n\n This parameter co-exists with **currentChargeInkWh** parameter.\n\n Minimum value has to be greater than or equal to **currentChargeInkWh**.\n\n Sensible Values : 85.\n:type max_charge_ink_wh: str\n:param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary\n systems, in kilowatts (kW).\n\n It can be used to specify consumption due to devices and systems such as AC systems, radio,\n heating, etc.\n\n Sensible Values : 1.7.\n:type auxiliary_power_ink_w: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GetRouteRangeResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.GetRouteRangeResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, fuel_budget_in_liters, energy_budget_ink_wh, time_budget_in_sec, distance_budget_in_meters, depart_at, route_type, traffic, avoid, travel_mode, hilliness, windingness, vehicle_axle_weight, vehicle_width, vehicle_height, vehicle_length, vehicle_max_speed, vehicle_weight, vehicle_commercial, vehicle_load_type, vehicle_engine_type, constant_speed_consumption_in_liters_per_hundredkm, current_fuel_in_liters, auxiliary_power_in_liters_per_hour, fuel_energy_density_in_m_joules_per_liter, acceleration_efficiency, deceleration_efficiency, uphill_efficiency, downhill_efficiency, constant_speed_consumption_ink_wh_per_hundredkm, current_charge_ink_wh, max_charge_ink_wh, auxiliary_power_ink_w" + }, + "_post_route_directions_batch_initial" : { + "sync": { + "signature": "def _post_route_directions_batch_initial(\n self,\n post_route_directions_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param post_route_directions_batch_request_body: The list of route directions queries/requests\n to process. The list can contain a max of 700 queries for async and 100 queries for sync\n version and must contain at least 1 query.\n:type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _post_route_directions_batch_initial(\n self,\n post_route_directions_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e Optional[\"_models.RouteDirectionsBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param post_route_directions_batch_request_body: The list of route directions queries/requests\n to process. The list can contain a max of 700 queries for async and 100 queries for sync\n version and must contain at least 1 query.\n:type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "post_route_directions_batch_request_body, format" + }, + "begin_post_route_directions_batch" : { + "sync": { + "signature": "def begin_post_route_directions_batch(\n self,\n post_route_directions_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Route Directions Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Route Directions Batch API sends batches of queries to `Route Directions API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections\u003e`_ using just a single\nAPI call. You can call Route Directions Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **700** queries and sync API\nup to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex route\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **700** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Route Directions Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0``\nNote:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security\n\u003c#security\u003e`_\\ ) to the *status URI* before running it. :code:`\u003cbr\u003e`\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *route directions* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 3 *route directions*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n { \"query\":\n\"?query=47.620659,-122.348934:47.610101,-122.342015\u0026travelMode=bicycle\u0026routeType=eco\u0026traffic=false\"\n},\n { \"query\":\n\"?query=40.759856,-73.985108:40.771136,-73.973506\u0026travelMode=pedestrian\u0026routeType=shortest\" },\n { \"query\": \"?query=48.923159,-122.557362:32.621279,-116.840362\" }\n ]\n }\n\nA *route directions* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *route directions*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#uri-parameters\u003e`_. The\nstring values in the *route directions* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **700** queries and sync API up to **100** queries,\nand the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``RouteDirectionsResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 1 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 1,\n \"totalRequests\": 2\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\": {\n \"routes\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"legs\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"points\": [\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.34892\n },\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.3485\n },\n {\n \"latitude\": 47.62095,\n \"longitude\": -122.3476\n }\n ]\n }\n ],\n \"sections\": [\n {\n \"startPointIndex\": 0,\n \"endPointIndex\": 40,\n \"sectionType\": \"TRAVEL_MODE\",\n \"travelMode\": \"bicycle\"\n }\n ]\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param post_route_directions_batch_request_body: The list of route directions queries/requests\n to process. The list can contain a max of 700 queries for async and 100 queries for sync\n version and must contain at least 1 query.\n:type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_post_route_directions_batch(\n self,\n post_route_directions_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.RouteDirectionsBatchResponse\"]:\n", + "doc": "\"\"\"**Route Directions Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Route Directions Batch API sends batches of queries to `Route Directions API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections\u003e`_ using just a single\nAPI call. You can call Route Directions Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **700** queries and sync API\nup to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex route\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **700** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Route Directions Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0``\nNote:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security\n\u003c#security\u003e`_\\ ) to the *status URI* before running it. :code:`\u003cbr\u003e`\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *route directions* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 3 *route directions*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n { \"query\":\n\"?query=47.620659,-122.348934:47.610101,-122.342015\u0026travelMode=bicycle\u0026routeType=eco\u0026traffic=false\"\n},\n { \"query\":\n\"?query=40.759856,-73.985108:40.771136,-73.973506\u0026travelMode=pedestrian\u0026routeType=shortest\" },\n { \"query\": \"?query=48.923159,-122.557362:32.621279,-116.840362\" }\n ]\n }\n\nA *route directions* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *route directions*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#uri-parameters\u003e`_. The\nstring values in the *route directions* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **700** queries and sync API up to **100** queries,\nand the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``RouteDirectionsResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 1 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 1,\n \"totalRequests\": 2\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\": {\n \"routes\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"legs\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"points\": [\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.34892\n },\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.3485\n },\n {\n \"latitude\": 47.62095,\n \"longitude\": -122.3476\n }\n ]\n }\n ],\n \"sections\": [\n {\n \"startPointIndex\": 0,\n \"endPointIndex\": 40,\n \"sectionType\": \"TRAVEL_MODE\",\n \"travelMode\": \"bicycle\"\n }\n ]\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param post_route_directions_batch_request_body: The list of route directions queries/requests\n to process. The list can contain a max of 700 queries for async and 100 queries for sync\n version and must contain at least 1 query.\n:type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "post_route_directions_batch_request_body, format" + }, + "_get_route_directions_batch_initial" : { + "sync": { + "signature": "def _get_route_directions_batch_initial(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _get_route_directions_batch_initial(\n self,\n format: str,\n **kwargs: Any\n) -\u003e Optional[\"_models.RouteDirectionsBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format" + }, + "begin_get_route_directions_batch" : { + "sync": { + "signature": "def begin_get_route_directions_batch(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Download Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``RouteDirectionsResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 1 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 1,\n \"totalRequests\": 2\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\": {\n \"routes\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"legs\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"points\": [\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.34892\n },\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.3485\n },\n {\n \"latitude\": 47.62095,\n \"longitude\": -122.3476\n }\n ]\n }\n ],\n \"sections\": [\n {\n \"startPointIndex\": 0,\n \"endPointIndex\": 40,\n \"sectionType\": \"TRAVEL_MODE\",\n \"travelMode\": \"bicycle\"\n }\n ]\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_get_route_directions_batch(\n self,\n format: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.RouteDirectionsBatchResponse\"]:\n", + "doc": "\"\"\"Download Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``RouteDirectionsResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 1 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 1,\n \"totalRequests\": 2\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\": {\n \"routes\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"legs\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"points\": [\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.34892\n },\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.3485\n },\n {\n \"latitude\": 47.62095,\n \"longitude\": -122.3476\n }\n ]\n }\n ],\n \"sections\": [\n {\n \"startPointIndex\": 0,\n \"endPointIndex\": 40,\n \"sectionType\": \"TRAVEL_MODE\",\n \"travelMode\": \"bicycle\"\n }\n ]\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "format" + }, + "post_route_directions_batch_sync" : { + "sync": { + "signature": "def post_route_directions_batch_sync(\n self,\n post_route_directions_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Route Directions Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Route Directions Batch API sends batches of queries to `Route Directions API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections\u003e`_ using just a single\nAPI call. You can call Route Directions Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **700** queries and sync API\nup to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex route\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **700** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Route Directions Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0``\nNote:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security\n\u003c#security\u003e`_\\ ) to the *status URI* before running it. :code:`\u003cbr\u003e`\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *route directions* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 3 *route directions*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n { \"query\":\n\"?query=47.620659,-122.348934:47.610101,-122.342015\u0026travelMode=bicycle\u0026routeType=eco\u0026traffic=false\"\n},\n { \"query\":\n\"?query=40.759856,-73.985108:40.771136,-73.973506\u0026travelMode=pedestrian\u0026routeType=shortest\" },\n { \"query\": \"?query=48.923159,-122.557362:32.621279,-116.840362\" }\n ]\n }\n\nA *route directions* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *route directions*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#uri-parameters\u003e`_. The\nstring values in the *route directions* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **700** queries and sync API up to **100** queries,\nand the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``RouteDirectionsResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 1 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 1,\n \"totalRequests\": 2\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\": {\n \"routes\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"legs\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"points\": [\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.34892\n },\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.3485\n },\n {\n \"latitude\": 47.62095,\n \"longitude\": -122.3476\n }\n ]\n }\n ],\n \"sections\": [\n {\n \"startPointIndex\": 0,\n \"endPointIndex\": 40,\n \"sectionType\": \"TRAVEL_MODE\",\n \"travelMode\": \"bicycle\"\n }\n ]\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param post_route_directions_batch_request_body: The list of route directions queries/requests\n to process. The list can contain a max of 700 queries for async and 100 queries for sync\n version and must contain at least 1 query.\n:type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_route_directions_batch_sync(\n self,\n post_route_directions_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.RouteDirectionsBatchResponse\":\n", + "doc": "\"\"\"**Route Directions Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Route Directions Batch API sends batches of queries to `Route Directions API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections\u003e`_ using just a single\nAPI call. You can call Route Directions Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **700** queries and sync API\nup to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex route\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **700** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Route Directions Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0``\nNote:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security\n\u003c#security\u003e`_\\ ) to the *status URI* before running it. :code:`\u003cbr\u003e`\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *route directions* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 3 *route directions*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n { \"query\":\n\"?query=47.620659,-122.348934:47.610101,-122.342015\u0026travelMode=bicycle\u0026routeType=eco\u0026traffic=false\"\n},\n { \"query\":\n\"?query=40.759856,-73.985108:40.771136,-73.973506\u0026travelMode=pedestrian\u0026routeType=shortest\" },\n { \"query\": \"?query=48.923159,-122.557362:32.621279,-116.840362\" }\n ]\n }\n\nA *route directions* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *route directions*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#uri-parameters\u003e`_. The\nstring values in the *route directions* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **700** queries and sync API up to **100** queries,\nand the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``RouteDirectionsResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/route/getroutedirections#routedirectionsresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 1 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 1,\n \"totalRequests\": 2\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\": {\n \"routes\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"legs\": [\n {\n \"summary\": {\n \"lengthInMeters\": 1758,\n \"travelTimeInSeconds\": 387,\n \"trafficDelayInSeconds\": 0,\n \"departureTime\": \"2018-07-17T00:49:56+00:00\",\n \"arrivalTime\": \"2018-07-17T00:56:22+00:00\"\n },\n \"points\": [\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.34892\n },\n {\n \"latitude\": 47.62094,\n \"longitude\": -122.3485\n },\n {\n \"latitude\": 47.62095,\n \"longitude\": -122.3476\n }\n ]\n }\n ],\n \"sections\": [\n {\n \"startPointIndex\": 0,\n \"endPointIndex\": 40,\n \"sectionType\": \"TRAVEL_MODE\",\n \"travelMode\": \"bicycle\"\n }\n ]\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param post_route_directions_batch_request_body: The list of route directions queries/requests\n to process. The list can contain a max of 700 queries for async and 100 queries for sync\n version and must contain at least 1 query.\n:type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.route.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: RouteDirectionsBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "post_route_directions_batch_request_body, format" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-route/azure/maps/route/_route_client.py b/sdk/maps/azure-maps-route/azure/maps/route/_route_client.py new file mode 100644 index 000000000000..8756024fe5c0 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/_route_client.py @@ -0,0 +1,82 @@ +# 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 RouteClientConfiguration +from .operations import RouteClientOperationsMixin +from . import models + + +class RouteClient(RouteClientOperationsMixin): + """Azure Maps Route 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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + 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 = RouteClientConfiguration(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: () -> RouteClient + 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-route/azure/maps/route/_version.py b/sdk/maps/azure-maps-route/azure/maps/route/_version.py new file mode 100644 index 000000000000..b9995fb385b0 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/_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 = "1.0-preview" diff --git a/sdk/maps/azure-maps-route/azure/maps/route/aio/__init__.py b/sdk/maps/azure-maps-route/azure/maps/route/aio/__init__.py new file mode 100644 index 000000000000..affbe9c7b264 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/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 ._route_client import RouteClient +__all__ = ['RouteClient'] diff --git a/sdk/maps/azure-maps-route/azure/maps/route/aio/_configuration.py b/sdk/maps/azure-maps-route/azure/maps/route/aio/_configuration.py new file mode 100644 index 000000000000..052e19ca2dc7 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/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 RouteClientConfiguration(Configuration): + """Configuration for RouteClient. + + 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(RouteClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-route/{}'.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-route/azure/maps/route/aio/_route_client.py b/sdk/maps/azure-maps-route/azure/maps/route/aio/_route_client.py new file mode 100644 index 000000000000..12900a9eb5a0 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/aio/_route_client.py @@ -0,0 +1,75 @@ +# 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 RouteClientConfiguration +from .operations import RouteClientOperationsMixin +from .. import models + + +class RouteClient(RouteClientOperationsMixin): + """Azure Maps Route 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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + 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 = RouteClientConfiguration(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) -> "RouteClient": + 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-route/azure/maps/route/aio/operations/__init__.py b/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/__init__.py new file mode 100644 index 000000000000..5eff2a716822 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/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 ._route_client_operations import RouteClientOperationsMixin + +__all__ = [ + 'RouteClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_route_client_operations.py b/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_route_client_operations.py new file mode 100644 index 000000000000..3827ae9c7ff0 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/aio/operations/_route_client_operations.py @@ -0,0 +1,3321 @@ +# 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, 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 azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RouteClientOperationsMixin: + + async def _post_route_matrix_initial( + self, + post_route_matrix_request_body: "_models.PostRouteMatrixRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + wait_for_results: Optional[bool] = None, + compute_travel_time_for: Optional[Union[str, "_models.ComputeTravelTimeFor"]] = None, + section_type: Optional[Union[str, "_models.SectionType"]] = None, + arrive_at: Optional[datetime.datetime] = None, + depart_at: Optional[datetime.datetime] = None, + vehicle_axle_weight: Optional[int] = None, + vehicle_length: Optional[float] = None, + vehicle_height: Optional[float] = None, + vehicle_width: Optional[float] = None, + vehicle_max_speed: Optional[int] = None, + vehicle_weight: Optional[int] = None, + windingness: Optional[Union[str, "_models.WindingnessLevel"]] = None, + hilliness: Optional[Union[str, "_models.HillinessDegree"]] = None, + travel_mode: Optional[Union[str, "_models.TravelMode"]] = None, + avoid: Optional[List[Union[str, "_models.RouteAvoidType"]]] = None, + traffic: Optional[bool] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + vehicle_load_type: Optional[Union[str, "_models.VehicleLoadType"]] = None, + **kwargs: Any + ) -> Optional["_models.RouteMatrixResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteMatrixResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_route_matrix_initial.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 wait_for_results is not None: + query_parameters['waitForResults'] = self._serialize.query("wait_for_results", wait_for_results, 'bool') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_matrix_request_body, 'PostRouteMatrixRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_route_matrix_initial.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + async def begin_post_route_matrix( + self, + post_route_matrix_request_body: "_models.PostRouteMatrixRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + wait_for_results: Optional[bool] = None, + compute_travel_time_for: Optional[Union[str, "_models.ComputeTravelTimeFor"]] = None, + section_type: Optional[Union[str, "_models.SectionType"]] = None, + arrive_at: Optional[datetime.datetime] = None, + depart_at: Optional[datetime.datetime] = None, + vehicle_axle_weight: Optional[int] = None, + vehicle_length: Optional[float] = None, + vehicle_height: Optional[float] = None, + vehicle_width: Optional[float] = None, + vehicle_max_speed: Optional[int] = None, + vehicle_weight: Optional[int] = None, + windingness: Optional[Union[str, "_models.WindingnessLevel"]] = None, + hilliness: Optional[Union[str, "_models.HillinessDegree"]] = None, + travel_mode: Optional[Union[str, "_models.TravelMode"]] = None, + avoid: Optional[List[Union[str, "_models.RouteAvoidType"]]] = None, + traffic: Optional[bool] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + vehicle_load_type: Optional[Union[str, "_models.VehicleLoadType"]] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.RouteMatrixResponse"]: + """**Applies to**\ : S1 pricing tier. + + The Matrix Routing service allows calculation of a matrix of route summaries for a set of + routes defined by origin and destination locations by using an asynchronous (async) or + synchronous (sync) POST request. For every given origin, the service calculates the cost of + routing from that origin to every given destination. The set of origins and the set of + destinations can be thought of as the column and row headers of a table and each cell in the + table contains the costs of routing from the origin to the destination for that cell. As an + example, let's say a food delivery company has 20 drivers and they need to find the closest + driver to pick up the delivery from the restaurant. To solve this use case, they can call + Matrix Route API. + + For each route, the travel times and distances are returned. You can use the computed costs to + determine which detailed routes to calculate using the Route Directions API. + + The maximum size of a matrix for async request is **700** and for sync request it's **100** + (the number of origins multiplied by the number of destinations). + + Submit Synchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If your scenario requires synchronous requests and the maximum size of the matrix is less than + or equal to 100, you might want to make synchronous request. The maximum size of a matrix for + this API is **100** (the number of origins multiplied by the number of destinations). With that + constraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not + need to be square). + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex routing + requests. When you make a request by using async request, by default the service returns a 202 + response code along a redirect URL in the Location field of the response header. This URL + should be checked periodically until the response data or error information is available. If + ``waitForResults`` parameter in the request is set to true, user will get a 200 response if the + request is finished under 120 seconds. + + The maximum size of a matrix for this API is **700** (the number of origins multiplied by the + number of destinations). With that constraint in mind, examples of possible matrix dimensions + are: 50x10, 10x10, 28x25. 10x70 (it does not need to be square). + + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + + Here's a typical sequence of asynchronous operations: + + + #. + Client sends a Route Matrix POST request to Azure Maps + + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Route Matrix request has been accepted. + + HTTP ``Error`` - There was an error processing your Route Matrix request. This could + either be a 400 Bad Request or any other Error status code. + + + + #. + If the Matrix Route request was accepted successfully, the Location header in the response + contains the URL to download the results of the request. This status URI looks like the + following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + + #. Client issues a GET request on the download URL obtained in Step 3 to download the results + + Download Sync Results + ^^^^^^^^^^^^^^^^^^^^^ + + When you make a POST request for Route Matrix Sync API, the service returns 200 response code + for successful request and a response array. The response body will contain the data and there + will be no possibility to retrieve the results later. + + Download Async Results + ^^^^^^^^^^^^^^^^^^^^^^ + + When a request issues a ``202 Accepted`` response, the request is being processed using our + async pipeline. You will be given a URL to check the progress of your async request in the + location header of the response. This status URI looks like the following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + The URL provided by the location header will return the following responses when a ``GET`` + request is issued. + + .. + + HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try + again in some time. + + HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of + the results. + + :param post_route_matrix_request_body: The matrix of origin and destination coordinates to + compute the route distance, travel time and other summary for each cell of the matrix based on + the input parameters. The minimum and the maximum cell count supported are 1 and **700** for + async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations + or 25 origins and 25 destinations for async API. + :type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :param wait_for_results: Boolean to indicate whether to execute the request synchronously. If + set to true, user will get a 200 response if the request is finished under 120 seconds. + Otherwise, user will get a 202 response right away. Please refer to the API description for + more details on 202 response. **Supported only for async request**. + :type wait_for_results: bool + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + :type vehicle_weight: int + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteMatrixResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteMatrixResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteMatrixResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_route_matrix_initial( + post_route_matrix_request_body=post_route_matrix_request_body, + format=format, + wait_for_results=wait_for_results, + compute_travel_time_for=compute_travel_time_for, + section_type=section_type, + arrive_at=arrive_at, + depart_at=depart_at, + vehicle_axle_weight=vehicle_axle_weight, + vehicle_length=vehicle_length, + vehicle_height=vehicle_height, + vehicle_width=vehicle_width, + vehicle_max_speed=vehicle_max_speed, + vehicle_weight=vehicle_weight, + windingness=windingness, + hilliness=hilliness, + travel_mode=travel_mode, + avoid=avoid, + traffic=traffic, + route_type=route_type, + vehicle_load_type=vehicle_load_type, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_route_matrix.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + async def _get_route_matrix_initial( + self, + format: str, + **kwargs: Any + ) -> Optional["_models.RouteMatrixResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteMatrixResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_route_matrix_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_route_matrix_initial.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + async def begin_get_route_matrix( + self, + format: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.RouteMatrixResponse"]: + """If the Matrix Route request was accepted successfully, the Location header in the response + contains the URL to download the results of the request. This status URI looks like the + following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + + #. Client issues a GET request on the download URL obtained in Step 3 to download the results + + Download Sync Results + ^^^^^^^^^^^^^^^^^^^^^ + + When you make a POST request for Route Matrix Sync API, the service returns 200 response code + for successful request and a response array. The response body will contain the data and there + will be no possibility to retrieve the results later. + + Download Async Results + ^^^^^^^^^^^^^^^^^^^^^^ + + When a request issues a ``202 Accepted`` response, the request is being processed using our + async pipeline. You will be given a URL to check the progress of your async request in the + location header of the response. This status URI looks like the following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + The URL provided by the location header will return the following responses when a ``GET`` + request is issued. + + .. + + HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try + again in some time. + + HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of + the results. + + :param format: Matrix id received after the Matrix Route request was accepted successfully. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteMatrixResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteMatrixResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteMatrixResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_route_matrix_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_route_matrix.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + async def post_route_matrix_sync( + self, + post_route_matrix_request_body: "_models.PostRouteMatrixRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + wait_for_results: Optional[bool] = None, + compute_travel_time_for: Optional[Union[str, "_models.ComputeTravelTimeFor"]] = None, + section_type: Optional[Union[str, "_models.SectionType"]] = None, + arrive_at: Optional[datetime.datetime] = None, + depart_at: Optional[datetime.datetime] = None, + vehicle_axle_weight: Optional[int] = None, + vehicle_length: Optional[float] = None, + vehicle_height: Optional[float] = None, + vehicle_width: Optional[float] = None, + vehicle_max_speed: Optional[int] = None, + vehicle_weight: Optional[int] = None, + windingness: Optional[Union[str, "_models.WindingnessLevel"]] = None, + hilliness: Optional[Union[str, "_models.HillinessDegree"]] = None, + travel_mode: Optional[Union[str, "_models.TravelMode"]] = None, + avoid: Optional[List[Union[str, "_models.RouteAvoidType"]]] = None, + traffic: Optional[bool] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + vehicle_load_type: Optional[Union[str, "_models.VehicleLoadType"]] = None, + **kwargs: Any + ) -> "_models.RouteMatrixResponse": + """**Applies to**\ : S1 pricing tier. + + The Matrix Routing service allows calculation of a matrix of route summaries for a set of + routes defined by origin and destination locations by using an asynchronous (async) or + synchronous (sync) POST request. For every given origin, the service calculates the cost of + routing from that origin to every given destination. The set of origins and the set of + destinations can be thought of as the column and row headers of a table and each cell in the + table contains the costs of routing from the origin to the destination for that cell. As an + example, let's say a food delivery company has 20 drivers and they need to find the closest + driver to pick up the delivery from the restaurant. To solve this use case, they can call + Matrix Route API. + + For each route, the travel times and distances are returned. You can use the computed costs to + determine which detailed routes to calculate using the Route Directions API. + + The maximum size of a matrix for async request is **700** and for sync request it's **100** + (the number of origins multiplied by the number of destinations). + + Submit Synchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If your scenario requires synchronous requests and the maximum size of the matrix is less than + or equal to 100, you might want to make synchronous request. The maximum size of a matrix for + this API is **100** (the number of origins multiplied by the number of destinations). With that + constraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not + need to be square). + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex routing + requests. When you make a request by using async request, by default the service returns a 202 + response code along a redirect URL in the Location field of the response header. This URL + should be checked periodically until the response data or error information is available. If + ``waitForResults`` parameter in the request is set to true, user will get a 200 response if the + request is finished under 120 seconds. + + The maximum size of a matrix for this API is **700** (the number of origins multiplied by the + number of destinations). With that constraint in mind, examples of possible matrix dimensions + are: 50x10, 10x10, 28x25. 10x70 (it does not need to be square). + + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + + Here's a typical sequence of asynchronous operations: + + + #. + Client sends a Route Matrix POST request to Azure Maps + + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Route Matrix request has been accepted. + + HTTP ``Error`` - There was an error processing your Route Matrix request. This could + either be a 400 Bad Request or any other Error status code. + + + + #. + If the Matrix Route request was accepted successfully, the Location header in the response + contains the URL to download the results of the request. This status URI looks like the + following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + + #. Client issues a GET request on the download URL obtained in Step 3 to download the results + + Download Sync Results + ^^^^^^^^^^^^^^^^^^^^^ + + When you make a POST request for Route Matrix Sync API, the service returns 200 response code + for successful request and a response array. The response body will contain the data and there + will be no possibility to retrieve the results later. + + Download Async Results + ^^^^^^^^^^^^^^^^^^^^^^ + + When a request issues a ``202 Accepted`` response, the request is being processed using our + async pipeline. You will be given a URL to check the progress of your async request in the + location header of the response. This status URI looks like the following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + The URL provided by the location header will return the following responses when a ``GET`` + request is issued. + + .. + + HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try + again in some time. + + HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of + the results. + + :param post_route_matrix_request_body: The matrix of origin and destination coordinates to + compute the route distance, travel time and other summary for each cell of the matrix based on + the input parameters. The minimum and the maximum cell count supported are 1 and **700** for + async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations + or 25 origins and 25 destinations for async API. + :type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :param wait_for_results: Boolean to indicate whether to execute the request synchronously. If + set to true, user will get a 200 response if the request is finished under 120 seconds. + Otherwise, user will get a 202 response right away. Please refer to the API description for + more details on 202 response. **Supported only for async request**. + :type wait_for_results: bool + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + :type vehicle_weight: int + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteMatrixResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteMatrixResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteMatrixResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_route_matrix_sync.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 wait_for_results is not None: + query_parameters['waitForResults'] = self._serialize.query("wait_for_results", wait_for_results, 'bool') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_matrix_request_body, 'PostRouteMatrixRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('RouteMatrixResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_route_matrix_sync.metadata = {'url': '/route/matrix/sync/{format}'} # type: ignore + + async def get_route_directions( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + max_alternatives: Optional[int] = None, + alternative_type: Optional[Union[str, "_models.AlternativeRouteType"]] = None, + min_deviation_distance: Optional[int] = None, + arrive_at: Optional[datetime.datetime] = None, + depart_at: Optional[datetime.datetime] = None, + min_deviation_time: Optional[int] = None, + instructions_type: Optional[Union[str, "_models.RouteInstructionsType"]] = None, + language: Optional[str] = None, + compute_best_order: Optional[bool] = None, + route_representation: Optional[Union[str, "_models.RouteRepresentation"]] = None, + compute_travel_time_for: Optional[Union[str, "_models.ComputeTravelTimeFor"]] = None, + vehicle_heading: Optional[int] = None, + report: Optional[str] = None, + section_type: Optional[Union[str, "_models.SectionType"]] = None, + vehicle_axle_weight: Optional[int] = None, + vehicle_width: Optional[float] = None, + vehicle_height: Optional[float] = None, + vehicle_length: Optional[float] = None, + vehicle_max_speed: Optional[int] = None, + vehicle_weight: Optional[int] = None, + vehicle_commercial: Optional[bool] = None, + windingness: Optional[Union[str, "_models.WindingnessLevel"]] = None, + hilliness: Optional[Union[str, "_models.HillinessDegree"]] = None, + travel_mode: Optional[Union[str, "_models.TravelMode"]] = None, + avoid: Optional[List[Union[str, "_models.RouteAvoidType"]]] = None, + traffic: Optional[bool] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + vehicle_load_type: Optional[Union[str, "_models.VehicleLoadType"]] = None, + vehicle_engine_type: Optional[Union[str, "_models.VehicleEngineType"]] = None, + constant_speed_consumption_in_liters_per_hundredkm: Optional[float] = None, + current_fuel_in_liters: Optional[float] = None, + auxiliary_power_in_liters_per_hour: Optional[float] = None, + fuel_energy_density_in_m_joules_per_liter: Optional[float] = None, + acceleration_efficiency: Optional[float] = None, + deceleration_efficiency: Optional[float] = None, + uphill_efficiency: Optional[float] = None, + downhill_efficiency: Optional[float] = None, + constant_speed_consumption_ink_wh_per_hundredkm: Optional[str] = None, + current_charge_ink_wh: Optional[str] = None, + max_charge_ink_wh: Optional[str] = None, + auxiliary_power_ink_w: Optional[str] = None, + **kwargs: Any + ) -> "_models.RouteDirectionsResponse": + """**Applies to**\ : S0 and S1 pricing tiers. + + Returns a route between an origin and a destination, passing through waypoints if they are + specified. The route will take into account factors such as current traffic and the typical + road speeds on the requested day of the week and time of day. + + Information returned includes the distance, estimated travel time, and a representation of the + route geometry. Additional routing information such as optimized waypoint order or turn by turn + instructions is also available, depending on the options selected. + + Routing service provides a set of parameters for a detailed description of vehicle-specific + Consumption Model. Please check `Consumption Model + `_ for detailed explanation of + the concepts and parameters involved. + + :param query: The Coordinates through which the route is calculated, delimited by a colon. A + minimum of two coordinates is required. The first one is the origin and the last is the + destination of the route. Optional coordinates in-between act as WayPoints in the route. You + can pass up to 150 WayPoints. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.route.models.ResponseFormat + :param max_alternatives: Number of desired alternative routes to be calculated. Default: 0, + minimum: 0 and maximum: 5. + :type max_alternatives: int + :param alternative_type: Controls the optimality, with respect to the given planning criteria, + of the calculated alternatives compared to the reference route. + :type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType + :param min_deviation_distance: All alternative routes returned will follow the reference route + (see section POST Requests) from the origin point of the calculateRoute request for at least + this number of meters. Can only be used when reconstructing a route. The minDeviationDistance + parameter cannot be used in conjunction with arriveAt. + :type min_deviation_distance: int + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param min_deviation_time: All alternative routes returned will follow the reference route (see + section POST Requests) from the origin point of the calculateRoute request for at least this + number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter + cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to + a value greater than zero has the following consequences: + + + * The origin point of the *calculateRoute* Request must be on + (or very near) the input reference route. + + * If this is not the case, an error is returned. + * However, the origin point does not need to be at the beginning + of the input reference route (it can be thought of as the current + vehicle position on the reference route). + + * The reference route, returned as the first route in the *calculateRoute* + Response, will start at the origin point specified in the *calculateRoute* + Request. The initial part of the input reference route up until the origin + point will be excluded from the Response. + * The values of *minDeviationDistance* and *minDeviationTime* determine + how far alternative routes will be guaranteed to follow the reference + route from the origin point onwards. + * The route must use *departAt*. + * The *vehicleHeading* is ignored. + :type min_deviation_time: int + :param instructions_type: If specified, guidance instructions will be returned. Note that the + instructionsType parameter cannot be used in conjunction with routeRepresentation=none. + :type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType + :param language: The language parameter determines the language of the guidance messages. + Proper nouns (the names of streets, plazas, etc.) are returned in the specified language, or + if that is not available, they are returned in an available language that is close to it. + Allowed values are (a subset of) the IETF language tags. The currently supported languages are + listed in the `Supported languages section + `_. + + Default value: en-GB. + :type language: str + :param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to + reduce the route length. Yields best results when used in conjunction with routeType + *shortest*. Notice that origin and destination are excluded from the optimized waypoint + indices. To include origin and destination in the response, please increase all the indices by + 1 to account for the origin, and then add the destination as the final index. Possible values + are true or false. True computes a better order if possible, but is not allowed to be used in + conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints. + False will use the locations in the given order and not allowed to be used in conjunction with + routeRepresentation *none*. + :type compute_best_order: bool + :param route_representation: Specifies the representation of the set of routes provided as + response. This parameter value can only be used in conjunction with computeBestOrder=true. + :type route_representation: str or ~azure.maps.route.models.RouteRepresentation + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param vehicle_heading: The directional heading of the vehicle in degrees starting at true + North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is + 180 degrees, west is 270 degrees. Possible values 0-359. + :type vehicle_heading: int + :param report: Specifies which data should be reported for diagnosis purposes. The only + possible value is *effectiveSettings*. Reports the effective parameters or data used when + calling the API. In the case of defaulted parameters the default will be reflected where the + parameter was not specified by the caller. + :type report: str + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + + + * + It is mandatory if any of the *Efficiency parameters are set. + + * + It must be strictly positive when used in the context of the Consumption Model. Weight + restrictions are considered. + + * + If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is + non-zero, then weight restrictions are considered. + + * + In all other cases, this parameter is ignored. + + Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900. + :type vehicle_weight: int + :param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed + to drive on some roads. + :type vehicle_commercial: bool + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is + specified, it must be consistent with the value of **vehicleEngineType**. + :type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType + :param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent + component of consumption. + + Provided as an unordered list of colon-delimited speed & consumption-rate pairs. The list + defines points on a consumption curve. Consumption rates for speeds not in the list are found + as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0. + + Sensible Values : 50,6.3:130,11.5 + + **Note** : This parameter is required for **The Combustion Consumption Model**. + :type constant_speed_consumption_in_liters_per_hundredkm: float + :param current_fuel_in_liters: Specifies the current supply of fuel in liters. + + Sensible Values : 55. + :type current_fuel_in_liters: float + :param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining + auxiliary systems of the vehicle, in liters per hour. + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 0.2. + :type auxiliary_power_in_liters_per_hour: float + :param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy + stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the + ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For + example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. + + This parameter is required if any ***Efficiency** parameter is set. + + Sensible Values : 34.2. + :type fuel_energy_density_in_m_joules_per_liter: float + :param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored + in fuel to kinetic energy when the vehicle accelerates *(i.e. + KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting + consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **decelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **decelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66. + :type acceleration_efficiency: float + :param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved + (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost). + ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using + **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **accelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **accelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91. + :type deceleration_efficiency: float + :param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel + to potential energy when the vehicle gains elevation *(i.e. + PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by + converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **downhillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **downhillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74. + :type uphill_efficiency: float + :param downhill_efficiency: Specifies the efficiency of converting potential energy to saved + (not consumed) fuel when the vehicle loses elevation *(i.e. + ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved + (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **uphillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **uphillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73. + :type downhill_efficiency: float + :param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component + of consumption. + + Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a + consumption curve. Consumption rates for speeds not in the list are found as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and + 100000.0. + + Sensible Values : 50,8.2:130,21.3 + + This parameter is required for **Electric consumption model**. + :type constant_speed_consumption_ink_wh_per_hundredkm: str + :param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours + (kWh). + + This parameter co-exists with **maxChargeInkWh** parameter. + + The range of values allowed are 0.0 to **maxChargeInkWh**. + + Sensible Values : 43. + :type current_charge_ink_wh: str + :param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh) + that may be stored in the vehicle's battery. + + This parameter co-exists with **currentChargeInkWh** parameter. + + Minimum value has to be greater than or equal to **currentChargeInkWh**. + + Sensible Values : 85. + :type max_charge_ink_wh: str + :param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary + systems, in kilowatts (kW). + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 1.7. + :type auxiliary_power_ink_w: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteDirectionsResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteDirectionsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_route_directions.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['query'] = self._serialize.query("query", query, 'str') + if max_alternatives is not None: + query_parameters['maxAlternatives'] = self._serialize.query("max_alternatives", max_alternatives, 'int', maximum=5, minimum=0) + if alternative_type is not None: + query_parameters['alternativeType'] = self._serialize.query("alternative_type", alternative_type, 'str') + if min_deviation_distance is not None: + query_parameters['minDeviationDistance'] = self._serialize.query("min_deviation_distance", min_deviation_distance, 'int') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if min_deviation_time is not None: + query_parameters['minDeviationTime'] = self._serialize.query("min_deviation_time", min_deviation_time, 'int') + if instructions_type is not None: + query_parameters['instructionsType'] = self._serialize.query("instructions_type", instructions_type, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if compute_best_order is not None: + query_parameters['computeBestOrder'] = self._serialize.query("compute_best_order", compute_best_order, 'bool') + if route_representation is not None: + query_parameters['routeRepresentation'] = self._serialize.query("route_representation", route_representation, 'str') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if vehicle_heading is not None: + query_parameters['vehicleHeading'] = self._serialize.query("vehicle_heading", vehicle_heading, 'int', maximum=359, minimum=0) + if report is not None: + query_parameters['report'] = self._serialize.query("report", report, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if vehicle_commercial is not None: + query_parameters['vehicleCommercial'] = self._serialize.query("vehicle_commercial", vehicle_commercial, 'bool') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, 'str') + if vehicle_engine_type is not None: + query_parameters['vehicleEngineType'] = self._serialize.query("vehicle_engine_type", vehicle_engine_type, 'str') + if constant_speed_consumption_in_liters_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInLitersPerHundredkm'] = self._serialize.query("constant_speed_consumption_in_liters_per_hundredkm", constant_speed_consumption_in_liters_per_hundredkm, 'float') + if current_fuel_in_liters is not None: + query_parameters['currentFuelInLiters'] = self._serialize.query("current_fuel_in_liters", current_fuel_in_liters, 'float') + if auxiliary_power_in_liters_per_hour is not None: + query_parameters['auxiliaryPowerInLitersPerHour'] = self._serialize.query("auxiliary_power_in_liters_per_hour", auxiliary_power_in_liters_per_hour, 'float') + if fuel_energy_density_in_m_joules_per_liter is not None: + query_parameters['fuelEnergyDensityInMJoulesPerLiter'] = self._serialize.query("fuel_energy_density_in_m_joules_per_liter", fuel_energy_density_in_m_joules_per_liter, 'float') + if acceleration_efficiency is not None: + query_parameters['accelerationEfficiency'] = self._serialize.query("acceleration_efficiency", acceleration_efficiency, 'float') + if deceleration_efficiency is not None: + query_parameters['decelerationEfficiency'] = self._serialize.query("deceleration_efficiency", deceleration_efficiency, 'float') + if uphill_efficiency is not None: + query_parameters['uphillEfficiency'] = self._serialize.query("uphill_efficiency", uphill_efficiency, 'float') + if downhill_efficiency is not None: + query_parameters['downhillEfficiency'] = self._serialize.query("downhill_efficiency", downhill_efficiency, 'float') + if constant_speed_consumption_ink_wh_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInkWhPerHundredkm'] = self._serialize.query("constant_speed_consumption_ink_wh_per_hundredkm", constant_speed_consumption_ink_wh_per_hundredkm, 'str') + if current_charge_ink_wh is not None: + query_parameters['currentChargeInkWh'] = self._serialize.query("current_charge_ink_wh", current_charge_ink_wh, 'str') + if max_charge_ink_wh is not None: + query_parameters['maxChargeInkWh'] = self._serialize.query("max_charge_ink_wh", max_charge_ink_wh, 'str') + if auxiliary_power_ink_w is not None: + query_parameters['auxiliaryPowerInkW'] = self._serialize.query("auxiliary_power_ink_w", auxiliary_power_ink_w, '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('RouteDirectionsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_directions.metadata = {'url': '/route/directions/{format}'} # type: ignore + + async def post_route_directions( + self, + query: str, + post_route_directions_request_body: "_models.PostRouteDirectionsRequestBody", + format: Union[str, "_models.ResponseFormat"] = "json", + max_alternatives: Optional[int] = None, + alternative_type: Optional[Union[str, "_models.AlternativeRouteType"]] = None, + min_deviation_distance: Optional[int] = None, + min_deviation_time: Optional[int] = None, + instructions_type: Optional[Union[str, "_models.RouteInstructionsType"]] = None, + language: Optional[str] = None, + compute_best_order: Optional[bool] = None, + route_representation: Optional[Union[str, "_models.RouteRepresentation"]] = None, + compute_travel_time_for: Optional[Union[str, "_models.ComputeTravelTimeFor"]] = None, + vehicle_heading: Optional[int] = None, + report: Optional[str] = None, + section_type: Optional[Union[str, "_models.SectionType"]] = None, + arrive_at: Optional[datetime.datetime] = None, + depart_at: Optional[datetime.datetime] = None, + vehicle_axle_weight: Optional[int] = None, + vehicle_length: Optional[float] = None, + vehicle_height: Optional[float] = None, + vehicle_width: Optional[float] = None, + vehicle_max_speed: Optional[int] = None, + vehicle_weight: Optional[int] = None, + vehicle_commercial: Optional[bool] = None, + windingness: Optional[Union[str, "_models.WindingnessLevel"]] = None, + hilliness: Optional[Union[str, "_models.HillinessDegree"]] = None, + travel_mode: Optional[Union[str, "_models.TravelMode"]] = None, + avoid: Optional[List[Union[str, "_models.RouteAvoidType"]]] = None, + traffic: Optional[bool] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + vehicle_load_type: Optional[Union[str, "_models.VehicleLoadType"]] = None, + vehicle_engine_type: Optional[Union[str, "_models.VehicleEngineType"]] = None, + constant_speed_consumption_in_liters_per_hundredkm: Optional[float] = None, + current_fuel_in_liters: Optional[float] = None, + auxiliary_power_in_liters_per_hour: Optional[float] = None, + fuel_energy_density_in_m_joules_per_liter: Optional[float] = None, + acceleration_efficiency: Optional[float] = None, + deceleration_efficiency: Optional[float] = None, + uphill_efficiency: Optional[float] = None, + downhill_efficiency: Optional[float] = None, + constant_speed_consumption_ink_wh_per_hundredkm: Optional[str] = None, + current_charge_ink_wh: Optional[str] = None, + max_charge_ink_wh: Optional[str] = None, + auxiliary_power_ink_w: Optional[str] = None, + **kwargs: Any + ) -> "_models.RouteDirectionsResponse": + """**Applies to**\ : S0 and S1 pricing tiers. + + Returns a route between an origin and a destination, passing through waypoints if they are + specified. The route will take into account factors such as current traffic and the typical + road speeds on the requested day of the week and time of day. + + Information returned includes the distance, estimated travel time, and a representation of the + route geometry. Additional routing information such as optimized waypoint order or turn by turn + instructions is also available, depending on the options selected. + + Routing service provides a set of parameters for a detailed description of a vehicle-specific + Consumption Model. Please check `Consumption Model + `_ for detailed explanation of + the concepts and parameters involved. + + :param query: The Coordinates through which the route is calculated. Needs two coordinates at + least. Delimited by colon. First one is the origin and the last is the destination of the + route. The coordinates are in a lat,long format. Optional coordinates in between act as + WayPoints in the route. + :type query: str + :param post_route_directions_request_body: Used for reconstructing a route and for calculating + zero or more alternative routes to this reference route. The provided sequence of coordinates + is used as input for route reconstruction. The alternative routes are calculated between the + origin and destination points specified in the base path parameter locations. If both + minDeviationDistance and minDeviationTime are set to zero, then these origin and destination + points are expected to be at (or very near) the beginning and end of the reference route, + respectively. Intermediate locations (waypoints) are not supported when using + supportingPoints. + + Setting at least one of minDeviationDistance or minDeviationTime to a value greater than zero + has the following consequences: + + + * The origin point of the calculateRoute request must be on (or very near) the input reference + route. If this is not the case, an error is returned. However, the origin point does not need + to be at the beginning of the input reference route (it can be thought of as the current + vehicle position on the reference route). + * The reference route, returned as the first route in the calculateRoute response, will start + at the origin point specified in the calculateRoute request. The initial part of the input + reference route up until the origin point will be excluded from the response. + * The values of minDeviationDistance and minDeviationTime determine how far alternative routes + will be guaranteed to follow the reference route from the origin point onwards. + * The route must use departAt. + * The vehicleHeading is ignored. + :type post_route_directions_request_body: ~azure.maps.route.models.PostRouteDirectionsRequestBody + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.route.models.ResponseFormat + :param max_alternatives: Number of desired alternative routes to be calculated. Default: 0, + minimum: 0 and maximum: 5. + :type max_alternatives: int + :param alternative_type: Controls the optimality, with respect to the given planning criteria, + of the calculated alternatives compared to the reference route. + :type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType + :param min_deviation_distance: All alternative routes returned will follow the reference route + (see section POST Requests) from the origin point of the calculateRoute request for at least + this number of meters. Can only be used when reconstructing a route. The minDeviationDistance + parameter cannot be used in conjunction with arriveAt. + :type min_deviation_distance: int + :param min_deviation_time: All alternative routes returned will follow the reference route (see + section POST Requests) from the origin point of the calculateRoute request for at least this + number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter + cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to + a value greater than zero has the following consequences: + + + * The origin point of the *calculateRoute* Request must be on + (or very near) the input reference route. + + * If this is not the case, an error is returned. + * However, the origin point does not need to be at the beginning + of the input reference route (it can be thought of as the current + vehicle position on the reference route). + + * The reference route, returned as the first route in the *calculateRoute* + Response, will start at the origin point specified in the *calculateRoute* + Request. The initial part of the input reference route up until the origin + point will be excluded from the Response. + * The values of *minDeviationDistance* and *minDeviationTime* determine + how far alternative routes will be guaranteed to follow the reference + route from the origin point onwards. + * The route must use *departAt*. + * The *vehicleHeading* is ignored. + :type min_deviation_time: int + :param instructions_type: If specified, guidance instructions will be returned. Note that the + instructionsType parameter cannot be used in conjunction with routeRepresentation=none. + :type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType + :param language: The language parameter determines the language of the guidance messages. It + does not affect proper nouns (the names of streets, plazas, etc.) It has no effect when + instructionsType=coded. Allowed values are (a subset of) the IETF language tags described. + :type language: str + :param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to + reduce the route length. Yields best results when used in conjunction with routeType + *shortest*. Notice that origin and destination are excluded from the optimized waypoint + indices. To include origin and destination in the response, please increase all the indices by + 1 to account for the origin, and then add the destination as the final index. Possible values + are true or false. True computes a better order if possible, but is not allowed to be used in + conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints. + False will use the locations in the given order and not allowed to be used in conjunction with + routeRepresentation *none*. + :type compute_best_order: bool + :param route_representation: Specifies the representation of the set of routes provided as + response. This parameter value can only be used in conjunction with computeBestOrder=true. + :type route_representation: str or ~azure.maps.route.models.RouteRepresentation + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param vehicle_heading: The directional heading of the vehicle in degrees starting at true + North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is + 180 degrees, west is 270 degrees. Possible values 0-359. + :type vehicle_heading: int + :param report: Specifies which data should be reported for diagnosis purposes. The only + possible value is *effectiveSettings*. Reports the effective parameters or data used when + calling the API. In the case of defaulted parameters the default will be reflected where the + parameter was not specified by the caller. + :type report: str + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + + + * + It is mandatory if any of the *Efficiency parameters are set. + + * + It must be strictly positive when used in the context of the Consumption Model. Weight + restrictions are considered. + + * + If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is + non-zero, then weight restrictions are considered. + + * + In all other cases, this parameter is ignored. + + Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900. + :type vehicle_weight: int + :param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed + to drive on some roads. + :type vehicle_commercial: bool + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is + specified, it must be consistent with the value of **vehicleEngineType**. + :type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType + :param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent + component of consumption. + + Provided as an unordered list of colon-delimited speed & consumption-rate pairs. The list + defines points on a consumption curve. Consumption rates for speeds not in the list are found + as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0. + + Sensible Values : 50,6.3:130,11.5 + + **Note** : This parameter is required for **The Combustion Consumption Model**. + :type constant_speed_consumption_in_liters_per_hundredkm: float + :param current_fuel_in_liters: Specifies the current supply of fuel in liters. + + Sensible Values : 55. + :type current_fuel_in_liters: float + :param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining + auxiliary systems of the vehicle, in liters per hour. + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 0.2. + :type auxiliary_power_in_liters_per_hour: float + :param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy + stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the + ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For + example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. + + This parameter is required if any ***Efficiency** parameter is set. + + Sensible Values : 34.2. + :type fuel_energy_density_in_m_joules_per_liter: float + :param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored + in fuel to kinetic energy when the vehicle accelerates *(i.e. + KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting + consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **decelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **decelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66. + :type acceleration_efficiency: float + :param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved + (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost). + ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using + **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **accelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **accelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91. + :type deceleration_efficiency: float + :param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel + to potential energy when the vehicle gains elevation *(i.e. + PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by + converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **downhillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **downhillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74. + :type uphill_efficiency: float + :param downhill_efficiency: Specifies the efficiency of converting potential energy to saved + (not consumed) fuel when the vehicle loses elevation *(i.e. + ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved + (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **uphillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **uphillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73. + :type downhill_efficiency: float + :param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component + of consumption. + + Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a + consumption curve. Consumption rates for speeds not in the list are found as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and + 100000.0. + + Sensible Values : 50,8.2:130,21.3 + + This parameter is required for **Electric consumption model**. + :type constant_speed_consumption_ink_wh_per_hundredkm: str + :param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours + (kWh). + + This parameter co-exists with **maxChargeInkWh** parameter. + + The range of values allowed are 0.0 to **maxChargeInkWh**. + + Sensible Values : 43. + :type current_charge_ink_wh: str + :param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh) + that may be stored in the vehicle's battery. + + This parameter co-exists with **currentChargeInkWh** parameter. + + Minimum value has to be greater than or equal to **currentChargeInkWh**. + + Sensible Values : 85. + :type max_charge_ink_wh: str + :param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary + systems, in kilowatts (kW). + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 1.7. + :type auxiliary_power_ink_w: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteDirectionsResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteDirectionsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_route_directions.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['query'] = self._serialize.query("query", query, 'str') + if max_alternatives is not None: + query_parameters['maxAlternatives'] = self._serialize.query("max_alternatives", max_alternatives, 'int', maximum=5, minimum=0) + if alternative_type is not None: + query_parameters['alternativeType'] = self._serialize.query("alternative_type", alternative_type, 'str') + if min_deviation_distance is not None: + query_parameters['minDeviationDistance'] = self._serialize.query("min_deviation_distance", min_deviation_distance, 'int') + if min_deviation_time is not None: + query_parameters['minDeviationTime'] = self._serialize.query("min_deviation_time", min_deviation_time, 'int') + if instructions_type is not None: + query_parameters['instructionsType'] = self._serialize.query("instructions_type", instructions_type, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if compute_best_order is not None: + query_parameters['computeBestOrder'] = self._serialize.query("compute_best_order", compute_best_order, 'bool') + if route_representation is not None: + query_parameters['routeRepresentation'] = self._serialize.query("route_representation", route_representation, 'str') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if vehicle_heading is not None: + query_parameters['vehicleHeading'] = self._serialize.query("vehicle_heading", vehicle_heading, 'int', maximum=359, minimum=0) + if report is not None: + query_parameters['report'] = self._serialize.query("report", report, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if vehicle_commercial is not None: + query_parameters['vehicleCommercial'] = self._serialize.query("vehicle_commercial", vehicle_commercial, 'bool') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, 'str') + if vehicle_engine_type is not None: + query_parameters['vehicleEngineType'] = self._serialize.query("vehicle_engine_type", vehicle_engine_type, 'str') + if constant_speed_consumption_in_liters_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInLitersPerHundredkm'] = self._serialize.query("constant_speed_consumption_in_liters_per_hundredkm", constant_speed_consumption_in_liters_per_hundredkm, 'float') + if current_fuel_in_liters is not None: + query_parameters['currentFuelInLiters'] = self._serialize.query("current_fuel_in_liters", current_fuel_in_liters, 'float') + if auxiliary_power_in_liters_per_hour is not None: + query_parameters['auxiliaryPowerInLitersPerHour'] = self._serialize.query("auxiliary_power_in_liters_per_hour", auxiliary_power_in_liters_per_hour, 'float') + if fuel_energy_density_in_m_joules_per_liter is not None: + query_parameters['fuelEnergyDensityInMJoulesPerLiter'] = self._serialize.query("fuel_energy_density_in_m_joules_per_liter", fuel_energy_density_in_m_joules_per_liter, 'float') + if acceleration_efficiency is not None: + query_parameters['accelerationEfficiency'] = self._serialize.query("acceleration_efficiency", acceleration_efficiency, 'float') + if deceleration_efficiency is not None: + query_parameters['decelerationEfficiency'] = self._serialize.query("deceleration_efficiency", deceleration_efficiency, 'float') + if uphill_efficiency is not None: + query_parameters['uphillEfficiency'] = self._serialize.query("uphill_efficiency", uphill_efficiency, 'float') + if downhill_efficiency is not None: + query_parameters['downhillEfficiency'] = self._serialize.query("downhill_efficiency", downhill_efficiency, 'float') + if constant_speed_consumption_ink_wh_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInkWhPerHundredkm'] = self._serialize.query("constant_speed_consumption_ink_wh_per_hundredkm", constant_speed_consumption_ink_wh_per_hundredkm, 'str') + if current_charge_ink_wh is not None: + query_parameters['currentChargeInkWh'] = self._serialize.query("current_charge_ink_wh", current_charge_ink_wh, 'str') + if max_charge_ink_wh is not None: + query_parameters['maxChargeInkWh'] = self._serialize.query("max_charge_ink_wh", max_charge_ink_wh, 'str') + if auxiliary_power_ink_w is not None: + query_parameters['auxiliaryPowerInkW'] = self._serialize.query("auxiliary_power_ink_w", auxiliary_power_ink_w, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_directions_request_body, 'PostRouteDirectionsRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('RouteDirectionsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_route_directions.metadata = {'url': '/route/directions/{format}'} # type: ignore + + async def get_route_range( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + fuel_budget_in_liters: Optional[float] = None, + energy_budget_ink_wh: Optional[float] = None, + time_budget_in_sec: Optional[float] = None, + distance_budget_in_meters: Optional[float] = None, + depart_at: Optional[datetime.datetime] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + traffic: Optional[bool] = None, + avoid: Optional[List[Union[str, "_models.RouteAvoidType"]]] = None, + travel_mode: Optional[Union[str, "_models.TravelMode"]] = None, + hilliness: Optional[Union[str, "_models.HillinessDegree"]] = None, + windingness: Optional[Union[str, "_models.WindingnessLevel"]] = None, + vehicle_axle_weight: Optional[int] = None, + vehicle_width: Optional[float] = None, + vehicle_height: Optional[float] = None, + vehicle_length: Optional[float] = None, + vehicle_max_speed: Optional[int] = None, + vehicle_weight: Optional[int] = None, + vehicle_commercial: Optional[bool] = None, + vehicle_load_type: Optional[Union[str, "_models.VehicleLoadType"]] = None, + vehicle_engine_type: Optional[Union[str, "_models.VehicleEngineType"]] = None, + constant_speed_consumption_in_liters_per_hundredkm: Optional[float] = None, + current_fuel_in_liters: Optional[float] = None, + auxiliary_power_in_liters_per_hour: Optional[float] = None, + fuel_energy_density_in_m_joules_per_liter: Optional[float] = None, + acceleration_efficiency: Optional[float] = None, + deceleration_efficiency: Optional[float] = None, + uphill_efficiency: Optional[float] = None, + downhill_efficiency: Optional[float] = None, + constant_speed_consumption_ink_wh_per_hundredkm: Optional[str] = None, + current_charge_ink_wh: Optional[str] = None, + max_charge_ink_wh: Optional[str] = None, + auxiliary_power_ink_w: Optional[str] = None, + **kwargs: Any + ) -> "_models.GetRouteRangeResponse": + """**Route Range (Isochrone) API** + + **Applies to**\ : S1 pricing tier. + + This service will calculate a set of locations that can be reached from the origin point based + on fuel, energy, time or distance budget that is specified. A polygon boundary (or Isochrone) + is returned in a counterclockwise orientation as well as the precise polygon center which was + the result of the origin point. + + The returned polygon can be used for further processing such as `Search Inside Geometry + `_ to search for + POIs within the provided Isochrone. + + :param query: The Coordinate from which the range calculation should start. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.route.models.ResponseFormat + :param fuel_budget_in_liters: Fuel budget in liters that determines maximal range which can be + travelled using the specified Combustion Consumption Model.:code:`
` When fuelBudgetInLiters + is used, it is mandatory to specify a detailed Combustion Consumption Model.:code:`
` + Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + distanceBudgetInMeters) must be used. + :type fuel_budget_in_liters: float + :param energy_budget_ink_wh: Electric energy budget in kilowatt hours (kWh) that determines + maximal range which can be travelled using the specified Electric Consumption + Model.:code:`
` When energyBudgetInkWh is used, it is mandatory to specify a detailed + Electric Consumption Model.:code:`
` Exactly one budget (fuelBudgetInLiters, + energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must be used. + :type energy_budget_ink_wh: float + :param time_budget_in_sec: Time budget in seconds that determines maximal range which can be + travelled using driving time. The Consumption Model will only affect the range when routeType + is eco.:code:`
` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, + or distanceBudgetInMeters) must be used. + :type time_budget_in_sec: float + :param distance_budget_in_meters: Distance budget in meters that determines maximal range which + can be travelled using driving distance. The Consumption Model will only affect the range when + routeType is eco.:code:`
` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, + timeBudgetInSec, or distanceBudgetInMeters) must be used. + :type distance_budget_in_meters: float + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + + + * + It is mandatory if any of the *Efficiency parameters are set. + + * + It must be strictly positive when used in the context of the Consumption Model. Weight + restrictions are considered. + + * + If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is + non-zero, then weight restrictions are considered. + + * + In all other cases, this parameter is ignored. + + Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900. + :type vehicle_weight: int + :param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed + to drive on some roads. + :type vehicle_commercial: bool + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is + specified, it must be consistent with the value of **vehicleEngineType**. + :type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType + :param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent + component of consumption. + + Provided as an unordered list of colon-delimited speed & consumption-rate pairs. The list + defines points on a consumption curve. Consumption rates for speeds not in the list are found + as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0. + + Sensible Values : 50,6.3:130,11.5 + + **Note** : This parameter is required for **The Combustion Consumption Model**. + :type constant_speed_consumption_in_liters_per_hundredkm: float + :param current_fuel_in_liters: Specifies the current supply of fuel in liters. + + Sensible Values : 55. + :type current_fuel_in_liters: float + :param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining + auxiliary systems of the vehicle, in liters per hour. + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 0.2. + :type auxiliary_power_in_liters_per_hour: float + :param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy + stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the + ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For + example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. + + This parameter is required if any ***Efficiency** parameter is set. + + Sensible Values : 34.2. + :type fuel_energy_density_in_m_joules_per_liter: float + :param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored + in fuel to kinetic energy when the vehicle accelerates *(i.e. + KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting + consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **decelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **decelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66. + :type acceleration_efficiency: float + :param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved + (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost). + ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using + **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **accelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **accelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91. + :type deceleration_efficiency: float + :param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel + to potential energy when the vehicle gains elevation *(i.e. + PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by + converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **downhillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **downhillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74. + :type uphill_efficiency: float + :param downhill_efficiency: Specifies the efficiency of converting potential energy to saved + (not consumed) fuel when the vehicle loses elevation *(i.e. + ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved + (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **uphillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **uphillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73. + :type downhill_efficiency: float + :param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component + of consumption. + + Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a + consumption curve. Consumption rates for speeds not in the list are found as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and + 100000.0. + + Sensible Values : 50,8.2:130,21.3 + + This parameter is required for **Electric consumption model**. + :type constant_speed_consumption_ink_wh_per_hundredkm: str + :param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours + (kWh). + + This parameter co-exists with **maxChargeInkWh** parameter. + + The range of values allowed are 0.0 to **maxChargeInkWh**. + + Sensible Values : 43. + :type current_charge_ink_wh: str + :param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh) + that may be stored in the vehicle's battery. + + This parameter co-exists with **currentChargeInkWh** parameter. + + Minimum value has to be greater than or equal to **currentChargeInkWh**. + + Sensible Values : 85. + :type max_charge_ink_wh: str + :param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary + systems, in kilowatts (kW). + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 1.7. + :type auxiliary_power_ink_w: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetRouteRangeResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.GetRouteRangeResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GetRouteRangeResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_route_range.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['query'] = self._serialize.query("query", query, 'str') + if fuel_budget_in_liters is not None: + query_parameters['fuelBudgetInLiters'] = self._serialize.query("fuel_budget_in_liters", fuel_budget_in_liters, 'float') + if energy_budget_ink_wh is not None: + query_parameters['energyBudgetInkWh'] = self._serialize.query("energy_budget_ink_wh", energy_budget_ink_wh, 'float') + if time_budget_in_sec is not None: + query_parameters['timeBudgetInSec'] = self._serialize.query("time_budget_in_sec", time_budget_in_sec, 'float') + if distance_budget_in_meters is not None: + query_parameters['distanceBudgetInMeters'] = self._serialize.query("distance_budget_in_meters", distance_budget_in_meters, 'float') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if vehicle_commercial is not None: + query_parameters['vehicleCommercial'] = self._serialize.query("vehicle_commercial", vehicle_commercial, 'bool') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, 'str') + if vehicle_engine_type is not None: + query_parameters['vehicleEngineType'] = self._serialize.query("vehicle_engine_type", vehicle_engine_type, 'str') + if constant_speed_consumption_in_liters_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInLitersPerHundredkm'] = self._serialize.query("constant_speed_consumption_in_liters_per_hundredkm", constant_speed_consumption_in_liters_per_hundredkm, 'float') + if current_fuel_in_liters is not None: + query_parameters['currentFuelInLiters'] = self._serialize.query("current_fuel_in_liters", current_fuel_in_liters, 'float') + if auxiliary_power_in_liters_per_hour is not None: + query_parameters['auxiliaryPowerInLitersPerHour'] = self._serialize.query("auxiliary_power_in_liters_per_hour", auxiliary_power_in_liters_per_hour, 'float') + if fuel_energy_density_in_m_joules_per_liter is not None: + query_parameters['fuelEnergyDensityInMJoulesPerLiter'] = self._serialize.query("fuel_energy_density_in_m_joules_per_liter", fuel_energy_density_in_m_joules_per_liter, 'float') + if acceleration_efficiency is not None: + query_parameters['accelerationEfficiency'] = self._serialize.query("acceleration_efficiency", acceleration_efficiency, 'float') + if deceleration_efficiency is not None: + query_parameters['decelerationEfficiency'] = self._serialize.query("deceleration_efficiency", deceleration_efficiency, 'float') + if uphill_efficiency is not None: + query_parameters['uphillEfficiency'] = self._serialize.query("uphill_efficiency", uphill_efficiency, 'float') + if downhill_efficiency is not None: + query_parameters['downhillEfficiency'] = self._serialize.query("downhill_efficiency", downhill_efficiency, 'float') + if constant_speed_consumption_ink_wh_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInkWhPerHundredkm'] = self._serialize.query("constant_speed_consumption_ink_wh_per_hundredkm", constant_speed_consumption_ink_wh_per_hundredkm, 'str') + if current_charge_ink_wh is not None: + query_parameters['currentChargeInkWh'] = self._serialize.query("current_charge_ink_wh", current_charge_ink_wh, 'str') + if max_charge_ink_wh is not None: + query_parameters['maxChargeInkWh'] = self._serialize.query("max_charge_ink_wh", max_charge_ink_wh, 'str') + if auxiliary_power_ink_w is not None: + query_parameters['auxiliaryPowerInkW'] = self._serialize.query("auxiliary_power_ink_w", auxiliary_power_ink_w, '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('GetRouteRangeResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_range.metadata = {'url': '/route/range/{format}'} # type: ignore + + async def _post_route_directions_batch_initial( + self, + post_route_directions_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> Optional["_models.RouteDirectionsBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteDirectionsBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_route_directions_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_directions_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_route_directions_batch_initial.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + async def begin_post_route_directions_batch( + self, + post_route_directions_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> AsyncLROPoller["_models.RouteDirectionsBatchResponse"]: + """**Route Directions Batch API** + + **Applies to**\ : S1 pricing tier. + + The Route Directions Batch API sends batches of queries to `Route Directions API + `_ using just a single + API call. You can call Route Directions Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **700** queries and sync API + up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex route + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **700** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Route Directions Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + ``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0`` + Note:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security + <#security>`_\ ) to the *status URI* before running it. :code:`
` + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *route directions* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 3 *route directions* + queries: + + .. code-block:: json + + { + "batchItems": [ + { "query": + "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + }, + { "query": + "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" }, + { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + ] + } + + A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *route directions* + `URI parameters + `_. The + string values in the *route directions* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **700** queries and sync API up to **100** queries, + and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``RouteDirectionsResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 1 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 1, + "totalRequests": 2 + }, + "batchItems": [ + { + "statusCode": 200, + "response": { + "routes": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "legs": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "points": [ + { + "latitude": 47.62094, + "longitude": -122.34892 + }, + { + "latitude": 47.62094, + "longitude": -122.3485 + }, + { + "latitude": 47.62095, + "longitude": -122.3476 + } + ] + } + ], + "sections": [ + { + "startPointIndex": 0, + "endPointIndex": 40, + "sectionType": "TRAVEL_MODE", + "travelMode": "bicycle" + } + ] + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param post_route_directions_batch_request_body: The list of route directions queries/requests + to process. The list can contain a max of 700 queries for async and 100 queries for sync + version and must contain at least 1 query. + :type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_route_directions_batch_initial( + post_route_directions_batch_request_body=post_route_directions_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_route_directions_batch.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + async def _get_route_directions_batch_initial( + self, + format: str, + **kwargs: Any + ) -> Optional["_models.RouteDirectionsBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteDirectionsBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_route_directions_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_route_directions_batch_initial.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + async def begin_get_route_directions_batch( + self, + format: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.RouteDirectionsBatchResponse"]: + """Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``RouteDirectionsResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 1 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 1, + "totalRequests": 2 + }, + "batchItems": [ + { + "statusCode": 200, + "response": { + "routes": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "legs": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "points": [ + { + "latitude": 47.62094, + "longitude": -122.34892 + }, + { + "latitude": 47.62094, + "longitude": -122.3485 + }, + { + "latitude": 47.62095, + "longitude": -122.3476 + } + ] + } + ], + "sections": [ + { + "startPointIndex": 0, + "endPointIndex": 40, + "sectionType": "TRAVEL_MODE", + "travelMode": "bicycle" + } + ] + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_route_directions_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_route_directions_batch.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + async def post_route_directions_batch_sync( + self, + post_route_directions_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.RouteDirectionsBatchResponse": + """**Route Directions Batch API** + + **Applies to**\ : S1 pricing tier. + + The Route Directions Batch API sends batches of queries to `Route Directions API + `_ using just a single + API call. You can call Route Directions Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **700** queries and sync API + up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex route + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **700** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Route Directions Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + ``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0`` + Note:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security + <#security>`_\ ) to the *status URI* before running it. :code:`
` + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *route directions* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 3 *route directions* + queries: + + .. code-block:: json + + { + "batchItems": [ + { "query": + "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + }, + { "query": + "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" }, + { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + ] + } + + A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *route directions* + `URI parameters + `_. The + string values in the *route directions* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **700** queries and sync API up to **100** queries, + and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``RouteDirectionsResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 1 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 1, + "totalRequests": 2 + }, + "batchItems": [ + { + "statusCode": 200, + "response": { + "routes": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "legs": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "points": [ + { + "latitude": 47.62094, + "longitude": -122.34892 + }, + { + "latitude": 47.62094, + "longitude": -122.3485 + }, + { + "latitude": 47.62095, + "longitude": -122.3476 + } + ] + } + ], + "sections": [ + { + "startPointIndex": 0, + "endPointIndex": 40, + "sectionType": "TRAVEL_MODE", + "travelMode": "bicycle" + } + ] + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param post_route_directions_batch_request_body: The list of route directions queries/requests + to process. The list can contain a max of 700 queries for async and 100 queries for sync + version and must contain at least 1 query. + :type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteDirectionsBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_route_directions_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_directions_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('RouteDirectionsBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_route_directions_batch_sync.metadata = {'url': '/route/directions/batch/sync/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-route/azure/maps/route/models/__init__.py b/sdk/maps/azure-maps-route/azure/maps/route/models/__init__.py new file mode 100644 index 000000000000..09013959c4c8 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/models/__init__.py @@ -0,0 +1,218 @@ +# 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 BatchItem + from ._models_py3 import BatchRequestBody + from ._models_py3 import BatchRequestBodyBatchItemsItem + from ._models_py3 import BatchResponse + from ._models_py3 import BatchResponseSummary + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import GeoJsonFeature + from ._models_py3 import GeoJsonFeatureCollection + from ._models_py3 import GeoJsonFeatureCollectionData + from ._models_py3 import GeoJsonFeatureData + from ._models_py3 import GeoJsonGeometry + from ._models_py3 import GeoJsonGeometryCollection + from ._models_py3 import GeoJsonGeometryCollectionData + from ._models_py3 import GeoJsonLineString + from ._models_py3 import GeoJsonLineStringData + from ._models_py3 import GeoJsonMultiLineString + from ._models_py3 import GeoJsonMultiLineStringData + from ._models_py3 import GeoJsonMultiPoint + from ._models_py3 import GeoJsonMultiPointData + from ._models_py3 import GeoJsonMultiPolygon + from ._models_py3 import GeoJsonMultiPolygonData + from ._models_py3 import GeoJsonObject + from ._models_py3 import GeoJsonPoint + from ._models_py3 import GeoJsonPointData + from ._models_py3 import GeoJsonPolygon + from ._models_py3 import GeoJsonPolygonData + from ._models_py3 import GetRouteRangeResponse + from ._models_py3 import LatLongPair + from ._models_py3 import PostRouteDirectionsRequestBody + from ._models_py3 import PostRouteMatrixRequestBody + from ._models_py3 import RouteDirectionsBatchItem + from ._models_py3 import RouteDirectionsBatchItemResponse + from ._models_py3 import RouteDirectionsBatchResponse + from ._models_py3 import RouteDirectionsResponse + from ._models_py3 import RouteDirectionsResult + from ._models_py3 import RouteDirectionsSummary + from ._models_py3 import RouteMatrixResponse + from ._models_py3 import RouteMatrixResult + from ._models_py3 import RouteMatrixResultResponse + from ._models_py3 import RouteMatrixSummary + from ._models_py3 import RouteOptimizedWaypoint + from ._models_py3 import RouteRange + from ._models_py3 import RouteResponseReport + from ._models_py3 import RouteResponseReportEffectiveSetting + from ._models_py3 import RouteResultGuidance + from ._models_py3 import RouteResultInstruction + from ._models_py3 import RouteResultInstructionGroup + from ._models_py3 import RouteResultLeg + from ._models_py3 import RouteResultLegSummary + from ._models_py3 import RouteResultSection + from ._models_py3 import RouteResultSectionTec + from ._models_py3 import RouteResultSectionTecCause +except (SyntaxError, ImportError): + from ._models import BatchItem # type: ignore + from ._models import BatchRequestBody # type: ignore + from ._models import BatchRequestBodyBatchItemsItem # type: ignore + from ._models import BatchResponse # type: ignore + from ._models import BatchResponseSummary # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import GeoJsonFeature # type: ignore + from ._models import GeoJsonFeatureCollection # type: ignore + from ._models import GeoJsonFeatureCollectionData # type: ignore + from ._models import GeoJsonFeatureData # type: ignore + from ._models import GeoJsonGeometry # type: ignore + from ._models import GeoJsonGeometryCollection # type: ignore + from ._models import GeoJsonGeometryCollectionData # type: ignore + from ._models import GeoJsonLineString # type: ignore + from ._models import GeoJsonLineStringData # type: ignore + from ._models import GeoJsonMultiLineString # type: ignore + from ._models import GeoJsonMultiLineStringData # type: ignore + from ._models import GeoJsonMultiPoint # type: ignore + from ._models import GeoJsonMultiPointData # type: ignore + from ._models import GeoJsonMultiPolygon # type: ignore + from ._models import GeoJsonMultiPolygonData # type: ignore + from ._models import GeoJsonObject # type: ignore + from ._models import GeoJsonPoint # type: ignore + from ._models import GeoJsonPointData # type: ignore + from ._models import GeoJsonPolygon # type: ignore + from ._models import GeoJsonPolygonData # type: ignore + from ._models import GetRouteRangeResponse # type: ignore + from ._models import LatLongPair # type: ignore + from ._models import PostRouteDirectionsRequestBody # type: ignore + from ._models import PostRouteMatrixRequestBody # type: ignore + from ._models import RouteDirectionsBatchItem # type: ignore + from ._models import RouteDirectionsBatchItemResponse # type: ignore + from ._models import RouteDirectionsBatchResponse # type: ignore + from ._models import RouteDirectionsResponse # type: ignore + from ._models import RouteDirectionsResult # type: ignore + from ._models import RouteDirectionsSummary # type: ignore + from ._models import RouteMatrixResponse # type: ignore + from ._models import RouteMatrixResult # type: ignore + from ._models import RouteMatrixResultResponse # type: ignore + from ._models import RouteMatrixSummary # type: ignore + from ._models import RouteOptimizedWaypoint # type: ignore + from ._models import RouteRange # type: ignore + from ._models import RouteResponseReport # type: ignore + from ._models import RouteResponseReportEffectiveSetting # type: ignore + from ._models import RouteResultGuidance # type: ignore + from ._models import RouteResultInstruction # type: ignore + from ._models import RouteResultInstructionGroup # type: ignore + from ._models import RouteResultLeg # type: ignore + from ._models import RouteResultLegSummary # type: ignore + from ._models import RouteResultSection # type: ignore + from ._models import RouteResultSectionTec # type: ignore + from ._models import RouteResultSectionTecCause # type: ignore + +from ._route_client_enums import ( + AlternativeRouteType, + ComputeTravelTimeFor, + DrivingSide, + GeoJsonObjectType, + GuidanceInstructionType, + GuidanceManeuver, + HillinessDegree, + JsonFormat, + JunctionType, + MagnitudeOfDelay, + ResponseFormat, + RouteAvoidType, + RouteInstructionsType, + RouteRepresentation, + RouteType, + SectionType, + TravelMode, + VehicleEngineType, + VehicleLoadType, + WindingnessLevel, +) + +__all__ = [ + 'BatchItem', + 'BatchRequestBody', + 'BatchRequestBodyBatchItemsItem', + 'BatchResponse', + 'BatchResponseSummary', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'GeoJsonFeature', + 'GeoJsonFeatureCollection', + 'GeoJsonFeatureCollectionData', + 'GeoJsonFeatureData', + 'GeoJsonGeometry', + 'GeoJsonGeometryCollection', + 'GeoJsonGeometryCollectionData', + 'GeoJsonLineString', + 'GeoJsonLineStringData', + 'GeoJsonMultiLineString', + 'GeoJsonMultiLineStringData', + 'GeoJsonMultiPoint', + 'GeoJsonMultiPointData', + 'GeoJsonMultiPolygon', + 'GeoJsonMultiPolygonData', + 'GeoJsonObject', + 'GeoJsonPoint', + 'GeoJsonPointData', + 'GeoJsonPolygon', + 'GeoJsonPolygonData', + 'GetRouteRangeResponse', + 'LatLongPair', + 'PostRouteDirectionsRequestBody', + 'PostRouteMatrixRequestBody', + 'RouteDirectionsBatchItem', + 'RouteDirectionsBatchItemResponse', + 'RouteDirectionsBatchResponse', + 'RouteDirectionsResponse', + 'RouteDirectionsResult', + 'RouteDirectionsSummary', + 'RouteMatrixResponse', + 'RouteMatrixResult', + 'RouteMatrixResultResponse', + 'RouteMatrixSummary', + 'RouteOptimizedWaypoint', + 'RouteRange', + 'RouteResponseReport', + 'RouteResponseReportEffectiveSetting', + 'RouteResultGuidance', + 'RouteResultInstruction', + 'RouteResultInstructionGroup', + 'RouteResultLeg', + 'RouteResultLegSummary', + 'RouteResultSection', + 'RouteResultSectionTec', + 'RouteResultSectionTecCause', + 'AlternativeRouteType', + 'ComputeTravelTimeFor', + 'DrivingSide', + 'GeoJsonObjectType', + 'GuidanceInstructionType', + 'GuidanceManeuver', + 'HillinessDegree', + 'JsonFormat', + 'JunctionType', + 'MagnitudeOfDelay', + 'ResponseFormat', + 'RouteAvoidType', + 'RouteInstructionsType', + 'RouteRepresentation', + 'RouteType', + 'SectionType', + 'TravelMode', + 'VehicleEngineType', + 'VehicleLoadType', + 'WindingnessLevel', +] diff --git a/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py b/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py new file mode 100644 index 000000000000..5c761b6a32e1 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/models/_models.py @@ -0,0 +1,2003 @@ +# 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 BatchItem(msrest.serialization.Model): + """An item returned from Batch API. Extend with 'response' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + """ + + _validation = { + 'status_code': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchItem, self).__init__(**kwargs) + self.status_code = None + + +class BatchRequestBody(msrest.serialization.Model): + """This type represents the request body for the Batch service. + + :param batch_items: The list of queries to process. + :type batch_items: list[~azure.maps.route.models.BatchRequestBodyBatchItemsItem] + """ + + _attribute_map = { + 'batch_items': {'key': 'batchItems', 'type': '[BatchRequestBodyBatchItemsItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchRequestBody, self).__init__(**kwargs) + self.batch_items = kwargs.get('batch_items', None) + + +class BatchRequestBodyBatchItemsItem(msrest.serialization.Model): + """Batch Query object. + + :param query: Partial query string. + :type query: str + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchRequestBodyBatchItemsItem, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + + +class BatchResponse(msrest.serialization.Model): + """This object is returned from a successful Batch service call. Extend with 'batchItems' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.route.models.BatchResponseSummary + """ + + _validation = { + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponse, self).__init__(**kwargs) + self.summary = None + + +class BatchResponseSummary(msrest.serialization.Model): + """Summary for the batch request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_requests: Number of successful requests in the batch. + :vartype successful_requests: int + :ivar total_requests: Total number of requests in the batch. + :vartype total_requests: int + """ + + _validation = { + 'successful_requests': {'readonly': True}, + 'total_requests': {'readonly': True}, + } + + _attribute_map = { + 'successful_requests': {'key': 'successfulRequests', 'type': 'int'}, + 'total_requests': {'key': 'totalRequests', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponseSummary, self).__init__(**kwargs) + self.successful_requests = None + self.total_requests = 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.route.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.route.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.route.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 GeoJsonFeatureData(msrest.serialization.Model): + """GeoJsonFeatureData. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.route.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + """ + + _validation = { + 'geometry': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeatureData, self).__init__(**kwargs) + self.geometry = kwargs['geometry'] + self.properties = kwargs.get('properties', None) + self.id = kwargs.get('id', None) + self.feature_type = kwargs.get('feature_type', None) + + +class GeoJsonObject(msrest.serialization.Model): + """A valid ``GeoJSON`` object. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonFeature, GeoJsonFeatureCollection, GeoJsonGeometry. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Feature': 'GeoJsonFeature', 'FeatureCollection': 'GeoJsonFeatureCollection', 'GeoJsonGeometry': 'GeoJsonGeometry'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonObject, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class GeoJsonFeature(GeoJsonObject, GeoJsonFeatureData): + """A valid ``GeoJSON Feature`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.route.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'geometry': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeature, self).__init__(**kwargs) + self.geometry = kwargs['geometry'] + self.properties = kwargs.get('properties', None) + self.id = kwargs.get('id', None) + self.feature_type = kwargs.get('feature_type', None) + self.type = 'Feature' # type: str + self.type = 'Feature' # type: str + + +class GeoJsonFeatureCollectionData(msrest.serialization.Model): + """GeoJsonFeatureCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.route.models.GeoJsonFeature] + """ + + _validation = { + 'features': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeatureCollectionData, self).__init__(**kwargs) + self.features = kwargs['features'] + + +class GeoJsonFeatureCollection(GeoJsonObject, GeoJsonFeatureCollectionData): + """A valid ``GeoJSON FeatureCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.route.models.GeoJsonFeature] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'features': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeatureCollection, self).__init__(**kwargs) + self.features = kwargs['features'] + self.type = 'FeatureCollection' # type: str + self.type = 'FeatureCollection' # type: str + + +class GeoJsonGeometry(GeoJsonObject): + """A valid ``GeoJSON`` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonGeometryCollection, GeoJsonLineString, GeoJsonMultiLineString, GeoJsonMultiPoint, GeoJsonMultiPolygon, GeoJsonPoint, GeoJsonPolygon. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'GeometryCollection': 'GeoJsonGeometryCollection', 'LineString': 'GeoJsonLineString', 'MultiLineString': 'GeoJsonMultiLineString', 'MultiPoint': 'GeoJsonMultiPoint', 'MultiPolygon': 'GeoJsonMultiPolygon', 'Point': 'GeoJsonPoint', 'Polygon': 'GeoJsonPolygon'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometry, self).__init__(**kwargs) + self.type = 'GeoJsonGeometry' # type: str + + +class GeoJsonGeometryCollectionData(msrest.serialization.Model): + """GeoJsonGeometryCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.route.models.GeoJsonGeometry] + """ + + _validation = { + 'geometries': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometryCollectionData, self).__init__(**kwargs) + self.geometries = kwargs['geometries'] + + +class GeoJsonGeometryCollection(GeoJsonGeometry, GeoJsonGeometryCollectionData): + """A valid ``GeoJSON GeometryCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.route.models.GeoJsonGeometry] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'geometries': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometryCollection, self).__init__(**kwargs) + self.geometries = kwargs['geometries'] + self.type = 'GeometryCollection' # type: str + self.type = 'GeometryCollection' # type: str + + +class GeoJsonLineStringData(msrest.serialization.Model): + """GeoJsonLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonLineStringData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonLineString(GeoJsonGeometry, GeoJsonLineStringData): + """A valid ``GeoJSON LineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonLineString, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'LineString' # type: str + self.type = 'LineString' # type: str + + +class GeoJsonMultiLineStringData(msrest.serialization.Model): + """GeoJsonMultiLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiLineStringData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonMultiLineString(GeoJsonGeometry, GeoJsonMultiLineStringData): + """A valid ``GeoJSON MultiLineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiLineString, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'MultiLineString' # type: str + self.type = 'MultiLineString' # type: str + + +class GeoJsonMultiPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson MultiPoint``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPointData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonMultiPoint(GeoJsonGeometry, GeoJsonMultiPointData): + """A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPoint, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'MultiPoint' # type: str + self.type = 'MultiPoint' # type: str + + +class GeoJsonMultiPolygonData(msrest.serialization.Model): + """GeoJsonMultiPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPolygonData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonMultiPolygon(GeoJsonGeometry, GeoJsonMultiPolygonData): + """A valid ``GeoJSON MultiPolygon`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPolygon, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'MultiPolygon' # type: str + self.type = 'MultiPolygon' # type: str + + +class GeoJsonPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson Point``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPointData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonPoint(GeoJsonGeometry, GeoJsonPointData): + """A valid ``GeoJSON Point`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPoint, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'Point' # type: str + self.type = 'Point' # type: str + + +class GeoJsonPolygonData(msrest.serialization.Model): + """GeoJsonPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPolygonData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonPolygon(GeoJsonGeometry, GeoJsonPolygonData): + """A valid ``GeoJSON Polygon`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPolygon, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'Polygon' # type: str + self.type = 'Polygon' # type: str + + +class GetRouteRangeResponse(msrest.serialization.Model): + """This object is returned from a successful Route Reachable Range 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 + :param reachable_range: Reachable Range. + :type reachable_range: ~azure.maps.route.models.RouteRange + :param report: Reports the effective settings used in the current call. + :type report: ~azure.maps.route.models.RouteResponseReport + """ + + _validation = { + 'format_version': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'reachable_range': {'key': 'reachableRange', 'type': 'RouteRange'}, + 'report': {'key': 'report', 'type': 'RouteResponseReport'}, + } + + def __init__( + self, + **kwargs + ): + super(GetRouteRangeResponse, self).__init__(**kwargs) + self.format_version = None + self.reachable_range = kwargs.get('reachable_range', None) + self.report = kwargs.get('report', None) + + +class LatLongPair(msrest.serialization.Model): + """A location represented as a latitude and longitude. + + :param latitude: Latitude property. + :type latitude: float + :param longitude: Longitude property. + :type longitude: float + """ + + _attribute_map = { + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(LatLongPair, self).__init__(**kwargs) + self.latitude = kwargs.get('latitude', None) + self.longitude = kwargs.get('longitude', None) + + +class PostRouteDirectionsRequestBody(msrest.serialization.Model): + """Post body parameters for Route directions. + + :param supporting_points: A GeoJSON Geometry collection representing sequence of coordinates + used as input for route reconstruction and for calculating zero or more alternative routes to + this reference route. + + + * The provided sequence of supporting points is used as input for route reconstruction. + * The alternative routes are calculated between the origin and destination points specified in + the base path parameter locations. + * If both *minDeviationDistance* and *minDeviationTime* are set to zero, then these origin and + destination points are + expected to be at (or very near) the beginning and end of the reference route, respectively. + * Intermediate locations (\ *waypoints*\ ) are not supported when using + :code:`<_supportingPoints_>`. + * The reference route may contain traffic incidents of type _ROAD\ *CLOSURE*\ , which are + ignored for the calculation of the reference route's travel time and traffic delay. + :type supporting_points: ~azure.maps.route.models.GeoJsonGeometryCollection + :param avoid_vignette: This is a list of 3-character, ISO 3166-1, alpha-3 country codes of + countries in which all toll roads with vignettes are to be avoided, e.g. "AUS,CHE". Toll roads + with vignettes in countries not in the list are unaffected. Note: It is an error to specify + both **avoidVignette** and **allowVignette**. + :type avoid_vignette: list[str] + :param allow_vignette: This is a list of 3-character, ISO 3166-1, alpha-3 country codes of + countries in which toll roads with vignettes are allowed, e.g. "AUS,CHE". Specifying + **allowVignette** with some countries X is equivalent to specifying **avoidVignette** with all + countries but X. Specifying **allowVignette** with an empty list is the same as avoiding all + toll roads with vignettes. Note: It is an error to specify both **avoidVignette** and + **allowVignette**. + :type allow_vignette: list[str] + :param avoid_areas: A GeoJSON MultiPolygon representing list of areas to avoid. Only rectangle + polygons are supported. The maximum size of a rectangle is about 160x160 km. Maximum number of + avoided areas is **10**. It cannot cross the 180th meridian. It must be between -80 and +80 + degrees of latitude. + :type avoid_areas: ~azure.maps.route.models.GeoJsonMultiPolygon + """ + + _attribute_map = { + 'supporting_points': {'key': 'supportingPoints', 'type': 'GeoJsonGeometryCollection'}, + 'avoid_vignette': {'key': 'avoidVignette', 'type': '[str]'}, + 'allow_vignette': {'key': 'allowVignette', 'type': '[str]'}, + 'avoid_areas': {'key': 'avoidAreas', 'type': 'GeoJsonMultiPolygon'}, + } + + def __init__( + self, + **kwargs + ): + super(PostRouteDirectionsRequestBody, self).__init__(**kwargs) + self.supporting_points = kwargs.get('supporting_points', None) + self.avoid_vignette = kwargs.get('avoid_vignette', None) + self.allow_vignette = kwargs.get('allow_vignette', None) + self.avoid_areas = kwargs.get('avoid_areas', None) + + +class PostRouteMatrixRequestBody(msrest.serialization.Model): + """An object with a matrix of coordinates. + + :param origins: A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 + `_ for details. + :type origins: ~azure.maps.route.models.GeoJsonMultiPoint + :param destinations: A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 + `_ for details. + :type destinations: ~azure.maps.route.models.GeoJsonMultiPoint + """ + + _attribute_map = { + 'origins': {'key': 'origins', 'type': 'GeoJsonMultiPoint'}, + 'destinations': {'key': 'destinations', 'type': 'GeoJsonMultiPoint'}, + } + + def __init__( + self, + **kwargs + ): + super(PostRouteMatrixRequestBody, self).__init__(**kwargs) + self.origins = kwargs.get('origins', None) + self.destinations = kwargs.get('destinations', None) + + +class RouteDirectionsBatchItem(BatchItem): + """An item returned from Route Directions Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. RouteDirectionsResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.route.models.RouteDirectionsBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'RouteDirectionsBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsBatchItem, self).__init__(**kwargs) + self.response = None + + +class RouteDirectionsResponse(msrest.serialization.Model): + """This object is returned from a successful Route Directions 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 routes: Routes array. + :vartype routes: list[~azure.maps.route.models.RouteDirectionsResult] + :ivar optimized_waypoints: Optimized sequence of waypoints. It shows the index from the user + provided waypoint sequence for the original and optimized list. For instance, a response: + + .. code-block:: + + + + + + + + means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the + index starts by 0 the original is "first, second, third" while the optimized is "second, third, + first". + :vartype optimized_waypoints: list[~azure.maps.route.models.RouteOptimizedWaypoint] + :param report: Reports the effective settings used in the current call. + :type report: ~azure.maps.route.models.RouteResponseReport + """ + + _validation = { + 'format_version': {'readonly': True}, + 'routes': {'readonly': True}, + 'optimized_waypoints': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'routes': {'key': 'routes', 'type': '[RouteDirectionsResult]'}, + 'optimized_waypoints': {'key': 'optimizedWaypoints', 'type': '[RouteOptimizedWaypoint]'}, + 'report': {'key': 'report', 'type': 'RouteResponseReport'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsResponse, self).__init__(**kwargs) + self.format_version = None + self.routes = None + self.optimized_waypoints = None + self.report = kwargs.get('report', None) + + +class RouteDirectionsBatchItemResponse(ErrorResponse, RouteDirectionsResponse): + """The result of the query. RouteDirectionsResponse if the query completed successfully, ErrorResponse otherwise. + + 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 routes: Routes array. + :vartype routes: list[~azure.maps.route.models.RouteDirectionsResult] + :ivar optimized_waypoints: Optimized sequence of waypoints. It shows the index from the user + provided waypoint sequence for the original and optimized list. For instance, a response: + + .. code-block:: + + + + + + + + means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the + index starts by 0 the original is "first, second, third" while the optimized is "second, third, + first". + :vartype optimized_waypoints: list[~azure.maps.route.models.RouteOptimizedWaypoint] + :param report: Reports the effective settings used in the current call. + :type report: ~azure.maps.route.models.RouteResponseReport + :param error: The error object. + :type error: ~azure.maps.route.models.ErrorDetail + """ + + _validation = { + 'format_version': {'readonly': True}, + 'routes': {'readonly': True}, + 'optimized_waypoints': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'routes': {'key': 'routes', 'type': '[RouteDirectionsResult]'}, + 'optimized_waypoints': {'key': 'optimizedWaypoints', 'type': '[RouteOptimizedWaypoint]'}, + 'report': {'key': 'report', 'type': 'RouteResponseReport'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsBatchItemResponse, self).__init__(**kwargs) + self.format_version = None + self.routes = None + self.optimized_waypoints = None + self.report = kwargs.get('report', None) + self.error = kwargs.get('error', None) + + +class RouteDirectionsBatchResponse(BatchResponse): + """This object is returned from a successful Route Directions Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.route.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.route.models.RouteDirectionsBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[RouteDirectionsBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class RouteDirectionsResult(msrest.serialization.Model): + """RouteDirectionsResult. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object. + :vartype summary: ~azure.maps.route.models.RouteDirectionsSummary + :ivar legs: Legs array. + :vartype legs: list[~azure.maps.route.models.RouteResultLeg] + :ivar sections: Sections array. + :vartype sections: list[~azure.maps.route.models.RouteResultSection] + :ivar guidance: Contains guidance related elements. This field is present only when guidance + was requested and is available. + :vartype guidance: ~azure.maps.route.models.RouteResultGuidance + """ + + _validation = { + 'summary': {'readonly': True}, + 'legs': {'readonly': True}, + 'sections': {'readonly': True}, + 'guidance': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'RouteDirectionsSummary'}, + 'legs': {'key': 'legs', 'type': '[RouteResultLeg]'}, + 'sections': {'key': 'sections', 'type': '[RouteResultSection]'}, + 'guidance': {'key': 'guidance', 'type': 'RouteResultGuidance'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsResult, self).__init__(**kwargs) + self.summary = None + self.legs = None + self.sections = None + self.guidance = None + + +class RouteDirectionsSummary(msrest.serialization.Model): + """Summary object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar length_in_meters: Length In Meters property. + :vartype length_in_meters: int + :ivar travel_time_in_seconds: Estimated travel time in seconds property that includes the delay + due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes + the delay due to traffic. If DepartAt is in the future, travel time is calculated using + time-dependent historic traffic data. + :vartype travel_time_in_seconds: int + :ivar traffic_delay_in_seconds: Estimated delay in seconds caused by the real-time incident(s) + according to traffic information. For routes planned with departure time in the future, delays + is always 0. To return additional travel times using different types of traffic information, + parameter computeTravelTimeFor=all needs to be added. + :vartype traffic_delay_in_seconds: int + :ivar departure_time: Departure Time property. + :vartype departure_time: str + :ivar arrival_time: Arrival Time property. + :vartype arrival_time: str + """ + + _validation = { + 'length_in_meters': {'readonly': True}, + 'travel_time_in_seconds': {'readonly': True}, + 'traffic_delay_in_seconds': {'readonly': True}, + 'departure_time': {'readonly': True}, + 'arrival_time': {'readonly': True}, + } + + _attribute_map = { + 'length_in_meters': {'key': 'lengthInMeters', 'type': 'int'}, + 'travel_time_in_seconds': {'key': 'travelTimeInSeconds', 'type': 'int'}, + 'traffic_delay_in_seconds': {'key': 'trafficDelayInSeconds', 'type': 'int'}, + 'departure_time': {'key': 'departureTime', 'type': 'str'}, + 'arrival_time': {'key': 'arrivalTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsSummary, self).__init__(**kwargs) + self.length_in_meters = None + self.travel_time_in_seconds = None + self.traffic_delay_in_seconds = None + self.departure_time = None + self.arrival_time = None + + +class RouteMatrixResponse(msrest.serialization.Model): + """This object is returned from a successful Route Matrix call. For ex, if 2 origins and 3 destinations are provided, there are going to 2 arrays with 3 elements in each. Each element's content depends on the options provided in the query. + + 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 matrix: Results as a 2 dimensional array of route summaries. + :vartype matrix: list[list[~azure.maps.route.models.RouteMatrixResult]] + :ivar summary: Summary object. + :vartype summary: ~azure.maps.route.models.RouteMatrixSummary + """ + + _validation = { + 'format_version': {'readonly': True}, + 'matrix': {'readonly': True}, + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'matrix': {'key': 'matrix', 'type': '[[RouteMatrixResult]]'}, + 'summary': {'key': 'summary', 'type': 'RouteMatrixSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixResponse, self).__init__(**kwargs) + self.format_version = None + self.matrix = None + self.summary = None + + +class RouteMatrixResult(msrest.serialization.Model): + """Matrix result object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: StatusCode property for the current cell in the input matrix. + :vartype status_code: int + :ivar response: Response object of the current cell in the input matrix. + :vartype response: ~azure.maps.route.models.RouteMatrixResultResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'response': {'key': 'response', 'type': 'RouteMatrixResultResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixResult, self).__init__(**kwargs) + self.status_code = None + self.response = None + + +class RouteMatrixResultResponse(msrest.serialization.Model): + """Response object of the current cell in the input matrix. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar route_summary: Summary object for route section. + :vartype route_summary: ~azure.maps.route.models.RouteResultLegSummary + """ + + _validation = { + 'route_summary': {'readonly': True}, + } + + _attribute_map = { + 'route_summary': {'key': 'routeSummary', 'type': 'RouteResultLegSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixResultResponse, self).__init__(**kwargs) + self.route_summary = None + + +class RouteMatrixSummary(msrest.serialization.Model): + """Summary object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_routes: Number of successful routes in the response. + :vartype successful_routes: int + :ivar total_routes: Total number of routes requested. Number of cells in the input matrix. + :vartype total_routes: int + """ + + _validation = { + 'successful_routes': {'readonly': True}, + 'total_routes': {'readonly': True}, + } + + _attribute_map = { + 'successful_routes': {'key': 'successfulRoutes', 'type': 'int'}, + 'total_routes': {'key': 'totalRoutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixSummary, self).__init__(**kwargs) + self.successful_routes = None + self.total_routes = None + + +class RouteOptimizedWaypoint(msrest.serialization.Model): + """Optimized way point object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provided_index: Way point index provided by the user. + :vartype provided_index: int + :ivar optimized_index: Optimized way point index from the system. + :vartype optimized_index: int + """ + + _validation = { + 'provided_index': {'readonly': True}, + 'optimized_index': {'readonly': True}, + } + + _attribute_map = { + 'provided_index': {'key': 'providedIndex', 'type': 'int'}, + 'optimized_index': {'key': 'optimizedIndex', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteOptimizedWaypoint, self).__init__(**kwargs) + self.provided_index = None + self.optimized_index = None + + +class RouteRange(msrest.serialization.Model): + """Reachable Range. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param center: Center point of the reachable range. + :type center: ~azure.maps.route.models.LatLongPair + :ivar boundary: Polygon boundary of the reachable range represented as a list of points. + :vartype boundary: list[~azure.maps.route.models.LatLongPair] + """ + + _validation = { + 'boundary': {'readonly': True}, + } + + _attribute_map = { + 'center': {'key': 'center', 'type': 'LatLongPair'}, + 'boundary': {'key': 'boundary', 'type': '[LatLongPair]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteRange, self).__init__(**kwargs) + self.center = kwargs.get('center', None) + self.boundary = None + + +class RouteResponseReport(msrest.serialization.Model): + """Reports the effective settings used in the current call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar effective_settings: Effective parameters or data used when calling this Route API. + :vartype effective_settings: list[~azure.maps.route.models.RouteResponseReportEffectiveSetting] + """ + + _validation = { + 'effective_settings': {'readonly': True}, + } + + _attribute_map = { + 'effective_settings': {'key': 'effectiveSettings', 'type': '[RouteResponseReportEffectiveSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResponseReport, self).__init__(**kwargs) + self.effective_settings = None + + +class RouteResponseReportEffectiveSetting(msrest.serialization.Model): + """Effective parameter or data used when calling this Route API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key: Name of the parameter used. + :vartype key: str + :ivar value: Value of the parameter used. + :vartype value: str + """ + + _validation = { + 'key': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResponseReportEffectiveSetting, self).__init__(**kwargs) + self.key = None + self.value = None + + +class RouteResultGuidance(msrest.serialization.Model): + """Contains guidance related elements. This field is present only when guidance was requested and is available. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar instructions: A list of instructions describing maneuvers. + :vartype instructions: list[~azure.maps.route.models.RouteResultInstruction] + :ivar instruction_groups: Groups a sequence of instruction elements which are related to each + other. + :vartype instruction_groups: list[~azure.maps.route.models.RouteResultInstructionGroup] + """ + + _validation = { + 'instructions': {'readonly': True}, + 'instruction_groups': {'readonly': True}, + } + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[RouteResultInstruction]'}, + 'instruction_groups': {'key': 'instructionGroups', 'type': '[RouteResultInstructionGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultGuidance, self).__init__(**kwargs) + self.instructions = None + self.instruction_groups = None + + +class RouteResultInstruction(msrest.serialization.Model): + """A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar route_offset_in_meters: Distance from the start of the route to the point of the + instruction. + :vartype route_offset_in_meters: int + :ivar travel_time_in_seconds: Estimated travel time up to the point corresponding to + routeOffsetInMeters. + :vartype travel_time_in_seconds: int + :param point: A location represented as a latitude and longitude. + :type point: ~azure.maps.route.models.LatLongPair + :ivar point_index: The index of the point in the list of polyline "points" corresponding to the + point of the instruction. + :vartype point_index: int + :param instruction_type: Type of the instruction, e.g., turn or change of road form. Possible + values include: "TURN", "ROAD_CHANGE", "LOCATION_DEPARTURE", "LOCATION_ARRIVAL", + "DIRECTION_INFO", "LOCATION_WAYPOINT". + :type instruction_type: str or ~azure.maps.route.models.GuidanceInstructionType + :ivar road_numbers: The road number(s) of the next significant road segment(s) after the + maneuver, or of the road(s) to be followed. Example: ["E34", "N205"]. + :vartype road_numbers: list[str] + :ivar exit_number: The number(s) of a highway exit taken by the current maneuver. If an exit + has multiple exit numbers, they will be separated by "," and possibly aggregated by "-", e.g., + "10, 13-15". + :vartype exit_number: str + :ivar street: Street name of the next significant road segment after the maneuver, or of the + street that should be followed. + :vartype street: str + :ivar signpost_text: The text on a signpost which is most relevant to the maneuver, or to the + direction that should be followed. + :vartype signpost_text: str + :ivar country_code: 3-character `ISO 3166-1 `_ + alpha-3 country code. E.g. USA. + :vartype country_code: str + :ivar state_code: A subdivision (e.g., state) of the country, represented by the second part of + an `ISO 3166-2 `_ code. This is only available for + some countries like the US, Canada, and Mexico. + :vartype state_code: str + :ivar junction_type: The type of the junction where the maneuver takes place. For larger + roundabouts, two separate instructions are generated for entering and leaving the roundabout. + Possible values include: "REGULAR", "ROUNDABOUT", "BIFURCATION". + :vartype junction_type: str or ~azure.maps.route.models.JunctionType + :ivar turn_angle_in_decimal_degrees: Indicates the direction of an instruction. If junctionType + indicates a turn instruction: + + + * 180 = U-turn + * [-179, -1] = Left turn + * 0 = Straight on (a '0 degree' turn) + * [1, 179] = Right turn + + If junctionType indicates a bifurcation instruction: + + + * <0 - keep left + * >0 - keep right. + :vartype turn_angle_in_decimal_degrees: int + :ivar roundabout_exit_number: This indicates which exit to take at a roundabout. + :vartype roundabout_exit_number: str + :ivar possible_combine_with_next: It is possible to optionally combine the instruction with the + next one. This can be used to build messages like "Turn left and then turn right". + :vartype possible_combine_with_next: bool + :ivar driving_side: Indicates left-hand vs. right-hand side driving at the point of the + maneuver. Possible values include: "LEFT", "RIGHT". + :vartype driving_side: str or ~azure.maps.route.models.DrivingSide + :ivar maneuver: A code identifying the maneuver. Possible values include: "ARRIVE", + "ARRIVE_LEFT", "ARRIVE_RIGHT", "DEPART", "STRAIGHT", "KEEP_RIGHT", "BEAR_RIGHT", "TURN_RIGHT", + "SHARP_RIGHT", "KEEP_LEFT", "BEAR_LEFT", "TURN_LEFT", "SHARP_LEFT", "MAKE_UTURN", + "ENTER_MOTORWAY", "ENTER_FREEWAY", "ENTER_HIGHWAY", "TAKE_EXIT", "MOTORWAY_EXIT_LEFT", + "MOTORWAY_EXIT_RIGHT", "TAKE_FERRY", "ROUNDABOUT_CROSS", "ROUNDABOUT_RIGHT", "ROUNDABOUT_LEFT", + "ROUNDABOUT_BACK", "TRY_MAKE_UTURN", "FOLLOW", "SWITCH_PARALLEL_ROAD", "SWITCH_MAIN_ROAD", + "ENTRANCE_RAMP", "WAYPOINT_LEFT", "WAYPOINT_RIGHT", "WAYPOINT_REACHED". + :vartype maneuver: str or ~azure.maps.route.models.GuidanceManeuver + :ivar message: A human-readable message for the maneuver. + :vartype message: str + :ivar combined_message: A human-readable message for the maneuver combined with the message + from the next instruction. Sometimes it is possible to combine two successive instructions into + a single instruction making it easier to follow. When this is the case the + possibleCombineWithNext flag will be true. For example: + + .. code-block:: + + 10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + 11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam + + The possibleCombineWithNext flag on instruction 10 is true. This indicates to the clients of + coded guidance that it can be combined with instruction 11. The instructions will be combined + automatically for clients requesting human-readable guidance. The combinedMessage field + contains the combined message: + + .. code-block:: + + Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + then follow Einsteinweg/A10/E22 towards Ring Amsterdam. + :vartype combined_message: str + """ + + _validation = { + 'route_offset_in_meters': {'readonly': True}, + 'travel_time_in_seconds': {'readonly': True}, + 'point_index': {'readonly': True}, + 'road_numbers': {'readonly': True}, + 'exit_number': {'readonly': True}, + 'street': {'readonly': True}, + 'signpost_text': {'readonly': True}, + 'country_code': {'readonly': True}, + 'state_code': {'readonly': True}, + 'junction_type': {'readonly': True}, + 'turn_angle_in_decimal_degrees': {'readonly': True}, + 'roundabout_exit_number': {'readonly': True}, + 'possible_combine_with_next': {'readonly': True}, + 'driving_side': {'readonly': True}, + 'maneuver': {'readonly': True}, + 'message': {'readonly': True}, + 'combined_message': {'readonly': True}, + } + + _attribute_map = { + 'route_offset_in_meters': {'key': 'routeOffsetInMeters', 'type': 'int'}, + 'travel_time_in_seconds': {'key': 'travelTimeInSeconds', 'type': 'int'}, + 'point': {'key': 'point', 'type': 'LatLongPair'}, + 'point_index': {'key': 'pointIndex', 'type': 'int'}, + 'instruction_type': {'key': 'instructionType', 'type': 'str'}, + 'road_numbers': {'key': 'roadNumbers', 'type': '[str]'}, + 'exit_number': {'key': 'exitNumber', 'type': 'str'}, + 'street': {'key': 'street', 'type': 'str'}, + 'signpost_text': {'key': 'signpostText', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'state_code': {'key': 'stateCode', 'type': 'str'}, + 'junction_type': {'key': 'junctionType', 'type': 'str'}, + 'turn_angle_in_decimal_degrees': {'key': 'turnAngleInDecimalDegrees', 'type': 'int'}, + 'roundabout_exit_number': {'key': 'roundaboutExitNumber', 'type': 'str'}, + 'possible_combine_with_next': {'key': 'possibleCombineWithNext', 'type': 'bool'}, + 'driving_side': {'key': 'drivingSide', 'type': 'str'}, + 'maneuver': {'key': 'maneuver', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'combined_message': {'key': 'combinedMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultInstruction, self).__init__(**kwargs) + self.route_offset_in_meters = None + self.travel_time_in_seconds = None + self.point = kwargs.get('point', None) + self.point_index = None + self.instruction_type = kwargs.get('instruction_type', None) + self.road_numbers = None + self.exit_number = None + self.street = None + self.signpost_text = None + self.country_code = None + self.state_code = None + self.junction_type = None + self.turn_angle_in_decimal_degrees = None + self.roundabout_exit_number = None + self.possible_combine_with_next = None + self.driving_side = None + self.maneuver = None + self.message = None + self.combined_message = None + + +class RouteResultInstructionGroup(msrest.serialization.Model): + """Groups a sequence of instruction elements which are related to each other. The sequence range is constrained with firstInstructionIndex and lastInstructionIndex. When human-readable text messages are requested for guidance (instructionType=text or tagged), then the instructionGroup has a summary message returned when available. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar first_instruction_index: Index of the first instruction. + :vartype first_instruction_index: int + :ivar last_instruction_index: Index of the last instruction. + :vartype last_instruction_index: int + :ivar group_length_in_meters: Length of the group. + :vartype group_length_in_meters: int + :ivar group_message: Summary message when human-readable text messages are requested for + guidance (instructionType=text or tagged). + :vartype group_message: str + """ + + _validation = { + 'first_instruction_index': {'readonly': True}, + 'last_instruction_index': {'readonly': True}, + 'group_length_in_meters': {'readonly': True}, + 'group_message': {'readonly': True}, + } + + _attribute_map = { + 'first_instruction_index': {'key': 'firstInstructionIndex', 'type': 'int'}, + 'last_instruction_index': {'key': 'lastInstructionIndex', 'type': 'int'}, + 'group_length_in_meters': {'key': 'groupLengthInMeters', 'type': 'int'}, + 'group_message': {'key': 'groupMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultInstructionGroup, self).__init__(**kwargs) + self.first_instruction_index = None + self.last_instruction_index = None + self.group_length_in_meters = None + self.group_message = None + + +class RouteResultLeg(msrest.serialization.Model): + """RouteResultLeg. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for route section. + :vartype summary: ~azure.maps.route.models.RouteResultLegSummary + :ivar points: Points array. + :vartype points: list[~azure.maps.route.models.LatLongPair] + """ + + _validation = { + 'summary': {'readonly': True}, + 'points': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'RouteResultLegSummary'}, + 'points': {'key': 'points', 'type': '[LatLongPair]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultLeg, self).__init__(**kwargs) + self.summary = None + self.points = None + + +class RouteResultLegSummary(msrest.serialization.Model): + """Summary object for route section. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar length_in_meters: Length In Meters property. + :vartype length_in_meters: int + :ivar travel_time_in_seconds: Estimated travel time in seconds property that includes the delay + due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes + the delay due to traffic. If DepartAt is in the future, travel time is calculated using + time-dependent historic traffic data. + :vartype travel_time_in_seconds: int + :ivar traffic_delay_in_seconds: Estimated delay in seconds caused by the real-time incident(s) + according to traffic information. For routes planned with departure time in the future, delays + is always 0. To return additional travel times using different types of traffic information, + parameter computeTravelTimeFor=all needs to be added. + :vartype traffic_delay_in_seconds: int + :ivar departure_time: Departure Time property. + :vartype departure_time: str + :ivar arrival_time: Arrival Time property. + :vartype arrival_time: str + :ivar no_traffic_travel_time_in_seconds: Estimated travel time calculated as if there are no + delays on the route due to traffic conditions (e.g. congestion). Included only if + computeTravelTimeFor = all is used in the query. + :vartype no_traffic_travel_time_in_seconds: int + :ivar historic_traffic_travel_time_in_seconds: Estimated travel time calculated using + time-dependent historic traffic data. Included only if computeTravelTimeFor = all is used in + the query. + :vartype historic_traffic_travel_time_in_seconds: int + :ivar live_traffic_incidents_travel_time_in_seconds: Estimated travel time calculated using + real-time speed data. Included only if computeTravelTimeFor = all is used in the query. + :vartype live_traffic_incidents_travel_time_in_seconds: int + :ivar fuel_consumption_in_liters: Estimated fuel consumption in liters using the Combustion + Consumption Model. Included if vehicleEngineType is set to *combustion* and + constantSpeedConsumptionInLitersPerHundredkm is specified. The value will be non-negative. + :vartype fuel_consumption_in_liters: float + :ivar battery_consumption_ink_wh: Estimated electric energy consumption in kilowatt hours (kWh) + using the Electric Consumption Model. Included if vehicleEngineType is set to electric and + constantSpeedConsumptionInkWhPerHundredkm is specified. The value of batteryConsumptionInkWh + includes the recuperated electric energy and can therefore be negative (which indicates gaining + energy). If both maxChargeInkWh and currentChargeInkWh are specified, recuperation will be + capped to ensure that the battery charge level never exceeds maxChargeInkWh. If neither + maxChargeInkWh nor currentChargeInkWh are specified, unconstrained recuperation is assumed in + the consumption calculation. + :vartype battery_consumption_ink_wh: float + """ + + _validation = { + 'length_in_meters': {'readonly': True}, + 'travel_time_in_seconds': {'readonly': True}, + 'traffic_delay_in_seconds': {'readonly': True}, + 'departure_time': {'readonly': True}, + 'arrival_time': {'readonly': True}, + 'no_traffic_travel_time_in_seconds': {'readonly': True}, + 'historic_traffic_travel_time_in_seconds': {'readonly': True}, + 'live_traffic_incidents_travel_time_in_seconds': {'readonly': True}, + 'fuel_consumption_in_liters': {'readonly': True}, + 'battery_consumption_ink_wh': {'readonly': True}, + } + + _attribute_map = { + 'length_in_meters': {'key': 'lengthInMeters', 'type': 'int'}, + 'travel_time_in_seconds': {'key': 'travelTimeInSeconds', 'type': 'int'}, + 'traffic_delay_in_seconds': {'key': 'trafficDelayInSeconds', 'type': 'int'}, + 'departure_time': {'key': 'departureTime', 'type': 'str'}, + 'arrival_time': {'key': 'arrivalTime', 'type': 'str'}, + 'no_traffic_travel_time_in_seconds': {'key': 'noTrafficTravelTimeInSeconds', 'type': 'int'}, + 'historic_traffic_travel_time_in_seconds': {'key': 'historicTrafficTravelTimeInSeconds', 'type': 'int'}, + 'live_traffic_incidents_travel_time_in_seconds': {'key': 'liveTrafficIncidentsTravelTimeInSeconds', 'type': 'int'}, + 'fuel_consumption_in_liters': {'key': 'fuelConsumptionInLiters', 'type': 'float'}, + 'battery_consumption_ink_wh': {'key': 'batteryConsumptionInkWh', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultLegSummary, self).__init__(**kwargs) + self.length_in_meters = None + self.travel_time_in_seconds = None + self.traffic_delay_in_seconds = None + self.departure_time = None + self.arrival_time = None + self.no_traffic_travel_time_in_seconds = None + self.historic_traffic_travel_time_in_seconds = None + self.live_traffic_incidents_travel_time_in_seconds = None + self.fuel_consumption_in_liters = None + self.battery_consumption_ink_wh = None + + +class RouteResultSection(msrest.serialization.Model): + """RouteResultSection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar start_point_index: Start Point Index property. + :vartype start_point_index: int + :ivar end_point_index: End Point Index property. + :vartype end_point_index: int + :ivar section_type: Section Type property. + :vartype section_type: str + :ivar travel_mode: Travel Mode property. + :vartype travel_mode: str + :ivar simple_category: Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or + OTHER. See "tec" for detailed information. + :vartype simple_category: str + :ivar effective_speed_in_kmh: Effective speed of the incident in km/h, averaged over its entire + length. + :vartype effective_speed_in_kmh: int + :ivar delay_in_seconds: Delay in seconds caused by the incident. + :vartype delay_in_seconds: int + :ivar magnitude_of_delay: The magnitude of delay caused by the incident. These values + correspond to the values of the response field ty of the `Get Traffic Incident Detail API + `_. Possible values + include: "0", "1", "2", "3", "4". + :vartype magnitude_of_delay: str or ~azure.maps.route.models.MagnitudeOfDelay + :param tec: Details of the traffic event, using definitions in the `TPEG2-TEC + `_ standard. Can contain effectCode and causes + elements. + :type tec: ~azure.maps.route.models.RouteResultSectionTec + """ + + _validation = { + 'start_point_index': {'readonly': True}, + 'end_point_index': {'readonly': True}, + 'section_type': {'readonly': True}, + 'travel_mode': {'readonly': True}, + 'simple_category': {'readonly': True}, + 'effective_speed_in_kmh': {'readonly': True}, + 'delay_in_seconds': {'readonly': True}, + 'magnitude_of_delay': {'readonly': True}, + } + + _attribute_map = { + 'start_point_index': {'key': 'startPointIndex', 'type': 'int'}, + 'end_point_index': {'key': 'endPointIndex', 'type': 'int'}, + 'section_type': {'key': 'sectionType', 'type': 'str'}, + 'travel_mode': {'key': 'travelMode', 'type': 'str'}, + 'simple_category': {'key': 'simpleCategory', 'type': 'str'}, + 'effective_speed_in_kmh': {'key': 'effectiveSpeedInKmh', 'type': 'int'}, + 'delay_in_seconds': {'key': 'delayInSeconds', 'type': 'int'}, + 'magnitude_of_delay': {'key': 'magnitudeOfDelay', 'type': 'str'}, + 'tec': {'key': 'tec', 'type': 'RouteResultSectionTec'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultSection, self).__init__(**kwargs) + self.start_point_index = None + self.end_point_index = None + self.section_type = None + self.travel_mode = None + self.simple_category = None + self.effective_speed_in_kmh = None + self.delay_in_seconds = None + self.magnitude_of_delay = None + self.tec = kwargs.get('tec', None) + + +class RouteResultSectionTec(msrest.serialization.Model): + """Details of the traffic event, using definitions in the `TPEG2-TEC `_ standard. Can contain effectCode and causes elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar effect_code: The effect on the traffic flow. Contains a value in the tec001:EffectCode + table, as defined in the `TPEG2-TEC `_ standard. Can + be used to color-code traffic events according to severity. + :vartype effect_code: int + :param causes: Causes array. + :type causes: list[~azure.maps.route.models.RouteResultSectionTecCause] + """ + + _validation = { + 'effect_code': {'readonly': True}, + } + + _attribute_map = { + 'effect_code': {'key': 'effectCode', 'type': 'int'}, + 'causes': {'key': 'causes', 'type': '[RouteResultSectionTecCause]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultSectionTec, self).__init__(**kwargs) + self.effect_code = None + self.causes = kwargs.get('causes', None) + + +class RouteResultSectionTecCause(msrest.serialization.Model): + """The cause of the traffic event. Can contain mainCauseCode and subCauseCode elements. Can be used to define iconography and descriptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar main_cause_code: The main cause of the traffic event. Contains a value in the + tec002:CauseCode table, as defined in the `TPEG2-TEC + `_ standard. + :vartype main_cause_code: int + :ivar sub_cause_code: The subcause of the traffic event. Contains a value in the sub cause + table defined by the mainCauseCode, as defined in the `TPEG2-TEC + `_ standard. + :vartype sub_cause_code: int + """ + + _validation = { + 'main_cause_code': {'readonly': True}, + 'sub_cause_code': {'readonly': True}, + } + + _attribute_map = { + 'main_cause_code': {'key': 'mainCauseCode', 'type': 'int'}, + 'sub_cause_code': {'key': 'subCauseCode', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultSectionTecCause, self).__init__(**kwargs) + self.main_cause_code = None + self.sub_cause_code = None diff --git a/sdk/maps/azure-maps-route/azure/maps/route/models/_models_py3.py b/sdk/maps/azure-maps-route/azure/maps/route/models/_models_py3.py new file mode 100644 index 000000000000..cf39a07a66dd --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/models/_models_py3.py @@ -0,0 +1,2083 @@ +# 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, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._route_client_enums import * + + +class BatchItem(msrest.serialization.Model): + """An item returned from Batch API. Extend with 'response' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + """ + + _validation = { + 'status_code': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchItem, self).__init__(**kwargs) + self.status_code = None + + +class BatchRequestBody(msrest.serialization.Model): + """This type represents the request body for the Batch service. + + :param batch_items: The list of queries to process. + :type batch_items: list[~azure.maps.route.models.BatchRequestBodyBatchItemsItem] + """ + + _attribute_map = { + 'batch_items': {'key': 'batchItems', 'type': '[BatchRequestBodyBatchItemsItem]'}, + } + + def __init__( + self, + *, + batch_items: Optional[List["BatchRequestBodyBatchItemsItem"]] = None, + **kwargs + ): + super(BatchRequestBody, self).__init__(**kwargs) + self.batch_items = batch_items + + +class BatchRequestBodyBatchItemsItem(msrest.serialization.Model): + """Batch Query object. + + :param query: Partial query string. + :type query: str + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__( + self, + *, + query: Optional[str] = None, + **kwargs + ): + super(BatchRequestBodyBatchItemsItem, self).__init__(**kwargs) + self.query = query + + +class BatchResponse(msrest.serialization.Model): + """This object is returned from a successful Batch service call. Extend with 'batchItems' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.route.models.BatchResponseSummary + """ + + _validation = { + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponse, self).__init__(**kwargs) + self.summary = None + + +class BatchResponseSummary(msrest.serialization.Model): + """Summary for the batch request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_requests: Number of successful requests in the batch. + :vartype successful_requests: int + :ivar total_requests: Total number of requests in the batch. + :vartype total_requests: int + """ + + _validation = { + 'successful_requests': {'readonly': True}, + 'total_requests': {'readonly': True}, + } + + _attribute_map = { + 'successful_requests': {'key': 'successfulRequests', 'type': 'int'}, + 'total_requests': {'key': 'totalRequests', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponseSummary, self).__init__(**kwargs) + self.successful_requests = None + self.total_requests = 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.route.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.route.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.route.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 GeoJsonFeatureData(msrest.serialization.Model): + """GeoJsonFeatureData. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.route.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + """ + + _validation = { + 'geometry': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + def __init__( + self, + *, + geometry: "GeoJsonGeometry", + properties: Optional[Any] = None, + id: Optional[str] = None, + feature_type: Optional[str] = None, + **kwargs + ): + super(GeoJsonFeatureData, self).__init__(**kwargs) + self.geometry = geometry + self.properties = properties + self.id = id + self.feature_type = feature_type + + +class GeoJsonObject(msrest.serialization.Model): + """A valid ``GeoJSON`` object. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonFeature, GeoJsonFeatureCollection, GeoJsonGeometry. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Feature': 'GeoJsonFeature', 'FeatureCollection': 'GeoJsonFeatureCollection', 'GeoJsonGeometry': 'GeoJsonGeometry'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonObject, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class GeoJsonFeature(GeoJsonObject, GeoJsonFeatureData): + """A valid ``GeoJSON Feature`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.route.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'geometry': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + geometry: "GeoJsonGeometry", + properties: Optional[Any] = None, + id: Optional[str] = None, + feature_type: Optional[str] = None, + **kwargs + ): + super(GeoJsonFeature, self).__init__(geometry=geometry, properties=properties, id=id, feature_type=feature_type, **kwargs) + self.geometry = geometry + self.properties = properties + self.id = id + self.feature_type = feature_type + self.type = 'Feature' # type: str + self.type = 'Feature' # type: str + + +class GeoJsonFeatureCollectionData(msrest.serialization.Model): + """GeoJsonFeatureCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.route.models.GeoJsonFeature] + """ + + _validation = { + 'features': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + } + + def __init__( + self, + *, + features: List["GeoJsonFeature"], + **kwargs + ): + super(GeoJsonFeatureCollectionData, self).__init__(**kwargs) + self.features = features + + +class GeoJsonFeatureCollection(GeoJsonObject, GeoJsonFeatureCollectionData): + """A valid ``GeoJSON FeatureCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.route.models.GeoJsonFeature] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'features': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + features: List["GeoJsonFeature"], + **kwargs + ): + super(GeoJsonFeatureCollection, self).__init__(features=features, **kwargs) + self.features = features + self.type = 'FeatureCollection' # type: str + self.type = 'FeatureCollection' # type: str + + +class GeoJsonGeometry(GeoJsonObject): + """A valid ``GeoJSON`` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonGeometryCollection, GeoJsonLineString, GeoJsonMultiLineString, GeoJsonMultiPoint, GeoJsonMultiPolygon, GeoJsonPoint, GeoJsonPolygon. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'GeometryCollection': 'GeoJsonGeometryCollection', 'LineString': 'GeoJsonLineString', 'MultiLineString': 'GeoJsonMultiLineString', 'MultiPoint': 'GeoJsonMultiPoint', 'MultiPolygon': 'GeoJsonMultiPolygon', 'Point': 'GeoJsonPoint', 'Polygon': 'GeoJsonPolygon'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometry, self).__init__(**kwargs) + self.type = 'GeoJsonGeometry' # type: str + + +class GeoJsonGeometryCollectionData(msrest.serialization.Model): + """GeoJsonGeometryCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.route.models.GeoJsonGeometry] + """ + + _validation = { + 'geometries': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + } + + def __init__( + self, + *, + geometries: List["GeoJsonGeometry"], + **kwargs + ): + super(GeoJsonGeometryCollectionData, self).__init__(**kwargs) + self.geometries = geometries + + +class GeoJsonGeometryCollection(GeoJsonGeometry, GeoJsonGeometryCollectionData): + """A valid ``GeoJSON GeometryCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.route.models.GeoJsonGeometry] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'geometries': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + geometries: List["GeoJsonGeometry"], + **kwargs + ): + super(GeoJsonGeometryCollection, self).__init__(geometries=geometries, **kwargs) + self.geometries = geometries + self.type = 'GeometryCollection' # type: str + self.type = 'GeometryCollection' # type: str + + +class GeoJsonLineStringData(msrest.serialization.Model): + """GeoJsonLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonLineStringData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonLineString(GeoJsonGeometry, GeoJsonLineStringData): + """A valid ``GeoJSON LineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonLineString, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'LineString' # type: str + self.type = 'LineString' # type: str + + +class GeoJsonMultiLineStringData(msrest.serialization.Model): + """GeoJsonMultiLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonMultiLineStringData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonMultiLineString(GeoJsonGeometry, GeoJsonMultiLineStringData): + """A valid ``GeoJSON MultiLineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonMultiLineString, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'MultiLineString' # type: str + self.type = 'MultiLineString' # type: str + + +class GeoJsonMultiPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson MultiPoint``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonMultiPointData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonMultiPoint(GeoJsonGeometry, GeoJsonMultiPointData): + """A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonMultiPoint, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'MultiPoint' # type: str + self.type = 'MultiPoint' # type: str + + +class GeoJsonMultiPolygonData(msrest.serialization.Model): + """GeoJsonMultiPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[List[float]]]], + **kwargs + ): + super(GeoJsonMultiPolygonData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonMultiPolygon(GeoJsonGeometry, GeoJsonMultiPolygonData): + """A valid ``GeoJSON MultiPolygon`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[List[float]]]], + **kwargs + ): + super(GeoJsonMultiPolygon, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'MultiPolygon' # type: str + self.type = 'MultiPolygon' # type: str + + +class GeoJsonPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson Point``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + } + + def __init__( + self, + *, + coordinates: List[float], + **kwargs + ): + super(GeoJsonPointData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonPoint(GeoJsonGeometry, GeoJsonPointData): + """A valid ``GeoJSON Point`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[float], + **kwargs + ): + super(GeoJsonPoint, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'Point' # type: str + self.type = 'Point' # type: str + + +class GeoJsonPolygonData(msrest.serialization.Model): + """GeoJsonPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonPolygonData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonPolygon(GeoJsonGeometry, GeoJsonPolygonData): + """A valid ``GeoJSON Polygon`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.route.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonPolygon, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'Polygon' # type: str + self.type = 'Polygon' # type: str + + +class GetRouteRangeResponse(msrest.serialization.Model): + """This object is returned from a successful Route Reachable Range 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 + :param reachable_range: Reachable Range. + :type reachable_range: ~azure.maps.route.models.RouteRange + :param report: Reports the effective settings used in the current call. + :type report: ~azure.maps.route.models.RouteResponseReport + """ + + _validation = { + 'format_version': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'reachable_range': {'key': 'reachableRange', 'type': 'RouteRange'}, + 'report': {'key': 'report', 'type': 'RouteResponseReport'}, + } + + def __init__( + self, + *, + reachable_range: Optional["RouteRange"] = None, + report: Optional["RouteResponseReport"] = None, + **kwargs + ): + super(GetRouteRangeResponse, self).__init__(**kwargs) + self.format_version = None + self.reachable_range = reachable_range + self.report = report + + +class LatLongPair(msrest.serialization.Model): + """A location represented as a latitude and longitude. + + :param latitude: Latitude property. + :type latitude: float + :param longitude: Longitude property. + :type longitude: float + """ + + _attribute_map = { + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + } + + def __init__( + self, + *, + latitude: Optional[float] = None, + longitude: Optional[float] = None, + **kwargs + ): + super(LatLongPair, self).__init__(**kwargs) + self.latitude = latitude + self.longitude = longitude + + +class PostRouteDirectionsRequestBody(msrest.serialization.Model): + """Post body parameters for Route directions. + + :param supporting_points: A GeoJSON Geometry collection representing sequence of coordinates + used as input for route reconstruction and for calculating zero or more alternative routes to + this reference route. + + + * The provided sequence of supporting points is used as input for route reconstruction. + * The alternative routes are calculated between the origin and destination points specified in + the base path parameter locations. + * If both *minDeviationDistance* and *minDeviationTime* are set to zero, then these origin and + destination points are + expected to be at (or very near) the beginning and end of the reference route, respectively. + * Intermediate locations (\ *waypoints*\ ) are not supported when using + :code:`<_supportingPoints_>`. + * The reference route may contain traffic incidents of type _ROAD\ *CLOSURE*\ , which are + ignored for the calculation of the reference route's travel time and traffic delay. + :type supporting_points: ~azure.maps.route.models.GeoJsonGeometryCollection + :param avoid_vignette: This is a list of 3-character, ISO 3166-1, alpha-3 country codes of + countries in which all toll roads with vignettes are to be avoided, e.g. "AUS,CHE". Toll roads + with vignettes in countries not in the list are unaffected. Note: It is an error to specify + both **avoidVignette** and **allowVignette**. + :type avoid_vignette: list[str] + :param allow_vignette: This is a list of 3-character, ISO 3166-1, alpha-3 country codes of + countries in which toll roads with vignettes are allowed, e.g. "AUS,CHE". Specifying + **allowVignette** with some countries X is equivalent to specifying **avoidVignette** with all + countries but X. Specifying **allowVignette** with an empty list is the same as avoiding all + toll roads with vignettes. Note: It is an error to specify both **avoidVignette** and + **allowVignette**. + :type allow_vignette: list[str] + :param avoid_areas: A GeoJSON MultiPolygon representing list of areas to avoid. Only rectangle + polygons are supported. The maximum size of a rectangle is about 160x160 km. Maximum number of + avoided areas is **10**. It cannot cross the 180th meridian. It must be between -80 and +80 + degrees of latitude. + :type avoid_areas: ~azure.maps.route.models.GeoJsonMultiPolygon + """ + + _attribute_map = { + 'supporting_points': {'key': 'supportingPoints', 'type': 'GeoJsonGeometryCollection'}, + 'avoid_vignette': {'key': 'avoidVignette', 'type': '[str]'}, + 'allow_vignette': {'key': 'allowVignette', 'type': '[str]'}, + 'avoid_areas': {'key': 'avoidAreas', 'type': 'GeoJsonMultiPolygon'}, + } + + def __init__( + self, + *, + supporting_points: Optional["GeoJsonGeometryCollection"] = None, + avoid_vignette: Optional[List[str]] = None, + allow_vignette: Optional[List[str]] = None, + avoid_areas: Optional["GeoJsonMultiPolygon"] = None, + **kwargs + ): + super(PostRouteDirectionsRequestBody, self).__init__(**kwargs) + self.supporting_points = supporting_points + self.avoid_vignette = avoid_vignette + self.allow_vignette = allow_vignette + self.avoid_areas = avoid_areas + + +class PostRouteMatrixRequestBody(msrest.serialization.Model): + """An object with a matrix of coordinates. + + :param origins: A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 + `_ for details. + :type origins: ~azure.maps.route.models.GeoJsonMultiPoint + :param destinations: A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 + `_ for details. + :type destinations: ~azure.maps.route.models.GeoJsonMultiPoint + """ + + _attribute_map = { + 'origins': {'key': 'origins', 'type': 'GeoJsonMultiPoint'}, + 'destinations': {'key': 'destinations', 'type': 'GeoJsonMultiPoint'}, + } + + def __init__( + self, + *, + origins: Optional["GeoJsonMultiPoint"] = None, + destinations: Optional["GeoJsonMultiPoint"] = None, + **kwargs + ): + super(PostRouteMatrixRequestBody, self).__init__(**kwargs) + self.origins = origins + self.destinations = destinations + + +class RouteDirectionsBatchItem(BatchItem): + """An item returned from Route Directions Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. RouteDirectionsResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.route.models.RouteDirectionsBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'RouteDirectionsBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsBatchItem, self).__init__(**kwargs) + self.response = None + + +class RouteDirectionsResponse(msrest.serialization.Model): + """This object is returned from a successful Route Directions 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 routes: Routes array. + :vartype routes: list[~azure.maps.route.models.RouteDirectionsResult] + :ivar optimized_waypoints: Optimized sequence of waypoints. It shows the index from the user + provided waypoint sequence for the original and optimized list. For instance, a response: + + .. code-block:: + + + + + + + + means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the + index starts by 0 the original is "first, second, third" while the optimized is "second, third, + first". + :vartype optimized_waypoints: list[~azure.maps.route.models.RouteOptimizedWaypoint] + :param report: Reports the effective settings used in the current call. + :type report: ~azure.maps.route.models.RouteResponseReport + """ + + _validation = { + 'format_version': {'readonly': True}, + 'routes': {'readonly': True}, + 'optimized_waypoints': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'routes': {'key': 'routes', 'type': '[RouteDirectionsResult]'}, + 'optimized_waypoints': {'key': 'optimizedWaypoints', 'type': '[RouteOptimizedWaypoint]'}, + 'report': {'key': 'report', 'type': 'RouteResponseReport'}, + } + + def __init__( + self, + *, + report: Optional["RouteResponseReport"] = None, + **kwargs + ): + super(RouteDirectionsResponse, self).__init__(**kwargs) + self.format_version = None + self.routes = None + self.optimized_waypoints = None + self.report = report + + +class RouteDirectionsBatchItemResponse(ErrorResponse, RouteDirectionsResponse): + """The result of the query. RouteDirectionsResponse if the query completed successfully, ErrorResponse otherwise. + + 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 routes: Routes array. + :vartype routes: list[~azure.maps.route.models.RouteDirectionsResult] + :ivar optimized_waypoints: Optimized sequence of waypoints. It shows the index from the user + provided waypoint sequence for the original and optimized list. For instance, a response: + + .. code-block:: + + + + + + + + means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the + index starts by 0 the original is "first, second, third" while the optimized is "second, third, + first". + :vartype optimized_waypoints: list[~azure.maps.route.models.RouteOptimizedWaypoint] + :param report: Reports the effective settings used in the current call. + :type report: ~azure.maps.route.models.RouteResponseReport + :param error: The error object. + :type error: ~azure.maps.route.models.ErrorDetail + """ + + _validation = { + 'format_version': {'readonly': True}, + 'routes': {'readonly': True}, + 'optimized_waypoints': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'routes': {'key': 'routes', 'type': '[RouteDirectionsResult]'}, + 'optimized_waypoints': {'key': 'optimizedWaypoints', 'type': '[RouteOptimizedWaypoint]'}, + 'report': {'key': 'report', 'type': 'RouteResponseReport'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + report: Optional["RouteResponseReport"] = None, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(RouteDirectionsBatchItemResponse, self).__init__(error=error, report=report, **kwargs) + self.format_version = None + self.routes = None + self.optimized_waypoints = None + self.report = report + self.error = error + + +class RouteDirectionsBatchResponse(BatchResponse): + """This object is returned from a successful Route Directions Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.route.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.route.models.RouteDirectionsBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[RouteDirectionsBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class RouteDirectionsResult(msrest.serialization.Model): + """RouteDirectionsResult. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object. + :vartype summary: ~azure.maps.route.models.RouteDirectionsSummary + :ivar legs: Legs array. + :vartype legs: list[~azure.maps.route.models.RouteResultLeg] + :ivar sections: Sections array. + :vartype sections: list[~azure.maps.route.models.RouteResultSection] + :ivar guidance: Contains guidance related elements. This field is present only when guidance + was requested and is available. + :vartype guidance: ~azure.maps.route.models.RouteResultGuidance + """ + + _validation = { + 'summary': {'readonly': True}, + 'legs': {'readonly': True}, + 'sections': {'readonly': True}, + 'guidance': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'RouteDirectionsSummary'}, + 'legs': {'key': 'legs', 'type': '[RouteResultLeg]'}, + 'sections': {'key': 'sections', 'type': '[RouteResultSection]'}, + 'guidance': {'key': 'guidance', 'type': 'RouteResultGuidance'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsResult, self).__init__(**kwargs) + self.summary = None + self.legs = None + self.sections = None + self.guidance = None + + +class RouteDirectionsSummary(msrest.serialization.Model): + """Summary object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar length_in_meters: Length In Meters property. + :vartype length_in_meters: int + :ivar travel_time_in_seconds: Estimated travel time in seconds property that includes the delay + due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes + the delay due to traffic. If DepartAt is in the future, travel time is calculated using + time-dependent historic traffic data. + :vartype travel_time_in_seconds: int + :ivar traffic_delay_in_seconds: Estimated delay in seconds caused by the real-time incident(s) + according to traffic information. For routes planned with departure time in the future, delays + is always 0. To return additional travel times using different types of traffic information, + parameter computeTravelTimeFor=all needs to be added. + :vartype traffic_delay_in_seconds: int + :ivar departure_time: Departure Time property. + :vartype departure_time: str + :ivar arrival_time: Arrival Time property. + :vartype arrival_time: str + """ + + _validation = { + 'length_in_meters': {'readonly': True}, + 'travel_time_in_seconds': {'readonly': True}, + 'traffic_delay_in_seconds': {'readonly': True}, + 'departure_time': {'readonly': True}, + 'arrival_time': {'readonly': True}, + } + + _attribute_map = { + 'length_in_meters': {'key': 'lengthInMeters', 'type': 'int'}, + 'travel_time_in_seconds': {'key': 'travelTimeInSeconds', 'type': 'int'}, + 'traffic_delay_in_seconds': {'key': 'trafficDelayInSeconds', 'type': 'int'}, + 'departure_time': {'key': 'departureTime', 'type': 'str'}, + 'arrival_time': {'key': 'arrivalTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteDirectionsSummary, self).__init__(**kwargs) + self.length_in_meters = None + self.travel_time_in_seconds = None + self.traffic_delay_in_seconds = None + self.departure_time = None + self.arrival_time = None + + +class RouteMatrixResponse(msrest.serialization.Model): + """This object is returned from a successful Route Matrix call. For ex, if 2 origins and 3 destinations are provided, there are going to 2 arrays with 3 elements in each. Each element's content depends on the options provided in the query. + + 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 matrix: Results as a 2 dimensional array of route summaries. + :vartype matrix: list[list[~azure.maps.route.models.RouteMatrixResult]] + :ivar summary: Summary object. + :vartype summary: ~azure.maps.route.models.RouteMatrixSummary + """ + + _validation = { + 'format_version': {'readonly': True}, + 'matrix': {'readonly': True}, + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'format_version': {'key': 'formatVersion', 'type': 'str'}, + 'matrix': {'key': 'matrix', 'type': '[[RouteMatrixResult]]'}, + 'summary': {'key': 'summary', 'type': 'RouteMatrixSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixResponse, self).__init__(**kwargs) + self.format_version = None + self.matrix = None + self.summary = None + + +class RouteMatrixResult(msrest.serialization.Model): + """Matrix result object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: StatusCode property for the current cell in the input matrix. + :vartype status_code: int + :ivar response: Response object of the current cell in the input matrix. + :vartype response: ~azure.maps.route.models.RouteMatrixResultResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'response': {'key': 'response', 'type': 'RouteMatrixResultResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixResult, self).__init__(**kwargs) + self.status_code = None + self.response = None + + +class RouteMatrixResultResponse(msrest.serialization.Model): + """Response object of the current cell in the input matrix. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar route_summary: Summary object for route section. + :vartype route_summary: ~azure.maps.route.models.RouteResultLegSummary + """ + + _validation = { + 'route_summary': {'readonly': True}, + } + + _attribute_map = { + 'route_summary': {'key': 'routeSummary', 'type': 'RouteResultLegSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixResultResponse, self).__init__(**kwargs) + self.route_summary = None + + +class RouteMatrixSummary(msrest.serialization.Model): + """Summary object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_routes: Number of successful routes in the response. + :vartype successful_routes: int + :ivar total_routes: Total number of routes requested. Number of cells in the input matrix. + :vartype total_routes: int + """ + + _validation = { + 'successful_routes': {'readonly': True}, + 'total_routes': {'readonly': True}, + } + + _attribute_map = { + 'successful_routes': {'key': 'successfulRoutes', 'type': 'int'}, + 'total_routes': {'key': 'totalRoutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteMatrixSummary, self).__init__(**kwargs) + self.successful_routes = None + self.total_routes = None + + +class RouteOptimizedWaypoint(msrest.serialization.Model): + """Optimized way point object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provided_index: Way point index provided by the user. + :vartype provided_index: int + :ivar optimized_index: Optimized way point index from the system. + :vartype optimized_index: int + """ + + _validation = { + 'provided_index': {'readonly': True}, + 'optimized_index': {'readonly': True}, + } + + _attribute_map = { + 'provided_index': {'key': 'providedIndex', 'type': 'int'}, + 'optimized_index': {'key': 'optimizedIndex', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteOptimizedWaypoint, self).__init__(**kwargs) + self.provided_index = None + self.optimized_index = None + + +class RouteRange(msrest.serialization.Model): + """Reachable Range. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param center: Center point of the reachable range. + :type center: ~azure.maps.route.models.LatLongPair + :ivar boundary: Polygon boundary of the reachable range represented as a list of points. + :vartype boundary: list[~azure.maps.route.models.LatLongPair] + """ + + _validation = { + 'boundary': {'readonly': True}, + } + + _attribute_map = { + 'center': {'key': 'center', 'type': 'LatLongPair'}, + 'boundary': {'key': 'boundary', 'type': '[LatLongPair]'}, + } + + def __init__( + self, + *, + center: Optional["LatLongPair"] = None, + **kwargs + ): + super(RouteRange, self).__init__(**kwargs) + self.center = center + self.boundary = None + + +class RouteResponseReport(msrest.serialization.Model): + """Reports the effective settings used in the current call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar effective_settings: Effective parameters or data used when calling this Route API. + :vartype effective_settings: list[~azure.maps.route.models.RouteResponseReportEffectiveSetting] + """ + + _validation = { + 'effective_settings': {'readonly': True}, + } + + _attribute_map = { + 'effective_settings': {'key': 'effectiveSettings', 'type': '[RouteResponseReportEffectiveSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResponseReport, self).__init__(**kwargs) + self.effective_settings = None + + +class RouteResponseReportEffectiveSetting(msrest.serialization.Model): + """Effective parameter or data used when calling this Route API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key: Name of the parameter used. + :vartype key: str + :ivar value: Value of the parameter used. + :vartype value: str + """ + + _validation = { + 'key': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResponseReportEffectiveSetting, self).__init__(**kwargs) + self.key = None + self.value = None + + +class RouteResultGuidance(msrest.serialization.Model): + """Contains guidance related elements. This field is present only when guidance was requested and is available. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar instructions: A list of instructions describing maneuvers. + :vartype instructions: list[~azure.maps.route.models.RouteResultInstruction] + :ivar instruction_groups: Groups a sequence of instruction elements which are related to each + other. + :vartype instruction_groups: list[~azure.maps.route.models.RouteResultInstructionGroup] + """ + + _validation = { + 'instructions': {'readonly': True}, + 'instruction_groups': {'readonly': True}, + } + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[RouteResultInstruction]'}, + 'instruction_groups': {'key': 'instructionGroups', 'type': '[RouteResultInstructionGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultGuidance, self).__init__(**kwargs) + self.instructions = None + self.instruction_groups = None + + +class RouteResultInstruction(msrest.serialization.Model): + """A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar route_offset_in_meters: Distance from the start of the route to the point of the + instruction. + :vartype route_offset_in_meters: int + :ivar travel_time_in_seconds: Estimated travel time up to the point corresponding to + routeOffsetInMeters. + :vartype travel_time_in_seconds: int + :param point: A location represented as a latitude and longitude. + :type point: ~azure.maps.route.models.LatLongPair + :ivar point_index: The index of the point in the list of polyline "points" corresponding to the + point of the instruction. + :vartype point_index: int + :param instruction_type: Type of the instruction, e.g., turn or change of road form. Possible + values include: "TURN", "ROAD_CHANGE", "LOCATION_DEPARTURE", "LOCATION_ARRIVAL", + "DIRECTION_INFO", "LOCATION_WAYPOINT". + :type instruction_type: str or ~azure.maps.route.models.GuidanceInstructionType + :ivar road_numbers: The road number(s) of the next significant road segment(s) after the + maneuver, or of the road(s) to be followed. Example: ["E34", "N205"]. + :vartype road_numbers: list[str] + :ivar exit_number: The number(s) of a highway exit taken by the current maneuver. If an exit + has multiple exit numbers, they will be separated by "," and possibly aggregated by "-", e.g., + "10, 13-15". + :vartype exit_number: str + :ivar street: Street name of the next significant road segment after the maneuver, or of the + street that should be followed. + :vartype street: str + :ivar signpost_text: The text on a signpost which is most relevant to the maneuver, or to the + direction that should be followed. + :vartype signpost_text: str + :ivar country_code: 3-character `ISO 3166-1 `_ + alpha-3 country code. E.g. USA. + :vartype country_code: str + :ivar state_code: A subdivision (e.g., state) of the country, represented by the second part of + an `ISO 3166-2 `_ code. This is only available for + some countries like the US, Canada, and Mexico. + :vartype state_code: str + :ivar junction_type: The type of the junction where the maneuver takes place. For larger + roundabouts, two separate instructions are generated for entering and leaving the roundabout. + Possible values include: "REGULAR", "ROUNDABOUT", "BIFURCATION". + :vartype junction_type: str or ~azure.maps.route.models.JunctionType + :ivar turn_angle_in_decimal_degrees: Indicates the direction of an instruction. If junctionType + indicates a turn instruction: + + + * 180 = U-turn + * [-179, -1] = Left turn + * 0 = Straight on (a '0 degree' turn) + * [1, 179] = Right turn + + If junctionType indicates a bifurcation instruction: + + + * <0 - keep left + * >0 - keep right. + :vartype turn_angle_in_decimal_degrees: int + :ivar roundabout_exit_number: This indicates which exit to take at a roundabout. + :vartype roundabout_exit_number: str + :ivar possible_combine_with_next: It is possible to optionally combine the instruction with the + next one. This can be used to build messages like "Turn left and then turn right". + :vartype possible_combine_with_next: bool + :ivar driving_side: Indicates left-hand vs. right-hand side driving at the point of the + maneuver. Possible values include: "LEFT", "RIGHT". + :vartype driving_side: str or ~azure.maps.route.models.DrivingSide + :ivar maneuver: A code identifying the maneuver. Possible values include: "ARRIVE", + "ARRIVE_LEFT", "ARRIVE_RIGHT", "DEPART", "STRAIGHT", "KEEP_RIGHT", "BEAR_RIGHT", "TURN_RIGHT", + "SHARP_RIGHT", "KEEP_LEFT", "BEAR_LEFT", "TURN_LEFT", "SHARP_LEFT", "MAKE_UTURN", + "ENTER_MOTORWAY", "ENTER_FREEWAY", "ENTER_HIGHWAY", "TAKE_EXIT", "MOTORWAY_EXIT_LEFT", + "MOTORWAY_EXIT_RIGHT", "TAKE_FERRY", "ROUNDABOUT_CROSS", "ROUNDABOUT_RIGHT", "ROUNDABOUT_LEFT", + "ROUNDABOUT_BACK", "TRY_MAKE_UTURN", "FOLLOW", "SWITCH_PARALLEL_ROAD", "SWITCH_MAIN_ROAD", + "ENTRANCE_RAMP", "WAYPOINT_LEFT", "WAYPOINT_RIGHT", "WAYPOINT_REACHED". + :vartype maneuver: str or ~azure.maps.route.models.GuidanceManeuver + :ivar message: A human-readable message for the maneuver. + :vartype message: str + :ivar combined_message: A human-readable message for the maneuver combined with the message + from the next instruction. Sometimes it is possible to combine two successive instructions into + a single instruction making it easier to follow. When this is the case the + possibleCombineWithNext flag will be true. For example: + + .. code-block:: + + 10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + 11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam + + The possibleCombineWithNext flag on instruction 10 is true. This indicates to the clients of + coded guidance that it can be combined with instruction 11. The instructions will be combined + automatically for clients requesting human-readable guidance. The combinedMessage field + contains the combined message: + + .. code-block:: + + Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam + then follow Einsteinweg/A10/E22 towards Ring Amsterdam. + :vartype combined_message: str + """ + + _validation = { + 'route_offset_in_meters': {'readonly': True}, + 'travel_time_in_seconds': {'readonly': True}, + 'point_index': {'readonly': True}, + 'road_numbers': {'readonly': True}, + 'exit_number': {'readonly': True}, + 'street': {'readonly': True}, + 'signpost_text': {'readonly': True}, + 'country_code': {'readonly': True}, + 'state_code': {'readonly': True}, + 'junction_type': {'readonly': True}, + 'turn_angle_in_decimal_degrees': {'readonly': True}, + 'roundabout_exit_number': {'readonly': True}, + 'possible_combine_with_next': {'readonly': True}, + 'driving_side': {'readonly': True}, + 'maneuver': {'readonly': True}, + 'message': {'readonly': True}, + 'combined_message': {'readonly': True}, + } + + _attribute_map = { + 'route_offset_in_meters': {'key': 'routeOffsetInMeters', 'type': 'int'}, + 'travel_time_in_seconds': {'key': 'travelTimeInSeconds', 'type': 'int'}, + 'point': {'key': 'point', 'type': 'LatLongPair'}, + 'point_index': {'key': 'pointIndex', 'type': 'int'}, + 'instruction_type': {'key': 'instructionType', 'type': 'str'}, + 'road_numbers': {'key': 'roadNumbers', 'type': '[str]'}, + 'exit_number': {'key': 'exitNumber', 'type': 'str'}, + 'street': {'key': 'street', 'type': 'str'}, + 'signpost_text': {'key': 'signpostText', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'state_code': {'key': 'stateCode', 'type': 'str'}, + 'junction_type': {'key': 'junctionType', 'type': 'str'}, + 'turn_angle_in_decimal_degrees': {'key': 'turnAngleInDecimalDegrees', 'type': 'int'}, + 'roundabout_exit_number': {'key': 'roundaboutExitNumber', 'type': 'str'}, + 'possible_combine_with_next': {'key': 'possibleCombineWithNext', 'type': 'bool'}, + 'driving_side': {'key': 'drivingSide', 'type': 'str'}, + 'maneuver': {'key': 'maneuver', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'combined_message': {'key': 'combinedMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + point: Optional["LatLongPair"] = None, + instruction_type: Optional[Union[str, "GuidanceInstructionType"]] = None, + **kwargs + ): + super(RouteResultInstruction, self).__init__(**kwargs) + self.route_offset_in_meters = None + self.travel_time_in_seconds = None + self.point = point + self.point_index = None + self.instruction_type = instruction_type + self.road_numbers = None + self.exit_number = None + self.street = None + self.signpost_text = None + self.country_code = None + self.state_code = None + self.junction_type = None + self.turn_angle_in_decimal_degrees = None + self.roundabout_exit_number = None + self.possible_combine_with_next = None + self.driving_side = None + self.maneuver = None + self.message = None + self.combined_message = None + + +class RouteResultInstructionGroup(msrest.serialization.Model): + """Groups a sequence of instruction elements which are related to each other. The sequence range is constrained with firstInstructionIndex and lastInstructionIndex. When human-readable text messages are requested for guidance (instructionType=text or tagged), then the instructionGroup has a summary message returned when available. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar first_instruction_index: Index of the first instruction. + :vartype first_instruction_index: int + :ivar last_instruction_index: Index of the last instruction. + :vartype last_instruction_index: int + :ivar group_length_in_meters: Length of the group. + :vartype group_length_in_meters: int + :ivar group_message: Summary message when human-readable text messages are requested for + guidance (instructionType=text or tagged). + :vartype group_message: str + """ + + _validation = { + 'first_instruction_index': {'readonly': True}, + 'last_instruction_index': {'readonly': True}, + 'group_length_in_meters': {'readonly': True}, + 'group_message': {'readonly': True}, + } + + _attribute_map = { + 'first_instruction_index': {'key': 'firstInstructionIndex', 'type': 'int'}, + 'last_instruction_index': {'key': 'lastInstructionIndex', 'type': 'int'}, + 'group_length_in_meters': {'key': 'groupLengthInMeters', 'type': 'int'}, + 'group_message': {'key': 'groupMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultInstructionGroup, self).__init__(**kwargs) + self.first_instruction_index = None + self.last_instruction_index = None + self.group_length_in_meters = None + self.group_message = None + + +class RouteResultLeg(msrest.serialization.Model): + """RouteResultLeg. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for route section. + :vartype summary: ~azure.maps.route.models.RouteResultLegSummary + :ivar points: Points array. + :vartype points: list[~azure.maps.route.models.LatLongPair] + """ + + _validation = { + 'summary': {'readonly': True}, + 'points': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'RouteResultLegSummary'}, + 'points': {'key': 'points', 'type': '[LatLongPair]'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultLeg, self).__init__(**kwargs) + self.summary = None + self.points = None + + +class RouteResultLegSummary(msrest.serialization.Model): + """Summary object for route section. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar length_in_meters: Length In Meters property. + :vartype length_in_meters: int + :ivar travel_time_in_seconds: Estimated travel time in seconds property that includes the delay + due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes + the delay due to traffic. If DepartAt is in the future, travel time is calculated using + time-dependent historic traffic data. + :vartype travel_time_in_seconds: int + :ivar traffic_delay_in_seconds: Estimated delay in seconds caused by the real-time incident(s) + according to traffic information. For routes planned with departure time in the future, delays + is always 0. To return additional travel times using different types of traffic information, + parameter computeTravelTimeFor=all needs to be added. + :vartype traffic_delay_in_seconds: int + :ivar departure_time: Departure Time property. + :vartype departure_time: str + :ivar arrival_time: Arrival Time property. + :vartype arrival_time: str + :ivar no_traffic_travel_time_in_seconds: Estimated travel time calculated as if there are no + delays on the route due to traffic conditions (e.g. congestion). Included only if + computeTravelTimeFor = all is used in the query. + :vartype no_traffic_travel_time_in_seconds: int + :ivar historic_traffic_travel_time_in_seconds: Estimated travel time calculated using + time-dependent historic traffic data. Included only if computeTravelTimeFor = all is used in + the query. + :vartype historic_traffic_travel_time_in_seconds: int + :ivar live_traffic_incidents_travel_time_in_seconds: Estimated travel time calculated using + real-time speed data. Included only if computeTravelTimeFor = all is used in the query. + :vartype live_traffic_incidents_travel_time_in_seconds: int + :ivar fuel_consumption_in_liters: Estimated fuel consumption in liters using the Combustion + Consumption Model. Included if vehicleEngineType is set to *combustion* and + constantSpeedConsumptionInLitersPerHundredkm is specified. The value will be non-negative. + :vartype fuel_consumption_in_liters: float + :ivar battery_consumption_ink_wh: Estimated electric energy consumption in kilowatt hours (kWh) + using the Electric Consumption Model. Included if vehicleEngineType is set to electric and + constantSpeedConsumptionInkWhPerHundredkm is specified. The value of batteryConsumptionInkWh + includes the recuperated electric energy and can therefore be negative (which indicates gaining + energy). If both maxChargeInkWh and currentChargeInkWh are specified, recuperation will be + capped to ensure that the battery charge level never exceeds maxChargeInkWh. If neither + maxChargeInkWh nor currentChargeInkWh are specified, unconstrained recuperation is assumed in + the consumption calculation. + :vartype battery_consumption_ink_wh: float + """ + + _validation = { + 'length_in_meters': {'readonly': True}, + 'travel_time_in_seconds': {'readonly': True}, + 'traffic_delay_in_seconds': {'readonly': True}, + 'departure_time': {'readonly': True}, + 'arrival_time': {'readonly': True}, + 'no_traffic_travel_time_in_seconds': {'readonly': True}, + 'historic_traffic_travel_time_in_seconds': {'readonly': True}, + 'live_traffic_incidents_travel_time_in_seconds': {'readonly': True}, + 'fuel_consumption_in_liters': {'readonly': True}, + 'battery_consumption_ink_wh': {'readonly': True}, + } + + _attribute_map = { + 'length_in_meters': {'key': 'lengthInMeters', 'type': 'int'}, + 'travel_time_in_seconds': {'key': 'travelTimeInSeconds', 'type': 'int'}, + 'traffic_delay_in_seconds': {'key': 'trafficDelayInSeconds', 'type': 'int'}, + 'departure_time': {'key': 'departureTime', 'type': 'str'}, + 'arrival_time': {'key': 'arrivalTime', 'type': 'str'}, + 'no_traffic_travel_time_in_seconds': {'key': 'noTrafficTravelTimeInSeconds', 'type': 'int'}, + 'historic_traffic_travel_time_in_seconds': {'key': 'historicTrafficTravelTimeInSeconds', 'type': 'int'}, + 'live_traffic_incidents_travel_time_in_seconds': {'key': 'liveTrafficIncidentsTravelTimeInSeconds', 'type': 'int'}, + 'fuel_consumption_in_liters': {'key': 'fuelConsumptionInLiters', 'type': 'float'}, + 'battery_consumption_ink_wh': {'key': 'batteryConsumptionInkWh', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultLegSummary, self).__init__(**kwargs) + self.length_in_meters = None + self.travel_time_in_seconds = None + self.traffic_delay_in_seconds = None + self.departure_time = None + self.arrival_time = None + self.no_traffic_travel_time_in_seconds = None + self.historic_traffic_travel_time_in_seconds = None + self.live_traffic_incidents_travel_time_in_seconds = None + self.fuel_consumption_in_liters = None + self.battery_consumption_ink_wh = None + + +class RouteResultSection(msrest.serialization.Model): + """RouteResultSection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar start_point_index: Start Point Index property. + :vartype start_point_index: int + :ivar end_point_index: End Point Index property. + :vartype end_point_index: int + :ivar section_type: Section Type property. + :vartype section_type: str + :ivar travel_mode: Travel Mode property. + :vartype travel_mode: str + :ivar simple_category: Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or + OTHER. See "tec" for detailed information. + :vartype simple_category: str + :ivar effective_speed_in_kmh: Effective speed of the incident in km/h, averaged over its entire + length. + :vartype effective_speed_in_kmh: int + :ivar delay_in_seconds: Delay in seconds caused by the incident. + :vartype delay_in_seconds: int + :ivar magnitude_of_delay: The magnitude of delay caused by the incident. These values + correspond to the values of the response field ty of the `Get Traffic Incident Detail API + `_. Possible values + include: "0", "1", "2", "3", "4". + :vartype magnitude_of_delay: str or ~azure.maps.route.models.MagnitudeOfDelay + :param tec: Details of the traffic event, using definitions in the `TPEG2-TEC + `_ standard. Can contain effectCode and causes + elements. + :type tec: ~azure.maps.route.models.RouteResultSectionTec + """ + + _validation = { + 'start_point_index': {'readonly': True}, + 'end_point_index': {'readonly': True}, + 'section_type': {'readonly': True}, + 'travel_mode': {'readonly': True}, + 'simple_category': {'readonly': True}, + 'effective_speed_in_kmh': {'readonly': True}, + 'delay_in_seconds': {'readonly': True}, + 'magnitude_of_delay': {'readonly': True}, + } + + _attribute_map = { + 'start_point_index': {'key': 'startPointIndex', 'type': 'int'}, + 'end_point_index': {'key': 'endPointIndex', 'type': 'int'}, + 'section_type': {'key': 'sectionType', 'type': 'str'}, + 'travel_mode': {'key': 'travelMode', 'type': 'str'}, + 'simple_category': {'key': 'simpleCategory', 'type': 'str'}, + 'effective_speed_in_kmh': {'key': 'effectiveSpeedInKmh', 'type': 'int'}, + 'delay_in_seconds': {'key': 'delayInSeconds', 'type': 'int'}, + 'magnitude_of_delay': {'key': 'magnitudeOfDelay', 'type': 'str'}, + 'tec': {'key': 'tec', 'type': 'RouteResultSectionTec'}, + } + + def __init__( + self, + *, + tec: Optional["RouteResultSectionTec"] = None, + **kwargs + ): + super(RouteResultSection, self).__init__(**kwargs) + self.start_point_index = None + self.end_point_index = None + self.section_type = None + self.travel_mode = None + self.simple_category = None + self.effective_speed_in_kmh = None + self.delay_in_seconds = None + self.magnitude_of_delay = None + self.tec = tec + + +class RouteResultSectionTec(msrest.serialization.Model): + """Details of the traffic event, using definitions in the `TPEG2-TEC `_ standard. Can contain effectCode and causes elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar effect_code: The effect on the traffic flow. Contains a value in the tec001:EffectCode + table, as defined in the `TPEG2-TEC `_ standard. Can + be used to color-code traffic events according to severity. + :vartype effect_code: int + :param causes: Causes array. + :type causes: list[~azure.maps.route.models.RouteResultSectionTecCause] + """ + + _validation = { + 'effect_code': {'readonly': True}, + } + + _attribute_map = { + 'effect_code': {'key': 'effectCode', 'type': 'int'}, + 'causes': {'key': 'causes', 'type': '[RouteResultSectionTecCause]'}, + } + + def __init__( + self, + *, + causes: Optional[List["RouteResultSectionTecCause"]] = None, + **kwargs + ): + super(RouteResultSectionTec, self).__init__(**kwargs) + self.effect_code = None + self.causes = causes + + +class RouteResultSectionTecCause(msrest.serialization.Model): + """The cause of the traffic event. Can contain mainCauseCode and subCauseCode elements. Can be used to define iconography and descriptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar main_cause_code: The main cause of the traffic event. Contains a value in the + tec002:CauseCode table, as defined in the `TPEG2-TEC + `_ standard. + :vartype main_cause_code: int + :ivar sub_cause_code: The subcause of the traffic event. Contains a value in the sub cause + table defined by the mainCauseCode, as defined in the `TPEG2-TEC + `_ standard. + :vartype sub_cause_code: int + """ + + _validation = { + 'main_cause_code': {'readonly': True}, + 'sub_cause_code': {'readonly': True}, + } + + _attribute_map = { + 'main_cause_code': {'key': 'mainCauseCode', 'type': 'int'}, + 'sub_cause_code': {'key': 'subCauseCode', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteResultSectionTecCause, self).__init__(**kwargs) + self.main_cause_code = None + self.sub_cause_code = None diff --git a/sdk/maps/azure-maps-route/azure/maps/route/models/_route_client_enums.py b/sdk/maps/azure-maps-route/azure/maps/route/models/_route_client_enums.py new file mode 100644 index 000000000000..a1929b626787 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/models/_route_client_enums.py @@ -0,0 +1,368 @@ +# 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 AlternativeRouteType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Allow any alternative route to be returned irrespective of how it compares to the reference + #: route in terms of optimality. + ANY_ROUTE = "anyRoute" + #: Return an alternative route only if it is better than the reference route according to the + #: given planning criteria. + BETTER_ROUTE = "betterRoute" + +class ComputeTravelTimeFor(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Does not compute additional travel times. + NONE = "none" + #: Computes travel times for all types of traffic information and specifies all results in the + #: fields noTrafficTravelTimeInSeconds, historicTrafficTravelTimeInSeconds and + #: liveTrafficIncidentsTravelTimeInSeconds being included in the summaries in the route response. + ALL = "all" + +class DrivingSide(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates left-hand vs. right-hand side driving at the point of the maneuver. + """ + + #: Left side. + LEFT = "LEFT" + #: Right side. + RIGHT = "RIGHT" + +class GeoJsonObjectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON object types - Point, + MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and + FeatureCollection. + """ + + #: ``GeoJSON Point`` geometry. + GEO_JSON_POINT = "Point" + #: ``GeoJSON MultiPoint`` geometry. + GEO_JSON_MULTI_POINT = "MultiPoint" + #: ``GeoJSON LineString`` geometry. + GEO_JSON_LINE_STRING = "LineString" + #: ``GeoJSON MultiLineString`` geometry. + GEO_JSON_MULTI_LINE_STRING = "MultiLineString" + #: ``GeoJSON Polygon`` geometry. + GEO_JSON_POLYGON = "Polygon" + #: ``GeoJSON MultiPolygon`` geometry. + GEO_JSON_MULTI_POLYGON = "MultiPolygon" + #: ``GeoJSON GeometryCollection`` geometry. + GEO_JSON_GEOMETRY_COLLECTION = "GeometryCollection" + #: ``GeoJSON Feature`` object. + GEO_JSON_FEATURE = "Feature" + #: ``GeoJSON FeatureCollection`` object. + GEO_JSON_FEATURE_COLLECTION = "FeatureCollection" + +class GuidanceInstructionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the instruction, e.g., turn or change of road form. + """ + + #: Turn. + TURN = "TURN" + #: Road Change. + ROAD_CHANGE = "ROAD_CHANGE" + #: Departure location. + LOCATION_DEPARTURE = "LOCATION_DEPARTURE" + #: Arrival location. + LOCATION_ARRIVAL = "LOCATION_ARRIVAL" + #: Direction information. + DIRECTION_INFO = "DIRECTION_INFO" + #: Way point location. + LOCATION_WAYPOINT = "LOCATION_WAYPOINT" + +class GuidanceManeuver(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """A code identifying the maneuver. + """ + + #: You have arrived. + ARRIVE = "ARRIVE" + #: You have arrived. Your destination is on the left. + ARRIVE_LEFT = "ARRIVE_LEFT" + #: You have arrived. Your destination is on the right. + ARRIVE_RIGHT = "ARRIVE_RIGHT" + #: Leave. + DEPART = "DEPART" + #: Keep straight on. + STRAIGHT = "STRAIGHT" + #: Keep right. + KEEP_RIGHT = "KEEP_RIGHT" + #: Bear right. + BEAR_RIGHT = "BEAR_RIGHT" + #: Turn right. + TURN_RIGHT = "TURN_RIGHT" + #: Turn sharp right. + SHARP_RIGHT = "SHARP_RIGHT" + #: Keep left. + KEEP_LEFT = "KEEP_LEFT" + #: Bear left. + BEAR_LEFT = "BEAR_LEFT" + #: Turn left. + TURN_LEFT = "TURN_LEFT" + #: Turn sharp left. + SHARP_LEFT = "SHARP_LEFT" + #: Make a U-turn. + MAKE_UTURN = "MAKE_UTURN" + #: Take the motorway. + ENTER_MOTORWAY = "ENTER_MOTORWAY" + #: Take the freeway. + ENTER_FREEWAY = "ENTER_FREEWAY" + #: Take the highway. + ENTER_HIGHWAY = "ENTER_HIGHWAY" + #: Take the exit. + TAKE_EXIT = "TAKE_EXIT" + #: Take the left exit. + MOTORWAY_EXIT_LEFT = "MOTORWAY_EXIT_LEFT" + #: Take the right exit. + MOTORWAY_EXIT_RIGHT = "MOTORWAY_EXIT_RIGHT" + #: Take the ferry. + TAKE_FERRY = "TAKE_FERRY" + #: Cross the roundabout. + ROUNDABOUT_CROSS = "ROUNDABOUT_CROSS" + #: At the roundabout take the exit on the right. + ROUNDABOUT_RIGHT = "ROUNDABOUT_RIGHT" + #: At the roundabout take the exit on the left. + ROUNDABOUT_LEFT = "ROUNDABOUT_LEFT" + #: Go around the roundabout. + ROUNDABOUT_BACK = "ROUNDABOUT_BACK" + #: Try to make a U-turn. + TRY_MAKE_UTURN = "TRY_MAKE_UTURN" + #: Follow. + FOLLOW = "FOLLOW" + #: Switch to the parallel road. + SWITCH_PARALLEL_ROAD = "SWITCH_PARALLEL_ROAD" + #: Switch to the main road. + SWITCH_MAIN_ROAD = "SWITCH_MAIN_ROAD" + #: Take the ramp. + ENTRANCE_RAMP = "ENTRANCE_RAMP" + #: You have reached the waypoint. It is on the left. + WAYPOINT_LEFT = "WAYPOINT_LEFT" + #: You have reached the waypoint. It is on the right. + WAYPOINT_RIGHT = "WAYPOINT_RIGHT" + #: You have reached the waypoint. + WAYPOINT_REACHED = "WAYPOINT_REACHED" + +class HillinessDegree(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: low. + LOW = "low" + #: normal. + NORMAL = "normal" + #: high. + HIGH = "high" + +class JsonFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + +class JunctionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the junction where the maneuver takes place. For larger roundabouts, two separate + instructions are generated for entering and leaving the roundabout. + """ + + #: regular. + REGULAR = "REGULAR" + #: roundabout. + ROUNDABOUT = "ROUNDABOUT" + #: bifurcation. + BIFURCATION = "BIFURCATION" + +class MagnitudeOfDelay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The magnitude of delay caused by the incident. These values correspond to the values of the + response field ty of the `Get Traffic Incident Detail API + `_. + """ + + #: Unknown. + ZERO = "0" + #: Minor. + ONE = "1" + #: Moderate. + TWO = "2" + #: Major. + THREE = "3" + #: Undefined, used for road closures and other indefinite delays. + FOUR = "4" + +class ResponseFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + #: `The Extensible Markup Language `_. + XML = "xml" + +class RouteAvoidType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Avoids toll roads. + TOLL_ROADS = "tollRoads" + #: Avoids motorways. + MOTORWAYS = "motorways" + #: Avoids ferries. + FERRIES = "ferries" + #: Avoids unpaved roads. + UNPAVED_ROADS = "unpavedRoads" + #: Avoids routes that require the use of carpool (HOV/High Occupancy Vehicle) lanes. + CARPOOLS = "carpools" + #: Avoids using the same road multiple times. Most useful in conjunction with ``routeType``\ + #: =thrilling. + ALREADY_USED_ROADS = "alreadyUsedRoads" + #: Avoids border crossings in route calculation. + BORDER_CROSSINGS = "borderCrossings" + +class RouteInstructionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Returns raw instruction data without human-readable messages. + CODED = "coded" + #: Returns raw instructions data with human-readable messages in plain text. + TEXT = "text" + #: Returns raw instruction data with tagged human-readable messages to permit formatting. A + #: human-readable message is built up from repeatable identified elements. These are tagged to + #: allow client applications to format them correctly. The following message components are tagged + #: when instructionsType=tagged: street, roadNumber, signpostText, exitNumber, + #: roundaboutExitNumber. + #: + #: Example of tagged 'Turn left' message:​ + #: + #: .. code-block:: + #: + #: Turn left onto A4/E19 + #: towards Den Haag. + TAGGED = "tagged" + +class RouteRepresentation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Includes route geometry in the response. + POLYLINE = "polyline" + #: Summary as per polyline but excluding the point geometry elements for the routes in the + #: response. + SUMMARY_ONLY = "summaryOnly" + #: Includes only the optimized waypoint indices but does not include the route geometry in the + #: response. + NONE = "none" + +class RouteType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: The fastest route. + FASTEST = "fastest" + #: The shortest route by distance. + SHORTEST = "shortest" + #: A route balanced by economy and speed. + ECO = "eco" + #: Includes interesting or challenging roads and uses as few motorways as possible. You can choose + #: the level of turns included and also the degree of hilliness. See the hilliness and windingness + #: parameters for how to set this. There is a limit of 900 km on routes planned with + #: ``routeType``\ =thrilling. + THRILLING = "thrilling" + +class SectionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Get sections if the route includes car trains. + CAR_TRAIN = "carTrain" + #: Countries the route has parts in. + COUNTRY = "country" + #: Get sections if the route includes ferries. + FERRY = "ferry" + #: Get sections if the route includes motorways. + MOTORWAY = "motorway" + #: Get sections which are suited for pedestrians. + PEDESTRIAN = "pedestrian" + #: Get sections which require a toll to be payed. + TOLL_ROAD = "tollRoad" + #: Get sections which require a toll vignette to be present. + TOLL_VIGNETTE = "tollVignette" + #: Get sections which contain traffic information. + TRAFFIC = "traffic" + #: Get sections in relation to the request parameter ``travelMode``. + TRAVEL_MODE = "travelMode" + #: Get sections if the route includes tunnels. + TUNNEL = "tunnel" + +class TravelMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: The returned routes are optimized for cars. + CAR = "car" + #: The returned routes are optimized for commercial vehicles, like for trucks. + TRUCK = "truck" + #: The returned routes are optimized for taxis. BETA functionality. + TAXI = "taxi" + #: The returned routes are optimized for buses, including the use of bus only lanes. BETA + #: functionality. + BUS = "bus" + #: The returned routes are optimized for vans. BETA functionality. + VAN = "van" + #: The returned routes are optimized for motorcycles. BETA functionality. + MOTORCYCLE = "motorcycle" + #: The returned routes are optimized for bicycles, including use of bicycle lanes. + BICYCLE = "bicycle" + #: The returned routes are optimized for pedestrians, including the use of sidewalks. + PEDESTRIAN = "pedestrian" + +class VehicleEngineType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Internal combustion engine. + COMBUSTION = "combustion" + #: Electric engine. + ELECTRIC = "electric" + +class VehicleLoadType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Explosives. + US_HAZMAT_CLASS1 = "USHazmatClass1" + #: Compressed gas. + US_HAZMAT_CLASS2 = "USHazmatClass2" + #: Flammable liquids. + US_HAZMAT_CLASS3 = "USHazmatClass3" + #: Flammable solids. + US_HAZMAT_CLASS4 = "USHazmatClass4" + #: Oxidizers. + US_HAZMAT_CLASS5 = "USHazmatClass5" + #: Poisons. + US_HAZMAT_CLASS6 = "USHazmatClass6" + #: Radioactive. + US_HAZMAT_CLASS7 = "USHazmatClass7" + #: Corrosives. + US_HAZMAT_CLASS8 = "USHazmatClass8" + #: Miscellaneous. + US_HAZMAT_CLASS9 = "USHazmatClass9" + #: Explosives. + OTHER_HAZMAT_EXPLOSIVE = "otherHazmatExplosive" + #: Miscellaneous. + OTHER_HAZMAT_GENERAL = "otherHazmatGeneral" + #: Harmful to water. + OTHER_HAZMAT_HARMFUL_TO_WATER = "otherHazmatHarmfulToWater" + +class WindingnessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: low. + LOW = "low" + #: normal. + NORMAL = "normal" + #: high. + HIGH = "high" diff --git a/sdk/maps/azure-maps-route/azure/maps/route/operations/__init__.py b/sdk/maps/azure-maps-route/azure/maps/route/operations/__init__.py new file mode 100644 index 000000000000..5eff2a716822 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/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 ._route_client_operations import RouteClientOperationsMixin + +__all__ = [ + 'RouteClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-route/azure/maps/route/operations/_route_client_operations.py b/sdk/maps/azure-maps-route/azure/maps/route/operations/_route_client_operations.py new file mode 100644 index 000000000000..5b2989b074cf --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/operations/_route_client_operations.py @@ -0,0 +1,3338 @@ +# 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 azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RouteClientOperationsMixin(object): + + def _post_route_matrix_initial( + self, + post_route_matrix_request_body, # type: "_models.PostRouteMatrixRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + wait_for_results=None, # type: Optional[bool] + compute_travel_time_for=None, # type: Optional[Union[str, "_models.ComputeTravelTimeFor"]] + section_type=None, # type: Optional[Union[str, "_models.SectionType"]] + arrive_at=None, # type: Optional[datetime.datetime] + depart_at=None, # type: Optional[datetime.datetime] + vehicle_axle_weight=None, # type: Optional[int] + vehicle_length=None, # type: Optional[float] + vehicle_height=None, # type: Optional[float] + vehicle_width=None, # type: Optional[float] + vehicle_max_speed=None, # type: Optional[int] + vehicle_weight=None, # type: Optional[int] + windingness=None, # type: Optional[Union[str, "_models.WindingnessLevel"]] + hilliness=None, # type: Optional[Union[str, "_models.HillinessDegree"]] + travel_mode=None, # type: Optional[Union[str, "_models.TravelMode"]] + avoid=None, # type: Optional[List[Union[str, "_models.RouteAvoidType"]]] + traffic=None, # type: Optional[bool] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] + vehicle_load_type=None, # type: Optional[Union[str, "_models.VehicleLoadType"]] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RouteMatrixResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteMatrixResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_route_matrix_initial.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 wait_for_results is not None: + query_parameters['waitForResults'] = self._serialize.query("wait_for_results", wait_for_results, 'bool') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_matrix_request_body, 'PostRouteMatrixRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_route_matrix_initial.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + def begin_post_route_matrix( + self, + post_route_matrix_request_body, # type: "_models.PostRouteMatrixRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + wait_for_results=None, # type: Optional[bool] + compute_travel_time_for=None, # type: Optional[Union[str, "_models.ComputeTravelTimeFor"]] + section_type=None, # type: Optional[Union[str, "_models.SectionType"]] + arrive_at=None, # type: Optional[datetime.datetime] + depart_at=None, # type: Optional[datetime.datetime] + vehicle_axle_weight=None, # type: Optional[int] + vehicle_length=None, # type: Optional[float] + vehicle_height=None, # type: Optional[float] + vehicle_width=None, # type: Optional[float] + vehicle_max_speed=None, # type: Optional[int] + vehicle_weight=None, # type: Optional[int] + windingness=None, # type: Optional[Union[str, "_models.WindingnessLevel"]] + hilliness=None, # type: Optional[Union[str, "_models.HillinessDegree"]] + travel_mode=None, # type: Optional[Union[str, "_models.TravelMode"]] + avoid=None, # type: Optional[List[Union[str, "_models.RouteAvoidType"]]] + traffic=None, # type: Optional[bool] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] + vehicle_load_type=None, # type: Optional[Union[str, "_models.VehicleLoadType"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteMatrixResponse"] + """**Applies to**\ : S1 pricing tier. + + The Matrix Routing service allows calculation of a matrix of route summaries for a set of + routes defined by origin and destination locations by using an asynchronous (async) or + synchronous (sync) POST request. For every given origin, the service calculates the cost of + routing from that origin to every given destination. The set of origins and the set of + destinations can be thought of as the column and row headers of a table and each cell in the + table contains the costs of routing from the origin to the destination for that cell. As an + example, let's say a food delivery company has 20 drivers and they need to find the closest + driver to pick up the delivery from the restaurant. To solve this use case, they can call + Matrix Route API. + + For each route, the travel times and distances are returned. You can use the computed costs to + determine which detailed routes to calculate using the Route Directions API. + + The maximum size of a matrix for async request is **700** and for sync request it's **100** + (the number of origins multiplied by the number of destinations). + + Submit Synchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If your scenario requires synchronous requests and the maximum size of the matrix is less than + or equal to 100, you might want to make synchronous request. The maximum size of a matrix for + this API is **100** (the number of origins multiplied by the number of destinations). With that + constraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not + need to be square). + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex routing + requests. When you make a request by using async request, by default the service returns a 202 + response code along a redirect URL in the Location field of the response header. This URL + should be checked periodically until the response data or error information is available. If + ``waitForResults`` parameter in the request is set to true, user will get a 200 response if the + request is finished under 120 seconds. + + The maximum size of a matrix for this API is **700** (the number of origins multiplied by the + number of destinations). With that constraint in mind, examples of possible matrix dimensions + are: 50x10, 10x10, 28x25. 10x70 (it does not need to be square). + + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + + Here's a typical sequence of asynchronous operations: + + + #. + Client sends a Route Matrix POST request to Azure Maps + + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Route Matrix request has been accepted. + + HTTP ``Error`` - There was an error processing your Route Matrix request. This could + either be a 400 Bad Request or any other Error status code. + + + + #. + If the Matrix Route request was accepted successfully, the Location header in the response + contains the URL to download the results of the request. This status URI looks like the + following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + + #. Client issues a GET request on the download URL obtained in Step 3 to download the results + + Download Sync Results + ^^^^^^^^^^^^^^^^^^^^^ + + When you make a POST request for Route Matrix Sync API, the service returns 200 response code + for successful request and a response array. The response body will contain the data and there + will be no possibility to retrieve the results later. + + Download Async Results + ^^^^^^^^^^^^^^^^^^^^^^ + + When a request issues a ``202 Accepted`` response, the request is being processed using our + async pipeline. You will be given a URL to check the progress of your async request in the + location header of the response. This status URI looks like the following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + The URL provided by the location header will return the following responses when a ``GET`` + request is issued. + + .. + + HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try + again in some time. + + HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of + the results. + + :param post_route_matrix_request_body: The matrix of origin and destination coordinates to + compute the route distance, travel time and other summary for each cell of the matrix based on + the input parameters. The minimum and the maximum cell count supported are 1 and **700** for + async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations + or 25 origins and 25 destinations for async API. + :type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :param wait_for_results: Boolean to indicate whether to execute the request synchronously. If + set to true, user will get a 200 response if the request is finished under 120 seconds. + Otherwise, user will get a 202 response right away. Please refer to the API description for + more details on 202 response. **Supported only for async request**. + :type wait_for_results: bool + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + :type vehicle_weight: int + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteMatrixResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteMatrixResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteMatrixResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_route_matrix_initial( + post_route_matrix_request_body=post_route_matrix_request_body, + format=format, + wait_for_results=wait_for_results, + compute_travel_time_for=compute_travel_time_for, + section_type=section_type, + arrive_at=arrive_at, + depart_at=depart_at, + vehicle_axle_weight=vehicle_axle_weight, + vehicle_length=vehicle_length, + vehicle_height=vehicle_height, + vehicle_width=vehicle_width, + vehicle_max_speed=vehicle_max_speed, + vehicle_weight=vehicle_weight, + windingness=windingness, + hilliness=hilliness, + travel_mode=travel_mode, + avoid=avoid, + traffic=traffic, + route_type=route_type, + vehicle_load_type=vehicle_load_type, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_route_matrix.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + def _get_route_matrix_initial( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RouteMatrixResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteMatrixResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_route_matrix_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_route_matrix_initial.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + def begin_get_route_matrix( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteMatrixResponse"] + """If the Matrix Route request was accepted successfully, the Location header in the response + contains the URL to download the results of the request. This status URI looks like the + following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + + #. Client issues a GET request on the download URL obtained in Step 3 to download the results + + Download Sync Results + ^^^^^^^^^^^^^^^^^^^^^ + + When you make a POST request for Route Matrix Sync API, the service returns 200 response code + for successful request and a response array. The response body will contain the data and there + will be no possibility to retrieve the results later. + + Download Async Results + ^^^^^^^^^^^^^^^^^^^^^^ + + When a request issues a ``202 Accepted`` response, the request is being processed using our + async pipeline. You will be given a URL to check the progress of your async request in the + location header of the response. This status URI looks like the following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + The URL provided by the location header will return the following responses when a ``GET`` + request is issued. + + .. + + HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try + again in some time. + + HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of + the results. + + :param format: Matrix id received after the Matrix Route request was accepted successfully. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteMatrixResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteMatrixResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteMatrixResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_route_matrix_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteMatrixResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_route_matrix.metadata = {'url': '/route/matrix/{format}'} # type: ignore + + def post_route_matrix_sync( + self, + post_route_matrix_request_body, # type: "_models.PostRouteMatrixRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + wait_for_results=None, # type: Optional[bool] + compute_travel_time_for=None, # type: Optional[Union[str, "_models.ComputeTravelTimeFor"]] + section_type=None, # type: Optional[Union[str, "_models.SectionType"]] + arrive_at=None, # type: Optional[datetime.datetime] + depart_at=None, # type: Optional[datetime.datetime] + vehicle_axle_weight=None, # type: Optional[int] + vehicle_length=None, # type: Optional[float] + vehicle_height=None, # type: Optional[float] + vehicle_width=None, # type: Optional[float] + vehicle_max_speed=None, # type: Optional[int] + vehicle_weight=None, # type: Optional[int] + windingness=None, # type: Optional[Union[str, "_models.WindingnessLevel"]] + hilliness=None, # type: Optional[Union[str, "_models.HillinessDegree"]] + travel_mode=None, # type: Optional[Union[str, "_models.TravelMode"]] + avoid=None, # type: Optional[List[Union[str, "_models.RouteAvoidType"]]] + traffic=None, # type: Optional[bool] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] + vehicle_load_type=None, # type: Optional[Union[str, "_models.VehicleLoadType"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteMatrixResponse" + """**Applies to**\ : S1 pricing tier. + + The Matrix Routing service allows calculation of a matrix of route summaries for a set of + routes defined by origin and destination locations by using an asynchronous (async) or + synchronous (sync) POST request. For every given origin, the service calculates the cost of + routing from that origin to every given destination. The set of origins and the set of + destinations can be thought of as the column and row headers of a table and each cell in the + table contains the costs of routing from the origin to the destination for that cell. As an + example, let's say a food delivery company has 20 drivers and they need to find the closest + driver to pick up the delivery from the restaurant. To solve this use case, they can call + Matrix Route API. + + For each route, the travel times and distances are returned. You can use the computed costs to + determine which detailed routes to calculate using the Route Directions API. + + The maximum size of a matrix for async request is **700** and for sync request it's **100** + (the number of origins multiplied by the number of destinations). + + Submit Synchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + If your scenario requires synchronous requests and the maximum size of the matrix is less than + or equal to 100, you might want to make synchronous request. The maximum size of a matrix for + this API is **100** (the number of origins multiplied by the number of destinations). With that + constraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not + need to be square). + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Route Matrix Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex routing + requests. When you make a request by using async request, by default the service returns a 202 + response code along a redirect URL in the Location field of the response header. This URL + should be checked periodically until the response data or error information is available. If + ``waitForResults`` parameter in the request is set to true, user will get a 200 response if the + request is finished under 120 seconds. + + The maximum size of a matrix for this API is **700** (the number of origins multiplied by the + number of destinations). With that constraint in mind, examples of possible matrix dimensions + are: 50x10, 10x10, 28x25. 10x70 (it does not need to be square). + + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/matrix/json?api-version=1.0&subscription-key={subscription-key} + + Here's a typical sequence of asynchronous operations: + + + #. + Client sends a Route Matrix POST request to Azure Maps + + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Route Matrix request has been accepted. + + HTTP ``Error`` - There was an error processing your Route Matrix request. This could + either be a 400 Bad Request or any other Error status code. + + + + #. + If the Matrix Route request was accepted successfully, the Location header in the response + contains the URL to download the results of the request. This status URI looks like the + following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + + #. Client issues a GET request on the download URL obtained in Step 3 to download the results + + Download Sync Results + ^^^^^^^^^^^^^^^^^^^^^ + + When you make a POST request for Route Matrix Sync API, the service returns 200 response code + for successful request and a response array. The response body will contain the data and there + will be no possibility to retrieve the results later. + + Download Async Results + ^^^^^^^^^^^^^^^^^^^^^^ + + When a request issues a ``202 Accepted`` response, the request is being processed using our + async pipeline. You will be given a URL to check the progress of your async request in the + location header of the response. This status URI looks like the following: + + .. code-block:: + + GET + https://atlas.microsoft.com/route/matrix/{matrixId}?api-version=1.0?subscription-key={subscription-key} + + The URL provided by the location header will return the following responses when a ``GET`` + request is issued. + + .. + + HTTP ``202 Accepted`` - Matrix request was accepted but is still being processed. Please try + again in some time. + + HTTP ``200 OK`` - Matrix request successfully processed. The response body contains all of + the results. + + :param post_route_matrix_request_body: The matrix of origin and destination coordinates to + compute the route distance, travel time and other summary for each cell of the matrix based on + the input parameters. The minimum and the maximum cell count supported are 1 and **700** for + async and **100** for sync respectively. For example, it can be 35 origins and 20 destinations + or 25 origins and 25 destinations for async API. + :type post_route_matrix_request_body: ~azure.maps.route.models.PostRouteMatrixRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :param wait_for_results: Boolean to indicate whether to execute the request synchronously. If + set to true, user will get a 200 response if the request is finished under 120 seconds. + Otherwise, user will get a 202 response right away. Please refer to the API description for + more details on 202 response. **Supported only for async request**. + :type wait_for_results: bool + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + :type vehicle_weight: int + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteMatrixResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteMatrixResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteMatrixResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_route_matrix_sync.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 wait_for_results is not None: + query_parameters['waitForResults'] = self._serialize.query("wait_for_results", wait_for_results, 'bool') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_matrix_request_body, 'PostRouteMatrixRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('RouteMatrixResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_route_matrix_sync.metadata = {'url': '/route/matrix/sync/{format}'} # type: ignore + + def get_route_directions( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + max_alternatives=None, # type: Optional[int] + alternative_type=None, # type: Optional[Union[str, "_models.AlternativeRouteType"]] + min_deviation_distance=None, # type: Optional[int] + arrive_at=None, # type: Optional[datetime.datetime] + depart_at=None, # type: Optional[datetime.datetime] + min_deviation_time=None, # type: Optional[int] + instructions_type=None, # type: Optional[Union[str, "_models.RouteInstructionsType"]] + language=None, # type: Optional[str] + compute_best_order=None, # type: Optional[bool] + route_representation=None, # type: Optional[Union[str, "_models.RouteRepresentation"]] + compute_travel_time_for=None, # type: Optional[Union[str, "_models.ComputeTravelTimeFor"]] + vehicle_heading=None, # type: Optional[int] + report=None, # type: Optional[str] + section_type=None, # type: Optional[Union[str, "_models.SectionType"]] + vehicle_axle_weight=None, # type: Optional[int] + vehicle_width=None, # type: Optional[float] + vehicle_height=None, # type: Optional[float] + vehicle_length=None, # type: Optional[float] + vehicle_max_speed=None, # type: Optional[int] + vehicle_weight=None, # type: Optional[int] + vehicle_commercial=None, # type: Optional[bool] + windingness=None, # type: Optional[Union[str, "_models.WindingnessLevel"]] + hilliness=None, # type: Optional[Union[str, "_models.HillinessDegree"]] + travel_mode=None, # type: Optional[Union[str, "_models.TravelMode"]] + avoid=None, # type: Optional[List[Union[str, "_models.RouteAvoidType"]]] + traffic=None, # type: Optional[bool] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] + vehicle_load_type=None, # type: Optional[Union[str, "_models.VehicleLoadType"]] + vehicle_engine_type=None, # type: Optional[Union[str, "_models.VehicleEngineType"]] + constant_speed_consumption_in_liters_per_hundredkm=None, # type: Optional[float] + current_fuel_in_liters=None, # type: Optional[float] + auxiliary_power_in_liters_per_hour=None, # type: Optional[float] + fuel_energy_density_in_m_joules_per_liter=None, # type: Optional[float] + acceleration_efficiency=None, # type: Optional[float] + deceleration_efficiency=None, # type: Optional[float] + uphill_efficiency=None, # type: Optional[float] + downhill_efficiency=None, # type: Optional[float] + constant_speed_consumption_ink_wh_per_hundredkm=None, # type: Optional[str] + current_charge_ink_wh=None, # type: Optional[str] + max_charge_ink_wh=None, # type: Optional[str] + auxiliary_power_ink_w=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteDirectionsResponse" + """**Applies to**\ : S0 and S1 pricing tiers. + + Returns a route between an origin and a destination, passing through waypoints if they are + specified. The route will take into account factors such as current traffic and the typical + road speeds on the requested day of the week and time of day. + + Information returned includes the distance, estimated travel time, and a representation of the + route geometry. Additional routing information such as optimized waypoint order or turn by turn + instructions is also available, depending on the options selected. + + Routing service provides a set of parameters for a detailed description of vehicle-specific + Consumption Model. Please check `Consumption Model + `_ for detailed explanation of + the concepts and parameters involved. + + :param query: The Coordinates through which the route is calculated, delimited by a colon. A + minimum of two coordinates is required. The first one is the origin and the last is the + destination of the route. Optional coordinates in-between act as WayPoints in the route. You + can pass up to 150 WayPoints. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.route.models.ResponseFormat + :param max_alternatives: Number of desired alternative routes to be calculated. Default: 0, + minimum: 0 and maximum: 5. + :type max_alternatives: int + :param alternative_type: Controls the optimality, with respect to the given planning criteria, + of the calculated alternatives compared to the reference route. + :type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType + :param min_deviation_distance: All alternative routes returned will follow the reference route + (see section POST Requests) from the origin point of the calculateRoute request for at least + this number of meters. Can only be used when reconstructing a route. The minDeviationDistance + parameter cannot be used in conjunction with arriveAt. + :type min_deviation_distance: int + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param min_deviation_time: All alternative routes returned will follow the reference route (see + section POST Requests) from the origin point of the calculateRoute request for at least this + number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter + cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to + a value greater than zero has the following consequences: + + + * The origin point of the *calculateRoute* Request must be on + (or very near) the input reference route. + + * If this is not the case, an error is returned. + * However, the origin point does not need to be at the beginning + of the input reference route (it can be thought of as the current + vehicle position on the reference route). + + * The reference route, returned as the first route in the *calculateRoute* + Response, will start at the origin point specified in the *calculateRoute* + Request. The initial part of the input reference route up until the origin + point will be excluded from the Response. + * The values of *minDeviationDistance* and *minDeviationTime* determine + how far alternative routes will be guaranteed to follow the reference + route from the origin point onwards. + * The route must use *departAt*. + * The *vehicleHeading* is ignored. + :type min_deviation_time: int + :param instructions_type: If specified, guidance instructions will be returned. Note that the + instructionsType parameter cannot be used in conjunction with routeRepresentation=none. + :type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType + :param language: The language parameter determines the language of the guidance messages. + Proper nouns (the names of streets, plazas, etc.) are returned in the specified language, or + if that is not available, they are returned in an available language that is close to it. + Allowed values are (a subset of) the IETF language tags. The currently supported languages are + listed in the `Supported languages section + `_. + + Default value: en-GB. + :type language: str + :param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to + reduce the route length. Yields best results when used in conjunction with routeType + *shortest*. Notice that origin and destination are excluded from the optimized waypoint + indices. To include origin and destination in the response, please increase all the indices by + 1 to account for the origin, and then add the destination as the final index. Possible values + are true or false. True computes a better order if possible, but is not allowed to be used in + conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints. + False will use the locations in the given order and not allowed to be used in conjunction with + routeRepresentation *none*. + :type compute_best_order: bool + :param route_representation: Specifies the representation of the set of routes provided as + response. This parameter value can only be used in conjunction with computeBestOrder=true. + :type route_representation: str or ~azure.maps.route.models.RouteRepresentation + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param vehicle_heading: The directional heading of the vehicle in degrees starting at true + North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is + 180 degrees, west is 270 degrees. Possible values 0-359. + :type vehicle_heading: int + :param report: Specifies which data should be reported for diagnosis purposes. The only + possible value is *effectiveSettings*. Reports the effective parameters or data used when + calling the API. In the case of defaulted parameters the default will be reflected where the + parameter was not specified by the caller. + :type report: str + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + + + * + It is mandatory if any of the *Efficiency parameters are set. + + * + It must be strictly positive when used in the context of the Consumption Model. Weight + restrictions are considered. + + * + If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is + non-zero, then weight restrictions are considered. + + * + In all other cases, this parameter is ignored. + + Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900. + :type vehicle_weight: int + :param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed + to drive on some roads. + :type vehicle_commercial: bool + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is + specified, it must be consistent with the value of **vehicleEngineType**. + :type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType + :param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent + component of consumption. + + Provided as an unordered list of colon-delimited speed & consumption-rate pairs. The list + defines points on a consumption curve. Consumption rates for speeds not in the list are found + as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0. + + Sensible Values : 50,6.3:130,11.5 + + **Note** : This parameter is required for **The Combustion Consumption Model**. + :type constant_speed_consumption_in_liters_per_hundredkm: float + :param current_fuel_in_liters: Specifies the current supply of fuel in liters. + + Sensible Values : 55. + :type current_fuel_in_liters: float + :param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining + auxiliary systems of the vehicle, in liters per hour. + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 0.2. + :type auxiliary_power_in_liters_per_hour: float + :param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy + stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the + ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For + example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. + + This parameter is required if any ***Efficiency** parameter is set. + + Sensible Values : 34.2. + :type fuel_energy_density_in_m_joules_per_liter: float + :param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored + in fuel to kinetic energy when the vehicle accelerates *(i.e. + KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting + consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **decelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **decelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66. + :type acceleration_efficiency: float + :param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved + (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost). + ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using + **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **accelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **accelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91. + :type deceleration_efficiency: float + :param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel + to potential energy when the vehicle gains elevation *(i.e. + PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by + converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **downhillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **downhillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74. + :type uphill_efficiency: float + :param downhill_efficiency: Specifies the efficiency of converting potential energy to saved + (not consumed) fuel when the vehicle loses elevation *(i.e. + ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved + (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **uphillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **uphillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73. + :type downhill_efficiency: float + :param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component + of consumption. + + Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a + consumption curve. Consumption rates for speeds not in the list are found as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and + 100000.0. + + Sensible Values : 50,8.2:130,21.3 + + This parameter is required for **Electric consumption model**. + :type constant_speed_consumption_ink_wh_per_hundredkm: str + :param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours + (kWh). + + This parameter co-exists with **maxChargeInkWh** parameter. + + The range of values allowed are 0.0 to **maxChargeInkWh**. + + Sensible Values : 43. + :type current_charge_ink_wh: str + :param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh) + that may be stored in the vehicle's battery. + + This parameter co-exists with **currentChargeInkWh** parameter. + + Minimum value has to be greater than or equal to **currentChargeInkWh**. + + Sensible Values : 85. + :type max_charge_ink_wh: str + :param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary + systems, in kilowatts (kW). + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 1.7. + :type auxiliary_power_ink_w: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteDirectionsResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteDirectionsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_route_directions.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['query'] = self._serialize.query("query", query, 'str') + if max_alternatives is not None: + query_parameters['maxAlternatives'] = self._serialize.query("max_alternatives", max_alternatives, 'int', maximum=5, minimum=0) + if alternative_type is not None: + query_parameters['alternativeType'] = self._serialize.query("alternative_type", alternative_type, 'str') + if min_deviation_distance is not None: + query_parameters['minDeviationDistance'] = self._serialize.query("min_deviation_distance", min_deviation_distance, 'int') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if min_deviation_time is not None: + query_parameters['minDeviationTime'] = self._serialize.query("min_deviation_time", min_deviation_time, 'int') + if instructions_type is not None: + query_parameters['instructionsType'] = self._serialize.query("instructions_type", instructions_type, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if compute_best_order is not None: + query_parameters['computeBestOrder'] = self._serialize.query("compute_best_order", compute_best_order, 'bool') + if route_representation is not None: + query_parameters['routeRepresentation'] = self._serialize.query("route_representation", route_representation, 'str') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if vehicle_heading is not None: + query_parameters['vehicleHeading'] = self._serialize.query("vehicle_heading", vehicle_heading, 'int', maximum=359, minimum=0) + if report is not None: + query_parameters['report'] = self._serialize.query("report", report, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if vehicle_commercial is not None: + query_parameters['vehicleCommercial'] = self._serialize.query("vehicle_commercial", vehicle_commercial, 'bool') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, 'str') + if vehicle_engine_type is not None: + query_parameters['vehicleEngineType'] = self._serialize.query("vehicle_engine_type", vehicle_engine_type, 'str') + if constant_speed_consumption_in_liters_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInLitersPerHundredkm'] = self._serialize.query("constant_speed_consumption_in_liters_per_hundredkm", constant_speed_consumption_in_liters_per_hundredkm, 'float') + if current_fuel_in_liters is not None: + query_parameters['currentFuelInLiters'] = self._serialize.query("current_fuel_in_liters", current_fuel_in_liters, 'float') + if auxiliary_power_in_liters_per_hour is not None: + query_parameters['auxiliaryPowerInLitersPerHour'] = self._serialize.query("auxiliary_power_in_liters_per_hour", auxiliary_power_in_liters_per_hour, 'float') + if fuel_energy_density_in_m_joules_per_liter is not None: + query_parameters['fuelEnergyDensityInMJoulesPerLiter'] = self._serialize.query("fuel_energy_density_in_m_joules_per_liter", fuel_energy_density_in_m_joules_per_liter, 'float') + if acceleration_efficiency is not None: + query_parameters['accelerationEfficiency'] = self._serialize.query("acceleration_efficiency", acceleration_efficiency, 'float') + if deceleration_efficiency is not None: + query_parameters['decelerationEfficiency'] = self._serialize.query("deceleration_efficiency", deceleration_efficiency, 'float') + if uphill_efficiency is not None: + query_parameters['uphillEfficiency'] = self._serialize.query("uphill_efficiency", uphill_efficiency, 'float') + if downhill_efficiency is not None: + query_parameters['downhillEfficiency'] = self._serialize.query("downhill_efficiency", downhill_efficiency, 'float') + if constant_speed_consumption_ink_wh_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInkWhPerHundredkm'] = self._serialize.query("constant_speed_consumption_ink_wh_per_hundredkm", constant_speed_consumption_ink_wh_per_hundredkm, 'str') + if current_charge_ink_wh is not None: + query_parameters['currentChargeInkWh'] = self._serialize.query("current_charge_ink_wh", current_charge_ink_wh, 'str') + if max_charge_ink_wh is not None: + query_parameters['maxChargeInkWh'] = self._serialize.query("max_charge_ink_wh", max_charge_ink_wh, 'str') + if auxiliary_power_ink_w is not None: + query_parameters['auxiliaryPowerInkW'] = self._serialize.query("auxiliary_power_ink_w", auxiliary_power_ink_w, '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('RouteDirectionsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_directions.metadata = {'url': '/route/directions/{format}'} # type: ignore + + def post_route_directions( + self, + query, # type: str + post_route_directions_request_body, # type: "_models.PostRouteDirectionsRequestBody" + format="json", # type: Union[str, "_models.ResponseFormat"] + max_alternatives=None, # type: Optional[int] + alternative_type=None, # type: Optional[Union[str, "_models.AlternativeRouteType"]] + min_deviation_distance=None, # type: Optional[int] + min_deviation_time=None, # type: Optional[int] + instructions_type=None, # type: Optional[Union[str, "_models.RouteInstructionsType"]] + language=None, # type: Optional[str] + compute_best_order=None, # type: Optional[bool] + route_representation=None, # type: Optional[Union[str, "_models.RouteRepresentation"]] + compute_travel_time_for=None, # type: Optional[Union[str, "_models.ComputeTravelTimeFor"]] + vehicle_heading=None, # type: Optional[int] + report=None, # type: Optional[str] + section_type=None, # type: Optional[Union[str, "_models.SectionType"]] + arrive_at=None, # type: Optional[datetime.datetime] + depart_at=None, # type: Optional[datetime.datetime] + vehicle_axle_weight=None, # type: Optional[int] + vehicle_length=None, # type: Optional[float] + vehicle_height=None, # type: Optional[float] + vehicle_width=None, # type: Optional[float] + vehicle_max_speed=None, # type: Optional[int] + vehicle_weight=None, # type: Optional[int] + vehicle_commercial=None, # type: Optional[bool] + windingness=None, # type: Optional[Union[str, "_models.WindingnessLevel"]] + hilliness=None, # type: Optional[Union[str, "_models.HillinessDegree"]] + travel_mode=None, # type: Optional[Union[str, "_models.TravelMode"]] + avoid=None, # type: Optional[List[Union[str, "_models.RouteAvoidType"]]] + traffic=None, # type: Optional[bool] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] + vehicle_load_type=None, # type: Optional[Union[str, "_models.VehicleLoadType"]] + vehicle_engine_type=None, # type: Optional[Union[str, "_models.VehicleEngineType"]] + constant_speed_consumption_in_liters_per_hundredkm=None, # type: Optional[float] + current_fuel_in_liters=None, # type: Optional[float] + auxiliary_power_in_liters_per_hour=None, # type: Optional[float] + fuel_energy_density_in_m_joules_per_liter=None, # type: Optional[float] + acceleration_efficiency=None, # type: Optional[float] + deceleration_efficiency=None, # type: Optional[float] + uphill_efficiency=None, # type: Optional[float] + downhill_efficiency=None, # type: Optional[float] + constant_speed_consumption_ink_wh_per_hundredkm=None, # type: Optional[str] + current_charge_ink_wh=None, # type: Optional[str] + max_charge_ink_wh=None, # type: Optional[str] + auxiliary_power_ink_w=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteDirectionsResponse" + """**Applies to**\ : S0 and S1 pricing tiers. + + Returns a route between an origin and a destination, passing through waypoints if they are + specified. The route will take into account factors such as current traffic and the typical + road speeds on the requested day of the week and time of day. + + Information returned includes the distance, estimated travel time, and a representation of the + route geometry. Additional routing information such as optimized waypoint order or turn by turn + instructions is also available, depending on the options selected. + + Routing service provides a set of parameters for a detailed description of a vehicle-specific + Consumption Model. Please check `Consumption Model + `_ for detailed explanation of + the concepts and parameters involved. + + :param query: The Coordinates through which the route is calculated. Needs two coordinates at + least. Delimited by colon. First one is the origin and the last is the destination of the + route. The coordinates are in a lat,long format. Optional coordinates in between act as + WayPoints in the route. + :type query: str + :param post_route_directions_request_body: Used for reconstructing a route and for calculating + zero or more alternative routes to this reference route. The provided sequence of coordinates + is used as input for route reconstruction. The alternative routes are calculated between the + origin and destination points specified in the base path parameter locations. If both + minDeviationDistance and minDeviationTime are set to zero, then these origin and destination + points are expected to be at (or very near) the beginning and end of the reference route, + respectively. Intermediate locations (waypoints) are not supported when using + supportingPoints. + + Setting at least one of minDeviationDistance or minDeviationTime to a value greater than zero + has the following consequences: + + + * The origin point of the calculateRoute request must be on (or very near) the input reference + route. If this is not the case, an error is returned. However, the origin point does not need + to be at the beginning of the input reference route (it can be thought of as the current + vehicle position on the reference route). + * The reference route, returned as the first route in the calculateRoute response, will start + at the origin point specified in the calculateRoute request. The initial part of the input + reference route up until the origin point will be excluded from the response. + * The values of minDeviationDistance and minDeviationTime determine how far alternative routes + will be guaranteed to follow the reference route from the origin point onwards. + * The route must use departAt. + * The vehicleHeading is ignored. + :type post_route_directions_request_body: ~azure.maps.route.models.PostRouteDirectionsRequestBody + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.route.models.ResponseFormat + :param max_alternatives: Number of desired alternative routes to be calculated. Default: 0, + minimum: 0 and maximum: 5. + :type max_alternatives: int + :param alternative_type: Controls the optimality, with respect to the given planning criteria, + of the calculated alternatives compared to the reference route. + :type alternative_type: str or ~azure.maps.route.models.AlternativeRouteType + :param min_deviation_distance: All alternative routes returned will follow the reference route + (see section POST Requests) from the origin point of the calculateRoute request for at least + this number of meters. Can only be used when reconstructing a route. The minDeviationDistance + parameter cannot be used in conjunction with arriveAt. + :type min_deviation_distance: int + :param min_deviation_time: All alternative routes returned will follow the reference route (see + section POST Requests) from the origin point of the calculateRoute request for at least this + number of seconds. Can only be used when reconstructing a route. The minDeviationTime parameter + cannot be used in conjunction with arriveAt. Default value is 0. Setting )minDeviationTime_ to + a value greater than zero has the following consequences: + + + * The origin point of the *calculateRoute* Request must be on + (or very near) the input reference route. + + * If this is not the case, an error is returned. + * However, the origin point does not need to be at the beginning + of the input reference route (it can be thought of as the current + vehicle position on the reference route). + + * The reference route, returned as the first route in the *calculateRoute* + Response, will start at the origin point specified in the *calculateRoute* + Request. The initial part of the input reference route up until the origin + point will be excluded from the Response. + * The values of *minDeviationDistance* and *minDeviationTime* determine + how far alternative routes will be guaranteed to follow the reference + route from the origin point onwards. + * The route must use *departAt*. + * The *vehicleHeading* is ignored. + :type min_deviation_time: int + :param instructions_type: If specified, guidance instructions will be returned. Note that the + instructionsType parameter cannot be used in conjunction with routeRepresentation=none. + :type instructions_type: str or ~azure.maps.route.models.RouteInstructionsType + :param language: The language parameter determines the language of the guidance messages. It + does not affect proper nouns (the names of streets, plazas, etc.) It has no effect when + instructionsType=coded. Allowed values are (a subset of) the IETF language tags described. + :type language: str + :param compute_best_order: Re-order the route waypoints using a fast heuristic algorithm to + reduce the route length. Yields best results when used in conjunction with routeType + *shortest*. Notice that origin and destination are excluded from the optimized waypoint + indices. To include origin and destination in the response, please increase all the indices by + 1 to account for the origin, and then add the destination as the final index. Possible values + are true or false. True computes a better order if possible, but is not allowed to be used in + conjunction with maxAlternatives value greater than 0 or in conjunction with circle waypoints. + False will use the locations in the given order and not allowed to be used in conjunction with + routeRepresentation *none*. + :type compute_best_order: bool + :param route_representation: Specifies the representation of the set of routes provided as + response. This parameter value can only be used in conjunction with computeBestOrder=true. + :type route_representation: str or ~azure.maps.route.models.RouteRepresentation + :param compute_travel_time_for: Specifies whether to return additional travel times using + different types of traffic information (none, historic, live) as well as the default + best-estimate travel time. + :type compute_travel_time_for: str or ~azure.maps.route.models.ComputeTravelTimeFor + :param vehicle_heading: The directional heading of the vehicle in degrees starting at true + North and continuing in clockwise direction. North is 0 degrees, east is 90 degrees, south is + 180 degrees, west is 270 degrees. Possible values 0-359. + :type vehicle_heading: int + :param report: Specifies which data should be reported for diagnosis purposes. The only + possible value is *effectiveSettings*. Reports the effective parameters or data used when + calling the API. In the case of defaulted parameters the default will be reflected where the + parameter was not specified by the caller. + :type report: str + :param section_type: Specifies which of the section types is reported in the route response. + :code:`
`:code:`
`For example if sectionType = pedestrian the sections which are suited + for pedestrians only are returned. Multiple types can be used. The default sectionType refers + to the travelMode input. By default travelMode is set to car. + :type section_type: str or ~azure.maps.route.models.SectionType + :param arrive_at: The date and time of arrival at the destination point. It must be specified + as a dateTime. When a time zone offset is not specified it will be assumed to be that of the + destination point. The arriveAt value must be in the future. The arriveAt parameter cannot be + used in conjunction with departAt, minDeviationDistance or minDeviationTime. + :type arrive_at: ~datetime.datetime + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + + + * + It is mandatory if any of the *Efficiency parameters are set. + + * + It must be strictly positive when used in the context of the Consumption Model. Weight + restrictions are considered. + + * + If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is + non-zero, then weight restrictions are considered. + + * + In all other cases, this parameter is ignored. + + Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900. + :type vehicle_weight: int + :param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed + to drive on some roads. + :type vehicle_commercial: bool + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is + specified, it must be consistent with the value of **vehicleEngineType**. + :type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType + :param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent + component of consumption. + + Provided as an unordered list of colon-delimited speed & consumption-rate pairs. The list + defines points on a consumption curve. Consumption rates for speeds not in the list are found + as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0. + + Sensible Values : 50,6.3:130,11.5 + + **Note** : This parameter is required for **The Combustion Consumption Model**. + :type constant_speed_consumption_in_liters_per_hundredkm: float + :param current_fuel_in_liters: Specifies the current supply of fuel in liters. + + Sensible Values : 55. + :type current_fuel_in_liters: float + :param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining + auxiliary systems of the vehicle, in liters per hour. + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 0.2. + :type auxiliary_power_in_liters_per_hour: float + :param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy + stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the + ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For + example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. + + This parameter is required if any ***Efficiency** parameter is set. + + Sensible Values : 34.2. + :type fuel_energy_density_in_m_joules_per_liter: float + :param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored + in fuel to kinetic energy when the vehicle accelerates *(i.e. + KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting + consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **decelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **decelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66. + :type acceleration_efficiency: float + :param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved + (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost). + ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using + **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **accelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **accelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91. + :type deceleration_efficiency: float + :param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel + to potential energy when the vehicle gains elevation *(i.e. + PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by + converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **downhillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **downhillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74. + :type uphill_efficiency: float + :param downhill_efficiency: Specifies the efficiency of converting potential energy to saved + (not consumed) fuel when the vehicle loses elevation *(i.e. + ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved + (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **uphillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **uphillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73. + :type downhill_efficiency: float + :param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component + of consumption. + + Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a + consumption curve. Consumption rates for speeds not in the list are found as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and + 100000.0. + + Sensible Values : 50,8.2:130,21.3 + + This parameter is required for **Electric consumption model**. + :type constant_speed_consumption_ink_wh_per_hundredkm: str + :param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours + (kWh). + + This parameter co-exists with **maxChargeInkWh** parameter. + + The range of values allowed are 0.0 to **maxChargeInkWh**. + + Sensible Values : 43. + :type current_charge_ink_wh: str + :param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh) + that may be stored in the vehicle's battery. + + This parameter co-exists with **currentChargeInkWh** parameter. + + Minimum value has to be greater than or equal to **currentChargeInkWh**. + + Sensible Values : 85. + :type max_charge_ink_wh: str + :param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary + systems, in kilowatts (kW). + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 1.7. + :type auxiliary_power_ink_w: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteDirectionsResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteDirectionsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_route_directions.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['query'] = self._serialize.query("query", query, 'str') + if max_alternatives is not None: + query_parameters['maxAlternatives'] = self._serialize.query("max_alternatives", max_alternatives, 'int', maximum=5, minimum=0) + if alternative_type is not None: + query_parameters['alternativeType'] = self._serialize.query("alternative_type", alternative_type, 'str') + if min_deviation_distance is not None: + query_parameters['minDeviationDistance'] = self._serialize.query("min_deviation_distance", min_deviation_distance, 'int') + if min_deviation_time is not None: + query_parameters['minDeviationTime'] = self._serialize.query("min_deviation_time", min_deviation_time, 'int') + if instructions_type is not None: + query_parameters['instructionsType'] = self._serialize.query("instructions_type", instructions_type, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if compute_best_order is not None: + query_parameters['computeBestOrder'] = self._serialize.query("compute_best_order", compute_best_order, 'bool') + if route_representation is not None: + query_parameters['routeRepresentation'] = self._serialize.query("route_representation", route_representation, 'str') + if compute_travel_time_for is not None: + query_parameters['computeTravelTimeFor'] = self._serialize.query("compute_travel_time_for", compute_travel_time_for, 'str') + if vehicle_heading is not None: + query_parameters['vehicleHeading'] = self._serialize.query("vehicle_heading", vehicle_heading, 'int', maximum=359, minimum=0) + if report is not None: + query_parameters['report'] = self._serialize.query("report", report, 'str') + if section_type is not None: + query_parameters['sectionType'] = self._serialize.query("section_type", section_type, 'str') + if arrive_at is not None: + query_parameters['arriveAt'] = self._serialize.query("arrive_at", arrive_at, 'iso-8601') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if vehicle_commercial is not None: + query_parameters['vehicleCommercial'] = self._serialize.query("vehicle_commercial", vehicle_commercial, 'bool') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, 'str') + if vehicle_engine_type is not None: + query_parameters['vehicleEngineType'] = self._serialize.query("vehicle_engine_type", vehicle_engine_type, 'str') + if constant_speed_consumption_in_liters_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInLitersPerHundredkm'] = self._serialize.query("constant_speed_consumption_in_liters_per_hundredkm", constant_speed_consumption_in_liters_per_hundredkm, 'float') + if current_fuel_in_liters is not None: + query_parameters['currentFuelInLiters'] = self._serialize.query("current_fuel_in_liters", current_fuel_in_liters, 'float') + if auxiliary_power_in_liters_per_hour is not None: + query_parameters['auxiliaryPowerInLitersPerHour'] = self._serialize.query("auxiliary_power_in_liters_per_hour", auxiliary_power_in_liters_per_hour, 'float') + if fuel_energy_density_in_m_joules_per_liter is not None: + query_parameters['fuelEnergyDensityInMJoulesPerLiter'] = self._serialize.query("fuel_energy_density_in_m_joules_per_liter", fuel_energy_density_in_m_joules_per_liter, 'float') + if acceleration_efficiency is not None: + query_parameters['accelerationEfficiency'] = self._serialize.query("acceleration_efficiency", acceleration_efficiency, 'float') + if deceleration_efficiency is not None: + query_parameters['decelerationEfficiency'] = self._serialize.query("deceleration_efficiency", deceleration_efficiency, 'float') + if uphill_efficiency is not None: + query_parameters['uphillEfficiency'] = self._serialize.query("uphill_efficiency", uphill_efficiency, 'float') + if downhill_efficiency is not None: + query_parameters['downhillEfficiency'] = self._serialize.query("downhill_efficiency", downhill_efficiency, 'float') + if constant_speed_consumption_ink_wh_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInkWhPerHundredkm'] = self._serialize.query("constant_speed_consumption_ink_wh_per_hundredkm", constant_speed_consumption_ink_wh_per_hundredkm, 'str') + if current_charge_ink_wh is not None: + query_parameters['currentChargeInkWh'] = self._serialize.query("current_charge_ink_wh", current_charge_ink_wh, 'str') + if max_charge_ink_wh is not None: + query_parameters['maxChargeInkWh'] = self._serialize.query("max_charge_ink_wh", max_charge_ink_wh, 'str') + if auxiliary_power_ink_w is not None: + query_parameters['auxiliaryPowerInkW'] = self._serialize.query("auxiliary_power_ink_w", auxiliary_power_ink_w, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_directions_request_body, 'PostRouteDirectionsRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('RouteDirectionsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_route_directions.metadata = {'url': '/route/directions/{format}'} # type: ignore + + def get_route_range( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + fuel_budget_in_liters=None, # type: Optional[float] + energy_budget_ink_wh=None, # type: Optional[float] + time_budget_in_sec=None, # type: Optional[float] + distance_budget_in_meters=None, # type: Optional[float] + depart_at=None, # type: Optional[datetime.datetime] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] + traffic=None, # type: Optional[bool] + avoid=None, # type: Optional[List[Union[str, "_models.RouteAvoidType"]]] + travel_mode=None, # type: Optional[Union[str, "_models.TravelMode"]] + hilliness=None, # type: Optional[Union[str, "_models.HillinessDegree"]] + windingness=None, # type: Optional[Union[str, "_models.WindingnessLevel"]] + vehicle_axle_weight=None, # type: Optional[int] + vehicle_width=None, # type: Optional[float] + vehicle_height=None, # type: Optional[float] + vehicle_length=None, # type: Optional[float] + vehicle_max_speed=None, # type: Optional[int] + vehicle_weight=None, # type: Optional[int] + vehicle_commercial=None, # type: Optional[bool] + vehicle_load_type=None, # type: Optional[Union[str, "_models.VehicleLoadType"]] + vehicle_engine_type=None, # type: Optional[Union[str, "_models.VehicleEngineType"]] + constant_speed_consumption_in_liters_per_hundredkm=None, # type: Optional[float] + current_fuel_in_liters=None, # type: Optional[float] + auxiliary_power_in_liters_per_hour=None, # type: Optional[float] + fuel_energy_density_in_m_joules_per_liter=None, # type: Optional[float] + acceleration_efficiency=None, # type: Optional[float] + deceleration_efficiency=None, # type: Optional[float] + uphill_efficiency=None, # type: Optional[float] + downhill_efficiency=None, # type: Optional[float] + constant_speed_consumption_ink_wh_per_hundredkm=None, # type: Optional[str] + current_charge_ink_wh=None, # type: Optional[str] + max_charge_ink_wh=None, # type: Optional[str] + auxiliary_power_ink_w=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.GetRouteRangeResponse" + """**Route Range (Isochrone) API** + + **Applies to**\ : S1 pricing tier. + + This service will calculate a set of locations that can be reached from the origin point based + on fuel, energy, time or distance budget that is specified. A polygon boundary (or Isochrone) + is returned in a counterclockwise orientation as well as the precise polygon center which was + the result of the origin point. + + The returned polygon can be used for further processing such as `Search Inside Geometry + `_ to search for + POIs within the provided Isochrone. + + :param query: The Coordinate from which the range calculation should start. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.route.models.ResponseFormat + :param fuel_budget_in_liters: Fuel budget in liters that determines maximal range which can be + travelled using the specified Combustion Consumption Model.:code:`
` When fuelBudgetInLiters + is used, it is mandatory to specify a detailed Combustion Consumption Model.:code:`
` + Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, or + distanceBudgetInMeters) must be used. + :type fuel_budget_in_liters: float + :param energy_budget_ink_wh: Electric energy budget in kilowatt hours (kWh) that determines + maximal range which can be travelled using the specified Electric Consumption + Model.:code:`
` When energyBudgetInkWh is used, it is mandatory to specify a detailed + Electric Consumption Model.:code:`
` Exactly one budget (fuelBudgetInLiters, + energyBudgetInkWh, timeBudgetInSec, or distanceBudgetInMeters) must be used. + :type energy_budget_ink_wh: float + :param time_budget_in_sec: Time budget in seconds that determines maximal range which can be + travelled using driving time. The Consumption Model will only affect the range when routeType + is eco.:code:`
` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, timeBudgetInSec, + or distanceBudgetInMeters) must be used. + :type time_budget_in_sec: float + :param distance_budget_in_meters: Distance budget in meters that determines maximal range which + can be travelled using driving distance. The Consumption Model will only affect the range when + routeType is eco.:code:`
` Exactly one budget (fuelBudgetInLiters, energyBudgetInkWh, + timeBudgetInSec, or distanceBudgetInMeters) must be used. + :type distance_budget_in_meters: float + :param depart_at: The date and time of departure from the origin point. Departure times apart + from now must be specified as a dateTime. When a time zone offset is not specified, it will be + assumed to be that of the origin point. The departAt value must be in the future in the + date-time format (1996-12-19T16:39:57-08:00). + :type depart_at: ~datetime.datetime + :param route_type: The type of route requested. + :type route_type: str or ~azure.maps.route.models.RouteType + :param traffic: Possible values: + + + * true - Do consider all available traffic information during routing + * false - Ignore current traffic data during routing. Note that although the current traffic + data is ignored + during routing, the effect of historic traffic on effective road speeds is still + incorporated. + :type traffic: bool + :param avoid: Specifies something that the route calculation should try to avoid when + determining the route. Can be specified multiple times in one request, for example, + '&avoid=motorways&avoid=tollRoads&avoid=ferries'. In calculateReachableRange requests, the + value alreadyUsedRoads must not be used. + :type avoid: list[str or ~azure.maps.route.models.RouteAvoidType] + :param travel_mode: The mode of travel for the requested route. If not defined, default is + 'car'. Note that the requested travelMode may not be available for the entire route. Where the + requested travelMode is not available for a particular section, the travelMode element of the + response for that section will be "other". Note that travel modes bus, motorcycle, taxi and van + are BETA functionality. Full restriction data is not available in all areas. In + **calculateReachableRange** requests, the values bicycle and pedestrian must not be used. + :type travel_mode: str or ~azure.maps.route.models.TravelMode + :param hilliness: Degree of hilliness for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type hilliness: str or ~azure.maps.route.models.HillinessDegree + :param windingness: Level of turns for thrilling route. This parameter can only be used in + conjunction with ``routeType``\ =thrilling. + :type windingness: str or ~azure.maps.route.models.WindingnessLevel + :param vehicle_axle_weight: Weight per axle of the vehicle in kg. A value of 0 means that + weight restrictions per axle are not considered. + :type vehicle_axle_weight: int + :param vehicle_width: Width of the vehicle in meters. A value of 0 means that width + restrictions are not considered. + :type vehicle_width: float + :param vehicle_height: Height of the vehicle in meters. A value of 0 means that height + restrictions are not considered. + :type vehicle_height: float + :param vehicle_length: Length of the vehicle in meters. A value of 0 means that length + restrictions are not considered. + :type vehicle_length: float + :param vehicle_max_speed: Maximum speed of the vehicle in km/hour. The max speed in the vehicle + profile is used to check whether a vehicle is allowed on motorways. + + + * + A value of 0 means that an appropriate value for the vehicle will be determined and applied + during route planning. + + * + A non-zero value may be overridden during route planning. For example, the current traffic + flow is 60 km/hour. If the vehicle maximum speed is set to 50 km/hour, the routing engine will + consider 60 km/hour as this is the current situation. If the maximum speed of the vehicle is + provided as 80 km/hour but the current traffic flow is 60 km/hour, then routing engine will + again use 60 km/hour. + :type vehicle_max_speed: int + :param vehicle_weight: Weight of the vehicle in kilograms. + + + * + It is mandatory if any of the *Efficiency parameters are set. + + * + It must be strictly positive when used in the context of the Consumption Model. Weight + restrictions are considered. + + * + If no detailed **Consumption Model** is specified and the value of **vehicleWeight** is + non-zero, then weight restrictions are considered. + + * + In all other cases, this parameter is ignored. + + Sensible Values : for **Combustion Model** : 1600, for **Electric Model** : 1900. + :type vehicle_weight: int + :param vehicle_commercial: Vehicle is used for commercial purposes and thus may not be allowed + to drive on some roads. + :type vehicle_commercial: bool + :param vehicle_load_type: Types of cargo that may be classified as hazardous materials and + restricted from some roads. Available vehicleLoadType values are US Hazmat classes 1 through 9, + plus generic classifications for use in other countries. Values beginning with USHazmat are for + US routing while otherHazmat should be used for all other countries. vehicleLoadType can be + specified multiple times. This parameter is currently only considered for travelMode=truck. + :type vehicle_load_type: str or ~azure.maps.route.models.VehicleLoadType + :param vehicle_engine_type: Engine type of the vehicle. When a detailed Consumption Model is + specified, it must be consistent with the value of **vehicleEngineType**. + :type vehicle_engine_type: str or ~azure.maps.route.models.VehicleEngineType + :param constant_speed_consumption_in_liters_per_hundredkm: Specifies the speed-dependent + component of consumption. + + Provided as an unordered list of colon-delimited speed & consumption-rate pairs. The list + defines points on a consumption curve. Consumption rates for speeds not in the list are found + as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in l/100km) is between 0.01 and 100000.0. + + Sensible Values : 50,6.3:130,11.5 + + **Note** : This parameter is required for **The Combustion Consumption Model**. + :type constant_speed_consumption_in_liters_per_hundredkm: float + :param current_fuel_in_liters: Specifies the current supply of fuel in liters. + + Sensible Values : 55. + :type current_fuel_in_liters: float + :param auxiliary_power_in_liters_per_hour: Specifies the amount of fuel consumed for sustaining + auxiliary systems of the vehicle, in liters per hour. + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 0.2. + :type auxiliary_power_in_liters_per_hour: float + :param fuel_energy_density_in_m_joules_per_liter: Specifies the amount of chemical energy + stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the + ***Efficiency** parameters for conversions between saved or consumed energy and fuel. For + example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. + + This parameter is required if any ***Efficiency** parameter is set. + + Sensible Values : 34.2. + :type fuel_energy_density_in_m_joules_per_liter: float + :param acceleration_efficiency: Specifies the efficiency of converting chemical energy stored + in fuel to kinetic energy when the vehicle accelerates *(i.e. + KineticEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by converting + consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **decelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **decelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.33, for **Electric Model** : 0.66. + :type acceleration_efficiency: float + :param deceleration_efficiency: Specifies the efficiency of converting kinetic energy to saved + (not consumed) fuel when the vehicle decelerates *(i.e. ChemicalEnergySaved/KineticEnergyLost). + ChemicalEnergySaved* is obtained by converting saved (not consumed) fuel to energy using + **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **accelerationEfficiency**. + + The range of values allowed are 0.0 to 1/\ **accelerationEfficiency**. + + Sensible Values : for **Combustion Model** : 0.83, for **Electric Model** : 0.91. + :type deceleration_efficiency: float + :param uphill_efficiency: Specifies the efficiency of converting chemical energy stored in fuel + to potential energy when the vehicle gains elevation *(i.e. + PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed* is obtained by + converting consumed fuel to chemical energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **downhillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **downhillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.27, for **Electric Model** : 0.74. + :type uphill_efficiency: float + :param downhill_efficiency: Specifies the efficiency of converting potential energy to saved + (not consumed) fuel when the vehicle loses elevation *(i.e. + ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved* is obtained by converting saved + (not consumed) fuel to energy using **fuelEnergyDensityInMJoulesPerLiter**. + + Must be paired with **uphillEfficiency**. + + The range of values allowed are 0.0 to 1/\ **uphillEfficiency**. + + Sensible Values : for **Combustion Model** : 0.51, for **Electric Model** : 0.73. + :type downhill_efficiency: float + :param constant_speed_consumption_ink_wh_per_hundredkm: Specifies the speed-dependent component + of consumption. + + Provided as an unordered list of speed/consumption-rate pairs. The list defines points on a + consumption curve. Consumption rates for speeds not in the list are found as follows: + + + * + by linear interpolation, if the given speed lies in between two speeds in the list + + * + by linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by + the nearest two points in the list + + The list must contain between 1 and 25 points (inclusive), and may not contain duplicate + points for the same speed. If it only contains a single point, then the consumption rate of + that point is used without further processing. + + Consumption specified for the largest speed must be greater than or equal to that of the + penultimate largest speed. This ensures that extrapolation does not lead to negative + consumption rates. + + Similarly, consumption values specified for the two smallest speeds in the list cannot lead to + a negative consumption rate for any smaller speed. + + The valid range for the consumption values(expressed in kWh/100km) is between 0.01 and + 100000.0. + + Sensible Values : 50,8.2:130,21.3 + + This parameter is required for **Electric consumption model**. + :type constant_speed_consumption_ink_wh_per_hundredkm: str + :param current_charge_ink_wh: Specifies the current electric energy supply in kilowatt hours + (kWh). + + This parameter co-exists with **maxChargeInkWh** parameter. + + The range of values allowed are 0.0 to **maxChargeInkWh**. + + Sensible Values : 43. + :type current_charge_ink_wh: str + :param max_charge_ink_wh: Specifies the maximum electric energy supply in kilowatt hours (kWh) + that may be stored in the vehicle's battery. + + This parameter co-exists with **currentChargeInkWh** parameter. + + Minimum value has to be greater than or equal to **currentChargeInkWh**. + + Sensible Values : 85. + :type max_charge_ink_wh: str + :param auxiliary_power_ink_w: Specifies the amount of power consumed for sustaining auxiliary + systems, in kilowatts (kW). + + It can be used to specify consumption due to devices and systems such as AC systems, radio, + heating, etc. + + Sensible Values : 1.7. + :type auxiliary_power_ink_w: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetRouteRangeResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.GetRouteRangeResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GetRouteRangeResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_route_range.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['query'] = self._serialize.query("query", query, 'str') + if fuel_budget_in_liters is not None: + query_parameters['fuelBudgetInLiters'] = self._serialize.query("fuel_budget_in_liters", fuel_budget_in_liters, 'float') + if energy_budget_ink_wh is not None: + query_parameters['energyBudgetInkWh'] = self._serialize.query("energy_budget_ink_wh", energy_budget_ink_wh, 'float') + if time_budget_in_sec is not None: + query_parameters['timeBudgetInSec'] = self._serialize.query("time_budget_in_sec", time_budget_in_sec, 'float') + if distance_budget_in_meters is not None: + query_parameters['distanceBudgetInMeters'] = self._serialize.query("distance_budget_in_meters", distance_budget_in_meters, 'float') + if depart_at is not None: + query_parameters['departAt'] = self._serialize.query("depart_at", depart_at, 'iso-8601') + if route_type is not None: + query_parameters['routeType'] = self._serialize.query("route_type", route_type, 'str') + if traffic is not None: + query_parameters['traffic'] = self._serialize.query("traffic", traffic, 'bool') + if avoid is not None: + query_parameters['avoid'] = [self._serialize.query("avoid", q, 'str') if q is not None else '' for q in avoid] + if travel_mode is not None: + query_parameters['travelMode'] = self._serialize.query("travel_mode", travel_mode, 'str') + if hilliness is not None: + query_parameters['hilliness'] = self._serialize.query("hilliness", hilliness, 'str') + if windingness is not None: + query_parameters['windingness'] = self._serialize.query("windingness", windingness, 'str') + if vehicle_axle_weight is not None: + query_parameters['vehicleAxleWeight'] = self._serialize.query("vehicle_axle_weight", vehicle_axle_weight, 'int') + if vehicle_width is not None: + query_parameters['vehicleWidth'] = self._serialize.query("vehicle_width", vehicle_width, 'float') + if vehicle_height is not None: + query_parameters['vehicleHeight'] = self._serialize.query("vehicle_height", vehicle_height, 'float') + if vehicle_length is not None: + query_parameters['vehicleLength'] = self._serialize.query("vehicle_length", vehicle_length, 'float') + if vehicle_max_speed is not None: + query_parameters['vehicleMaxSpeed'] = self._serialize.query("vehicle_max_speed", vehicle_max_speed, 'int') + if vehicle_weight is not None: + query_parameters['vehicleWeight'] = self._serialize.query("vehicle_weight", vehicle_weight, 'int') + if vehicle_commercial is not None: + query_parameters['vehicleCommercial'] = self._serialize.query("vehicle_commercial", vehicle_commercial, 'bool') + if vehicle_load_type is not None: + query_parameters['vehicleLoadType'] = self._serialize.query("vehicle_load_type", vehicle_load_type, 'str') + if vehicle_engine_type is not None: + query_parameters['vehicleEngineType'] = self._serialize.query("vehicle_engine_type", vehicle_engine_type, 'str') + if constant_speed_consumption_in_liters_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInLitersPerHundredkm'] = self._serialize.query("constant_speed_consumption_in_liters_per_hundredkm", constant_speed_consumption_in_liters_per_hundredkm, 'float') + if current_fuel_in_liters is not None: + query_parameters['currentFuelInLiters'] = self._serialize.query("current_fuel_in_liters", current_fuel_in_liters, 'float') + if auxiliary_power_in_liters_per_hour is not None: + query_parameters['auxiliaryPowerInLitersPerHour'] = self._serialize.query("auxiliary_power_in_liters_per_hour", auxiliary_power_in_liters_per_hour, 'float') + if fuel_energy_density_in_m_joules_per_liter is not None: + query_parameters['fuelEnergyDensityInMJoulesPerLiter'] = self._serialize.query("fuel_energy_density_in_m_joules_per_liter", fuel_energy_density_in_m_joules_per_liter, 'float') + if acceleration_efficiency is not None: + query_parameters['accelerationEfficiency'] = self._serialize.query("acceleration_efficiency", acceleration_efficiency, 'float') + if deceleration_efficiency is not None: + query_parameters['decelerationEfficiency'] = self._serialize.query("deceleration_efficiency", deceleration_efficiency, 'float') + if uphill_efficiency is not None: + query_parameters['uphillEfficiency'] = self._serialize.query("uphill_efficiency", uphill_efficiency, 'float') + if downhill_efficiency is not None: + query_parameters['downhillEfficiency'] = self._serialize.query("downhill_efficiency", downhill_efficiency, 'float') + if constant_speed_consumption_ink_wh_per_hundredkm is not None: + query_parameters['constantSpeedConsumptionInkWhPerHundredkm'] = self._serialize.query("constant_speed_consumption_ink_wh_per_hundredkm", constant_speed_consumption_ink_wh_per_hundredkm, 'str') + if current_charge_ink_wh is not None: + query_parameters['currentChargeInkWh'] = self._serialize.query("current_charge_ink_wh", current_charge_ink_wh, 'str') + if max_charge_ink_wh is not None: + query_parameters['maxChargeInkWh'] = self._serialize.query("max_charge_ink_wh", max_charge_ink_wh, 'str') + if auxiliary_power_ink_w is not None: + query_parameters['auxiliaryPowerInkW'] = self._serialize.query("auxiliary_power_ink_w", auxiliary_power_ink_w, '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('GetRouteRangeResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_range.metadata = {'url': '/route/range/{format}'} # type: ignore + + def _post_route_directions_batch_initial( + self, + post_route_directions_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RouteDirectionsBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteDirectionsBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_route_directions_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_directions_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_route_directions_batch_initial.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + def begin_post_route_directions_batch( + self, + post_route_directions_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteDirectionsBatchResponse"] + """**Route Directions Batch API** + + **Applies to**\ : S1 pricing tier. + + The Route Directions Batch API sends batches of queries to `Route Directions API + `_ using just a single + API call. You can call Route Directions Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **700** queries and sync API + up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex route + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **700** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Route Directions Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + ``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0`` + Note:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security + <#security>`_\ ) to the *status URI* before running it. :code:`
` + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *route directions* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 3 *route directions* + queries: + + .. code-block:: json + + { + "batchItems": [ + { "query": + "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + }, + { "query": + "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" }, + { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + ] + } + + A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *route directions* + `URI parameters + `_. The + string values in the *route directions* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **700** queries and sync API up to **100** queries, + and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``RouteDirectionsResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 1 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 1, + "totalRequests": 2 + }, + "batchItems": [ + { + "statusCode": 200, + "response": { + "routes": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "legs": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "points": [ + { + "latitude": 47.62094, + "longitude": -122.34892 + }, + { + "latitude": 47.62094, + "longitude": -122.3485 + }, + { + "latitude": 47.62095, + "longitude": -122.3476 + } + ] + } + ], + "sections": [ + { + "startPointIndex": 0, + "endPointIndex": 40, + "sectionType": "TRAVEL_MODE", + "travelMode": "bicycle" + } + ] + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param post_route_directions_batch_request_body: The list of route directions queries/requests + to process. The list can contain a max of 700 queries for async and 100 queries for sync + version and must contain at least 1 query. + :type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_route_directions_batch_initial( + post_route_directions_batch_request_body=post_route_directions_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_route_directions_batch.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + def _get_route_directions_batch_initial( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RouteDirectionsBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RouteDirectionsBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_route_directions_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_route_directions_batch_initial.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + def begin_get_route_directions_batch( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteDirectionsBatchResponse"] + """Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``RouteDirectionsResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 1 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 1, + "totalRequests": 2 + }, + "batchItems": [ + { + "statusCode": 200, + "response": { + "routes": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "legs": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "points": [ + { + "latitude": 47.62094, + "longitude": -122.34892 + }, + { + "latitude": 47.62094, + "longitude": -122.3485 + }, + { + "latitude": 47.62095, + "longitude": -122.3476 + } + ] + } + ], + "sections": [ + { + "startPointIndex": 0, + "endPointIndex": 40, + "sectionType": "TRAVEL_MODE", + "travelMode": "bicycle" + } + ] + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteDirectionsBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.route.models.RouteDirectionsBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_route_directions_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteDirectionsBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_route_directions_batch.metadata = {'url': '/route/directions/batch/{format}'} # type: ignore + + def post_route_directions_batch_sync( + self, + post_route_directions_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteDirectionsBatchResponse" + """**Route Directions Batch API** + + **Applies to**\ : S1 pricing tier. + + The Route Directions Batch API sends batches of queries to `Route Directions API + `_ using just a single + API call. You can call Route Directions Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **700** queries and sync API + up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex route + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **700** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Route Directions Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + ``GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0`` + Note:- Please remember to add AUTH information (subscription-key/azure_auth - See `Security + <#security>`_\ ) to the *status URI* before running it. :code:`
` + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *route directions* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 3 *route directions* + queries: + + .. code-block:: json + + { + "batchItems": [ + { "query": + "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" + }, + { "query": + "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" }, + { "query": "?query=48.923159,-122.557362:32.621279,-116.840362" } + ] + } + + A *route directions* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *route directions* + `URI parameters + `_. The + string values in the *route directions* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **700** queries and sync API up to **100** queries, + and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``RouteDirectionsResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 1 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 1, + "totalRequests": 2 + }, + "batchItems": [ + { + "statusCode": 200, + "response": { + "routes": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "legs": [ + { + "summary": { + "lengthInMeters": 1758, + "travelTimeInSeconds": 387, + "trafficDelayInSeconds": 0, + "departureTime": "2018-07-17T00:49:56+00:00", + "arrivalTime": "2018-07-17T00:56:22+00:00" + }, + "points": [ + { + "latitude": 47.62094, + "longitude": -122.34892 + }, + { + "latitude": 47.62094, + "longitude": -122.3485 + }, + { + "latitude": 47.62095, + "longitude": -122.3476 + } + ] + } + ], + "sections": [ + { + "startPointIndex": 0, + "endPointIndex": 40, + "sectionType": "TRAVEL_MODE", + "travelMode": "bicycle" + } + ] + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param post_route_directions_batch_request_body: The list of route directions queries/requests + to process. The list can contain a max of 700 queries for async and 100 queries for sync + version and must contain at least 1 query. + :type post_route_directions_batch_request_body: ~azure.maps.route.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.route.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteDirectionsBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.route.models.RouteDirectionsBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteDirectionsBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_route_directions_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(post_route_directions_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('RouteDirectionsBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_route_directions_batch_sync.metadata = {'url': '/route/directions/batch/sync/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-route/azure/maps/route/py.typed b/sdk/maps/azure-maps-route/azure/maps/route/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-route/azure/maps/route/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-route/sdk_packaging.toml b/sdk/maps/azure-maps-route/sdk_packaging.toml new file mode 100644 index 000000000000..7f0d7d7f77e9 --- /dev/null +++ b/sdk/maps/azure-maps-route/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-route" +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-route/setup.cfg b/sdk/maps/azure-maps-route/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-route/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-route/setup.py b/sdk/maps/azure-maps-route/setup.py new file mode 100644 index 000000000000..fb0b3e552b39 --- /dev/null +++ b/sdk/maps/azure-maps-route/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-route" +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'], + } +) diff --git a/sdk/maps/azure-maps-search/CHANGELOG.md b/sdk/maps/azure-maps-search/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-search/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-search/MANIFEST.in b/sdk/maps/azure-maps-search/MANIFEST.in new file mode 100644 index 000000000000..cb7d3109cc06 --- /dev/null +++ b/sdk/maps/azure-maps-search/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 + diff --git a/sdk/maps/azure-maps-search/README.md b/sdk/maps/azure-maps-search/README.md new file mode 100644 index 000000000000..6d03aa262433 --- /dev/null +++ b/sdk/maps/azure-maps-search/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-search%2FREADME.png) diff --git a/sdk/maps/azure-maps-search/_meta.json b/sdk/maps/azure-maps-search/_meta.json new file mode 100644 index 000000000000..4cc81494555b --- /dev/null +++ b/sdk/maps/azure-maps-search/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "fd01f0058f99a0d2b145abbb7ade2cd90d9d3a82", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/Search/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/Search/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-search/azure/__init__.py b/sdk/maps/azure-maps-search/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-search/azure/maps/__init__.py b/sdk/maps/azure-maps-search/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-search/azure/maps/search/__init__.py b/sdk/maps/azure-maps-search/azure/maps/search/__init__.py new file mode 100644 index 000000000000..0697d1ca3e8a --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/__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 ._search_client import SearchClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['SearchClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-search/azure/maps/search/_configuration.py b/sdk/maps/azure-maps-search/azure/maps/search/_configuration.py new file mode 100644 index 000000000000..502f16c09817 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/_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 SearchClientConfiguration(Configuration): + """Configuration for SearchClient. + + 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(SearchClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-search/{}'.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-search/azure/maps/search/_metadata.json b/sdk/maps/azure-maps-search/azure/maps/search/_metadata.json new file mode 100644 index 000000000000..48cced057990 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/_metadata.json @@ -0,0 +1,432 @@ +{ + "chosen_version": "1.0", + "total_api_version_list": ["1.0"], + "client": { + "name": "SearchClient", + "filename": "_search_client", + "description": "Azure Maps Search REST APIs.", + "base_url": "\u0027https://atlas.microsoft.com\u0027", + "custom_base_url": null, + "azure_arm": false, + "has_lro_operations": true, + "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\": [\"SearchClientConfiguration\"], \"._operations_mixin\": [\"SearchClientOperationsMixin\"]}}}", + "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\": [\"SearchClientConfiguration\"], \"._operations_mixin\": [\"SearchClientOperationsMixin\"]}}}" + }, + "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\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"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\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_search_polygon" : { + "sync": { + "signature": "def get_search_polygon(\n self,\n geometries, # type: List[str]\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Polygon**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Get Polygon service allows you to request the geometry data such as a city or country\noutline for a set of entities, previously retrieved from an Online Search request in GeoJSON\nformat. The geometry ID is returned in the dataSources object under \"geometry\" and \"id\" in\neither a Search Address or Search Fuzzy call.\n\nPlease note that any geometry ID retrieved from an Online Search endpoint has a limited\nlifetime. The client should not store geometry IDs in persistent storage for later referral,\nas the stability of these identifiers is not guaranteed for a long period of time. It is\nexpected that a request to the Polygon method is made within a few minutes of the request to\nthe Online Search method that provided the ID. The service allows for batch requests up to 20\nidentifiers.\n\n:param geometries: Comma separated list of geometry UUIDs, previously retrieved from an Online\n Search request.\n:type geometries: list[str]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchPolygonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchPolygonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_polygon(\n self,\n geometries: List[str],\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.SearchPolygonResponse\":\n", + "doc": "\"\"\"**Get Polygon**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Get Polygon service allows you to request the geometry data such as a city or country\noutline for a set of entities, previously retrieved from an Online Search request in GeoJSON\nformat. The geometry ID is returned in the dataSources object under \"geometry\" and \"id\" in\neither a Search Address or Search Fuzzy call.\n\nPlease note that any geometry ID retrieved from an Online Search endpoint has a limited\nlifetime. The client should not store geometry IDs in persistent storage for later referral,\nas the stability of these identifiers is not guaranteed for a long period of time. It is\nexpected that a request to the Polygon method is made within a few minutes of the request to\nthe Online Search method that provided the ID. The service allows for batch requests up to 20\nidentifiers.\n\n:param geometries: Comma separated list of geometry UUIDs, previously retrieved from an Online\n Search request.\n:type geometries: list[str]\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchPolygonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchPolygonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "geometries, format" + }, + "get_search_fuzzy" : { + "sync": { + "signature": "def get_search_fuzzy(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n typeahead=None, # type: Optional[bool]\n limit=None, # type: Optional[int]\n ofs=None, # type: Optional[int]\n category_set=None, # type: Optional[List[int]]\n country_set=None, # type: Optional[List[str]]\n lat=None, # type: Optional[float]\n lon=None, # type: Optional[float]\n radius=None, # type: Optional[float]\n top_left=None, # type: Optional[str]\n btm_right=None, # type: Optional[str]\n language=None, # type: Optional[str]\n extended_postal_codes_for=None, # type: Optional[str]\n min_fuzzy_level=None, # type: Optional[int]\n max_fuzzy_level=None, # type: Optional[int]\n idx_set=None, # type: Optional[List[Union[str, \"_models.SearchIndexSet\"]]]\n brand_set=None, # type: Optional[List[str]]\n connector_set=None, # type: Optional[List[Union[str, \"_models.ConnectorSet\"]]]\n entity_type=None, # type: Optional[Union[str, \"_models.EntityType\"]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n opening_hours=None, # type: Optional[Union[str, \"_models.OpeningHours\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Free Form Search**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe basic default API is Free Form Search which handles the most fuzzy of inputs handling any\ncombination of address or POI tokens. This search API is the canonical \u0027single line search\u0027.\nThe Free Form Search API is a seamless combination of POI search and geocoding. The API can\nalso be weighted with a contextual position (lat./lon. pair), or fully constrained by a\ncoordinate and radius, or it can be executed more generally without any geo biasing anchor\npoint.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`We strongly advise you to use the \u0027countrySet\u0027 parameter to\nspecify only the countries for which your application needs coverage, as the default behavior\nwill be to search the entire world, potentially returning unnecessary\nresults.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e` E.g.: ``countrySet``\\ =US,FR :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Please\nsee `Search Coverage\n\u003chttps://docs.microsoft.com/azure/location-based-services/geocoding-coverage\u003e`_ for a complete\nlist of all the supported countries.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Most Search queries default to\n``maxFuzzyLevel``\\ =2 to gain performance and also reduce unusual results. This new default can\nbe overridden as needed per request by passing in the query param ``maxFuzzyLevel``\\ =3 or 4.\n\n:param query: The applicable query string (e.g., \"seattle\", \"pizza\"). Can *also* be specified\n as a comma separated string composed by latitude followed by longitude (e.g., \"47.641268,\n -122.125679\"). Must be properly URL encoded.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param min_fuzzy_level: Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum:\n 4\n\n\n *\n Level 1 has no spell checking.\n\n *\n Level 2 uses normal n-gram spell checking. For example, query \"restrant\" can be matched to\n \"restaurant.\"\n\n *\n Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell\n checking is for \"rstrnt\" to \"restaurant\" matching. Shingle spell checking is for \"mountainview\"\n to \"mountain view\" matching.\n\n *\n Level 4 doesn\u2019t add any more spell checking functions.\n\n The search engine will start looking for a match on the level defined by minFuzzyLevel, and\n will stop searching at the level specified by maxFuzzyLevel.\n:type min_fuzzy_level: int\n:param max_fuzzy_level: Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum:\n 4\n\n\n *\n Level 1 has no spell checking.\n\n *\n Level 2 uses normal n-gram spell checking. For example, query \"restrant\" can be matched to\n \"restaurant.\"\n\n *\n Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell\n checking is for \"rstrnt\" to \"restaurant\" matching. Shingle spell checking is for \"mountainview\"\n to \"mountain view\" matching.\n\n *\n Level 4 doesn\u2019t add any more spell checking functions.\n\n The search engine will start looking for a match on the level defined by minFuzzyLevel, and\n will stop searching at the level specified by maxFuzzyLevel.\n:type max_fuzzy_level: int\n:param idx_set: A comma separated list of indexes which should be utilized for the search. Item\n order does not matter. Available indexes are: Addr = Address range interpolation, Geo =\n Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross\n Streets (intersections).\n:type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet]\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_fuzzy(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n typeahead: Optional[bool] = None,\n limit: Optional[int] = None,\n ofs: Optional[int] = None,\n category_set: Optional[List[int]] = None,\n country_set: Optional[List[str]] = None,\n lat: Optional[float] = None,\n lon: Optional[float] = None,\n radius: Optional[float] = None,\n top_left: Optional[str] = None,\n btm_right: Optional[str] = None,\n language: Optional[str] = None,\n extended_postal_codes_for: Optional[str] = None,\n min_fuzzy_level: Optional[int] = None,\n max_fuzzy_level: Optional[int] = None,\n idx_set: Optional[List[Union[str, \"_models.SearchIndexSet\"]]] = None,\n brand_set: Optional[List[str]] = None,\n connector_set: Optional[List[Union[str, \"_models.ConnectorSet\"]]] = None,\n entity_type: Optional[Union[str, \"_models.EntityType\"]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n opening_hours: Optional[Union[str, \"_models.OpeningHours\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Free Form Search**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe basic default API is Free Form Search which handles the most fuzzy of inputs handling any\ncombination of address or POI tokens. This search API is the canonical \u0027single line search\u0027.\nThe Free Form Search API is a seamless combination of POI search and geocoding. The API can\nalso be weighted with a contextual position (lat./lon. pair), or fully constrained by a\ncoordinate and radius, or it can be executed more generally without any geo biasing anchor\npoint.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`We strongly advise you to use the \u0027countrySet\u0027 parameter to\nspecify only the countries for which your application needs coverage, as the default behavior\nwill be to search the entire world, potentially returning unnecessary\nresults.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e` E.g.: ``countrySet``\\ =US,FR :code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Please\nsee `Search Coverage\n\u003chttps://docs.microsoft.com/azure/location-based-services/geocoding-coverage\u003e`_ for a complete\nlist of all the supported countries.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Most Search queries default to\n``maxFuzzyLevel``\\ =2 to gain performance and also reduce unusual results. This new default can\nbe overridden as needed per request by passing in the query param ``maxFuzzyLevel``\\ =3 or 4.\n\n:param query: The applicable query string (e.g., \"seattle\", \"pizza\"). Can *also* be specified\n as a comma separated string composed by latitude followed by longitude (e.g., \"47.641268,\n -122.125679\"). Must be properly URL encoded.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param min_fuzzy_level: Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum:\n 4\n\n\n *\n Level 1 has no spell checking.\n\n *\n Level 2 uses normal n-gram spell checking. For example, query \"restrant\" can be matched to\n \"restaurant.\"\n\n *\n Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell\n checking is for \"rstrnt\" to \"restaurant\" matching. Shingle spell checking is for \"mountainview\"\n to \"mountain view\" matching.\n\n *\n Level 4 doesn\u2019t add any more spell checking functions.\n\n The search engine will start looking for a match on the level defined by minFuzzyLevel, and\n will stop searching at the level specified by maxFuzzyLevel.\n:type min_fuzzy_level: int\n:param max_fuzzy_level: Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum:\n 4\n\n\n *\n Level 1 has no spell checking.\n\n *\n Level 2 uses normal n-gram spell checking. For example, query \"restrant\" can be matched to\n \"restaurant.\"\n\n *\n Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell\n checking is for \"rstrnt\" to \"restaurant\" matching. Shingle spell checking is for \"mountainview\"\n to \"mountain view\" matching.\n\n *\n Level 4 doesn\u2019t add any more spell checking functions.\n\n The search engine will start looking for a match on the level defined by minFuzzyLevel, and\n will stop searching at the level specified by maxFuzzyLevel.\n:type max_fuzzy_level: int\n:param idx_set: A comma separated list of indexes which should be utilized for the search. Item\n order does not matter. Available indexes are: Addr = Address range interpolation, Geo =\n Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross\n Streets (intersections).\n:type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet]\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, typeahead, limit, ofs, category_set, country_set, lat, lon, radius, top_left, btm_right, language, extended_postal_codes_for, min_fuzzy_level, max_fuzzy_level, idx_set, brand_set, connector_set, entity_type, localized_map_view, opening_hours" + }, + "get_search_poi" : { + "sync": { + "signature": "def get_search_poi(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n typeahead=None, # type: Optional[bool]\n limit=None, # type: Optional[int]\n ofs=None, # type: Optional[int]\n category_set=None, # type: Optional[List[int]]\n country_set=None, # type: Optional[List[str]]\n lat=None, # type: Optional[float]\n lon=None, # type: Optional[float]\n radius=None, # type: Optional[float]\n top_left=None, # type: Optional[str]\n btm_right=None, # type: Optional[str]\n language=None, # type: Optional[str]\n extended_postal_codes_for=None, # type: Optional[str]\n brand_set=None, # type: Optional[List[str]]\n connector_set=None, # type: Optional[List[Union[str, \"_models.ConnectorSet\"]]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n opening_hours=None, # type: Optional[Union[str, \"_models.OpeningHours\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get POI by Name**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nPoints of Interest (POI) Search allows you to request POI results by name. Search supports\nadditional query parameters such as language and filtering results by area of interest driven\nby country or bounding box. Endpoint will return only POI results matching the query string.\nResponse includes POI details such as address, coordinate location and category.\n\n:param query: The POI name to search for (e.g., \"statue of liberty\", \"starbucks\"), must be\n properly URL encoded.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **POI** = Points of Interest\n\n Value should be **POI** or **None** to disable extended postal codes.\n\n By default extended postal codes are included.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_poi(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n typeahead: Optional[bool] = None,\n limit: Optional[int] = None,\n ofs: Optional[int] = None,\n category_set: Optional[List[int]] = None,\n country_set: Optional[List[str]] = None,\n lat: Optional[float] = None,\n lon: Optional[float] = None,\n radius: Optional[float] = None,\n top_left: Optional[str] = None,\n btm_right: Optional[str] = None,\n language: Optional[str] = None,\n extended_postal_codes_for: Optional[str] = None,\n brand_set: Optional[List[str]] = None,\n connector_set: Optional[List[Union[str, \"_models.ConnectorSet\"]]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n opening_hours: Optional[Union[str, \"_models.OpeningHours\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Get POI by Name**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nPoints of Interest (POI) Search allows you to request POI results by name. Search supports\nadditional query parameters such as language and filtering results by area of interest driven\nby country or bounding box. Endpoint will return only POI results matching the query string.\nResponse includes POI details such as address, coordinate location and category.\n\n:param query: The POI name to search for (e.g., \"statue of liberty\", \"starbucks\"), must be\n properly URL encoded.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **POI** = Points of Interest\n\n Value should be **POI** or **None** to disable extended postal codes.\n\n By default extended postal codes are included.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, typeahead, limit, ofs, category_set, country_set, lat, lon, radius, top_left, btm_right, language, extended_postal_codes_for, brand_set, connector_set, localized_map_view, opening_hours" + }, + "get_search_nearby" : { + "sync": { + "signature": "def get_search_nearby(\n self,\n lat, # type: float\n lon, # type: float\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n limit=None, # type: Optional[int]\n ofs=None, # type: Optional[int]\n category_set=None, # type: Optional[List[int]]\n country_set=None, # type: Optional[List[str]]\n radius=None, # type: Optional[float]\n language=None, # type: Optional[str]\n extended_postal_codes_for=None, # type: Optional[str]\n brand_set=None, # type: Optional[List[str]]\n connector_set=None, # type: Optional[List[Union[str, \"_models.ConnectorSet\"]]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Nearby Search**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nIf you have a use case for only retrieving POI results around a specific location, the nearby\nsearch method may be the right choice. This endpoint will only return POI results, and does not\ntake in a search query parameter.\n\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param radius: The radius in meters to for the results to be constrained to the defined area,\n Min value is 1, Max Value is 50000.\n:type radius: float\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_nearby(\n self,\n lat: float,\n lon: float,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n limit: Optional[int] = None,\n ofs: Optional[int] = None,\n category_set: Optional[List[int]] = None,\n country_set: Optional[List[str]] = None,\n radius: Optional[float] = None,\n language: Optional[str] = None,\n extended_postal_codes_for: Optional[str] = None,\n brand_set: Optional[List[str]] = None,\n connector_set: Optional[List[Union[str, \"_models.ConnectorSet\"]]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Nearby Search**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nIf you have a use case for only retrieving POI results around a specific location, the nearby\nsearch method may be the right choice. This endpoint will only return POI results, and does not\ntake in a search query parameter.\n\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param radius: The radius in meters to for the results to be constrained to the defined area,\n Min value is 1, Max Value is 50000.\n:type radius: float\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "lat, lon, format, limit, ofs, category_set, country_set, radius, language, extended_postal_codes_for, brand_set, connector_set, localized_map_view" + }, + "get_search_poi_category" : { + "sync": { + "signature": "def get_search_poi_category(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n typeahead=None, # type: Optional[bool]\n limit=None, # type: Optional[int]\n ofs=None, # type: Optional[int]\n category_set=None, # type: Optional[List[int]]\n country_set=None, # type: Optional[List[str]]\n lat=None, # type: Optional[float]\n lon=None, # type: Optional[float]\n radius=None, # type: Optional[float]\n top_left=None, # type: Optional[str]\n btm_right=None, # type: Optional[str]\n language=None, # type: Optional[str]\n extended_postal_codes_for=None, # type: Optional[str]\n brand_set=None, # type: Optional[List[str]]\n connector_set=None, # type: Optional[List[Union[str, \"_models.ConnectorSet\"]]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n opening_hours=None, # type: Optional[Union[str, \"_models.OpeningHours\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get POI by Category**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nPoints of Interest (POI) Category Search allows you to request POI results from given category.\nSearch allows to query POIs from one category at a time. Endpoint will only return POI results\nwhich are categorized as specified. Response includes POI details such as address, coordinate\nlocation and classification.\n\n:param query: The POI category to search for (e.g., \"AIRPORT\", \"RESTAURANT\"), must be properly\n URL encoded. Supported main categories can be requested by calling `Get Search POI Category\n Tree API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. List of available categories can also be\n found `here \u003chttps://docs.microsoft.com/azure/azure-maps/supported-search-categories\u003e`_. We\n recommend to use POI Search Category Tree API to request the supported categories.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_poi_category(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n typeahead: Optional[bool] = None,\n limit: Optional[int] = None,\n ofs: Optional[int] = None,\n category_set: Optional[List[int]] = None,\n country_set: Optional[List[str]] = None,\n lat: Optional[float] = None,\n lon: Optional[float] = None,\n radius: Optional[float] = None,\n top_left: Optional[str] = None,\n btm_right: Optional[str] = None,\n language: Optional[str] = None,\n extended_postal_codes_for: Optional[str] = None,\n brand_set: Optional[List[str]] = None,\n connector_set: Optional[List[Union[str, \"_models.ConnectorSet\"]]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n opening_hours: Optional[Union[str, \"_models.OpeningHours\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Get POI by Category**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nPoints of Interest (POI) Category Search allows you to request POI results from given category.\nSearch allows to query POIs from one category at a time. Endpoint will only return POI results\nwhich are categorized as specified. Response includes POI details such as address, coordinate\nlocation and classification.\n\n:param query: The POI category to search for (e.g., \"AIRPORT\", \"RESTAURANT\"), must be properly\n URL encoded. Supported main categories can be requested by calling `Get Search POI Category\n Tree API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. List of available categories can also be\n found `here \u003chttps://docs.microsoft.com/azure/azure-maps/supported-search-categories\u003e`_. We\n recommend to use POI Search Category Tree API to request the supported categories.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, typeahead, limit, ofs, category_set, country_set, lat, lon, radius, top_left, btm_right, language, extended_postal_codes_for, brand_set, connector_set, localized_map_view, opening_hours" + }, + "get_search_poi_category_tree" : { + "sync": { + "signature": "def get_search_poi_category_tree(\n self,\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get POI Category Tree**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nPOI Category API provides a full list of supported Points of Interest (POI) categories and\nsubcategories together with their translations and synonyms. The returned content can be used\nto provide more meaningful results through other Search Service APIs, like `Get Search POI\n\u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpoi\u003e`_.\n\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:param language: Language in which search results should be returned. Should be one of\n supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When\n data in specified language is not available for a specific field, default language is used\n (English).\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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchPoiCategoryTreeResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchPoiCategoryTreeResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_poi_category_tree(\n self,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchPoiCategoryTreeResponse\":\n", + "doc": "\"\"\"**Get POI Category Tree**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nPOI Category API provides a full list of supported Points of Interest (POI) categories and\nsubcategories together with their translations and synonyms. The returned content can be used\nto provide more meaningful results through other Search Service APIs, like `Get Search POI\n\u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpoi\u003e`_.\n\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:param language: Language in which search results should be returned. Should be one of\n supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When\n data in specified language is not available for a specific field, default language is used\n (English).\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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchPoiCategoryTreeResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchPoiCategoryTreeResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format, language" + }, + "get_search_address" : { + "sync": { + "signature": "def get_search_address(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n typeahead=None, # type: Optional[bool]\n limit=None, # type: Optional[int]\n ofs=None, # type: Optional[int]\n country_set=None, # type: Optional[List[str]]\n lat=None, # type: Optional[float]\n lon=None, # type: Optional[float]\n radius=None, # type: Optional[float]\n top_left=None, # type: Optional[str]\n btm_right=None, # type: Optional[str]\n language=None, # type: Optional[str]\n extended_postal_codes_for=None, # type: Optional[str]\n entity_type=None, # type: Optional[Union[str, \"_models.EntityType\"]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Address Geocoding**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nIn many cases, the complete search service might be too much, for instance if you are only\ninterested in traditional geocoding. Search can also be accessed for address look up\nexclusively. The geocoding is performed by hitting the geocode endpoint with just the address\nor partial address in question. The geocoding search index will be queried for everything above\nthe street level data. No POIs will be returned. Note that the geocoder is very tolerant of\ntypos and incomplete addresses. It will also handle everything from exact street addresses or\nstreet or intersections as well as higher level geographies such as city centers, counties,\nstates etc.\n\n:param query: The address to search for (e.g., \"1 Microsoft way, Redmond, WA\"), must be\n properly URL encoded.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_address(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n typeahead: Optional[bool] = None,\n limit: Optional[int] = None,\n ofs: Optional[int] = None,\n country_set: Optional[List[str]] = None,\n lat: Optional[float] = None,\n lon: Optional[float] = None,\n radius: Optional[float] = None,\n top_left: Optional[str] = None,\n btm_right: Optional[str] = None,\n language: Optional[str] = None,\n extended_postal_codes_for: Optional[str] = None,\n entity_type: Optional[Union[str, \"_models.EntityType\"]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Address Geocoding**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nIn many cases, the complete search service might be too much, for instance if you are only\ninterested in traditional geocoding. Search can also be accessed for address look up\nexclusively. The geocoding is performed by hitting the geocode endpoint with just the address\nor partial address in question. The geocoding search index will be queried for everything above\nthe street level data. No POIs will be returned. Note that the geocoder is very tolerant of\ntypos and incomplete addresses. It will also handle everything from exact street addresses or\nstreet or intersections as well as higher level geographies such as city centers, counties,\nstates etc.\n\n:param query: The address to search for (e.g., \"1 Microsoft way, Redmond, WA\"), must be\n properly URL encoded.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a\n partial input and the search will enter predictive mode.\n:type typeahead: bool\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the\n search to the specified countries.\n:type country_set: list[str]\n:param lat: Latitude where results should be biased. E.g. 37.337.\n:type lat: float\n:param lon: Longitude where results should be biased. E.g. -121.89.\n:type lon: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param top_left: Top left position of the bounding box. E.g. 37.553,-122.453.\n:type top_left: str\n:param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453.\n:type btm_right: str\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 extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, typeahead, limit, ofs, country_set, lat, lon, radius, top_left, btm_right, language, extended_postal_codes_for, entity_type, localized_map_view" + }, + "get_search_address_reverse" : { + "sync": { + "signature": "def get_search_address_reverse(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n language=None, # type: Optional[str]\n return_speed_limit=None, # type: Optional[bool]\n heading=None, # type: Optional[float]\n radius=None, # type: Optional[float]\n number=None, # type: Optional[str]\n return_road_use=None, # type: Optional[bool]\n road_use=None, # type: Optional[str]\n allow_freeform_newline=None, # type: Optional[bool]\n return_match_type=None, # type: Optional[bool]\n entity_type=None, # type: Optional[Union[str, \"_models.EntityType\"]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Reverse Geocode to an Address**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThere may be times when you need to translate a coordinate (example: 37.786505, -122.3862)\ninto a human understandable street address. Most often this is needed in tracking applications\nwhere you receive a GPS feed from the device or asset and wish to know what address where the\ncoordinate is located. This endpoint will return address information for a given coordinate.\n\n:param query: The applicable query specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\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 return_speed_limit: Boolean. To enable return of the posted speed limit.\n:type return_speed_limit: bool\n:param heading: The directional heading of the vehicle in degrees, for travel along a segment\n of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can\n include upto one decimal place.\n:type heading: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param number: If a number is sent in along with the request, the response may include the side\n of the street (Left/Right) and also an offset position for that number.\n:type number: str\n:param return_road_use: Boolean. To enable return of the road use array for reverse geocodes at\n street level.\n:type return_road_use: bool\n:param road_use: To restrict reverse geocodes to a certain type of road use. The road use array\n for reverse geocodes can be one or more of LimitedAccess, Arterial, Terminal, Ramp, Rotary,\n LocalStreet.\n:type road_use: str\n:param allow_freeform_newline: Format of newlines in the formatted address.\n\n If true, the address will contain newlines.\n If false, newlines will be converted to commas.\n:type allow_freeform_newline: bool\n:param return_match_type: Include information on the type of match the geocoder achieved in the\n response.\n:type return_match_type: bool\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_address_reverse(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n language: Optional[str] = None,\n return_speed_limit: Optional[bool] = None,\n heading: Optional[float] = None,\n radius: Optional[float] = None,\n number: Optional[str] = None,\n return_road_use: Optional[bool] = None,\n road_use: Optional[str] = None,\n allow_freeform_newline: Optional[bool] = None,\n return_match_type: Optional[bool] = None,\n entity_type: Optional[Union[str, \"_models.EntityType\"]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchAddressReverseResponse\":\n", + "doc": "\"\"\"**Reverse Geocode to an Address**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThere may be times when you need to translate a coordinate (example: 37.786505, -122.3862)\ninto a human understandable street address. Most often this is needed in tracking applications\nwhere you receive a GPS feed from the device or asset and wish to know what address where the\ncoordinate is located. This endpoint will return address information for a given coordinate.\n\n:param query: The applicable query specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\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 return_speed_limit: Boolean. To enable return of the posted speed limit.\n:type return_speed_limit: bool\n:param heading: The directional heading of the vehicle in degrees, for travel along a segment\n of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can\n include upto one decimal place.\n:type heading: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\n:param number: If a number is sent in along with the request, the response may include the side\n of the street (Left/Right) and also an offset position for that number.\n:type number: str\n:param return_road_use: Boolean. To enable return of the road use array for reverse geocodes at\n street level.\n:type return_road_use: bool\n:param road_use: To restrict reverse geocodes to a certain type of road use. The road use array\n for reverse geocodes can be one or more of LimitedAccess, Arterial, Terminal, Ramp, Rotary,\n LocalStreet.\n:type road_use: str\n:param allow_freeform_newline: Format of newlines in the formatted address.\n\n If true, the address will contain newlines.\n If false, newlines will be converted to commas.\n:type allow_freeform_newline: bool\n:param return_match_type: Include information on the type of match the geocoder achieved in the\n response.\n:type return_match_type: bool\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, language, return_speed_limit, heading, radius, number, return_road_use, road_use, allow_freeform_newline, return_match_type, entity_type, localized_map_view" + }, + "get_search_address_reverse_cross_street" : { + "sync": { + "signature": "def get_search_address_reverse_cross_street(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n limit=None, # type: Optional[int]\n heading=None, # type: Optional[float]\n radius=None, # type: Optional[float]\n language=None, # type: Optional[str]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Reverse Geocode to a Cross Street**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThere may be times when you need to translate a coordinate (example: 37.786505, -122.3862)\ninto a human understandable cross street. Most often this is needed in tracking applications\nwhere you receive a GPS feed from the device or asset and wish to know what address where the\ncoordinate is located.\nThis endpoint will return cross street information for a given coordinate.\n\n:param query: The applicable query specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param heading: The directional heading of the vehicle in degrees, for travel along a segment\n of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can\n include upto one decimal place.\n:type heading: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseCrossStreetResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseCrossStreetResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_address_reverse_cross_street(\n self,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n limit: Optional[int] = None,\n heading: Optional[float] = None,\n radius: Optional[float] = None,\n language: Optional[str] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchAddressReverseCrossStreetResponse\":\n", + "doc": "\"\"\"**Reverse Geocode to a Cross Street**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThere may be times when you need to translate a coordinate (example: 37.786505, -122.3862)\ninto a human understandable cross street. Most often this is needed in tracking applications\nwhere you receive a GPS feed from the device or asset and wish to know what address where the\ncoordinate is located.\nThis endpoint will return cross street information for a given coordinate.\n\n:param query: The applicable query specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param heading: The directional heading of the vehicle in degrees, for travel along a segment\n of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can\n include upto one decimal place.\n:type heading: float\n:param radius: The radius in meters to for the results to be constrained to the defined area.\n:type radius: float\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseCrossStreetResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseCrossStreetResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, limit, heading, radius, language, localized_map_view" + }, + "get_search_address_structured" : { + "sync": { + "signature": "def get_search_address_structured(\n self,\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n language=None, # type: Optional[str]\n country_code=\"US\", # type: Optional[str]\n limit=None, # type: Optional[int]\n ofs=None, # type: Optional[int]\n street_number=None, # type: Optional[str]\n street_name=None, # type: Optional[str]\n cross_street=None, # type: Optional[str]\n municipality=None, # type: Optional[str]\n municipality_subdivision=None, # type: Optional[str]\n country_tertiary_subdivision=None, # type: Optional[str]\n country_secondary_subdivision=None, # type: Optional[str]\n country_subdivision=None, # type: Optional[str]\n postal_code=None, # type: Optional[str]\n extended_postal_codes_for=None, # type: Optional[str]\n entity_type=None, # type: Optional[Union[str, \"_models.EntityType\"]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Structured Address Geocoding**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nAzure Address Geocoding can also be accessed for structured address look up exclusively. The\ngeocoding search index will be queried for everything above the street level data. No POIs\nwill be returned. Note that the geocoder is very tolerant of typos and incomplete addresses.\nIt will also handle everything from exact street addresses or street or intersections as well\nas higher level geographies such as city centers, counties, states etc.\n\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\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 country_code: The 2 or 3 letter `ISO3166-1\n \u003chttps://www.iso.org/iso-3166-country-codes.html\u003e`_ country code portion of an address. E.g.\n US.\n:type country_code: str\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param street_number: The street number portion of an address.\n:type street_number: str\n:param street_name: The street name portion of an address.\n:type street_name: str\n:param cross_street: The cross street name for the structured address.\n:type cross_street: str\n:param municipality: The municipality portion of an address.\n:type municipality: str\n:param municipality_subdivision: The municipality subdivision (sub/super city) for the\n structured address.\n:type municipality_subdivision: str\n:param country_tertiary_subdivision: The named area for the structured address.\n:type country_tertiary_subdivision: str\n:param country_secondary_subdivision: The county for the structured address.\n:type country_secondary_subdivision: str\n:param country_subdivision: The country subdivision portion of an address.\n:type country_subdivision: str\n:param postal_code: The postal code portion of an address.\n:type postal_code: str\n:param extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_search_address_structured(\n self,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n language: Optional[str] = None,\n country_code: Optional[str] = \"US\",\n limit: Optional[int] = None,\n ofs: Optional[int] = None,\n street_number: Optional[str] = None,\n street_name: Optional[str] = None,\n cross_street: Optional[str] = None,\n municipality: Optional[str] = None,\n municipality_subdivision: Optional[str] = None,\n country_tertiary_subdivision: Optional[str] = None,\n country_secondary_subdivision: Optional[str] = None,\n country_subdivision: Optional[str] = None,\n postal_code: Optional[str] = None,\n extended_postal_codes_for: Optional[str] = None,\n entity_type: Optional[Union[str, \"_models.EntityType\"]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Structured Address Geocoding**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nAzure Address Geocoding can also be accessed for structured address look up exclusively. The\ngeocoding search index will be queried for everything above the street level data. No POIs\nwill be returned. Note that the geocoder is very tolerant of typos and incomplete addresses.\nIt will also handle everything from exact street addresses or street or intersections as well\nas higher level geographies such as city centers, counties, states etc.\n\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\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 country_code: The 2 or 3 letter `ISO3166-1\n \u003chttps://www.iso.org/iso-3166-country-codes.html\u003e`_ country code portion of an address. E.g.\n US.\n:type country_code: str\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: int\n:param ofs: Starting offset of the returned results within the full result set. Default: 0,\n minimum: 0 and maximum: 1900.\n:type ofs: int\n:param street_number: The street number portion of an address.\n:type street_number: str\n:param street_name: The street name portion of an address.\n:type street_name: str\n:param cross_street: The cross street name for the structured address.\n:type cross_street: str\n:param municipality: The municipality portion of an address.\n:type municipality: str\n:param municipality_subdivision: The municipality subdivision (sub/super city) for the\n structured address.\n:type municipality_subdivision: str\n:param country_tertiary_subdivision: The named area for the structured address.\n:type country_tertiary_subdivision: str\n:param country_secondary_subdivision: The county for the structured address.\n:type country_secondary_subdivision: str\n:param country_subdivision: The country subdivision portion of an address.\n:type country_subdivision: str\n:param postal_code: The postal code portion of an address.\n:type postal_code: str\n:param extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param entity_type: Specifies the level of filtering performed on geographies. Narrows the\n search for specified geography entity types, e.g. return only municipality. The resulting\n response will contain the geography ID as well as the entity type matched. If you provide more\n than one entity as a comma separated list, endpoint will return the \u0027smallest entity\n available\u0027. Returned Geometry ID can be used to get the geometry of that geography via `Get\n Search Polygon \u003chttps://docs.microsoft.com/rest/api/maps/search/getsearchpolygon\u003e`_ API. The\n following parameters are ignored when entityType is set:\n\n\n * heading\n * number\n * returnRoadUse\n * returnSpeedLimit\n * roadUse\n * returnMatchType.\n:type entity_type: str or ~azure.maps.search.models.EntityType\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.search.models.LocalizedMapView\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format, language, country_code, limit, ofs, street_number, street_name, cross_street, municipality, municipality_subdivision, country_tertiary_subdivision, country_secondary_subdivision, country_subdivision, postal_code, extended_postal_codes_for, entity_type, localized_map_view" + }, + "post_search_inside_geometry" : { + "sync": { + "signature": "def post_search_inside_geometry(\n self,\n query, # type: str\n search_inside_geometry_request_body, # type: \"_models.SearchInsideGeometryRequestBody\"\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n limit=None, # type: Optional[int]\n language=None, # type: Optional[str]\n category_set=None, # type: Optional[List[int]]\n extended_postal_codes_for=None, # type: Optional[str]\n idx_set=None, # type: Optional[List[Union[str, \"_models.SearchIndexSet\"]]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n opening_hours=None, # type: Optional[Union[str, \"_models.OpeningHours\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Search Geometry endpoint allows you to perform a free form search inside a single geometry\nor many of them. The search results that fall inside the geometry/geometries will be\nreturned.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`To send the geometry you will use a ``POST`` request where the\nrequest body will contain the ``geometry`` object represented as a ``GeoJSON`` type and the\n``Content-Type`` header will be set to ``application/json``. The geographical features to be\nsearched can be modeled as Polygon and/or Circle geometries represented using any one of the\nfollowing ``GeoJSON`` types::code:`\u003cul\u003e\u003cli\u003e**GeoJSON FeatureCollection** \u003cbr\u003eThe `geometry` can\nbe represented as a `GeoJSON FeatureCollection` object. This is the recommended option if the\ngeometry contains both Polygons and Circles. The `FeatureCollection` can contain a max of 50\n`GeoJSON Feature` objects. Each `Feature` object should represent either a Polygon or a Circle\nwith the following conditions:\u003cul style=\"list-style-type:none\"\u003e\u003cli\u003eA `Feature` object for the\nPolygon geometry can have a max of 50 coordinates and it\u0027s properties must be empty.\u003c/li\u003e\u003cli\u003eA\n`Feature` object for the Circle geometry is composed of a _center_ represented using a `GeoJSON\nPoint` type and a _radius_ value (in meters) which must be specified in the object\u0027s properties\nalong with the _subType_ property whose value should be \u0027Circle\u0027.\u003c/li\u003e\u003c/ul\u003e`:code:`\u003cbr\u003e` Please\nsee the Examples section below for a sample ``FeatureCollection``\nrepresentation.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`\u003c/li\u003e:code:`\u003cli\u003e**GeoJSON GeometryCollection**\u003cbr\u003eThe\n`geometry` can be represented as a `GeoJSON GeometryCollection` object. This is the recommended\noption if the geometry contains a list of Polygons only. The `GeometryCollection` can contain a\nmax of 50 `GeoJSON Polygon` objects. Each `Polygon` object can have a max of 50 coordinates.\nPlease see the Examples section below for a sample `GeometryCollection`\nrepresentation.\u003cbr\u003e\u003cbr\u003e\u003c/li\u003e`:code:`\u003cli\u003e**GeoJSON Polygon**\u003cbr\u003eThe `geometry` can be\nrepresented as a `GeoJSON Polygon` object. This is the recommended option if the geometry\ncontains a single Polygon. The `Polygon` object can have a max of 50 coordinates. Please see\nthe Examples section below for a sample `Polygon`\nrepresentation.\u003cbr\u003e\u003cbr\u003e\u003c/li\u003e`\u003c/ul\u003e.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`.\n\n:param query: The POI name to search for (e.g., \"statue of liberty\", \"starbucks\", \"pizza\").\n Must be properly URL encoded.\n:type query: str\n:param search_inside_geometry_request_body: This represents the geometry for one or more\n geographical features (parks, state boundary etc.) to search in and should be a GeoJSON\n compliant type. Please refer to `RFC 7946 \u003chttps://tools.ietf.org/html/rfc7946\u003e`_ for details.\n:type search_inside_geometry_request_body: ~azure.maps.search.models.SearchInsideGeometryRequestBody\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: 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 category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param idx_set: A comma separated list of indexes which should be utilized for the search. Item\n order does not matter. Available indexes are: Addr = Address range interpolation, Geo =\n Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross\n Streets (intersections).\n:type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_search_inside_geometry(\n self,\n query: str,\n search_inside_geometry_request_body: \"_models.SearchInsideGeometryRequestBody\",\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n limit: Optional[int] = None,\n language: Optional[str] = None,\n category_set: Optional[List[int]] = None,\n extended_postal_codes_for: Optional[str] = None,\n idx_set: Optional[List[Union[str, \"_models.SearchIndexSet\"]]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n opening_hours: Optional[Union[str, \"_models.OpeningHours\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Search Geometry endpoint allows you to perform a free form search inside a single geometry\nor many of them. The search results that fall inside the geometry/geometries will be\nreturned.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`To send the geometry you will use a ``POST`` request where the\nrequest body will contain the ``geometry`` object represented as a ``GeoJSON`` type and the\n``Content-Type`` header will be set to ``application/json``. The geographical features to be\nsearched can be modeled as Polygon and/or Circle geometries represented using any one of the\nfollowing ``GeoJSON`` types::code:`\u003cul\u003e\u003cli\u003e**GeoJSON FeatureCollection** \u003cbr\u003eThe `geometry` can\nbe represented as a `GeoJSON FeatureCollection` object. This is the recommended option if the\ngeometry contains both Polygons and Circles. The `FeatureCollection` can contain a max of 50\n`GeoJSON Feature` objects. Each `Feature` object should represent either a Polygon or a Circle\nwith the following conditions:\u003cul style=\"list-style-type:none\"\u003e\u003cli\u003eA `Feature` object for the\nPolygon geometry can have a max of 50 coordinates and it\u0027s properties must be empty.\u003c/li\u003e\u003cli\u003eA\n`Feature` object for the Circle geometry is composed of a _center_ represented using a `GeoJSON\nPoint` type and a _radius_ value (in meters) which must be specified in the object\u0027s properties\nalong with the _subType_ property whose value should be \u0027Circle\u0027.\u003c/li\u003e\u003c/ul\u003e`:code:`\u003cbr\u003e` Please\nsee the Examples section below for a sample ``FeatureCollection``\nrepresentation.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`\u003c/li\u003e:code:`\u003cli\u003e**GeoJSON GeometryCollection**\u003cbr\u003eThe\n`geometry` can be represented as a `GeoJSON GeometryCollection` object. This is the recommended\noption if the geometry contains a list of Polygons only. The `GeometryCollection` can contain a\nmax of 50 `GeoJSON Polygon` objects. Each `Polygon` object can have a max of 50 coordinates.\nPlease see the Examples section below for a sample `GeometryCollection`\nrepresentation.\u003cbr\u003e\u003cbr\u003e\u003c/li\u003e`:code:`\u003cli\u003e**GeoJSON Polygon**\u003cbr\u003eThe `geometry` can be\nrepresented as a `GeoJSON Polygon` object. This is the recommended option if the geometry\ncontains a single Polygon. The `Polygon` object can have a max of 50 coordinates. Please see\nthe Examples section below for a sample `Polygon`\nrepresentation.\u003cbr\u003e\u003cbr\u003e\u003c/li\u003e`\u003c/ul\u003e.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`.\n\n:param query: The POI name to search for (e.g., \"statue of liberty\", \"starbucks\", \"pizza\").\n Must be properly URL encoded.\n:type query: str\n:param search_inside_geometry_request_body: This represents the geometry for one or more\n geographical features (parks, state boundary etc.) to search in and should be a GeoJSON\n compliant type. Please refer to `RFC 7946 \u003chttps://tools.ietf.org/html/rfc7946\u003e`_ for details.\n:type search_inside_geometry_request_body: ~azure.maps.search.models.SearchInsideGeometryRequestBody\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and\n maximum: 100.\n:type limit: 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 category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param extended_postal_codes_for: Indexes for which extended postal codes should be included in\n the results.\n\n Available indexes are:\n\n **Addr** = Address ranges\n\n **Geo** = Geographies\n\n **PAD** = Point Addresses\n\n **POI** = Points of Interest\n\n **Str** = Streets\n\n **XStr** = Cross Streets (intersections)\n\n Value should be a comma separated list of index types (in any order) or **None** for no\n indexes.\n\n By default extended postal codes are included for all indexes except Geo. Extended postal code\n lists for geographies can be quite long so they have to be explicitly requested when needed.\n\n Usage examples:\n\n extendedPostalCodesFor=POI\n\n extendedPostalCodesFor=PAD,Addr,POI\n\n extendedPostalCodesFor=None\n\n Extended postal code is returned as an **extendedPostalCode** property of an address.\n Availability is region-dependent.\n:type extended_postal_codes_for: str\n:param idx_set: A comma separated list of indexes which should be utilized for the search. Item\n order does not matter. Available indexes are: Addr = Address range interpolation, Geo =\n Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross\n Streets (intersections).\n:type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, search_inside_geometry_request_body, format, limit, language, category_set, extended_postal_codes_for, idx_set, localized_map_view, opening_hours" + }, + "post_search_along_route" : { + "sync": { + "signature": "def post_search_along_route(\n self,\n query, # type: str\n max_detour_time, # type: int\n search_along_route_request_body, # type: \"_models.SearchAlongRouteRequestBody\"\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n category_set=None, # type: Optional[List[int]]\n limit=None, # type: Optional[int]\n brand_set=None, # type: Optional[List[str]]\n connector_set=None, # type: Optional[List[Union[str, \"_models.ConnectorSet\"]]]\n localized_map_view=None, # type: Optional[Union[str, \"_models.LocalizedMapView\"]]\n opening_hours=None, # type: Optional[Union[str, \"_models.OpeningHours\"]]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Search Along Route endpoint allows you to perform a fuzzy search for POIs along a specified\nroute. This search is constrained by specifying the ``maxDetourTime`` limiting\nmeasure.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`To send the route-points you will use a ``POST`` request where\nthe request body will contain the ``route`` object represented as a ``GeoJSON LineString`` type\nand the ``Content-Type`` header will be set to ``application/json``. Each route-point in\n``route`` is represented as a ``GeoJSON Position`` type i.e. an array where the *longitude*\nvalue is followed by the *latitude* value and the *altitude* value is ignored. The ``route``\nshould contain at least 2 route-points.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`It is possible that original\nroute will be altered, some of it\u0027s points may be skipped. If the route that passes through the\nfound point is faster than the original one, the ``detourTime`` value in the response is\nnegative.\n\n:param query: The POI name to search for (e.g., \"statue of liberty\", \"starbucks\", \"pizza\").\n Must be properly URL encoded.\n:type query: str\n:param max_detour_time: Maximum detour time of the point of interest in seconds. Max value is\n 3600 seconds.\n:type max_detour_time: int\n:param search_along_route_request_body: This represents the route to search along and should be\n a valid ``GeoJSON LineString`` type. Please refer to `RFC 7946\n \u003chttps://tools.ietf.org/html/rfc7946#section-3.1.4\u003e`_ for details.\n:type search_along_route_request_body: ~azure.maps.search.models.SearchAlongRouteRequestBody\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param limit: Maximum number of responses that will be returned. Default value is 10. Max value\n is 20.\n:type limit: int\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_search_along_route(\n self,\n query: str,\n max_detour_time: int,\n search_along_route_request_body: \"_models.SearchAlongRouteRequestBody\",\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n category_set: Optional[List[int]] = None,\n limit: Optional[int] = None,\n brand_set: Optional[List[str]] = None,\n connector_set: Optional[List[Union[str, \"_models.ConnectorSet\"]]] = None,\n localized_map_view: Optional[Union[str, \"_models.LocalizedMapView\"]] = None,\n opening_hours: Optional[Union[str, \"_models.OpeningHours\"]] = None,\n **kwargs: Any\n) -\u003e \"_models.SearchCommonResponse\":\n", + "doc": "\"\"\"**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Search Along Route endpoint allows you to perform a fuzzy search for POIs along a specified\nroute. This search is constrained by specifying the ``maxDetourTime`` limiting\nmeasure.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`To send the route-points you will use a ``POST`` request where\nthe request body will contain the ``route`` object represented as a ``GeoJSON LineString`` type\nand the ``Content-Type`` header will be set to ``application/json``. Each route-point in\n``route`` is represented as a ``GeoJSON Position`` type i.e. an array where the *longitude*\nvalue is followed by the *latitude* value and the *altitude* value is ignored. The ``route``\nshould contain at least 2 route-points.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`It is possible that original\nroute will be altered, some of it\u0027s points may be skipped. If the route that passes through the\nfound point is faster than the original one, the ``detourTime`` value in the response is\nnegative.\n\n:param query: The POI name to search for (e.g., \"statue of liberty\", \"starbucks\", \"pizza\").\n Must be properly URL encoded.\n:type query: str\n:param max_detour_time: Maximum detour time of the point of interest in seconds. Max value is\n 3600 seconds.\n:type max_detour_time: int\n:param search_along_route_request_body: This represents the route to search along and should be\n a valid ``GeoJSON LineString`` type. Please refer to `RFC 7946\n \u003chttps://tools.ietf.org/html/rfc7946#section-3.1.4\u003e`_ for details.\n:type search_along_route_request_body: ~azure.maps.search.models.SearchAlongRouteRequestBody\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.search.models.ResponseFormat\n:param category_set: A comma-separated list of category set IDs which could be used to restrict\n the result to specific Points of Interest categories. ID order does not matter. When multiple\n category identifiers are provided, only POIs that belong to (at least) one of the categories\n from the provided list will be returned. The list of supported categories can be discovered\n using\u202f `POI Categories API \u003chttps://aka.ms/AzureMapsPOICategoryTree\u003e`_. Usage examples:\n\n\n *\n **categorySet=7315**\\ \u202f(Search Points of Interest from category Restaurant)\n\n *\n **categorySet=7315025,7315017**\\ \u202f(Search Points of Interest of category either Italian or\n French Restaurant).\n:type category_set: list[int]\n:param limit: Maximum number of responses that will be returned. Default value is 10. Max value\n is 20.\n:type limit: int\n:param brand_set: A comma-separated list of brand names which could be used to restrict the\n result to specific brands. Item order does not matter. When multiple brands are provided, only\n results that belong to (at least) one of the provided list will be returned. Brands that\n contain a \",\" in their name should be put into quotes.\n\n Usage examples:\n\n brandSet=Foo\n\n brandSet=Foo,Bar\n\n brandSet=\"A,B,C Comma\",Bar.\n:type brand_set: list[str]\n:param connector_set: A comma-separated list of connector types which could be used to restrict\n the result to Electric Vehicle Station supporting specific connector types. Item order does not\n matter. When multiple connector types are provided, only results that belong to (at least) one\n of the provided list will be returned.\n\n Available connector types are:\n\n\n * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a\n certain region. They are all AC single phase and the standard Voltage and standard Amperage.\n See also: `Plug \u0026 socket types - World Standards\n \u003chttps://www.worldstandards.eu/electricity/plugs-and-sockets\u003e`_.\n * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called\n Yazaki after the original manufacturer or SAE J1772 after the standard that first published it.\n Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 1 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard.\n Provided as a cable and plug attached to the charging point.\n * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided\n as a socket set into the charging point.\n * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard.\n The connector is based on the Type 2 connector \u2013 as defined in the IEC 62196-2 standard \u2013 with\n two additional direct current (DC) contacts to allow DC fast charging.\n * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called\n Scame after the original manufacturer. Mostly used in combination with up to 240V single phase\n or up to 420V three phase infrastructure.\n * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric\n Power Company and industrial partners. Because of this is is also known as the TEPCO\u0027s\n connector. It supports fast DC charging.\n * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309\n standard. It is sometime referred to as by some combination of the standard, the color and the\n fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309\n standard.\n * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector.\n I.e. it refers to either Tesla\u0027s proprietary connector, sometimes referred to as Tesla Port\n mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n\n Usage examples:\n\n connectorSet=IEC62196Type2CableAttached\n connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached.\n:type connector_set: list[str or ~azure.maps.search.models.ConnectorSet]\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.search.models.LocalizedMapView\n:param opening_hours: Hours of operation for a POI (Points of Interest). The availability of\n hours of operation will vary based on the data available.\n Supported value: nextSevenDays.\n:type opening_hours: str or ~azure.maps.search.models.OpeningHours\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchCommonResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchCommonResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, max_detour_time, search_along_route_request_body, format, category_set, limit, brand_set, connector_set, localized_map_view, opening_hours" + }, + "post_search_fuzzy_batch_sync" : { + "sync": { + "signature": "def post_search_fuzzy_batch_sync(\n self,\n search_fuzzy_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Fuzzy Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Fuzzy API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy\u003e`_ using just a single\nAPI call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search fuzzy* queries you will use a ``POST`` request where the request body will\ncontain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set\nto ``application/json``. Here\u0027s a sample request body containing 5 *search fuzzy* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=atm\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\u0026limit=5\"},\n {\"query\": \"?query=Statue Of Liberty\u0026limit=2\"},\n {\"query\": \"?query=Starbucks\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\"},\n {\"query\": \"?query=Space Needle\"},\n {\"query\": \"?query=pizza\u0026limit=10\"}\n ]\n }\n\nA *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path,\napi-version and subscription-key. It can accept any of the supported *search fuzzy* `URI\nparameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters\u003e`_. The\nstring values in the *search fuzzy* query must be properly escaped (e.g. \" character should be\nescaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse\u003e`_ -\nIf the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"atm\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"ATM at Wells Fargo\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"3240 157th Ave NE, Redmond, WA 98052\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"statue of liberty\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"Statue of Liberty\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"New York, NY 10004\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process.\n The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchFuzzyBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_search_fuzzy_batch_sync(\n self,\n search_fuzzy_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.SearchFuzzyBatchResponse\":\n", + "doc": "\"\"\"**Search Fuzzy Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Fuzzy API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy\u003e`_ using just a single\nAPI call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search fuzzy* queries you will use a ``POST`` request where the request body will\ncontain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set\nto ``application/json``. Here\u0027s a sample request body containing 5 *search fuzzy* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=atm\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\u0026limit=5\"},\n {\"query\": \"?query=Statue Of Liberty\u0026limit=2\"},\n {\"query\": \"?query=Starbucks\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\"},\n {\"query\": \"?query=Space Needle\"},\n {\"query\": \"?query=pizza\u0026limit=10\"}\n ]\n }\n\nA *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path,\napi-version and subscription-key. It can accept any of the supported *search fuzzy* `URI\nparameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters\u003e`_. The\nstring values in the *search fuzzy* query must be properly escaped (e.g. \" character should be\nescaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse\u003e`_ -\nIf the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"atm\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"ATM at Wells Fargo\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"3240 157th Ave NE, Redmond, WA 98052\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"statue of liberty\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"Statue of Liberty\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"New York, NY 10004\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process.\n The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchFuzzyBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "search_fuzzy_batch_request_body, format" + }, + "_post_search_fuzzy_batch_initial" : { + "sync": { + "signature": "def _post_search_fuzzy_batch_initial(\n self,\n search_fuzzy_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process.\n The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchFuzzyBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _post_search_fuzzy_batch_initial(\n self,\n search_fuzzy_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e Optional[\"_models.SearchFuzzyBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process.\n The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchFuzzyBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "search_fuzzy_batch_request_body, format" + }, + "begin_post_search_fuzzy_batch" : { + "sync": { + "signature": "def begin_post_search_fuzzy_batch(\n self,\n search_fuzzy_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Fuzzy Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Fuzzy API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy\u003e`_ using just a single\nAPI call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search fuzzy* queries you will use a ``POST`` request where the request body will\ncontain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set\nto ``application/json``. Here\u0027s a sample request body containing 5 *search fuzzy* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=atm\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\u0026limit=5\"},\n {\"query\": \"?query=Statue Of Liberty\u0026limit=2\"},\n {\"query\": \"?query=Starbucks\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\"},\n {\"query\": \"?query=Space Needle\"},\n {\"query\": \"?query=pizza\u0026limit=10\"}\n ]\n }\n\nA *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path,\napi-version and subscription-key. It can accept any of the supported *search fuzzy* `URI\nparameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters\u003e`_. The\nstring values in the *search fuzzy* query must be properly escaped (e.g. \" character should be\nescaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse\u003e`_ -\nIf the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"atm\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"ATM at Wells Fargo\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"3240 157th Ave NE, Redmond, WA 98052\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"statue of liberty\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"Statue of Liberty\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"New York, NY 10004\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process.\n The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_post_search_fuzzy_batch(\n self,\n search_fuzzy_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.SearchFuzzyBatchResponse\"]:\n", + "doc": "\"\"\"**Search Fuzzy Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Fuzzy API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy\u003e`_ using just a single\nAPI call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search fuzzy* queries you will use a ``POST`` request where the request body will\ncontain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set\nto ``application/json``. Here\u0027s a sample request body containing 5 *search fuzzy* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=atm\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\u0026limit=5\"},\n {\"query\": \"?query=Statue Of Liberty\u0026limit=2\"},\n {\"query\": \"?query=Starbucks\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\"},\n {\"query\": \"?query=Space Needle\"},\n {\"query\": \"?query=pizza\u0026limit=10\"}\n ]\n }\n\nA *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path,\napi-version and subscription-key. It can accept any of the supported *search fuzzy* `URI\nparameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters\u003e`_. The\nstring values in the *search fuzzy* query must be properly escaped (e.g. \" character should be\nescaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse\u003e`_ -\nIf the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"atm\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"ATM at Wells Fargo\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"3240 157th Ave NE, Redmond, WA 98052\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"statue of liberty\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"Statue of Liberty\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"New York, NY 10004\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process.\n The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "search_fuzzy_batch_request_body, format" + }, + "_get_search_fuzzy_batch_initial" : { + "sync": { + "signature": "def _get_search_fuzzy_batch_initial(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchFuzzyBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _get_search_fuzzy_batch_initial(\n self,\n format: str,\n **kwargs: Any\n) -\u003e Optional[\"_models.SearchFuzzyBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchFuzzyBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format" + }, + "begin_get_search_fuzzy_batch" : { + "sync": { + "signature": "def begin_get_search_fuzzy_batch(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Fuzzy Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Fuzzy API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy\u003e`_ using just a single\nAPI call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search fuzzy* queries you will use a ``POST`` request where the request body will\ncontain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set\nto ``application/json``. Here\u0027s a sample request body containing 5 *search fuzzy* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=atm\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\u0026limit=5\"},\n {\"query\": \"?query=Statue Of Liberty\u0026limit=2\"},\n {\"query\": \"?query=Starbucks\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\"},\n {\"query\": \"?query=Space Needle\"},\n {\"query\": \"?query=pizza\u0026limit=10\"}\n ]\n }\n\nA *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path,\napi-version and subscription-key. It can accept any of the supported *search fuzzy* `URI\nparameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters\u003e`_. The\nstring values in the *search fuzzy* query must be properly escaped (e.g. \" character should be\nescaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse\u003e`_ -\nIf the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"atm\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"ATM at Wells Fargo\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"3240 157th Ave NE, Redmond, WA 98052\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"statue of liberty\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"Statue of Liberty\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"New York, NY 10004\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_get_search_fuzzy_batch(\n self,\n format: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.SearchFuzzyBatchResponse\"]:\n", + "doc": "\"\"\"**Search Fuzzy Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Fuzzy API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy\u003e`_ using just a single\nAPI call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search fuzzy* queries you will use a ``POST`` request where the request body will\ncontain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set\nto ``application/json``. Here\u0027s a sample request body containing 5 *search fuzzy* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=atm\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\u0026limit=5\"},\n {\"query\": \"?query=Statue Of Liberty\u0026limit=2\"},\n {\"query\": \"?query=Starbucks\u0026lat=47.639769\u0026lon=-122.128362\u0026radius=5000\"},\n {\"query\": \"?query=Space Needle\"},\n {\"query\": \"?query=pizza\u0026limit=10\"}\n ]\n }\n\nA *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path,\napi-version and subscription-key. It can accept any of the supported *search fuzzy* `URI\nparameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#uri-parameters\u003e`_. The\nstring values in the *search fuzzy* query must be properly escaped (e.g. \" character should be\nescaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchfuzzy#searchcommonresponse\u003e`_ -\nIf the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"atm\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"ATM at Wells Fargo\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"3240 157th Ave NE, Redmond, WA 98052\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"statue of liberty\"\n },\n \"results\": [\n {\n \"type\": \"POI\",\n \"poi\": {\n \"name\": \"Statue of Liberty\"\n },\n \"address\": {\n \"country\": \"United States Of America\",\n \"freeformAddress\": \"New York, NY 10004\"\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "format" + }, + "post_search_address_batch_sync" : { + "sync": { + "signature": "def post_search_address_batch_sync(\n self,\n search_address_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Address Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress\u003e`_ using just a single\nAPI call. You can call Search Address Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 5 *search address*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=400 Broad St, Seattle, WA 98109\u0026limit=3\"},\n {\"query\": \"?query=One, Microsoft Way, Redmond, WA 98052\u0026limit=3\"},\n {\"query\": \"?query=350 5th Ave, New York, NY 10118\u0026limit=1\"},\n {\"query\": \"?query=Pike Pl, Seattle, WA\n98101\u0026lat=47.610970\u0026lon=-122.342469\u0026radius=1000\"},\n {\"query\": \"?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris,\nFrance\u0026limit=1\"}\n ]\n }\n\nA *search address* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *search address*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters\u003e`_. The\nstring values in the *search address* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"one microsoft way redmond wa 98052\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.63989,\n \"lon\": -122.12509\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"pike pl seattle wa 98101\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.60963,\n \"lon\": -122.34215\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_batch_request_body: The list of address geocoding queries/requests to\n process. The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_search_address_batch_sync(\n self,\n search_address_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.SearchAddressBatchResponse\":\n", + "doc": "\"\"\"**Search Address Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress\u003e`_ using just a single\nAPI call. You can call Search Address Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 5 *search address*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=400 Broad St, Seattle, WA 98109\u0026limit=3\"},\n {\"query\": \"?query=One, Microsoft Way, Redmond, WA 98052\u0026limit=3\"},\n {\"query\": \"?query=350 5th Ave, New York, NY 10118\u0026limit=1\"},\n {\"query\": \"?query=Pike Pl, Seattle, WA\n98101\u0026lat=47.610970\u0026lon=-122.342469\u0026radius=1000\"},\n {\"query\": \"?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris,\nFrance\u0026limit=1\"}\n ]\n }\n\nA *search address* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *search address*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters\u003e`_. The\nstring values in the *search address* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"one microsoft way redmond wa 98052\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.63989,\n \"lon\": -122.12509\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"pike pl seattle wa 98101\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.60963,\n \"lon\": -122.34215\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_batch_request_body: The list of address geocoding queries/requests to\n process. The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "search_address_batch_request_body, format" + }, + "_post_search_address_batch_initial" : { + "sync": { + "signature": "def _post_search_address_batch_initial(\n self,\n search_address_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param search_address_batch_request_body: The list of address geocoding queries/requests to\n process. The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _post_search_address_batch_initial(\n self,\n search_address_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e Optional[\"_models.SearchAddressBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param search_address_batch_request_body: The list of address geocoding queries/requests to\n process. The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "search_address_batch_request_body, format" + }, + "begin_post_search_address_batch" : { + "sync": { + "signature": "def begin_post_search_address_batch(\n self,\n search_address_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Address Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress\u003e`_ using just a single\nAPI call. You can call Search Address Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 5 *search address*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=400 Broad St, Seattle, WA 98109\u0026limit=3\"},\n {\"query\": \"?query=One, Microsoft Way, Redmond, WA 98052\u0026limit=3\"},\n {\"query\": \"?query=350 5th Ave, New York, NY 10118\u0026limit=1\"},\n {\"query\": \"?query=Pike Pl, Seattle, WA\n98101\u0026lat=47.610970\u0026lon=-122.342469\u0026radius=1000\"},\n {\"query\": \"?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris,\nFrance\u0026limit=1\"}\n ]\n }\n\nA *search address* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *search address*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters\u003e`_. The\nstring values in the *search address* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"one microsoft way redmond wa 98052\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.63989,\n \"lon\": -122.12509\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"pike pl seattle wa 98101\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.60963,\n \"lon\": -122.34215\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_batch_request_body: The list of address geocoding queries/requests to\n process. The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either SearchAddressBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_post_search_address_batch(\n self,\n search_address_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.SearchAddressBatchResponse\"]:\n", + "doc": "\"\"\"**Search Address Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress\u003e`_ using just a single\nAPI call. You can call Search Address Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 5 *search address*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=400 Broad St, Seattle, WA 98109\u0026limit=3\"},\n {\"query\": \"?query=One, Microsoft Way, Redmond, WA 98052\u0026limit=3\"},\n {\"query\": \"?query=350 5th Ave, New York, NY 10118\u0026limit=1\"},\n {\"query\": \"?query=Pike Pl, Seattle, WA\n98101\u0026lat=47.610970\u0026lon=-122.342469\u0026radius=1000\"},\n {\"query\": \"?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris,\nFrance\u0026limit=1\"}\n ]\n }\n\nA *search address* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *search address*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters\u003e`_. The\nstring values in the *search address* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"one microsoft way redmond wa 98052\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.63989,\n \"lon\": -122.12509\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"pike pl seattle wa 98101\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.60963,\n \"lon\": -122.34215\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_batch_request_body: The list of address geocoding queries/requests to\n process. The list can contain a max of 10,000 queries and must contain at least 1 query.\n:type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either SearchAddressBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "search_address_batch_request_body, format" + }, + "_get_search_address_batch_initial" : { + "sync": { + "signature": "def _get_search_address_batch_initial(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _get_search_address_batch_initial(\n self,\n format: str,\n **kwargs: Any\n) -\u003e Optional[\"_models.SearchAddressBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format" + }, + "begin_get_search_address_batch" : { + "sync": { + "signature": "def begin_get_search_address_batch(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Address Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress\u003e`_ using just a single\nAPI call. You can call Search Address Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 5 *search address*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=400 Broad St, Seattle, WA 98109\u0026limit=3\"},\n {\"query\": \"?query=One, Microsoft Way, Redmond, WA 98052\u0026limit=3\"},\n {\"query\": \"?query=350 5th Ave, New York, NY 10118\u0026limit=1\"},\n {\"query\": \"?query=Pike Pl, Seattle, WA\n98101\u0026lat=47.610970\u0026lon=-122.342469\u0026radius=1000\"},\n {\"query\": \"?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris,\nFrance\u0026limit=1\"}\n ]\n }\n\nA *search address* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *search address*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters\u003e`_. The\nstring values in the *search address* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"one microsoft way redmond wa 98052\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.63989,\n \"lon\": -122.12509\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"pike pl seattle wa 98101\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.60963,\n \"lon\": -122.34215\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either SearchAddressBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_get_search_address_batch(\n self,\n format: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.SearchAddressBatchResponse\"]:\n", + "doc": "\"\"\"**Search Address Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress\u003e`_ using just a single\nAPI call. You can call Search Address Batch API to run either asynchronously (async) or\nsynchronously (sync). The async API allows caller to batch up to **10,000** queries and sync\nAPI up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address* queries you will use a ``POST`` request where the request body\nwill contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will\nbe set to ``application/json``. Here\u0027s a sample request body containing 5 *search address*\nqueries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=400 Broad St, Seattle, WA 98109\u0026limit=3\"},\n {\"query\": \"?query=One, Microsoft Way, Redmond, WA 98052\u0026limit=3\"},\n {\"query\": \"?query=350 5th Ave, New York, NY 10118\u0026limit=1\"},\n {\"query\": \"?query=Pike Pl, Seattle, WA\n98101\u0026lat=47.610970\u0026lon=-122.342469\u0026radius=1000\"},\n {\"query\": \"?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris,\nFrance\u0026limit=1\"}\n ]\n }\n\nA *search address* query in a batch is just a partial URL *without* the protocol, base URL,\npath, api-version and subscription-key. It can accept any of the supported *search address*\n`URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#uri-parameters\u003e`_. The\nstring values in the *search address* query must be properly escaped (e.g. \" character should\nbe escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchCommonResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#SearchCommonResponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"one microsoft way redmond wa 98052\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.63989,\n \"lon\": -122.12509\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"query\": \"pike pl seattle wa 98101\"\n },\n \"results\": [\n {\n \"position\": {\n \"lat\": 47.60963,\n \"lon\": -122.34215\n }\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either SearchAddressBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "format" + }, + "post_search_address_reverse_batch_sync" : { + "sync": { + "signature": "def post_search_address_reverse_batch_sync(\n self,\n search_address_reverse_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Address Reverse Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address Reverse API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse\u003e`_ using just a\nsingle API call. You can call Search Address Reverse Batch API to run either asynchronously\n(async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries\nand sync API up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address reverse* queries you will use a ``POST`` request where the request\nbody will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header\nwill be set to ``application/json``. Here\u0027s a sample request body containing 5 *search address\nreverse* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=48.858561,2.294911\"},\n {\"query\": \"?query=47.639765,-122.127896\u0026radius=5000\u0026limit=2\"},\n {\"query\": \"?query=47.621028,-122.348170\"},\n {\"query\": \"?query=43.722990,10.396695\"},\n {\"query\": \"?query=40.750958,-73.982336\"}\n ]\n }\n\nA *search address reverse* query in a batch is just a partial URL *without* the protocol, base\nURL, path, api-version and subscription-key. It can accept any of the supported *search address\nreverse* `URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters\u003e`_.\nThe string values in the *search address reverse* query must be properly escaped (e.g. \"\ncharacter should be escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchAddressReverseResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 11\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"France\",\n \"freeformAddress\": \"Avenue Anatole France, 75007 Paris\"\n },\n \"position\": \"48.858490,2.294820\"\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 1\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"United States of America\",\n \"freeformAddress\": \"157th Pl NE, Redmond WA 98052\"\n },\n \"position\": \"47.640470,-122.129430\"\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_reverse_batch_request_body: The list of reverse geocoding\n queries/requests to process. The list can contain a max of 10,000 queries and must contain at\n least 1 query.\n:type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def post_search_address_reverse_batch_sync(\n self,\n search_address_reverse_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e \"_models.SearchAddressReverseBatchResponse\":\n", + "doc": "\"\"\"**Search Address Reverse Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address Reverse API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse\u003e`_ using just a\nsingle API call. You can call Search Address Reverse Batch API to run either asynchronously\n(async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries\nand sync API up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address reverse* queries you will use a ``POST`` request where the request\nbody will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header\nwill be set to ``application/json``. Here\u0027s a sample request body containing 5 *search address\nreverse* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=48.858561,2.294911\"},\n {\"query\": \"?query=47.639765,-122.127896\u0026radius=5000\u0026limit=2\"},\n {\"query\": \"?query=47.621028,-122.348170\"},\n {\"query\": \"?query=43.722990,10.396695\"},\n {\"query\": \"?query=40.750958,-73.982336\"}\n ]\n }\n\nA *search address reverse* query in a batch is just a partial URL *without* the protocol, base\nURL, path, api-version and subscription-key. It can accept any of the supported *search address\nreverse* `URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters\u003e`_.\nThe string values in the *search address reverse* query must be properly escaped (e.g. \"\ncharacter should be escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchAddressReverseResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 11\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"France\",\n \"freeformAddress\": \"Avenue Anatole France, 75007 Paris\"\n },\n \"position\": \"48.858490,2.294820\"\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 1\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"United States of America\",\n \"freeformAddress\": \"157th Pl NE, Redmond WA 98052\"\n },\n \"position\": \"47.640470,-122.129430\"\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_reverse_batch_request_body: The list of reverse geocoding\n queries/requests to process. The list can contain a max of 10,000 queries and must contain at\n least 1 query.\n:type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "search_address_reverse_batch_request_body, format" + }, + "_post_search_address_reverse_batch_initial" : { + "sync": { + "signature": "def _post_search_address_reverse_batch_initial(\n self,\n search_address_reverse_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param search_address_reverse_batch_request_body: The list of reverse geocoding\n queries/requests to process. The list can contain a max of 10,000 queries and must contain at\n least 1 query.\n:type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _post_search_address_reverse_batch_initial(\n self,\n search_address_reverse_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e Optional[\"_models.SearchAddressReverseBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param search_address_reverse_batch_request_body: The list of reverse geocoding\n queries/requests to process. The list can contain a max of 10,000 queries and must contain at\n least 1 query.\n:type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "search_address_reverse_batch_request_body, format" + }, + "begin_post_search_address_reverse_batch" : { + "sync": { + "signature": "def begin_post_search_address_reverse_batch(\n self,\n search_address_reverse_batch_request_body, # type: \"_models.BatchRequestBody\"\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Address Reverse Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address Reverse API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse\u003e`_ using just a\nsingle API call. You can call Search Address Reverse Batch API to run either asynchronously\n(async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries\nand sync API up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address reverse* queries you will use a ``POST`` request where the request\nbody will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header\nwill be set to ``application/json``. Here\u0027s a sample request body containing 5 *search address\nreverse* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=48.858561,2.294911\"},\n {\"query\": \"?query=47.639765,-122.127896\u0026radius=5000\u0026limit=2\"},\n {\"query\": \"?query=47.621028,-122.348170\"},\n {\"query\": \"?query=43.722990,10.396695\"},\n {\"query\": \"?query=40.750958,-73.982336\"}\n ]\n }\n\nA *search address reverse* query in a batch is just a partial URL *without* the protocol, base\nURL, path, api-version and subscription-key. It can accept any of the supported *search address\nreverse* `URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters\u003e`_.\nThe string values in the *search address reverse* query must be properly escaped (e.g. \"\ncharacter should be escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchAddressReverseResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 11\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"France\",\n \"freeformAddress\": \"Avenue Anatole France, 75007 Paris\"\n },\n \"position\": \"48.858490,2.294820\"\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 1\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"United States of America\",\n \"freeformAddress\": \"157th Pl NE, Redmond WA 98052\"\n },\n \"position\": \"47.640470,-122.129430\"\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_reverse_batch_request_body: The list of reverse geocoding\n queries/requests to process. The list can contain a max of 10,000 queries and must contain at\n least 1 query.\n:type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_post_search_address_reverse_batch(\n self,\n search_address_reverse_batch_request_body: \"_models.BatchRequestBody\",\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.SearchAddressReverseBatchResponse\"]:\n", + "doc": "\"\"\"**Search Address Reverse Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address Reverse API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse\u003e`_ using just a\nsingle API call. You can call Search Address Reverse Batch API to run either asynchronously\n(async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries\nand sync API up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address reverse* queries you will use a ``POST`` request where the request\nbody will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header\nwill be set to ``application/json``. Here\u0027s a sample request body containing 5 *search address\nreverse* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=48.858561,2.294911\"},\n {\"query\": \"?query=47.639765,-122.127896\u0026radius=5000\u0026limit=2\"},\n {\"query\": \"?query=47.621028,-122.348170\"},\n {\"query\": \"?query=43.722990,10.396695\"},\n {\"query\": \"?query=40.750958,-73.982336\"}\n ]\n }\n\nA *search address reverse* query in a batch is just a partial URL *without* the protocol, base\nURL, path, api-version and subscription-key. It can accept any of the supported *search address\nreverse* `URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters\u003e`_.\nThe string values in the *search address reverse* query must be properly escaped (e.g. \"\ncharacter should be escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchAddressReverseResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 11\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"France\",\n \"freeformAddress\": \"Avenue Anatole France, 75007 Paris\"\n },\n \"position\": \"48.858490,2.294820\"\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 1\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"United States of America\",\n \"freeformAddress\": \"157th Pl NE, Redmond WA 98052\"\n },\n \"position\": \"47.640470,-122.129430\"\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param search_address_reverse_batch_request_body: The list of reverse geocoding\n queries/requests to process. The list can contain a max of 10,000 queries and must contain at\n least 1 query.\n:type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.search.models.JsonFormat\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "search_address_reverse_batch_request_body, format" + }, + "_get_search_address_reverse_batch_initial" : { + "sync": { + "signature": "def _get_search_address_reverse_batch_initial(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _get_search_address_reverse_batch_initial(\n self,\n format: str,\n **kwargs: Any\n) -\u003e Optional[\"_models.SearchAddressReverseBatchResponse\"]:\n", + "doc": "\"\"\"\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SearchAddressReverseBatchResponse, or the result of cls(response)\n:rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "format" + }, + "begin_get_search_address_reverse_batch" : { + "sync": { + "signature": "def begin_get_search_address_reverse_batch(\n self,\n format, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Search Address Reverse Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address Reverse API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse\u003e`_ using just a\nsingle API call. You can call Search Address Reverse Batch API to run either asynchronously\n(async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries\nand sync API up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address reverse* queries you will use a ``POST`` request where the request\nbody will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header\nwill be set to ``application/json``. Here\u0027s a sample request body containing 5 *search address\nreverse* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=48.858561,2.294911\"},\n {\"query\": \"?query=47.639765,-122.127896\u0026radius=5000\u0026limit=2\"},\n {\"query\": \"?query=47.621028,-122.348170\"},\n {\"query\": \"?query=43.722990,10.396695\"},\n {\"query\": \"?query=40.750958,-73.982336\"}\n ]\n }\n\nA *search address reverse* query in a batch is just a partial URL *without* the protocol, base\nURL, path, api-version and subscription-key. It can accept any of the supported *search address\nreverse* `URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters\u003e`_.\nThe string values in the *search address reverse* query must be properly escaped (e.g. \"\ncharacter should be escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchAddressReverseResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 11\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"France\",\n \"freeformAddress\": \"Avenue Anatole France, 75007 Paris\"\n },\n \"position\": \"48.858490,2.294820\"\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 1\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"United States of America\",\n \"freeformAddress\": \"157th Pl NE, Redmond WA 98052\"\n },\n \"position\": \"47.640470,-122.129430\"\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_get_search_address_reverse_batch(\n self,\n format: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.SearchAddressReverseBatchResponse\"]:\n", + "doc": "\"\"\"**Search Address Reverse Batch API**\n\n**Applies to**\\ : S1 pricing tier.\n\nThe Search Address Batch API sends batches of queries to `Search Address Reverse API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse\u003e`_ using just a\nsingle API call. You can call Search Address Reverse Batch API to run either asynchronously\n(async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries\nand sync API up to **100** queries.\n\nSubmit Synchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Synchronous API is recommended for lightweight batch requests. When the service receives a\nrequest, it will respond as soon as the batch items are calculated and there will be no\npossibility to retrieve the results later. The Synchronous API will return a timeout error (a\n408 response) if the request takes longer than 60 seconds. The number of batch items is limited\nto **100** for this API.\n\n.. code-block::\n\n POST\nhttps://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0\u0026subscription-key={subscription-key}\n\nSubmit Asynchronous Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe Asynchronous API is appropriate for processing big volumes of relatively complex search\nrequests\n\n\n* It allows the retrieval of results in a separate call (multiple downloads are possible).\n* The asynchronous API is optimized for reliability and is not expected to run into a timeout.\n* The number of batch items is limited to **10,000** for this API.\n\nWhen you make a request by using async request, by default the service returns a 202 response\ncode along a redirect URL in the Location field of the response header. This URL should be\nchecked periodically until the response data or error information is available.\nThe asynchronous responses are stored for **14** days. The redirect URL returns a 404 response\nif used after the expiration period.\n\nPlease note that asynchronous batch request is a long-running request. Here\u0027s a typical\nsequence of operations:\n\n\n#. Client sends a Search Address Batch ``POST`` request to Azure Maps\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request has been accepted.\n\n HTTP ``Error`` - There was an error processing your Batch request. This could either be a\n``400 Bad Request`` or any other ``Error`` status code.\n\n\n#.\n If the batch request was accepted successfully, the ``Location`` header in the response\ncontains the URL to download the results of the batch request.\n This status URI looks like following:\n\n.. code-block::\n\n GET\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\n\n#. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the\nbatch results.\n\nPOST Body for Batch Request\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo send the *search address reverse* queries you will use a ``POST`` request where the request\nbody will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header\nwill be set to ``application/json``. Here\u0027s a sample request body containing 5 *search address\nreverse* queries:\n\n.. code-block:: json\n\n {\n \"batchItems\": [\n {\"query\": \"?query=48.858561,2.294911\"},\n {\"query\": \"?query=47.639765,-122.127896\u0026radius=5000\u0026limit=2\"},\n {\"query\": \"?query=47.621028,-122.348170\"},\n {\"query\": \"?query=43.722990,10.396695\"},\n {\"query\": \"?query=40.750958,-73.982336\"}\n ]\n }\n\nA *search address reverse* query in a batch is just a partial URL *without* the protocol, base\nURL, path, api-version and subscription-key. It can accept any of the supported *search address\nreverse* `URI parameters\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#uri-parameters\u003e`_.\nThe string values in the *search address reverse* query must be properly escaped (e.g. \"\ncharacter should be escaped with ) and it should also be properly URL-encoded.\n\nThe async API allows caller to batch up to **10,000** queries and sync API up to **100**\nqueries, and the batch should contain at least **1** query.\n\nDownload Asynchronous Batch Results\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download the async batch results you will issue a ``GET`` request to the batch download\nendpoint. This *download URL* can be obtained from the ``Location`` header of a successful\n``POST`` batch request and looks like the following:\n\n.. code-block::\n\nhttps://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0\u0026subscription-key={subscription-key}\n\nHere\u0027s the typical sequence of operations for downloading the batch results:\n\n\n#. Client sends a ``GET`` request using the *download URL*.\n#.\n The server will respond with one of the following:\n\n ..\n\n HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please\ntry again in some time.\n\n HTTP ``200 OK`` - Batch request successfully processed. The response body contains all\nthe batch results.\n\n\nBatch Response Model\n^^^^^^^^^^^^^^^^^^^^\n\nThe returned data content is similar for async and sync requests. When downloading the results\nof an async batch request, if the batch has finished processing, the response body contains the\nbatch response. This batch response contains a ``summary`` component that indicates the\n``totalRequests`` that were part of the original batch request and ``successfulRequests``\\ i.e.\nqueries which were executed successfully. The batch response also includes a ``batchItems``\narray which contains a response for each and every query in the batch request. The\n``batchItems`` will contain the results in the exact same order the original queries were sent\nin the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response``\nfields. Each ``response`` in ``batchItems`` is of one of the following types:\n\n\n*\n `\\ ``SearchAddressReverseResponse``\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddressreverse#searchaddressreverseresponse\u003e`_\n- If the query completed successfully.\n\n*\n ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in\nthis case.\n\nHere\u0027s a sample Batch Response with 2 *successful* and 1 *failed* result:\n\n.. code-block:: json\n\n {\n \"summary\": {\n \"successfulRequests\": 2,\n \"totalRequests\": 3\n },\n \"batchItems\": [\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 11\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"France\",\n \"freeformAddress\": \"Avenue Anatole France, 75007 Paris\"\n },\n \"position\": \"48.858490,2.294820\"\n }\n ]\n }\n },\n {\n \"statusCode\": 200,\n \"response\":\n {\n \"summary\": {\n \"queryTime\": 1\n },\n \"addresses\": [\n {\n \"address\": {\n \"country\": \"United States of America\",\n \"freeformAddress\": \"157th Pl NE, Redmond WA 98052\"\n },\n \"position\": \"47.640470,-122.129430\"\n }\n ]\n }\n },\n {\n \"statusCode\": 400,\n \"response\":\n {\n \"error\":\n {\n \"code\": \"400 BadRequest\",\n \"message\": \"Bad request: one or more parameters were incorrectly\nspecified or are mutually exclusive.\"\n }\n }\n }\n ]\n }.\n\n:param format: Batch id for querying the operation.\n:type format: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "format" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-search/azure/maps/search/_search_client.py b/sdk/maps/azure-maps-search/azure/maps/search/_search_client.py new file mode 100644 index 000000000000..b039c40cc84a --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/_search_client.py @@ -0,0 +1,82 @@ +# 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 SearchClientConfiguration +from .operations import SearchClientOperationsMixin +from . import models + + +class SearchClient(SearchClientOperationsMixin): + """Azure Maps Search 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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + 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 = SearchClientConfiguration(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: () -> SearchClient + 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-search/azure/maps/search/_version.py b/sdk/maps/azure-maps-search/azure/maps/search/_version.py new file mode 100644 index 000000000000..b9995fb385b0 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/_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 = "1.0-preview" diff --git a/sdk/maps/azure-maps-search/azure/maps/search/aio/__init__.py b/sdk/maps/azure-maps-search/azure/maps/search/aio/__init__.py new file mode 100644 index 000000000000..ec41d54fc046 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/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 ._search_client import SearchClient +__all__ = ['SearchClient'] diff --git a/sdk/maps/azure-maps-search/azure/maps/search/aio/_configuration.py b/sdk/maps/azure-maps-search/azure/maps/search/aio/_configuration.py new file mode 100644 index 000000000000..3b8316242ee9 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/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 SearchClientConfiguration(Configuration): + """Configuration for SearchClient. + + 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(SearchClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-search/{}'.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-search/azure/maps/search/aio/_search_client.py b/sdk/maps/azure-maps-search/azure/maps/search/aio/_search_client.py new file mode 100644 index 000000000000..edb61adc6111 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/aio/_search_client.py @@ -0,0 +1,75 @@ +# 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 SearchClientConfiguration +from .operations import SearchClientOperationsMixin +from .. import models + + +class SearchClient(SearchClientOperationsMixin): + """Azure Maps Search 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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + 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 = SearchClientConfiguration(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) -> "SearchClient": + 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-search/azure/maps/search/aio/operations/__init__.py b/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/__init__.py new file mode 100644 index 000000000000..4389fba0b784 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/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 ._search_client_operations import SearchClientOperationsMixin + +__all__ = [ + 'SearchClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_search_client_operations.py b/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_search_client_operations.py new file mode 100644 index 000000000000..518d03a35e15 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/aio/operations/_search_client_operations.py @@ -0,0 +1,5225 @@ +# 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, Callable, Dict, Generic, 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 azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SearchClientOperationsMixin: + + async def get_search_polygon( + self, + geometries: List[str], + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.SearchPolygonResponse": + """**Get Polygon** + + **Applies to**\ : S1 pricing tier. + + The Get Polygon service allows you to request the geometry data such as a city or country + outline for a set of entities, previously retrieved from an Online Search request in GeoJSON + format. The geometry ID is returned in the dataSources object under "geometry" and "id" in + either a Search Address or Search Fuzzy call. + + Please note that any geometry ID retrieved from an Online Search endpoint has a limited + lifetime. The client should not store geometry IDs in persistent storage for later referral, + as the stability of these identifiers is not guaranteed for a long period of time. It is + expected that a request to the Polygon method is made within a few minutes of the request to + the Online Search method that provided the ID. The service allows for batch requests up to 20 + identifiers. + + :param geometries: Comma separated list of geometry UUIDs, previously retrieved from an Online + Search request. + :type geometries: list[str] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchPolygonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchPolygonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchPolygonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_polygon.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['geometries'] = self._serialize.query("geometries", geometries, '[str]', 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('SearchPolygonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_polygon.metadata = {'url': '/search/polygon/{format}'} # type: ignore + + async def get_search_fuzzy( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + typeahead: Optional[bool] = None, + limit: Optional[int] = None, + ofs: Optional[int] = None, + category_set: Optional[List[int]] = None, + country_set: Optional[List[str]] = None, + lat: Optional[float] = None, + lon: Optional[float] = None, + radius: Optional[float] = None, + top_left: Optional[str] = None, + btm_right: Optional[str] = None, + language: Optional[str] = None, + extended_postal_codes_for: Optional[str] = None, + min_fuzzy_level: Optional[int] = None, + max_fuzzy_level: Optional[int] = None, + idx_set: Optional[List[Union[str, "_models.SearchIndexSet"]]] = None, + brand_set: Optional[List[str]] = None, + connector_set: Optional[List[Union[str, "_models.ConnectorSet"]]] = None, + entity_type: Optional[Union[str, "_models.EntityType"]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + opening_hours: Optional[Union[str, "_models.OpeningHours"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Free Form Search** + + **Applies to**\ : S0 and S1 pricing tiers. + + The basic default API is Free Form Search which handles the most fuzzy of inputs handling any + combination of address or POI tokens. This search API is the canonical 'single line search'. + The Free Form Search API is a seamless combination of POI search and geocoding. The API can + also be weighted with a contextual position (lat./lon. pair), or fully constrained by a + coordinate and radius, or it can be executed more generally without any geo biasing anchor + point.:code:`
`:code:`
`We strongly advise you to use the 'countrySet' parameter to + specify only the countries for which your application needs coverage, as the default behavior + will be to search the entire world, potentially returning unnecessary + results.:code:`
`:code:`
` E.g.: ``countrySet``\ =US,FR :code:`
`:code:`
`Please + see `Search Coverage + `_ for a complete + list of all the supported countries.:code:`
`:code:`
`Most Search queries default to + ``maxFuzzyLevel``\ =2 to gain performance and also reduce unusual results. This new default can + be overridden as needed per request by passing in the query param ``maxFuzzyLevel``\ =3 or 4. + + :param query: The applicable query string (e.g., "seattle", "pizza"). Can *also* be specified + as a comma separated string composed by latitude followed by longitude (e.g., "47.641268, + -122.125679"). Must be properly URL encoded. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param min_fuzzy_level: Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum: + 4 + + + * + Level 1 has no spell checking. + + * + Level 2 uses normal n-gram spell checking. For example, query "restrant" can be matched to + "restaurant." + + * + Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell + checking is for "rstrnt" to "restaurant" matching. Shingle spell checking is for "mountainview" + to "mountain view" matching. + + * + Level 4 doesn’t add any more spell checking functions. + + The search engine will start looking for a match on the level defined by minFuzzyLevel, and + will stop searching at the level specified by maxFuzzyLevel. + :type min_fuzzy_level: int + :param max_fuzzy_level: Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum: + 4 + + + * + Level 1 has no spell checking. + + * + Level 2 uses normal n-gram spell checking. For example, query "restrant" can be matched to + "restaurant." + + * + Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell + checking is for "rstrnt" to "restaurant" matching. Shingle spell checking is for "mountainview" + to "mountain view" matching. + + * + Level 4 doesn’t add any more spell checking functions. + + The search engine will start looking for a match on the level defined by minFuzzyLevel, and + will stop searching at the level specified by maxFuzzyLevel. + :type max_fuzzy_level: int + :param idx_set: A comma separated list of indexes which should be utilized for the search. Item + order does not matter. Available indexes are: Addr = Address range interpolation, Geo = + Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross + Streets (intersections). + :type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet] + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_fuzzy.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if min_fuzzy_level is not None: + query_parameters['minFuzzyLevel'] = self._serialize.query("min_fuzzy_level", min_fuzzy_level, 'int', maximum=4, minimum=1) + if max_fuzzy_level is not None: + query_parameters['maxFuzzyLevel'] = self._serialize.query("max_fuzzy_level", max_fuzzy_level, 'int', maximum=4, minimum=1) + if idx_set is not None: + query_parameters['idxSet'] = self._serialize.query("idx_set", idx_set, '[str]', div=',') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, 'str') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_fuzzy.metadata = {'url': '/search/fuzzy/{format}'} # type: ignore + + async def get_search_poi( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + typeahead: Optional[bool] = None, + limit: Optional[int] = None, + ofs: Optional[int] = None, + category_set: Optional[List[int]] = None, + country_set: Optional[List[str]] = None, + lat: Optional[float] = None, + lon: Optional[float] = None, + radius: Optional[float] = None, + top_left: Optional[str] = None, + btm_right: Optional[str] = None, + language: Optional[str] = None, + extended_postal_codes_for: Optional[str] = None, + brand_set: Optional[List[str]] = None, + connector_set: Optional[List[Union[str, "_models.ConnectorSet"]]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + opening_hours: Optional[Union[str, "_models.OpeningHours"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Get POI by Name** + + **Applies to**\ : S0 and S1 pricing tiers. + + Points of Interest (POI) Search allows you to request POI results by name. Search supports + additional query parameters such as language and filtering results by area of interest driven + by country or bounding box. Endpoint will return only POI results matching the query string. + Response includes POI details such as address, coordinate location and category. + + :param query: The POI name to search for (e.g., "statue of liberty", "starbucks"), must be + properly URL encoded. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **POI** = Points of Interest + + Value should be **POI** or **None** to disable extended postal codes. + + By default extended postal codes are included. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_poi.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_poi.metadata = {'url': '/search/poi/{format}'} # type: ignore + + async def get_search_nearby( + self, + lat: float, + lon: float, + format: Union[str, "_models.ResponseFormat"] = "json", + limit: Optional[int] = None, + ofs: Optional[int] = None, + category_set: Optional[List[int]] = None, + country_set: Optional[List[str]] = None, + radius: Optional[float] = None, + language: Optional[str] = None, + extended_postal_codes_for: Optional[str] = None, + brand_set: Optional[List[str]] = None, + connector_set: Optional[List[Union[str, "_models.ConnectorSet"]]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Nearby Search** + + **Applies to**\ : S0 and S1 pricing tiers. + + If you have a use case for only retrieving POI results around a specific location, the nearby + search method may be the right choice. This endpoint will only return POI results, and does not + take in a search query parameter. + + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param radius: The radius in meters to for the results to be constrained to the defined area, + Min value is 1, Max Value is 50000. + :type radius: float + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_nearby.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['lat'] = self._serialize.query("lat", lat, 'float') + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + 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=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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_nearby.metadata = {'url': '/search/nearby/{format}'} # type: ignore + + async def get_search_poi_category( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + typeahead: Optional[bool] = None, + limit: Optional[int] = None, + ofs: Optional[int] = None, + category_set: Optional[List[int]] = None, + country_set: Optional[List[str]] = None, + lat: Optional[float] = None, + lon: Optional[float] = None, + radius: Optional[float] = None, + top_left: Optional[str] = None, + btm_right: Optional[str] = None, + language: Optional[str] = None, + extended_postal_codes_for: Optional[str] = None, + brand_set: Optional[List[str]] = None, + connector_set: Optional[List[Union[str, "_models.ConnectorSet"]]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + opening_hours: Optional[Union[str, "_models.OpeningHours"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Get POI by Category** + + **Applies to**\ : S0 and S1 pricing tiers. + + Points of Interest (POI) Category Search allows you to request POI results from given category. + Search allows to query POIs from one category at a time. Endpoint will only return POI results + which are categorized as specified. Response includes POI details such as address, coordinate + location and classification. + + :param query: The POI category to search for (e.g., "AIRPORT", "RESTAURANT"), must be properly + URL encoded. Supported main categories can be requested by calling `Get Search POI Category + Tree API `_. List of available categories can also be + found `here `_. We + recommend to use POI Search Category Tree API to request the supported categories. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_poi_category.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_poi_category.metadata = {'url': '/search/poi/category/{format}'} # type: ignore + + async def get_search_poi_category_tree( + self, + format: Union[str, "_models.JsonFormat"] = "json", + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.SearchPoiCategoryTreeResponse": + """**Get POI Category Tree** + + **Applies to**\ : S0 and S1 pricing tiers. + + POI Category API provides a full list of supported Points of Interest (POI) categories and + subcategories together with their translations and synonyms. The returned content can be used + to provide more meaningful results through other Search Service APIs, like `Get Search POI + `_. + + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :param language: Language in which search results should be returned. Should be one of + supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When + data in specified language is not available for a specific field, default language is used + (English). + + Please refer to `Supported Languages + `_ for details. + :type language: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchPoiCategoryTreeResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchPoiCategoryTreeResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchPoiCategoryTreeResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_poi_category_tree.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 language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('SearchPoiCategoryTreeResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_poi_category_tree.metadata = {'url': '/search/poi/category/tree/{format}'} # type: ignore + + async def get_search_address( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + typeahead: Optional[bool] = None, + limit: Optional[int] = None, + ofs: Optional[int] = None, + country_set: Optional[List[str]] = None, + lat: Optional[float] = None, + lon: Optional[float] = None, + radius: Optional[float] = None, + top_left: Optional[str] = None, + btm_right: Optional[str] = None, + language: Optional[str] = None, + extended_postal_codes_for: Optional[str] = None, + entity_type: Optional[Union[str, "_models.EntityType"]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Address Geocoding** + + **Applies to**\ : S0 and S1 pricing tiers. + + In many cases, the complete search service might be too much, for instance if you are only + interested in traditional geocoding. Search can also be accessed for address look up + exclusively. The geocoding is performed by hitting the geocode endpoint with just the address + or partial address in question. The geocoding search index will be queried for everything above + the street level data. No POIs will be returned. Note that the geocoder is very tolerant of + typos and incomplete addresses. It will also handle everything from exact street addresses or + street or intersections as well as higher level geographies such as city centers, counties, + states etc. + + :param query: The address to search for (e.g., "1 Microsoft way, Redmond, WA"), must be + properly URL encoded. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, '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=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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address.metadata = {'url': '/search/address/{format}'} # type: ignore + + async def get_search_address_reverse( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + language: Optional[str] = None, + return_speed_limit: Optional[bool] = None, + heading: Optional[float] = None, + radius: Optional[float] = None, + number: Optional[str] = None, + return_road_use: Optional[bool] = None, + road_use: Optional[str] = None, + allow_freeform_newline: Optional[bool] = None, + return_match_type: Optional[bool] = None, + entity_type: Optional[Union[str, "_models.EntityType"]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + **kwargs: Any + ) -> "_models.SearchAddressReverseResponse": + """**Reverse Geocode to an Address** + + **Applies to**\ : S0 and S1 pricing tiers. + + There may be times when you need to translate a coordinate (example: 37.786505, -122.3862) + into a human understandable street address. Most often this is needed in tracking applications + where you receive a GPS feed from the device or asset and wish to know what address where the + coordinate is located. This endpoint will return address information for a given coordinate. + + :param query: The applicable query specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :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 return_speed_limit: Boolean. To enable return of the posted speed limit. + :type return_speed_limit: bool + :param heading: The directional heading of the vehicle in degrees, for travel along a segment + of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can + include upto one decimal place. + :type heading: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param number: If a number is sent in along with the request, the response may include the side + of the street (Left/Right) and also an offset position for that number. + :type number: str + :param return_road_use: Boolean. To enable return of the road use array for reverse geocodes at + street level. + :type return_road_use: bool + :param road_use: To restrict reverse geocodes to a certain type of road use. The road use array + for reverse geocodes can be one or more of LimitedAccess, Arterial, Terminal, Ramp, Rotary, + LocalStreet. + :type road_use: str + :param allow_freeform_newline: Format of newlines in the formatted address. + + If true, the address will contain newlines. + If false, newlines will be converted to commas. + :type allow_freeform_newline: bool + :param return_match_type: Include information on the type of match the geocoder achieved in the + response. + :type return_match_type: bool + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressReverseResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressReverseResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address_reverse.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if return_speed_limit is not None: + query_parameters['returnSpeedLimit'] = self._serialize.query("return_speed_limit", return_speed_limit, 'bool') + if heading is not None: + query_parameters['heading'] = self._serialize.query("heading", heading, 'float', maximum=360, minimum=-360) + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if number is not None: + query_parameters['number'] = self._serialize.query("number", number, 'str') + if return_road_use is not None: + query_parameters['returnRoadUse'] = self._serialize.query("return_road_use", return_road_use, 'bool') + if road_use is not None: + query_parameters['roadUse'] = self._serialize.query("road_use", road_use, 'str') + if allow_freeform_newline is not None: + query_parameters['allowFreeformNewline'] = self._serialize.query("allow_freeform_newline", allow_freeform_newline, 'bool') + if return_match_type is not None: + query_parameters['returnMatchType'] = self._serialize.query("return_match_type", return_match_type, 'bool') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, '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=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('SearchAddressReverseResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address_reverse.metadata = {'url': '/search/address/reverse/{format}'} # type: ignore + + async def get_search_address_reverse_cross_street( + self, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + limit: Optional[int] = None, + heading: Optional[float] = None, + radius: Optional[float] = None, + language: Optional[str] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + **kwargs: Any + ) -> "_models.SearchAddressReverseCrossStreetResponse": + """**Reverse Geocode to a Cross Street** + + **Applies to**\ : S0 and S1 pricing tiers. + + There may be times when you need to translate a coordinate (example: 37.786505, -122.3862) + into a human understandable cross street. Most often this is needed in tracking applications + where you receive a GPS feed from the device or asset and wish to know what address where the + coordinate is located. + This endpoint will return cross street information for a given coordinate. + + :param query: The applicable query specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param heading: The directional heading of the vehicle in degrees, for travel along a segment + of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can + include upto one decimal place. + :type heading: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressReverseCrossStreetResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressReverseCrossStreetResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseCrossStreetResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address_reverse_cross_street.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['query'] = self._serialize.query("query", query, 'str') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if heading is not None: + query_parameters['heading'] = self._serialize.query("heading", heading, 'float', maximum=360, minimum=-360) + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + 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=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('SearchAddressReverseCrossStreetResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address_reverse_cross_street.metadata = {'url': '/search/address/reverse/crossStreet/{format}'} # type: ignore + + async def get_search_address_structured( + self, + format: Union[str, "_models.ResponseFormat"] = "json", + language: Optional[str] = None, + country_code: Optional[str] = "US", + limit: Optional[int] = None, + ofs: Optional[int] = None, + street_number: Optional[str] = None, + street_name: Optional[str] = None, + cross_street: Optional[str] = None, + municipality: Optional[str] = None, + municipality_subdivision: Optional[str] = None, + country_tertiary_subdivision: Optional[str] = None, + country_secondary_subdivision: Optional[str] = None, + country_subdivision: Optional[str] = None, + postal_code: Optional[str] = None, + extended_postal_codes_for: Optional[str] = None, + entity_type: Optional[Union[str, "_models.EntityType"]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Structured Address Geocoding** + + **Applies to**\ : S0 and S1 pricing tiers. + + Azure Address Geocoding can also be accessed for structured address look up exclusively. The + geocoding search index will be queried for everything above the street level data. No POIs + will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. + It will also handle everything from exact street addresses or street or intersections as well + as higher level geographies such as city centers, counties, states etc. + + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :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 country_code: The 2 or 3 letter `ISO3166-1 + `_ country code portion of an address. E.g. + US. + :type country_code: str + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param street_number: The street number portion of an address. + :type street_number: str + :param street_name: The street name portion of an address. + :type street_name: str + :param cross_street: The cross street name for the structured address. + :type cross_street: str + :param municipality: The municipality portion of an address. + :type municipality: str + :param municipality_subdivision: The municipality subdivision (sub/super city) for the + structured address. + :type municipality_subdivision: str + :param country_tertiary_subdivision: The named area for the structured address. + :type country_tertiary_subdivision: str + :param country_secondary_subdivision: The county for the structured address. + :type country_secondary_subdivision: str + :param country_subdivision: The country subdivision portion of an address. + :type country_subdivision: str + :param postal_code: The postal code portion of an address. + :type postal_code: str + :param extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address_structured.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 language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if country_code is not None: + query_parameters['countryCode'] = self._serialize.query("country_code", country_code, 'str') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if street_number is not None: + query_parameters['streetNumber'] = self._serialize.query("street_number", street_number, 'str') + if street_name is not None: + query_parameters['streetName'] = self._serialize.query("street_name", street_name, 'str') + if cross_street is not None: + query_parameters['crossStreet'] = self._serialize.query("cross_street", cross_street, 'str') + if municipality is not None: + query_parameters['municipality'] = self._serialize.query("municipality", municipality, 'str') + if municipality_subdivision is not None: + query_parameters['municipalitySubdivision'] = self._serialize.query("municipality_subdivision", municipality_subdivision, 'str') + if country_tertiary_subdivision is not None: + query_parameters['countryTertiarySubdivision'] = self._serialize.query("country_tertiary_subdivision", country_tertiary_subdivision, 'str') + if country_secondary_subdivision is not None: + query_parameters['countrySecondarySubdivision'] = self._serialize.query("country_secondary_subdivision", country_secondary_subdivision, 'str') + if country_subdivision is not None: + query_parameters['countrySubdivision'] = self._serialize.query("country_subdivision", country_subdivision, 'str') + if postal_code is not None: + query_parameters['postalCode'] = self._serialize.query("postal_code", postal_code, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, '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=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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address_structured.metadata = {'url': '/search/address/structured/{format}'} # type: ignore + + async def post_search_inside_geometry( + self, + query: str, + search_inside_geometry_request_body: "_models.SearchInsideGeometryRequestBody", + format: Union[str, "_models.ResponseFormat"] = "json", + limit: Optional[int] = None, + language: Optional[str] = None, + category_set: Optional[List[int]] = None, + extended_postal_codes_for: Optional[str] = None, + idx_set: Optional[List[Union[str, "_models.SearchIndexSet"]]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + opening_hours: Optional[Union[str, "_models.OpeningHours"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Applies to**\ : S0 and S1 pricing tiers. + + The Search Geometry endpoint allows you to perform a free form search inside a single geometry + or many of them. The search results that fall inside the geometry/geometries will be + returned.:code:`
`:code:`
`To send the geometry you will use a ``POST`` request where the + request body will contain the ``geometry`` object represented as a ``GeoJSON`` type and the + ``Content-Type`` header will be set to ``application/json``. The geographical features to be + searched can be modeled as Polygon and/or Circle geometries represented using any one of the + following ``GeoJSON`` types::code:`
  • **GeoJSON FeatureCollection**
    The `geometry` can + be represented as a `GeoJSON FeatureCollection` object. This is the recommended option if the + geometry contains both Polygons and Circles. The `FeatureCollection` can contain a max of 50 + `GeoJSON Feature` objects. Each `Feature` object should represent either a Polygon or a Circle + with the following conditions:
    • A `Feature` object for the + Polygon geometry can have a max of 50 coordinates and it's properties must be empty.
    • A + `Feature` object for the Circle geometry is composed of a _center_ represented using a `GeoJSON + Point` type and a _radius_ value (in meters) which must be specified in the object's properties + along with the _subType_ property whose value should be 'Circle'.
    `:code:`
    ` Please + see the Examples section below for a sample ``FeatureCollection`` + representation.:code:`
    `:code:`
    `
  • :code:`
  • **GeoJSON GeometryCollection**
    The + `geometry` can be represented as a `GeoJSON GeometryCollection` object. This is the recommended + option if the geometry contains a list of Polygons only. The `GeometryCollection` can contain a + max of 50 `GeoJSON Polygon` objects. Each `Polygon` object can have a max of 50 coordinates. + Please see the Examples section below for a sample `GeometryCollection` + representation.

  • `:code:`
  • **GeoJSON Polygon**
    The `geometry` can be + represented as a `GeoJSON Polygon` object. This is the recommended option if the geometry + contains a single Polygon. The `Polygon` object can have a max of 50 coordinates. Please see + the Examples section below for a sample `Polygon` + representation.

  • `
.:code:`
`:code:`
`. + + :param query: The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza"). + Must be properly URL encoded. + :type query: str + :param search_inside_geometry_request_body: This represents the geometry for one or more + geographical features (parks, state boundary etc.) to search in and should be a GeoJSON + compliant type. Please refer to `RFC 7946 `_ for details. + :type search_inside_geometry_request_body: ~azure.maps.search.models.SearchInsideGeometryRequestBody + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: 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 category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param idx_set: A comma separated list of indexes which should be utilized for the search. Item + order does not matter. Available indexes are: Addr = Address range interpolation, Geo = + Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross + Streets (intersections). + :type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_inside_geometry.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['query'] = self._serialize.query("query", query, 'str') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if idx_set is not None: + query_parameters['idxSet'] = self._serialize.query("idx_set", idx_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_inside_geometry_request_body, 'SearchInsideGeometryRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_inside_geometry.metadata = {'url': '/search/geometry/{format}'} # type: ignore + + async def post_search_along_route( + self, + query: str, + max_detour_time: int, + search_along_route_request_body: "_models.SearchAlongRouteRequestBody", + format: Union[str, "_models.ResponseFormat"] = "json", + category_set: Optional[List[int]] = None, + limit: Optional[int] = None, + brand_set: Optional[List[str]] = None, + connector_set: Optional[List[Union[str, "_models.ConnectorSet"]]] = None, + localized_map_view: Optional[Union[str, "_models.LocalizedMapView"]] = None, + opening_hours: Optional[Union[str, "_models.OpeningHours"]] = None, + **kwargs: Any + ) -> "_models.SearchCommonResponse": + """**Applies to**\ : S0 and S1 pricing tiers. + + The Search Along Route endpoint allows you to perform a fuzzy search for POIs along a specified + route. This search is constrained by specifying the ``maxDetourTime`` limiting + measure.:code:`
`:code:`
`To send the route-points you will use a ``POST`` request where + the request body will contain the ``route`` object represented as a ``GeoJSON LineString`` type + and the ``Content-Type`` header will be set to ``application/json``. Each route-point in + ``route`` is represented as a ``GeoJSON Position`` type i.e. an array where the *longitude* + value is followed by the *latitude* value and the *altitude* value is ignored. The ``route`` + should contain at least 2 route-points.:code:`
`:code:`
`It is possible that original + route will be altered, some of it's points may be skipped. If the route that passes through the + found point is faster than the original one, the ``detourTime`` value in the response is + negative. + + :param query: The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza"). + Must be properly URL encoded. + :type query: str + :param max_detour_time: Maximum detour time of the point of interest in seconds. Max value is + 3600 seconds. + :type max_detour_time: int + :param search_along_route_request_body: This represents the route to search along and should be + a valid ``GeoJSON LineString`` type. Please refer to `RFC 7946 + `_ for details. + :type search_along_route_request_body: ~azure.maps.search.models.SearchAlongRouteRequestBody + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param limit: Maximum number of responses that will be returned. Default value is 10. Max value + is 20. + :type limit: int + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_along_route.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['query'] = self._serialize.query("query", query, 'str') + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + query_parameters['maxDetourTime'] = self._serialize.query("max_detour_time", max_detour_time, 'int', maximum=3600) + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=20) + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_along_route_request_body, 'SearchAlongRouteRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_along_route.metadata = {'url': '/search/alongRoute/{format}'} # type: ignore + + async def post_search_fuzzy_batch_sync( + self, + search_fuzzy_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.SearchFuzzyBatchResponse": + """**Search Fuzzy Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Fuzzy API + `_ using just a single + API call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search fuzzy* queries you will use a ``POST`` request where the request body will + contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set + to ``application/json``. Here's a sample request body containing 5 *search fuzzy* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + {"query": "?query=Statue Of Liberty&limit=2"}, + {"query": "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + {"query": "?query=Space Needle"}, + {"query": "?query=pizza&limit=10"} + ] + } + + A *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path, + api-version and subscription-key. It can accept any of the supported *search fuzzy* `URI + parameters + `_. The + string values in the *search fuzzy* query must be properly escaped (e.g. " character should be + escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ - + If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "atm" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "ATM at Wells Fargo" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "statue of liberty" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "Statue of Liberty" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "New York, NY 10004" + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process. + The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchFuzzyBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchFuzzyBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_fuzzy_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_fuzzy_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchFuzzyBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_fuzzy_batch_sync.metadata = {'url': '/search/fuzzy/batch/sync/{format}'} # type: ignore + + async def _post_search_fuzzy_batch_initial( + self, + search_fuzzy_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> Optional["_models.SearchFuzzyBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchFuzzyBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_search_fuzzy_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_fuzzy_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_search_fuzzy_batch_initial.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + async def begin_post_search_fuzzy_batch( + self, + search_fuzzy_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> AsyncLROPoller["_models.SearchFuzzyBatchResponse"]: + """**Search Fuzzy Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Fuzzy API + `_ using just a single + API call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search fuzzy* queries you will use a ``POST`` request where the request body will + contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set + to ``application/json``. Here's a sample request body containing 5 *search fuzzy* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + {"query": "?query=Statue Of Liberty&limit=2"}, + {"query": "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + {"query": "?query=Space Needle"}, + {"query": "?query=pizza&limit=10"} + ] + } + + A *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path, + api-version and subscription-key. It can accept any of the supported *search fuzzy* `URI + parameters + `_. The + string values in the *search fuzzy* query must be properly escaped (e.g. " character should be + escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ - + If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "atm" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "ATM at Wells Fargo" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "statue of liberty" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "Statue of Liberty" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "New York, NY 10004" + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process. + The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchFuzzyBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_search_fuzzy_batch_initial( + search_fuzzy_batch_request_body=search_fuzzy_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_search_fuzzy_batch.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + async def _get_search_fuzzy_batch_initial( + self, + format: str, + **kwargs: Any + ) -> Optional["_models.SearchFuzzyBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchFuzzyBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_search_fuzzy_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_search_fuzzy_batch_initial.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + async def begin_get_search_fuzzy_batch( + self, + format: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.SearchFuzzyBatchResponse"]: + """**Search Fuzzy Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Fuzzy API + `_ using just a single + API call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search fuzzy* queries you will use a ``POST`` request where the request body will + contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set + to ``application/json``. Here's a sample request body containing 5 *search fuzzy* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + {"query": "?query=Statue Of Liberty&limit=2"}, + {"query": "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + {"query": "?query=Space Needle"}, + {"query": "?query=pizza&limit=10"} + ] + } + + A *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path, + api-version and subscription-key. It can accept any of the supported *search fuzzy* `URI + parameters + `_. The + string values in the *search fuzzy* query must be properly escaped (e.g. " character should be + escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ - + If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "atm" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "ATM at Wells Fargo" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "statue of liberty" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "Statue of Liberty" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "New York, NY 10004" + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchFuzzyBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_search_fuzzy_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_search_fuzzy_batch.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + async def post_search_address_batch_sync( + self, + search_address_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.SearchAddressBatchResponse": + """**Search Address Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address API + `_ using just a single + API call. You can call Search Address Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 5 *search address* + queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + {"query": "?query=Pike Pl, Seattle, WA + 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + France&limit=1"} + ] + } + + A *search address* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *search address* + `URI parameters + `_. The + string values in the *search address* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "one microsoft way redmond wa 98052" + }, + "results": [ + { + "position": { + "lat": 47.63989, + "lon": -122.12509 + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "pike pl seattle wa 98101" + }, + "results": [ + { + "position": { + "lat": 47.60963, + "lon": -122.34215 + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_batch_request_body: The list of address geocoding queries/requests to + process. The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_address_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchAddressBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_address_batch_sync.metadata = {'url': '/search/address/batch/sync/{format}'} # type: ignore + + async def _post_search_address_batch_initial( + self, + search_address_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> Optional["_models.SearchAddressBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_search_address_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_search_address_batch_initial.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + async def begin_post_search_address_batch( + self, + search_address_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> AsyncLROPoller["_models.SearchAddressBatchResponse"]: + """**Search Address Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address API + `_ using just a single + API call. You can call Search Address Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 5 *search address* + queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + {"query": "?query=Pike Pl, Seattle, WA + 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + France&limit=1"} + ] + } + + A *search address* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *search address* + `URI parameters + `_. The + string values in the *search address* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "one microsoft way redmond wa 98052" + }, + "results": [ + { + "position": { + "lat": 47.63989, + "lon": -122.12509 + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "pike pl seattle wa 98101" + }, + "results": [ + { + "position": { + "lat": 47.60963, + "lon": -122.34215 + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_batch_request_body: The list of address geocoding queries/requests to + process. The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SearchAddressBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_search_address_batch_initial( + search_address_batch_request_body=search_address_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_search_address_batch.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + async def _get_search_address_batch_initial( + self, + format: str, + **kwargs: Any + ) -> Optional["_models.SearchAddressBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_search_address_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_search_address_batch_initial.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + async def begin_get_search_address_batch( + self, + format: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.SearchAddressBatchResponse"]: + """**Search Address Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address API + `_ using just a single + API call. You can call Search Address Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 5 *search address* + queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + {"query": "?query=Pike Pl, Seattle, WA + 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + France&limit=1"} + ] + } + + A *search address* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *search address* + `URI parameters + `_. The + string values in the *search address* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "one microsoft way redmond wa 98052" + }, + "results": [ + { + "position": { + "lat": 47.63989, + "lon": -122.12509 + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "pike pl seattle wa 98101" + }, + "results": [ + { + "position": { + "lat": 47.60963, + "lon": -122.34215 + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SearchAddressBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_search_address_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_search_address_batch.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + async def post_search_address_reverse_batch_sync( + self, + search_address_reverse_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> "_models.SearchAddressReverseBatchResponse": + """**Search Address Reverse Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address Reverse API + `_ using just a + single API call. You can call Search Address Reverse Batch API to run either asynchronously + (async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries + and sync API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address reverse* queries you will use a ``POST`` request where the request + body will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header + will be set to ``application/json``. Here's a sample request body containing 5 *search address + reverse* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=48.858561,2.294911"}, + {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + {"query": "?query=47.621028,-122.348170"}, + {"query": "?query=43.722990,10.396695"}, + {"query": "?query=40.750958,-73.982336"} + ] + } + + A *search address reverse* query in a batch is just a partial URL *without* the protocol, base + URL, path, api-version and subscription-key. It can accept any of the supported *search address + reverse* `URI parameters + `_. + The string values in the *search address reverse* query must be properly escaped (e.g. " + character should be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchAddressReverseResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 11 + }, + "addresses": [ + { + "address": { + "country": "France", + "freeformAddress": "Avenue Anatole France, 75007 Paris" + }, + "position": "48.858490,2.294820" + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 1 + }, + "addresses": [ + { + "address": { + "country": "United States of America", + "freeformAddress": "157th Pl NE, Redmond WA 98052" + }, + "position": "47.640470,-122.129430" + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_reverse_batch_request_body: The list of reverse geocoding + queries/requests to process. The list can contain a max of 10,000 queries and must contain at + least 1 query. + :type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressReverseBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_address_reverse_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_reverse_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchAddressReverseBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_address_reverse_batch_sync.metadata = {'url': '/search/address/reverse/batch/sync/{format}'} # type: ignore + + async def _post_search_address_reverse_batch_initial( + self, + search_address_reverse_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> Optional["_models.SearchAddressReverseBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressReverseBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_search_address_reverse_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_reverse_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_search_address_reverse_batch_initial.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore + + async def begin_post_search_address_reverse_batch( + self, + search_address_reverse_batch_request_body: "_models.BatchRequestBody", + format: Union[str, "_models.JsonFormat"] = "json", + **kwargs: Any + ) -> AsyncLROPoller["_models.SearchAddressReverseBatchResponse"]: + """**Search Address Reverse Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address Reverse API + `_ using just a + single API call. You can call Search Address Reverse Batch API to run either asynchronously + (async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries + and sync API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address reverse* queries you will use a ``POST`` request where the request + body will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header + will be set to ``application/json``. Here's a sample request body containing 5 *search address + reverse* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=48.858561,2.294911"}, + {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + {"query": "?query=47.621028,-122.348170"}, + {"query": "?query=43.722990,10.396695"}, + {"query": "?query=40.750958,-73.982336"} + ] + } + + A *search address reverse* query in a batch is just a partial URL *without* the protocol, base + URL, path, api-version and subscription-key. It can accept any of the supported *search address + reverse* `URI parameters + `_. + The string values in the *search address reverse* query must be properly escaped (e.g. " + character should be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchAddressReverseResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 11 + }, + "addresses": [ + { + "address": { + "country": "France", + "freeformAddress": "Avenue Anatole France, 75007 Paris" + }, + "position": "48.858490,2.294820" + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 1 + }, + "addresses": [ + { + "address": { + "country": "United States of America", + "freeformAddress": "157th Pl NE, Redmond WA 98052" + }, + "position": "47.640470,-122.129430" + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_reverse_batch_request_body: The list of reverse geocoding + queries/requests to process. The list can contain a max of 10,000 queries and must contain at + least 1 query. + :type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_search_address_reverse_batch_initial( + search_address_reverse_batch_request_body=search_address_reverse_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_search_address_reverse_batch.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore + + async def _get_search_address_reverse_batch_initial( + self, + format: str, + **kwargs: Any + ) -> Optional["_models.SearchAddressReverseBatchResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressReverseBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_search_address_reverse_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_search_address_reverse_batch_initial.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore + + async def begin_get_search_address_reverse_batch( + self, + format: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.SearchAddressReverseBatchResponse"]: + """**Search Address Reverse Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address Reverse API + `_ using just a + single API call. You can call Search Address Reverse Batch API to run either asynchronously + (async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries + and sync API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address reverse* queries you will use a ``POST`` request where the request + body will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header + will be set to ``application/json``. Here's a sample request body containing 5 *search address + reverse* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=48.858561,2.294911"}, + {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + {"query": "?query=47.621028,-122.348170"}, + {"query": "?query=43.722990,10.396695"}, + {"query": "?query=40.750958,-73.982336"} + ] + } + + A *search address reverse* query in a batch is just a partial URL *without* the protocol, base + URL, path, api-version and subscription-key. It can accept any of the supported *search address + reverse* `URI parameters + `_. + The string values in the *search address reverse* query must be properly escaped (e.g. " + character should be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchAddressReverseResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 11 + }, + "addresses": [ + { + "address": { + "country": "France", + "freeformAddress": "Avenue Anatole France, 75007 Paris" + }, + "position": "48.858490,2.294820" + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 1 + }, + "addresses": [ + { + "address": { + "country": "United States of America", + "freeformAddress": "157th Pl NE, Redmond WA 98052" + }, + "position": "47.640470,-122.129430" + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_search_address_reverse_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_search_address_reverse_batch.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-search/azure/maps/search/models/__init__.py b/sdk/maps/azure-maps-search/azure/maps/search/models/__init__.py new file mode 100644 index 000000000000..206d42b050b3 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/models/__init__.py @@ -0,0 +1,235 @@ +# 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 BatchItem + from ._models_py3 import BatchRequestBody + from ._models_py3 import BatchRequestBodyBatchItemsItem + from ._models_py3 import BatchResponse + from ._models_py3 import BatchResponseSummary + from ._models_py3 import DataSources + from ._models_py3 import DataSourcesGeometry + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import GeoJsonFeature + from ._models_py3 import GeoJsonFeatureCollection + from ._models_py3 import GeoJsonFeatureCollectionData + from ._models_py3 import GeoJsonFeatureData + from ._models_py3 import GeoJsonGeometry + from ._models_py3 import GeoJsonGeometryCollection + from ._models_py3 import GeoJsonGeometryCollectionData + from ._models_py3 import GeoJsonLineString + from ._models_py3 import GeoJsonLineStringData + from ._models_py3 import GeoJsonMultiLineString + from ._models_py3 import GeoJsonMultiLineStringData + from ._models_py3 import GeoJsonMultiPoint + from ._models_py3 import GeoJsonMultiPointData + from ._models_py3 import GeoJsonMultiPolygon + from ._models_py3 import GeoJsonMultiPolygonData + from ._models_py3 import GeoJsonObject + from ._models_py3 import GeoJsonPoint + from ._models_py3 import GeoJsonPointData + from ._models_py3 import GeoJsonPolygon + from ._models_py3 import GeoJsonPolygonData + from ._models_py3 import LatLongPairAbbreviated + from ._models_py3 import PoiCategoryResult + from ._models_py3 import SearchAddressBatchItem + from ._models_py3 import SearchAddressBatchItemResponse + from ._models_py3 import SearchAddressBatchResponse + from ._models_py3 import SearchAddressReverseBatchItem + from ._models_py3 import SearchAddressReverseBatchItemResponse + from ._models_py3 import SearchAddressReverseBatchResponse + from ._models_py3 import SearchAddressReverseCrossStreetResponse + from ._models_py3 import SearchAddressReverseCrossStreetResult + from ._models_py3 import SearchAddressReverseResponse + from ._models_py3 import SearchAddressReverseResult + from ._models_py3 import SearchAlongRouteRequestBody + from ._models_py3 import SearchCommonResponse + from ._models_py3 import SearchCommonResult + from ._models_py3 import SearchCommonSummary + from ._models_py3 import SearchCommonSummaryGeoBias + from ._models_py3 import SearchFuzzyBatchItem + from ._models_py3 import SearchFuzzyBatchItemResponse + from ._models_py3 import SearchFuzzyBatchResponse + from ._models_py3 import SearchInsideGeometryRequestBody + from ._models_py3 import SearchPoiCategoryTreeResponse + from ._models_py3 import SearchPolygonResponse + from ._models_py3 import SearchPolygonResult + from ._models_py3 import SearchResultAddress + from ._models_py3 import SearchResultAddressRanges + from ._models_py3 import SearchResultEntryPoint + from ._models_py3 import SearchResultPoi + from ._models_py3 import SearchResultPoiBrand + from ._models_py3 import SearchResultPoiCategorySet + from ._models_py3 import SearchResultPoiClassification + from ._models_py3 import SearchResultPoiClassificationName + from ._models_py3 import SearchResultPoiOpeningHours + from ._models_py3 import SearchResultPoiOpeningHoursTimeRange + from ._models_py3 import SearchResultPoiOpeningHoursTimeRangeTime + from ._models_py3 import SearchResultViewport + from ._models_py3 import SearchSummaryGeoBias +except (SyntaxError, ImportError): + from ._models import BatchItem # type: ignore + from ._models import BatchRequestBody # type: ignore + from ._models import BatchRequestBodyBatchItemsItem # type: ignore + from ._models import BatchResponse # type: ignore + from ._models import BatchResponseSummary # type: ignore + from ._models import DataSources # type: ignore + from ._models import DataSourcesGeometry # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import GeoJsonFeature # type: ignore + from ._models import GeoJsonFeatureCollection # type: ignore + from ._models import GeoJsonFeatureCollectionData # type: ignore + from ._models import GeoJsonFeatureData # type: ignore + from ._models import GeoJsonGeometry # type: ignore + from ._models import GeoJsonGeometryCollection # type: ignore + from ._models import GeoJsonGeometryCollectionData # type: ignore + from ._models import GeoJsonLineString # type: ignore + from ._models import GeoJsonLineStringData # type: ignore + from ._models import GeoJsonMultiLineString # type: ignore + from ._models import GeoJsonMultiLineStringData # type: ignore + from ._models import GeoJsonMultiPoint # type: ignore + from ._models import GeoJsonMultiPointData # type: ignore + from ._models import GeoJsonMultiPolygon # type: ignore + from ._models import GeoJsonMultiPolygonData # type: ignore + from ._models import GeoJsonObject # type: ignore + from ._models import GeoJsonPoint # type: ignore + from ._models import GeoJsonPointData # type: ignore + from ._models import GeoJsonPolygon # type: ignore + from ._models import GeoJsonPolygonData # type: ignore + from ._models import LatLongPairAbbreviated # type: ignore + from ._models import PoiCategoryResult # type: ignore + from ._models import SearchAddressBatchItem # type: ignore + from ._models import SearchAddressBatchItemResponse # type: ignore + from ._models import SearchAddressBatchResponse # type: ignore + from ._models import SearchAddressReverseBatchItem # type: ignore + from ._models import SearchAddressReverseBatchItemResponse # type: ignore + from ._models import SearchAddressReverseBatchResponse # type: ignore + from ._models import SearchAddressReverseCrossStreetResponse # type: ignore + from ._models import SearchAddressReverseCrossStreetResult # type: ignore + from ._models import SearchAddressReverseResponse # type: ignore + from ._models import SearchAddressReverseResult # type: ignore + from ._models import SearchAlongRouteRequestBody # type: ignore + from ._models import SearchCommonResponse # type: ignore + from ._models import SearchCommonResult # type: ignore + from ._models import SearchCommonSummary # type: ignore + from ._models import SearchCommonSummaryGeoBias # type: ignore + from ._models import SearchFuzzyBatchItem # type: ignore + from ._models import SearchFuzzyBatchItemResponse # type: ignore + from ._models import SearchFuzzyBatchResponse # type: ignore + from ._models import SearchInsideGeometryRequestBody # type: ignore + from ._models import SearchPoiCategoryTreeResponse # type: ignore + from ._models import SearchPolygonResponse # type: ignore + from ._models import SearchPolygonResult # type: ignore + from ._models import SearchResultAddress # type: ignore + from ._models import SearchResultAddressRanges # type: ignore + from ._models import SearchResultEntryPoint # type: ignore + from ._models import SearchResultPoi # type: ignore + from ._models import SearchResultPoiBrand # type: ignore + from ._models import SearchResultPoiCategorySet # type: ignore + from ._models import SearchResultPoiClassification # type: ignore + from ._models import SearchResultPoiClassificationName # type: ignore + from ._models import SearchResultPoiOpeningHours # type: ignore + from ._models import SearchResultPoiOpeningHoursTimeRange # type: ignore + from ._models import SearchResultPoiOpeningHoursTimeRangeTime # type: ignore + from ._models import SearchResultViewport # type: ignore + from ._models import SearchSummaryGeoBias # type: ignore + +from ._search_client_enums import ( + ConnectorSet, + EntityType, + EntryPointType, + GeoJsonObjectType, + JsonFormat, + LocalizedMapView, + OpeningHours, + ResponseFormat, + SearchIndexSet, +) + +__all__ = [ + 'BatchItem', + 'BatchRequestBody', + 'BatchRequestBodyBatchItemsItem', + 'BatchResponse', + 'BatchResponseSummary', + 'DataSources', + 'DataSourcesGeometry', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'GeoJsonFeature', + 'GeoJsonFeatureCollection', + 'GeoJsonFeatureCollectionData', + 'GeoJsonFeatureData', + 'GeoJsonGeometry', + 'GeoJsonGeometryCollection', + 'GeoJsonGeometryCollectionData', + 'GeoJsonLineString', + 'GeoJsonLineStringData', + 'GeoJsonMultiLineString', + 'GeoJsonMultiLineStringData', + 'GeoJsonMultiPoint', + 'GeoJsonMultiPointData', + 'GeoJsonMultiPolygon', + 'GeoJsonMultiPolygonData', + 'GeoJsonObject', + 'GeoJsonPoint', + 'GeoJsonPointData', + 'GeoJsonPolygon', + 'GeoJsonPolygonData', + 'LatLongPairAbbreviated', + 'PoiCategoryResult', + 'SearchAddressBatchItem', + 'SearchAddressBatchItemResponse', + 'SearchAddressBatchResponse', + 'SearchAddressReverseBatchItem', + 'SearchAddressReverseBatchItemResponse', + 'SearchAddressReverseBatchResponse', + 'SearchAddressReverseCrossStreetResponse', + 'SearchAddressReverseCrossStreetResult', + 'SearchAddressReverseResponse', + 'SearchAddressReverseResult', + 'SearchAlongRouteRequestBody', + 'SearchCommonResponse', + 'SearchCommonResult', + 'SearchCommonSummary', + 'SearchCommonSummaryGeoBias', + 'SearchFuzzyBatchItem', + 'SearchFuzzyBatchItemResponse', + 'SearchFuzzyBatchResponse', + 'SearchInsideGeometryRequestBody', + 'SearchPoiCategoryTreeResponse', + 'SearchPolygonResponse', + 'SearchPolygonResult', + 'SearchResultAddress', + 'SearchResultAddressRanges', + 'SearchResultEntryPoint', + 'SearchResultPoi', + 'SearchResultPoiBrand', + 'SearchResultPoiCategorySet', + 'SearchResultPoiClassification', + 'SearchResultPoiClassificationName', + 'SearchResultPoiOpeningHours', + 'SearchResultPoiOpeningHoursTimeRange', + 'SearchResultPoiOpeningHoursTimeRangeTime', + 'SearchResultViewport', + 'SearchSummaryGeoBias', + 'ConnectorSet', + 'EntityType', + 'EntryPointType', + 'GeoJsonObjectType', + 'JsonFormat', + 'LocalizedMapView', + 'OpeningHours', + 'ResponseFormat', + 'SearchIndexSet', +] diff --git a/sdk/maps/azure-maps-search/azure/maps/search/models/_models.py b/sdk/maps/azure-maps-search/azure/maps/search/models/_models.py new file mode 100644 index 000000000000..cc46f5606a92 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/models/_models.py @@ -0,0 +1,2267 @@ +# 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 BatchItem(msrest.serialization.Model): + """An item returned from Batch API. Extend with 'response' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + """ + + _validation = { + 'status_code': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchItem, self).__init__(**kwargs) + self.status_code = None + + +class BatchRequestBody(msrest.serialization.Model): + """This type represents the request body for the Batch service. + + :param batch_items: The list of queries to process. + :type batch_items: list[~azure.maps.search.models.BatchRequestBodyBatchItemsItem] + """ + + _attribute_map = { + 'batch_items': {'key': 'batchItems', 'type': '[BatchRequestBodyBatchItemsItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchRequestBody, self).__init__(**kwargs) + self.batch_items = kwargs.get('batch_items', None) + + +class BatchRequestBodyBatchItemsItem(msrest.serialization.Model): + """Batch Query object. + + :param query: Partial query string. + :type query: str + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchRequestBodyBatchItemsItem, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + + +class BatchResponse(msrest.serialization.Model): + """This object is returned from a successful Batch service call. Extend with 'batchItems' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + """ + + _validation = { + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponse, self).__init__(**kwargs) + self.summary = None + + +class BatchResponseSummary(msrest.serialization.Model): + """Summary for the batch request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_requests: Number of successful requests in the batch. + :vartype successful_requests: int + :ivar total_requests: Total number of requests in the batch. + :vartype total_requests: int + """ + + _validation = { + 'successful_requests': {'readonly': True}, + 'total_requests': {'readonly': True}, + } + + _attribute_map = { + 'successful_requests': {'key': 'successfulRequests', 'type': 'int'}, + 'total_requests': {'key': 'totalRequests', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponseSummary, self).__init__(**kwargs) + self.successful_requests = None + self.total_requests = None + + +class DataSources(msrest.serialization.Model): + """Optional section. Reference ids for use with the `Get Search Polygon `_ API. + + :param geometry: Information about the geometric shape of the result. Only present if type == + Geography. + :type geometry: ~azure.maps.search.models.DataSourcesGeometry + """ + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'DataSourcesGeometry'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSources, self).__init__(**kwargs) + self.geometry = kwargs.get('geometry', None) + + +class DataSourcesGeometry(msrest.serialization.Model): + """Information about the geometric shape of the result. Only present if type == Geography. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Pass this as geometryId to the `Get Search Polygon + `_ API to fetch geometry + information for this result. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSourcesGeometry, self).__init__(**kwargs) + self.id = 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.search.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.search.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.search.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 GeoJsonFeatureData(msrest.serialization.Model): + """GeoJsonFeatureData. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.search.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + """ + + _validation = { + 'geometry': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeatureData, self).__init__(**kwargs) + self.geometry = kwargs['geometry'] + self.properties = kwargs.get('properties', None) + self.id = kwargs.get('id', None) + self.feature_type = kwargs.get('feature_type', None) + + +class GeoJsonObject(msrest.serialization.Model): + """A valid ``GeoJSON`` object. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonFeature, GeoJsonFeatureCollection, GeoJsonGeometry. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Feature': 'GeoJsonFeature', 'FeatureCollection': 'GeoJsonFeatureCollection', 'GeoJsonGeometry': 'GeoJsonGeometry'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonObject, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class GeoJsonFeature(GeoJsonObject, GeoJsonFeatureData): + """A valid ``GeoJSON Feature`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.search.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'geometry': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeature, self).__init__(**kwargs) + self.geometry = kwargs['geometry'] + self.properties = kwargs.get('properties', None) + self.id = kwargs.get('id', None) + self.feature_type = kwargs.get('feature_type', None) + self.type = 'Feature' # type: str + self.type = 'Feature' # type: str + + +class GeoJsonFeatureCollectionData(msrest.serialization.Model): + """GeoJsonFeatureCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.search.models.GeoJsonFeature] + """ + + _validation = { + 'features': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeatureCollectionData, self).__init__(**kwargs) + self.features = kwargs['features'] + + +class GeoJsonFeatureCollection(GeoJsonObject, GeoJsonFeatureCollectionData): + """A valid ``GeoJSON FeatureCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.search.models.GeoJsonFeature] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'features': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonFeatureCollection, self).__init__(**kwargs) + self.features = kwargs['features'] + self.type = 'FeatureCollection' # type: str + self.type = 'FeatureCollection' # type: str + + +class GeoJsonGeometry(GeoJsonObject): + """A valid ``GeoJSON`` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonGeometryCollection, GeoJsonLineString, GeoJsonMultiLineString, GeoJsonMultiPoint, GeoJsonMultiPolygon, GeoJsonPoint, GeoJsonPolygon. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'GeometryCollection': 'GeoJsonGeometryCollection', 'LineString': 'GeoJsonLineString', 'MultiLineString': 'GeoJsonMultiLineString', 'MultiPoint': 'GeoJsonMultiPoint', 'MultiPolygon': 'GeoJsonMultiPolygon', 'Point': 'GeoJsonPoint', 'Polygon': 'GeoJsonPolygon'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometry, self).__init__(**kwargs) + self.type = 'GeoJsonGeometry' # type: str + + +class GeoJsonGeometryCollectionData(msrest.serialization.Model): + """GeoJsonGeometryCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.search.models.GeoJsonGeometry] + """ + + _validation = { + 'geometries': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometryCollectionData, self).__init__(**kwargs) + self.geometries = kwargs['geometries'] + + +class GeoJsonGeometryCollection(GeoJsonGeometry, GeoJsonGeometryCollectionData): + """A valid ``GeoJSON GeometryCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.search.models.GeoJsonGeometry] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'geometries': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometryCollection, self).__init__(**kwargs) + self.geometries = kwargs['geometries'] + self.type = 'GeometryCollection' # type: str + self.type = 'GeometryCollection' # type: str + + +class GeoJsonLineStringData(msrest.serialization.Model): + """GeoJsonLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonLineStringData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonLineString(GeoJsonGeometry, GeoJsonLineStringData): + """A valid ``GeoJSON LineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonLineString, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'LineString' # type: str + self.type = 'LineString' # type: str + + +class GeoJsonMultiLineStringData(msrest.serialization.Model): + """GeoJsonMultiLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiLineStringData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonMultiLineString(GeoJsonGeometry, GeoJsonMultiLineStringData): + """A valid ``GeoJSON MultiLineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiLineString, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'MultiLineString' # type: str + self.type = 'MultiLineString' # type: str + + +class GeoJsonMultiPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson MultiPoint``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPointData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonMultiPoint(GeoJsonGeometry, GeoJsonMultiPointData): + """A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPoint, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'MultiPoint' # type: str + self.type = 'MultiPoint' # type: str + + +class GeoJsonMultiPolygonData(msrest.serialization.Model): + """GeoJsonMultiPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPolygonData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonMultiPolygon(GeoJsonGeometry, GeoJsonMultiPolygonData): + """A valid ``GeoJSON MultiPolygon`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonMultiPolygon, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'MultiPolygon' # type: str + self.type = 'MultiPolygon' # type: str + + +class GeoJsonPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson Point``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPointData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonPoint(GeoJsonGeometry, GeoJsonPointData): + """A valid ``GeoJSON Point`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPoint, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'Point' # type: str + self.type = 'Point' # type: str + + +class GeoJsonPolygonData(msrest.serialization.Model): + """GeoJsonPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPolygonData, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + + +class GeoJsonPolygon(GeoJsonGeometry, GeoJsonPolygonData): + """A valid ``GeoJSON Polygon`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonPolygon, self).__init__(**kwargs) + self.coordinates = kwargs['coordinates'] + self.type = 'Polygon' # type: str + self.type = 'Polygon' # type: str + + +class LatLongPairAbbreviated(msrest.serialization.Model): + """A location represented as a latitude and longitude using short names 'lat' & 'lon'. + + :param lat: Latitude property. + :type lat: float + :param lon: Longitude property. + :type lon: float + """ + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(LatLongPairAbbreviated, self).__init__(**kwargs) + self.lat = kwargs.get('lat', None) + self.lon = kwargs.get('lon', None) + + +class PoiCategoryResult(msrest.serialization.Model): + """POI category result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Unique ID for the category. ID can be used to restrict search results to specific + categories through other Search Service APIs, like `Get Search POI + `_. + :vartype id: int + :ivar name: Name of the category. + :vartype name: str + :ivar child_category_ids: Array of child category ids. + :vartype child_category_ids: list[int] + :ivar synonyms: Array of alternative names of the category. + :vartype synonyms: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'child_category_ids': {'readonly': True}, + 'synonyms': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'child_category_ids': {'key': 'childCategoryIds', 'type': '[int]'}, + 'synonyms': {'key': 'synonyms', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PoiCategoryResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.child_category_ids = None + self.synonyms = None + + +class SearchAddressBatchItem(BatchItem): + """An item returned from Search Address Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. SearchCommonResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.search.models.SearchAddressBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'SearchAddressBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressBatchItem, self).__init__(**kwargs) + self.response = None + + +class SearchCommonResponse(msrest.serialization.Model): + """This object is returned from a successful Search calls. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search API response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar results: A list of Search API results. + :vartype results: list[~azure.maps.search.models.SearchCommonResult] + """ + + _validation = { + 'summary': {'readonly': True}, + 'results': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'results': {'key': 'results', 'type': '[SearchCommonResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchCommonResponse, self).__init__(**kwargs) + self.summary = None + self.results = None + + +class SearchAddressBatchItemResponse(ErrorResponse, SearchCommonResponse): + """The result of the query. SearchCommonResponse if the query completed successfully, ErrorResponse otherwise. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search API response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar results: A list of Search API results. + :vartype results: list[~azure.maps.search.models.SearchCommonResult] + :param error: The error object. + :type error: ~azure.maps.search.models.ErrorDetail + """ + + _validation = { + 'summary': {'readonly': True}, + 'results': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'results': {'key': 'results', 'type': '[SearchCommonResult]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressBatchItemResponse, self).__init__(**kwargs) + self.summary = None + self.results = None + self.error = kwargs.get('error', None) + + +class SearchAddressBatchResponse(BatchResponse): + """This object is returned from a successful Search Address Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.search.models.SearchAddressBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[SearchAddressBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class SearchAddressReverseBatchItem(BatchItem): + """An item returned from Search Address Reverse Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. SearchAddressReverseResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.search.models.SearchAddressReverseBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'SearchAddressReverseBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseBatchItem, self).__init__(**kwargs) + self.response = None + + +class SearchAddressReverseResponse(msrest.serialization.Model): + """This object is returned from a successful Search Address Reverse call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search Address Reverse response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar addresses: Addresses array. + :vartype addresses: list[~azure.maps.search.models.SearchAddressReverseResult] + """ + + _validation = { + 'summary': {'readonly': True}, + 'addresses': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'addresses': {'key': 'addresses', 'type': '[SearchAddressReverseResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseResponse, self).__init__(**kwargs) + self.summary = None + self.addresses = None + + +class SearchAddressReverseBatchItemResponse(ErrorResponse, SearchAddressReverseResponse): + """The result of the query. SearchAddressReverseResponse if the query completed successfully, ErrorResponse otherwise. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search Address Reverse response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar addresses: Addresses array. + :vartype addresses: list[~azure.maps.search.models.SearchAddressReverseResult] + :param error: The error object. + :type error: ~azure.maps.search.models.ErrorDetail + """ + + _validation = { + 'summary': {'readonly': True}, + 'addresses': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'addresses': {'key': 'addresses', 'type': '[SearchAddressReverseResult]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseBatchItemResponse, self).__init__(**kwargs) + self.summary = None + self.addresses = None + self.error = kwargs.get('error', None) + + +class SearchAddressReverseBatchResponse(BatchResponse): + """This object is returned from a successful Search Address Reverse Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.search.models.SearchAddressReverseBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[SearchAddressReverseBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class SearchAddressReverseCrossStreetResponse(msrest.serialization.Model): + """This object is returned from a successful Search Address Reverse CrossStreet call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search Address Reverse Cross Street response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar addresses: Addresses array. + :vartype addresses: list[~azure.maps.search.models.SearchAddressReverseCrossStreetResult] + """ + + _validation = { + 'summary': {'readonly': True}, + 'addresses': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'addresses': {'key': 'addresses', 'type': '[SearchAddressReverseCrossStreetResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseCrossStreetResponse, self).__init__(**kwargs) + self.summary = None + self.addresses = None + + +class SearchAddressReverseCrossStreetResult(msrest.serialization.Model): + """Result object for a Search Address Reverse Cross Street response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar address: The address of the result. + :vartype address: ~azure.maps.search.models.SearchResultAddress + :ivar position: Position property in the form of "{latitude},{longitude}". + :vartype position: str + """ + + _validation = { + 'address': {'readonly': True}, + 'position': {'readonly': True}, + } + + _attribute_map = { + 'address': {'key': 'address', 'type': 'SearchResultAddress'}, + 'position': {'key': 'position', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseCrossStreetResult, self).__init__(**kwargs) + self.address = None + self.position = None + + +class SearchAddressReverseResult(msrest.serialization.Model): + """Result object for a Search Address Reverse response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar address: The address of the result. + :vartype address: ~azure.maps.search.models.SearchResultAddress + :ivar position: Position property in the form of "{latitude},{longitude}". + :vartype position: str + :ivar match_type: Information on the type of match. + + One of: + + + * AddressPoint + * HouseNumberRange + * Street. + :vartype match_type: str + """ + + _validation = { + 'address': {'readonly': True}, + 'position': {'readonly': True}, + 'match_type': {'readonly': True}, + } + + _attribute_map = { + 'address': {'key': 'address', 'type': 'SearchResultAddress'}, + 'position': {'key': 'position', 'type': 'str'}, + 'match_type': {'key': 'matchType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseResult, self).__init__(**kwargs) + self.address = None + self.position = None + self.match_type = None + + +class SearchAlongRouteRequestBody(msrest.serialization.Model): + """This type represents the request body for the Search Along Route service. + + :param route: A valid ``GeoJSON LineString`` geometry type. Please refer to `RFC 7946 + `_ for details. + :type route: ~azure.maps.search.models.GeoJsonLineString + """ + + _attribute_map = { + 'route': {'key': 'route', 'type': 'GeoJsonLineString'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAlongRouteRequestBody, self).__init__(**kwargs) + self.route = kwargs.get('route', None) + + +class SearchCommonResult(msrest.serialization.Model): + """Result object for a Search API response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: One of: + + + * POI + * Street + * Geography + * Point Address + * Address Range + * Cross Street. + :vartype type: str + :ivar id: Id property. + :vartype id: str + :ivar score: The value within a result set to indicate the relative matching score between + results. You can use this to determine that result x is twice as likely to be as relevant as + result y if the value of x is 2x the value of y. The values vary between queries and is only + meant as a relative value for one result set. + :vartype score: float + :ivar dist: Straight line distance between the result and geobias location in meters. + :vartype dist: float + :ivar info: Info property. + :vartype info: str + :param entity_type: Possible values include: "Country", "CountrySubdivision", + "CountrySecondarySubdivision", "CountryTertiarySubdivision", "Municipality", + "MunicipalitySubdivision", "Neighbourhood", "PostalCodeArea". + :type entity_type: str or ~azure.maps.search.models.EntityType + :ivar poi: Details of the returned POI including information such as the name, phone, url + address, and classifications. + :vartype poi: ~azure.maps.search.models.SearchResultPoi + :ivar address: The address of the result. + :vartype address: ~azure.maps.search.models.SearchResultAddress + :param position: A location represented as a latitude and longitude using short names 'lat' & + 'lon'. + :type position: ~azure.maps.search.models.LatLongPairAbbreviated + :ivar viewport: The viewport that covers the result represented by the top-left and + bottom-right coordinates of the viewport. + :vartype viewport: ~azure.maps.search.models.SearchResultViewport + :ivar entry_points: Entry Points array. + :vartype entry_points: list[~azure.maps.search.models.SearchResultEntryPoint] + :ivar address_ranges: Describes the address range on both sides of the street for a search + result. Coordinates for the start and end locations of the address range are included. + :vartype address_ranges: ~azure.maps.search.models.SearchResultAddressRanges + :ivar data_sources: Optional section. Reference ids for use with the `Get Search Polygon + `_ API. + :vartype data_sources: ~azure.maps.search.models.DataSources + :ivar match_type: Information on the type of match. + + One of: + + + * AddressPoint + * HouseNumberRange + * Street. + :vartype match_type: str + :ivar detour_time: Detour time in seconds. + :vartype detour_time: float + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'score': {'readonly': True}, + 'dist': {'readonly': True}, + 'info': {'readonly': True}, + 'poi': {'readonly': True}, + 'address': {'readonly': True}, + 'viewport': {'readonly': True}, + 'entry_points': {'readonly': True}, + 'address_ranges': {'readonly': True}, + 'data_sources': {'readonly': True}, + 'match_type': {'readonly': True}, + 'detour_time': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'dist': {'key': 'dist', 'type': 'float'}, + 'info': {'key': 'info', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'poi': {'key': 'poi', 'type': 'SearchResultPoi'}, + 'address': {'key': 'address', 'type': 'SearchResultAddress'}, + 'position': {'key': 'position', 'type': 'LatLongPairAbbreviated'}, + 'viewport': {'key': 'viewport', 'type': 'SearchResultViewport'}, + 'entry_points': {'key': 'entryPoints', 'type': '[SearchResultEntryPoint]'}, + 'address_ranges': {'key': 'addressRanges', 'type': 'SearchResultAddressRanges'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSources'}, + 'match_type': {'key': 'matchType', 'type': 'str'}, + 'detour_time': {'key': 'detourTime', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchCommonResult, self).__init__(**kwargs) + self.type = None + self.id = None + self.score = None + self.dist = None + self.info = None + self.entity_type = kwargs.get('entity_type', None) + self.poi = None + self.address = None + self.position = kwargs.get('position', None) + self.viewport = None + self.entry_points = None + self.address_ranges = None + self.data_sources = None + self.match_type = None + self.detour_time = None + + +class SearchCommonSummary(msrest.serialization.Model): + """Summary object for a Search API response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar query: Query property. + :vartype query: str + :ivar query_type: QueryType property. + :vartype query_type: str + :ivar query_time: QueryTime property. + :vartype query_time: int + :ivar num_results: NumResults property. + :vartype num_results: int + :ivar limit: Maximum number of responses that will be returned. + :vartype limit: int + :ivar offset: Offset property. + :vartype offset: int + :ivar total_results: TotalResults property. + :vartype total_results: int + :ivar fuzzy_level: FuzzyLevel property. + :vartype fuzzy_level: int + :ivar geo_bias: Indication when the internal search engine has applied a geospatial bias to + improve the ranking of results. In some methods, this can be affected by setting the lat and + lon parameters where available. In other cases it is purely internal. + :vartype geo_bias: ~azure.maps.search.models.SearchCommonSummaryGeoBias + """ + + _validation = { + 'query': {'readonly': True}, + 'query_type': {'readonly': True}, + 'query_time': {'readonly': True}, + 'num_results': {'readonly': True}, + 'limit': {'readonly': True}, + 'offset': {'readonly': True}, + 'total_results': {'readonly': True}, + 'fuzzy_level': {'readonly': True}, + 'geo_bias': {'readonly': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'query_type': {'key': 'queryType', 'type': 'str'}, + 'query_time': {'key': 'queryTime', 'type': 'int'}, + 'num_results': {'key': 'numResults', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'total_results': {'key': 'totalResults', 'type': 'int'}, + 'fuzzy_level': {'key': 'fuzzyLevel', 'type': 'int'}, + 'geo_bias': {'key': 'geoBias', 'type': 'SearchCommonSummaryGeoBias'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchCommonSummary, self).__init__(**kwargs) + self.query = None + self.query_type = None + self.query_time = None + self.num_results = None + self.limit = None + self.offset = None + self.total_results = None + self.fuzzy_level = None + self.geo_bias = None + + +class SearchCommonSummaryGeoBias(LatLongPairAbbreviated): + """Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal. + + :param lat: Latitude property. + :type lat: float + :param lon: Longitude property. + :type lon: float + """ + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchCommonSummaryGeoBias, self).__init__(**kwargs) + + +class SearchFuzzyBatchItem(BatchItem): + """An item returned from Search Fuzzy Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. SearchCommonResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.search.models.SearchFuzzyBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'SearchFuzzyBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchFuzzyBatchItem, self).__init__(**kwargs) + self.response = None + + +class SearchFuzzyBatchItemResponse(ErrorResponse, SearchCommonResponse): + """The result of the query. SearchCommonResponse if the query completed successfully, ErrorResponse otherwise. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search API response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar results: A list of Search API results. + :vartype results: list[~azure.maps.search.models.SearchCommonResult] + :param error: The error object. + :type error: ~azure.maps.search.models.ErrorDetail + """ + + _validation = { + 'summary': {'readonly': True}, + 'results': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'results': {'key': 'results', 'type': '[SearchCommonResult]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchFuzzyBatchItemResponse, self).__init__(**kwargs) + self.summary = None + self.results = None + self.error = kwargs.get('error', None) + + +class SearchFuzzyBatchResponse(BatchResponse): + """This object is returned from a successful Search Fuzzy Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.search.models.SearchFuzzyBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[SearchFuzzyBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchFuzzyBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class SearchInsideGeometryRequestBody(msrest.serialization.Model): + """This type represents the request body for the Search Inside Geometry service. + + :param geometry: A valid ``GeoJSON`` object. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.search.models.GeoJsonObject + """ + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonObject'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchInsideGeometryRequestBody, self).__init__(**kwargs) + self.geometry = kwargs.get('geometry', None) + + +class SearchPoiCategoryTreeResponse(msrest.serialization.Model): + """This object is returned from a successful POI Category Tree call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar poi_categories: Categories array. + :vartype poi_categories: list[~azure.maps.search.models.PoiCategoryResult] + """ + + _validation = { + 'poi_categories': {'readonly': True}, + } + + _attribute_map = { + 'poi_categories': {'key': 'poiCategories', 'type': '[PoiCategoryResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchPoiCategoryTreeResponse, self).__init__(**kwargs) + self.poi_categories = None + + +class SearchPolygonResponse(msrest.serialization.Model): + """This object is returned from a successful Search Polygon call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar additional_data: Results array. + :vartype additional_data: list[~azure.maps.search.models.SearchPolygonResult] + """ + + _validation = { + 'additional_data': {'readonly': True}, + } + + _attribute_map = { + 'additional_data': {'key': 'additionalData', 'type': '[SearchPolygonResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchPolygonResponse, self).__init__(**kwargs) + self.additional_data = None + + +class SearchPolygonResult(msrest.serialization.Model): + """SearchPolygonResult. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider_id: ID of the returned entity. + :vartype provider_id: str + :ivar error: Reason for the failure to obtain data for this provider. + :vartype error: str + :param geometry_data: Geometry data in GeoJSON format. Please refer to `RFC 7946 + `_ for details. Present only if "error" is not present. + :type geometry_data: ~azure.maps.search.models.GeoJsonObject + """ + + _validation = { + 'provider_id': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'provider_id': {'key': 'providerID', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'geometry_data': {'key': 'geometryData', 'type': 'GeoJsonObject'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchPolygonResult, self).__init__(**kwargs) + self.provider_id = None + self.error = None + self.geometry_data = kwargs.get('geometry_data', None) + + +class SearchResultAddress(msrest.serialization.Model): + """The address of the result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar building_number: Building Number property. + :vartype building_number: str + :ivar street: Street property. + :vartype street: str + :ivar cross_street: Cross Street property. + :vartype cross_street: str + :ivar street_number: Street Number property. + :vartype street_number: str + :ivar route_numbers: number of routes. + :vartype route_numbers: list[int] + :ivar street_name: Street Name property. + :vartype street_name: str + :ivar street_name_and_number: Street Name and Number property. + :vartype street_name_and_number: str + :ivar municipality: Municipality property. + :vartype municipality: str + :ivar municipality_subdivision: Municipality Subdivision property. + :vartype municipality_subdivision: str + :ivar country_tertiary_subdivision: Country Tertiary Subdivision property. + :vartype country_tertiary_subdivision: str + :ivar country_secondary_subdivision: Country Secondary Subdivision property. + :vartype country_secondary_subdivision: str + :ivar country_subdivision: Country Subdivision property. + :vartype country_subdivision: str + :ivar postal_code: Postal Code property. + :vartype postal_code: str + :ivar extended_postal_code: Extended Postal Code property. + :vartype extended_postal_code: str + :ivar country_code: Country Code property. + :vartype country_code: str + :ivar country: Country property. + :vartype country: str + :ivar country_code_iso3: Country Code ISO3 property. + :vartype country_code_iso3: str + :ivar freeform_address: Free form Address property. + :vartype freeform_address: str + :ivar country_subdivision_name: Country Subdivision Name property. + :vartype country_subdivision_name: str + :ivar local_name: An address component which represents the name of a geographic area or + locality that groups a number of addressable objects for addressing purposes, without being an + administrative unit. This field is used to build the ``freeformAddress`` property. + :vartype local_name: str + :ivar bounding_box: Bounding box coordinates. + :vartype bounding_box: any + """ + + _validation = { + 'building_number': {'readonly': True}, + 'street': {'readonly': True}, + 'cross_street': {'readonly': True}, + 'street_number': {'readonly': True}, + 'route_numbers': {'readonly': True}, + 'street_name': {'readonly': True}, + 'street_name_and_number': {'readonly': True}, + 'municipality': {'readonly': True}, + 'municipality_subdivision': {'readonly': True}, + 'country_tertiary_subdivision': {'readonly': True}, + 'country_secondary_subdivision': {'readonly': True}, + 'country_subdivision': {'readonly': True}, + 'postal_code': {'readonly': True}, + 'extended_postal_code': {'readonly': True}, + 'country_code': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code_iso3': {'readonly': True}, + 'freeform_address': {'readonly': True}, + 'country_subdivision_name': {'readonly': True}, + 'local_name': {'readonly': True}, + 'bounding_box': {'readonly': True}, + } + + _attribute_map = { + 'building_number': {'key': 'buildingNumber', 'type': 'str'}, + 'street': {'key': 'street', 'type': 'str'}, + 'cross_street': {'key': 'crossStreet', 'type': 'str'}, + 'street_number': {'key': 'streetNumber', 'type': 'str'}, + 'route_numbers': {'key': 'routeNumbers', 'type': '[int]'}, + 'street_name': {'key': 'streetName', 'type': 'str'}, + 'street_name_and_number': {'key': 'streetNameAndNumber', 'type': 'str'}, + 'municipality': {'key': 'municipality', 'type': 'str'}, + 'municipality_subdivision': {'key': 'municipalitySubdivision', 'type': 'str'}, + 'country_tertiary_subdivision': {'key': 'countryTertiarySubdivision', 'type': 'str'}, + 'country_secondary_subdivision': {'key': 'countrySecondarySubdivision', 'type': 'str'}, + 'country_subdivision': {'key': 'countrySubdivision', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'extended_postal_code': {'key': 'extendedPostalCode', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code_iso3': {'key': 'countryCodeISO3', 'type': 'str'}, + 'freeform_address': {'key': 'freeformAddress', 'type': 'str'}, + 'country_subdivision_name': {'key': 'countrySubdivisionName', 'type': 'str'}, + 'local_name': {'key': 'localName', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultAddress, self).__init__(**kwargs) + self.building_number = None + self.street = None + self.cross_street = None + self.street_number = None + self.route_numbers = None + self.street_name = None + self.street_name_and_number = None + self.municipality = None + self.municipality_subdivision = None + self.country_tertiary_subdivision = None + self.country_secondary_subdivision = None + self.country_subdivision = None + self.postal_code = None + self.extended_postal_code = None + self.country_code = None + self.country = None + self.country_code_iso3 = None + self.freeform_address = None + self.country_subdivision_name = None + self.local_name = None + self.bounding_box = None + + +class SearchResultAddressRanges(msrest.serialization.Model): + """Describes the address range on both sides of the street for a search result. Coordinates for the start and end locations of the address range are included. + + :param range_left: Address range on the left side of the street. + :type range_left: str + :param range_right: Address range on the right side of the street. + :type range_right: str + :param from_property: A location represented as a latitude and longitude using short names + 'lat' & 'lon'. + :type from_property: ~azure.maps.search.models.LatLongPairAbbreviated + :param to: A location represented as a latitude and longitude using short names 'lat' & 'lon'. + :type to: ~azure.maps.search.models.LatLongPairAbbreviated + """ + + _attribute_map = { + 'range_left': {'key': 'rangeLeft', 'type': 'str'}, + 'range_right': {'key': 'rangeRight', 'type': 'str'}, + 'from_property': {'key': 'from', 'type': 'LatLongPairAbbreviated'}, + 'to': {'key': 'to', 'type': 'LatLongPairAbbreviated'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultAddressRanges, self).__init__(**kwargs) + self.range_left = kwargs.get('range_left', None) + self.range_right = kwargs.get('range_right', None) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) + + +class SearchResultEntryPoint(msrest.serialization.Model): + """The entry point for the POI being returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of entry point. Value can be either *main* or *minor*. Possible values + include: "main", "minor". + :vartype type: str or ~azure.maps.search.models.EntryPointType + :param position: A location represented as a latitude and longitude using short names 'lat' & + 'lon'. + :type position: ~azure.maps.search.models.LatLongPairAbbreviated + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'position': {'key': 'position', 'type': 'LatLongPairAbbreviated'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultEntryPoint, self).__init__(**kwargs) + self.type = None + self.position = kwargs.get('position', None) + + +class SearchResultPoi(msrest.serialization.Model): + """Details of the returned POI including information such as the name, phone, url address, and classifications. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the POI property. + :vartype name: str + :ivar phone: Telephone number property. + :vartype phone: str + :ivar url: Website URL property. + :vartype url: str + :ivar category_set: The list of the most specific POI categories. + :vartype category_set: list[~azure.maps.search.models.SearchResultPoiCategorySet] + :ivar categories: **[Deprecated]** Use classifications instead. Categories array. + :vartype categories: list[str] + :ivar classifications: Classification array. + :vartype classifications: list[~azure.maps.search.models.SearchResultPoiClassification] + :ivar brands: Brands array. The name of the brand for the POI being returned. + :vartype brands: list[~azure.maps.search.models.SearchResultPoiBrand] + :param opening_hours: Opening hours for a POI (Points of Interest). + :type opening_hours: ~azure.maps.search.models.SearchResultPoiOpeningHours + """ + + _validation = { + 'name': {'readonly': True}, + 'phone': {'readonly': True}, + 'url': {'readonly': True}, + 'category_set': {'readonly': True}, + 'categories': {'readonly': True}, + 'classifications': {'readonly': True}, + 'brands': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'category_set': {'key': 'categorySet', 'type': '[SearchResultPoiCategorySet]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'classifications': {'key': 'classifications', 'type': '[SearchResultPoiClassification]'}, + 'brands': {'key': 'brands', 'type': '[SearchResultPoiBrand]'}, + 'opening_hours': {'key': 'openingHours', 'type': 'SearchResultPoiOpeningHours'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoi, self).__init__(**kwargs) + self.name = None + self.phone = None + self.url = None + self.category_set = None + self.categories = None + self.classifications = None + self.brands = None + self.opening_hours = kwargs.get('opening_hours', None) + + +class SearchResultPoiBrand(msrest.serialization.Model): + """The name of the brand for the POI being returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the brand. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiBrand, self).__init__(**kwargs) + self.name = None + + +class SearchResultPoiCategorySet(msrest.serialization.Model): + """POI category. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Category ID. + :vartype id: int + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiCategorySet, self).__init__(**kwargs) + self.id = None + + +class SearchResultPoiClassification(msrest.serialization.Model): + """The classification for the POI being returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Code property. + :vartype code: str + :ivar names: Names array. + :vartype names: list[~azure.maps.search.models.SearchResultPoiClassificationName] + """ + + _validation = { + 'code': {'readonly': True}, + 'names': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'names': {'key': 'names', 'type': '[SearchResultPoiClassificationName]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiClassification, self).__init__(**kwargs) + self.code = None + self.names = None + + +class SearchResultPoiClassificationName(msrest.serialization.Model): + """Name for the classification. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_locale: Name Locale property. + :vartype name_locale: str + :ivar name: Name property. + :vartype name: str + """ + + _validation = { + 'name_locale': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name_locale': {'key': 'nameLocale', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiClassificationName, self).__init__(**kwargs) + self.name_locale = None + self.name = None + + +class SearchResultPoiOpeningHours(msrest.serialization.Model): + """Opening hours for a POI (Points of Interest). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mode: Value used in the Request. + :vartype mode: str + :ivar time_ranges: List of time ranges for the next 7 days. + :vartype time_ranges: list[~azure.maps.search.models.SearchResultPoiOpeningHoursTimeRange] + """ + + _validation = { + 'mode': {'readonly': True}, + 'time_ranges': {'readonly': True}, + } + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[SearchResultPoiOpeningHoursTimeRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiOpeningHours, self).__init__(**kwargs) + self.mode = None + self.time_ranges = None + + +class SearchResultPoiOpeningHoursTimeRange(msrest.serialization.Model): + """Open time range for a day. + + :param start_time: The point in the next 7 days range when a given POI is being opened, or the + beginning of the range if it was opened before the range. + :type start_time: ~azure.maps.search.models.SearchResultPoiOpeningHoursTimeRangeTime + :param end_time: The point in the next 7 days range when a given POI is being closed, or the + beginning of the range if it was closed before the range. + :type end_time: ~azure.maps.search.models.SearchResultPoiOpeningHoursTimeRangeTime + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'SearchResultPoiOpeningHoursTimeRangeTime'}, + 'end_time': {'key': 'endTime', 'type': 'SearchResultPoiOpeningHoursTimeRangeTime'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiOpeningHoursTimeRange, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + + +class SearchResultPoiOpeningHoursTimeRangeTime(msrest.serialization.Model): + """Represents a date and time. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar date: Represents current day in calendar year in POI time zone. + :vartype date: str + :ivar hour: Hours are in the 24 hour format in the local time of a POI; possible values are 0 - + 23. + :vartype hour: int + :ivar minute: Minutes are in the local time of a POI; possible values are 0 - 59. + :vartype minute: int + """ + + _validation = { + 'date': {'readonly': True}, + 'hour': {'readonly': True}, + 'minute': {'readonly': True}, + } + + _attribute_map = { + 'date': {'key': 'date', 'type': 'str'}, + 'hour': {'key': 'hour', 'type': 'int'}, + 'minute': {'key': 'minute', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiOpeningHoursTimeRangeTime, self).__init__(**kwargs) + self.date = None + self.hour = None + self.minute = None + + +class SearchResultViewport(msrest.serialization.Model): + """The viewport that covers the result represented by the top-left and bottom-right coordinates of the viewport. + + :param top_left_point: A location represented as a latitude and longitude using short names + 'lat' & 'lon'. + :type top_left_point: ~azure.maps.search.models.LatLongPairAbbreviated + :param btm_right_point: A location represented as a latitude and longitude using short names + 'lat' & 'lon'. + :type btm_right_point: ~azure.maps.search.models.LatLongPairAbbreviated + """ + + _attribute_map = { + 'top_left_point': {'key': 'topLeftPoint', 'type': 'LatLongPairAbbreviated'}, + 'btm_right_point': {'key': 'btmRightPoint', 'type': 'LatLongPairAbbreviated'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultViewport, self).__init__(**kwargs) + self.top_left_point = kwargs.get('top_left_point', None) + self.btm_right_point = kwargs.get('btm_right_point', None) + + +class SearchSummaryGeoBias(msrest.serialization.Model): + """Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar lat: Latitude property. + :vartype lat: float + :ivar lon: Longitude property. + :vartype lon: float + """ + + _validation = { + 'lat': {'readonly': True}, + 'lon': {'readonly': True}, + } + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchSummaryGeoBias, self).__init__(**kwargs) + self.lat = None + self.lon = None diff --git a/sdk/maps/azure-maps-search/azure/maps/search/models/_models_py3.py b/sdk/maps/azure-maps-search/azure/maps/search/models/_models_py3.py new file mode 100644 index 000000000000..2bd17c8386bb --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/models/_models_py3.py @@ -0,0 +1,2357 @@ +# 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, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._search_client_enums import * + + +class BatchItem(msrest.serialization.Model): + """An item returned from Batch API. Extend with 'response' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + """ + + _validation = { + 'status_code': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchItem, self).__init__(**kwargs) + self.status_code = None + + +class BatchRequestBody(msrest.serialization.Model): + """This type represents the request body for the Batch service. + + :param batch_items: The list of queries to process. + :type batch_items: list[~azure.maps.search.models.BatchRequestBodyBatchItemsItem] + """ + + _attribute_map = { + 'batch_items': {'key': 'batchItems', 'type': '[BatchRequestBodyBatchItemsItem]'}, + } + + def __init__( + self, + *, + batch_items: Optional[List["BatchRequestBodyBatchItemsItem"]] = None, + **kwargs + ): + super(BatchRequestBody, self).__init__(**kwargs) + self.batch_items = batch_items + + +class BatchRequestBodyBatchItemsItem(msrest.serialization.Model): + """Batch Query object. + + :param query: Partial query string. + :type query: str + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__( + self, + *, + query: Optional[str] = None, + **kwargs + ): + super(BatchRequestBodyBatchItemsItem, self).__init__(**kwargs) + self.query = query + + +class BatchResponse(msrest.serialization.Model): + """This object is returned from a successful Batch service call. Extend with 'batchItems' property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + """ + + _validation = { + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponse, self).__init__(**kwargs) + self.summary = None + + +class BatchResponseSummary(msrest.serialization.Model): + """Summary for the batch request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar successful_requests: Number of successful requests in the batch. + :vartype successful_requests: int + :ivar total_requests: Total number of requests in the batch. + :vartype total_requests: int + """ + + _validation = { + 'successful_requests': {'readonly': True}, + 'total_requests': {'readonly': True}, + } + + _attribute_map = { + 'successful_requests': {'key': 'successfulRequests', 'type': 'int'}, + 'total_requests': {'key': 'totalRequests', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchResponseSummary, self).__init__(**kwargs) + self.successful_requests = None + self.total_requests = None + + +class DataSources(msrest.serialization.Model): + """Optional section. Reference ids for use with the `Get Search Polygon `_ API. + + :param geometry: Information about the geometric shape of the result. Only present if type == + Geography. + :type geometry: ~azure.maps.search.models.DataSourcesGeometry + """ + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'DataSourcesGeometry'}, + } + + def __init__( + self, + *, + geometry: Optional["DataSourcesGeometry"] = None, + **kwargs + ): + super(DataSources, self).__init__(**kwargs) + self.geometry = geometry + + +class DataSourcesGeometry(msrest.serialization.Model): + """Information about the geometric shape of the result. Only present if type == Geography. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Pass this as geometryId to the `Get Search Polygon + `_ API to fetch geometry + information for this result. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSourcesGeometry, self).__init__(**kwargs) + self.id = 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.search.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.search.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.search.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 GeoJsonFeatureData(msrest.serialization.Model): + """GeoJsonFeatureData. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.search.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + """ + + _validation = { + 'geometry': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + def __init__( + self, + *, + geometry: "GeoJsonGeometry", + properties: Optional[Any] = None, + id: Optional[str] = None, + feature_type: Optional[str] = None, + **kwargs + ): + super(GeoJsonFeatureData, self).__init__(**kwargs) + self.geometry = geometry + self.properties = properties + self.id = id + self.feature_type = feature_type + + +class GeoJsonObject(msrest.serialization.Model): + """A valid ``GeoJSON`` object. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonFeature, GeoJsonFeatureCollection, GeoJsonGeometry. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Feature': 'GeoJsonFeature', 'FeatureCollection': 'GeoJsonFeatureCollection', 'GeoJsonGeometry': 'GeoJsonGeometry'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonObject, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class GeoJsonFeature(GeoJsonObject, GeoJsonFeatureData): + """A valid ``GeoJSON Feature`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometry: Required. A valid ``GeoJSON`` geometry object. The type must be one of the + seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, + MultiPolygon and GeometryCollection. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.search.models.GeoJsonGeometry + :param properties: Properties can contain any additional metadata about the ``Feature``. Value + can be any JSON object or a JSON null value. + :type properties: any + :param id: Identifier for the feature. + :type id: str + :param feature_type: The type of the feature. The value depends on the data model the current + feature is part of. Some data models may have an empty value. + :type feature_type: str + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'geometry': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonGeometry'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'id': {'key': 'id', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + geometry: "GeoJsonGeometry", + properties: Optional[Any] = None, + id: Optional[str] = None, + feature_type: Optional[str] = None, + **kwargs + ): + super(GeoJsonFeature, self).__init__(geometry=geometry, properties=properties, id=id, feature_type=feature_type, **kwargs) + self.geometry = geometry + self.properties = properties + self.id = id + self.feature_type = feature_type + self.type = 'Feature' # type: str + self.type = 'Feature' # type: str + + +class GeoJsonFeatureCollectionData(msrest.serialization.Model): + """GeoJsonFeatureCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.search.models.GeoJsonFeature] + """ + + _validation = { + 'features': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + } + + def __init__( + self, + *, + features: List["GeoJsonFeature"], + **kwargs + ): + super(GeoJsonFeatureCollectionData, self).__init__(**kwargs) + self.features = features + + +class GeoJsonFeatureCollection(GeoJsonObject, GeoJsonFeatureCollectionData): + """A valid ``GeoJSON FeatureCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param features: Required. Contains a list of valid ``GeoJSON Feature`` objects. + :type features: list[~azure.maps.search.models.GeoJsonFeature] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'features': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'features': {'key': 'features', 'type': '[GeoJsonFeature]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + features: List["GeoJsonFeature"], + **kwargs + ): + super(GeoJsonFeatureCollection, self).__init__(features=features, **kwargs) + self.features = features + self.type = 'FeatureCollection' # type: str + self.type = 'FeatureCollection' # type: str + + +class GeoJsonGeometry(GeoJsonObject): + """A valid ``GeoJSON`` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to `RFC 7946 `_ for details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: GeoJsonGeometryCollection, GeoJsonLineString, GeoJsonMultiLineString, GeoJsonMultiPoint, GeoJsonMultiPolygon, GeoJsonPoint, GeoJsonPolygon. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'GeometryCollection': 'GeoJsonGeometryCollection', 'LineString': 'GeoJsonLineString', 'MultiLineString': 'GeoJsonMultiLineString', 'MultiPoint': 'GeoJsonMultiPoint', 'MultiPolygon': 'GeoJsonMultiPolygon', 'Point': 'GeoJsonPoint', 'Polygon': 'GeoJsonPolygon'} + } + + def __init__( + self, + **kwargs + ): + super(GeoJsonGeometry, self).__init__(**kwargs) + self.type = 'GeoJsonGeometry' # type: str + + +class GeoJsonGeometryCollectionData(msrest.serialization.Model): + """GeoJsonGeometryCollectionData. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.search.models.GeoJsonGeometry] + """ + + _validation = { + 'geometries': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + } + + def __init__( + self, + *, + geometries: List["GeoJsonGeometry"], + **kwargs + ): + super(GeoJsonGeometryCollectionData, self).__init__(**kwargs) + self.geometries = geometries + + +class GeoJsonGeometryCollection(GeoJsonGeometry, GeoJsonGeometryCollectionData): + """A valid ``GeoJSON GeometryCollection`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param geometries: Required. Contains a list of valid ``GeoJSON`` geometry objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type geometries: list[~azure.maps.search.models.GeoJsonGeometry] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'geometries': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'geometries': {'key': 'geometries', 'type': '[GeoJsonGeometry]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + geometries: List["GeoJsonGeometry"], + **kwargs + ): + super(GeoJsonGeometryCollection, self).__init__(geometries=geometries, **kwargs) + self.geometries = geometries + self.type = 'GeometryCollection' # type: str + self.type = 'GeometryCollection' # type: str + + +class GeoJsonLineStringData(msrest.serialization.Model): + """GeoJsonLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonLineStringData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonLineString(GeoJsonGeometry, GeoJsonLineStringData): + """A valid ``GeoJSON LineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson LineString`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonLineString, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'LineString' # type: str + self.type = 'LineString' # type: str + + +class GeoJsonMultiLineStringData(msrest.serialization.Model): + """GeoJsonMultiLineStringData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonMultiLineStringData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonMultiLineString(GeoJsonGeometry, GeoJsonMultiLineStringData): + """A valid ``GeoJSON MultiLineString`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiLineString`` geometry. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonMultiLineString, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'MultiLineString' # type: str + self.type = 'MultiLineString' # type: str + + +class GeoJsonMultiPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson MultiPoint``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonMultiPointData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonMultiPoint(GeoJsonGeometry, GeoJsonMultiPointData): + """A valid ``GeoJSON MultiPoint`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson MultiPoint`` geometry. + :type coordinates: list[list[float]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[float]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[float]], + **kwargs + ): + super(GeoJsonMultiPoint, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'MultiPoint' # type: str + self.type = 'MultiPoint' # type: str + + +class GeoJsonMultiPolygonData(msrest.serialization.Model): + """GeoJsonMultiPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[List[float]]]], + **kwargs + ): + super(GeoJsonMultiPolygonData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonMultiPolygon(GeoJsonGeometry, GeoJsonMultiPolygonData): + """A valid ``GeoJSON MultiPolygon`` object type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Contains a list of valid ``GeoJSON Polygon`` objects. **Note** + that coordinates in GeoJSON are in x, y order (longitude, latitude). + :type coordinates: list[list[list[list[float]]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[[float]]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[List[float]]]], + **kwargs + ): + super(GeoJsonMultiPolygon, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'MultiPolygon' # type: str + self.type = 'MultiPolygon' # type: str + + +class GeoJsonPointData(msrest.serialization.Model): + """Data contained by a ``GeoJson Point``. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + } + + def __init__( + self, + *, + coordinates: List[float], + **kwargs + ): + super(GeoJsonPointData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonPoint(GeoJsonGeometry, GeoJsonPointData): + """A valid ``GeoJSON Point`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. A ``Position`` is an array of numbers with two or more elements. + The first two elements are *longitude* and *latitude*\ , precisely in that order. + *Altitude/Elevation* is an optional third element. Please refer to `RFC 7946 + `_ for details. + :type coordinates: list[float] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[float]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[float], + **kwargs + ): + super(GeoJsonPoint, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'Point' # type: str + self.type = 'Point' # type: str + + +class GeoJsonPolygonData(msrest.serialization.Model): + """GeoJsonPolygonData. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + """ + + _validation = { + 'coordinates': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonPolygonData, self).__init__(**kwargs) + self.coordinates = coordinates + + +class GeoJsonPolygon(GeoJsonGeometry, GeoJsonPolygonData): + """A valid ``GeoJSON Polygon`` geometry type. Please refer to `RFC 7946 `_ for details. + + All required parameters must be populated in order to send to Azure. + + :param coordinates: Required. Coordinates for the ``GeoJson Polygon`` geometry type. + :type coordinates: list[list[list[float]]] + :param type: Required. Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON + object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, + GeometryCollection, Feature and FeatureCollection.Constant filled by server. Possible values + include: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", + "GeometryCollection", "Feature", "FeatureCollection". + :type type: str or ~azure.maps.search.models.GeoJsonObjectType + """ + + _validation = { + 'coordinates': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'coordinates': {'key': 'coordinates', 'type': '[[[float]]]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + coordinates: List[List[List[float]]], + **kwargs + ): + super(GeoJsonPolygon, self).__init__(coordinates=coordinates, **kwargs) + self.coordinates = coordinates + self.type = 'Polygon' # type: str + self.type = 'Polygon' # type: str + + +class LatLongPairAbbreviated(msrest.serialization.Model): + """A location represented as a latitude and longitude using short names 'lat' & 'lon'. + + :param lat: Latitude property. + :type lat: float + :param lon: Longitude property. + :type lon: float + """ + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + *, + lat: Optional[float] = None, + lon: Optional[float] = None, + **kwargs + ): + super(LatLongPairAbbreviated, self).__init__(**kwargs) + self.lat = lat + self.lon = lon + + +class PoiCategoryResult(msrest.serialization.Model): + """POI category result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Unique ID for the category. ID can be used to restrict search results to specific + categories through other Search Service APIs, like `Get Search POI + `_. + :vartype id: int + :ivar name: Name of the category. + :vartype name: str + :ivar child_category_ids: Array of child category ids. + :vartype child_category_ids: list[int] + :ivar synonyms: Array of alternative names of the category. + :vartype synonyms: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'child_category_ids': {'readonly': True}, + 'synonyms': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'child_category_ids': {'key': 'childCategoryIds', 'type': '[int]'}, + 'synonyms': {'key': 'synonyms', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PoiCategoryResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.child_category_ids = None + self.synonyms = None + + +class SearchAddressBatchItem(BatchItem): + """An item returned from Search Address Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. SearchCommonResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.search.models.SearchAddressBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'SearchAddressBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressBatchItem, self).__init__(**kwargs) + self.response = None + + +class SearchCommonResponse(msrest.serialization.Model): + """This object is returned from a successful Search calls. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search API response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar results: A list of Search API results. + :vartype results: list[~azure.maps.search.models.SearchCommonResult] + """ + + _validation = { + 'summary': {'readonly': True}, + 'results': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'results': {'key': 'results', 'type': '[SearchCommonResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchCommonResponse, self).__init__(**kwargs) + self.summary = None + self.results = None + + +class SearchAddressBatchItemResponse(ErrorResponse, SearchCommonResponse): + """The result of the query. SearchCommonResponse if the query completed successfully, ErrorResponse otherwise. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search API response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar results: A list of Search API results. + :vartype results: list[~azure.maps.search.models.SearchCommonResult] + :param error: The error object. + :type error: ~azure.maps.search.models.ErrorDetail + """ + + _validation = { + 'summary': {'readonly': True}, + 'results': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'results': {'key': 'results', 'type': '[SearchCommonResult]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(SearchAddressBatchItemResponse, self).__init__(error=error, **kwargs) + self.summary = None + self.results = None + self.error = error + + +class SearchAddressBatchResponse(BatchResponse): + """This object is returned from a successful Search Address Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.search.models.SearchAddressBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[SearchAddressBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class SearchAddressReverseBatchItem(BatchItem): + """An item returned from Search Address Reverse Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. SearchAddressReverseResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.search.models.SearchAddressReverseBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'SearchAddressReverseBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseBatchItem, self).__init__(**kwargs) + self.response = None + + +class SearchAddressReverseResponse(msrest.serialization.Model): + """This object is returned from a successful Search Address Reverse call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search Address Reverse response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar addresses: Addresses array. + :vartype addresses: list[~azure.maps.search.models.SearchAddressReverseResult] + """ + + _validation = { + 'summary': {'readonly': True}, + 'addresses': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'addresses': {'key': 'addresses', 'type': '[SearchAddressReverseResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseResponse, self).__init__(**kwargs) + self.summary = None + self.addresses = None + + +class SearchAddressReverseBatchItemResponse(ErrorResponse, SearchAddressReverseResponse): + """The result of the query. SearchAddressReverseResponse if the query completed successfully, ErrorResponse otherwise. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search Address Reverse response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar addresses: Addresses array. + :vartype addresses: list[~azure.maps.search.models.SearchAddressReverseResult] + :param error: The error object. + :type error: ~azure.maps.search.models.ErrorDetail + """ + + _validation = { + 'summary': {'readonly': True}, + 'addresses': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'addresses': {'key': 'addresses', 'type': '[SearchAddressReverseResult]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(SearchAddressReverseBatchItemResponse, self).__init__(error=error, **kwargs) + self.summary = None + self.addresses = None + self.error = error + + +class SearchAddressReverseBatchResponse(BatchResponse): + """This object is returned from a successful Search Address Reverse Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.search.models.SearchAddressReverseBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[SearchAddressReverseBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class SearchAddressReverseCrossStreetResponse(msrest.serialization.Model): + """This object is returned from a successful Search Address Reverse CrossStreet call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search Address Reverse Cross Street response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar addresses: Addresses array. + :vartype addresses: list[~azure.maps.search.models.SearchAddressReverseCrossStreetResult] + """ + + _validation = { + 'summary': {'readonly': True}, + 'addresses': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'addresses': {'key': 'addresses', 'type': '[SearchAddressReverseCrossStreetResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseCrossStreetResponse, self).__init__(**kwargs) + self.summary = None + self.addresses = None + + +class SearchAddressReverseCrossStreetResult(msrest.serialization.Model): + """Result object for a Search Address Reverse Cross Street response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar address: The address of the result. + :vartype address: ~azure.maps.search.models.SearchResultAddress + :ivar position: Position property in the form of "{latitude},{longitude}". + :vartype position: str + """ + + _validation = { + 'address': {'readonly': True}, + 'position': {'readonly': True}, + } + + _attribute_map = { + 'address': {'key': 'address', 'type': 'SearchResultAddress'}, + 'position': {'key': 'position', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseCrossStreetResult, self).__init__(**kwargs) + self.address = None + self.position = None + + +class SearchAddressReverseResult(msrest.serialization.Model): + """Result object for a Search Address Reverse response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar address: The address of the result. + :vartype address: ~azure.maps.search.models.SearchResultAddress + :ivar position: Position property in the form of "{latitude},{longitude}". + :vartype position: str + :ivar match_type: Information on the type of match. + + One of: + + + * AddressPoint + * HouseNumberRange + * Street. + :vartype match_type: str + """ + + _validation = { + 'address': {'readonly': True}, + 'position': {'readonly': True}, + 'match_type': {'readonly': True}, + } + + _attribute_map = { + 'address': {'key': 'address', 'type': 'SearchResultAddress'}, + 'position': {'key': 'position', 'type': 'str'}, + 'match_type': {'key': 'matchType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchAddressReverseResult, self).__init__(**kwargs) + self.address = None + self.position = None + self.match_type = None + + +class SearchAlongRouteRequestBody(msrest.serialization.Model): + """This type represents the request body for the Search Along Route service. + + :param route: A valid ``GeoJSON LineString`` geometry type. Please refer to `RFC 7946 + `_ for details. + :type route: ~azure.maps.search.models.GeoJsonLineString + """ + + _attribute_map = { + 'route': {'key': 'route', 'type': 'GeoJsonLineString'}, + } + + def __init__( + self, + *, + route: Optional["GeoJsonLineString"] = None, + **kwargs + ): + super(SearchAlongRouteRequestBody, self).__init__(**kwargs) + self.route = route + + +class SearchCommonResult(msrest.serialization.Model): + """Result object for a Search API response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: One of: + + + * POI + * Street + * Geography + * Point Address + * Address Range + * Cross Street. + :vartype type: str + :ivar id: Id property. + :vartype id: str + :ivar score: The value within a result set to indicate the relative matching score between + results. You can use this to determine that result x is twice as likely to be as relevant as + result y if the value of x is 2x the value of y. The values vary between queries and is only + meant as a relative value for one result set. + :vartype score: float + :ivar dist: Straight line distance between the result and geobias location in meters. + :vartype dist: float + :ivar info: Info property. + :vartype info: str + :param entity_type: Possible values include: "Country", "CountrySubdivision", + "CountrySecondarySubdivision", "CountryTertiarySubdivision", "Municipality", + "MunicipalitySubdivision", "Neighbourhood", "PostalCodeArea". + :type entity_type: str or ~azure.maps.search.models.EntityType + :ivar poi: Details of the returned POI including information such as the name, phone, url + address, and classifications. + :vartype poi: ~azure.maps.search.models.SearchResultPoi + :ivar address: The address of the result. + :vartype address: ~azure.maps.search.models.SearchResultAddress + :param position: A location represented as a latitude and longitude using short names 'lat' & + 'lon'. + :type position: ~azure.maps.search.models.LatLongPairAbbreviated + :ivar viewport: The viewport that covers the result represented by the top-left and + bottom-right coordinates of the viewport. + :vartype viewport: ~azure.maps.search.models.SearchResultViewport + :ivar entry_points: Entry Points array. + :vartype entry_points: list[~azure.maps.search.models.SearchResultEntryPoint] + :ivar address_ranges: Describes the address range on both sides of the street for a search + result. Coordinates for the start and end locations of the address range are included. + :vartype address_ranges: ~azure.maps.search.models.SearchResultAddressRanges + :ivar data_sources: Optional section. Reference ids for use with the `Get Search Polygon + `_ API. + :vartype data_sources: ~azure.maps.search.models.DataSources + :ivar match_type: Information on the type of match. + + One of: + + + * AddressPoint + * HouseNumberRange + * Street. + :vartype match_type: str + :ivar detour_time: Detour time in seconds. + :vartype detour_time: float + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'score': {'readonly': True}, + 'dist': {'readonly': True}, + 'info': {'readonly': True}, + 'poi': {'readonly': True}, + 'address': {'readonly': True}, + 'viewport': {'readonly': True}, + 'entry_points': {'readonly': True}, + 'address_ranges': {'readonly': True}, + 'data_sources': {'readonly': True}, + 'match_type': {'readonly': True}, + 'detour_time': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'dist': {'key': 'dist', 'type': 'float'}, + 'info': {'key': 'info', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'poi': {'key': 'poi', 'type': 'SearchResultPoi'}, + 'address': {'key': 'address', 'type': 'SearchResultAddress'}, + 'position': {'key': 'position', 'type': 'LatLongPairAbbreviated'}, + 'viewport': {'key': 'viewport', 'type': 'SearchResultViewport'}, + 'entry_points': {'key': 'entryPoints', 'type': '[SearchResultEntryPoint]'}, + 'address_ranges': {'key': 'addressRanges', 'type': 'SearchResultAddressRanges'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSources'}, + 'match_type': {'key': 'matchType', 'type': 'str'}, + 'detour_time': {'key': 'detourTime', 'type': 'float'}, + } + + def __init__( + self, + *, + entity_type: Optional[Union[str, "EntityType"]] = None, + position: Optional["LatLongPairAbbreviated"] = None, + **kwargs + ): + super(SearchCommonResult, self).__init__(**kwargs) + self.type = None + self.id = None + self.score = None + self.dist = None + self.info = None + self.entity_type = entity_type + self.poi = None + self.address = None + self.position = position + self.viewport = None + self.entry_points = None + self.address_ranges = None + self.data_sources = None + self.match_type = None + self.detour_time = None + + +class SearchCommonSummary(msrest.serialization.Model): + """Summary object for a Search API response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar query: Query property. + :vartype query: str + :ivar query_type: QueryType property. + :vartype query_type: str + :ivar query_time: QueryTime property. + :vartype query_time: int + :ivar num_results: NumResults property. + :vartype num_results: int + :ivar limit: Maximum number of responses that will be returned. + :vartype limit: int + :ivar offset: Offset property. + :vartype offset: int + :ivar total_results: TotalResults property. + :vartype total_results: int + :ivar fuzzy_level: FuzzyLevel property. + :vartype fuzzy_level: int + :ivar geo_bias: Indication when the internal search engine has applied a geospatial bias to + improve the ranking of results. In some methods, this can be affected by setting the lat and + lon parameters where available. In other cases it is purely internal. + :vartype geo_bias: ~azure.maps.search.models.SearchCommonSummaryGeoBias + """ + + _validation = { + 'query': {'readonly': True}, + 'query_type': {'readonly': True}, + 'query_time': {'readonly': True}, + 'num_results': {'readonly': True}, + 'limit': {'readonly': True}, + 'offset': {'readonly': True}, + 'total_results': {'readonly': True}, + 'fuzzy_level': {'readonly': True}, + 'geo_bias': {'readonly': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'query_type': {'key': 'queryType', 'type': 'str'}, + 'query_time': {'key': 'queryTime', 'type': 'int'}, + 'num_results': {'key': 'numResults', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'total_results': {'key': 'totalResults', 'type': 'int'}, + 'fuzzy_level': {'key': 'fuzzyLevel', 'type': 'int'}, + 'geo_bias': {'key': 'geoBias', 'type': 'SearchCommonSummaryGeoBias'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchCommonSummary, self).__init__(**kwargs) + self.query = None + self.query_type = None + self.query_time = None + self.num_results = None + self.limit = None + self.offset = None + self.total_results = None + self.fuzzy_level = None + self.geo_bias = None + + +class SearchCommonSummaryGeoBias(LatLongPairAbbreviated): + """Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal. + + :param lat: Latitude property. + :type lat: float + :param lon: Longitude property. + :type lon: float + """ + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + *, + lat: Optional[float] = None, + lon: Optional[float] = None, + **kwargs + ): + super(SearchCommonSummaryGeoBias, self).__init__(lat=lat, lon=lon, **kwargs) + + +class SearchFuzzyBatchItem(BatchItem): + """An item returned from Search Fuzzy Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status_code: HTTP request status code. + :vartype status_code: float + :ivar response: The result of the query. SearchCommonResponse if the query completed + successfully, ErrorResponse otherwise. + :vartype response: ~azure.maps.search.models.SearchFuzzyBatchItemResponse + """ + + _validation = { + 'status_code': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'float'}, + 'response': {'key': 'response', 'type': 'SearchFuzzyBatchItemResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchFuzzyBatchItem, self).__init__(**kwargs) + self.response = None + + +class SearchFuzzyBatchItemResponse(ErrorResponse, SearchCommonResponse): + """The result of the query. SearchCommonResponse if the query completed successfully, ErrorResponse otherwise. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary object for a Search API response. + :vartype summary: ~azure.maps.search.models.SearchCommonSummary + :ivar results: A list of Search API results. + :vartype results: list[~azure.maps.search.models.SearchCommonResult] + :param error: The error object. + :type error: ~azure.maps.search.models.ErrorDetail + """ + + _validation = { + 'summary': {'readonly': True}, + 'results': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'SearchCommonSummary'}, + 'results': {'key': 'results', 'type': '[SearchCommonResult]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(SearchFuzzyBatchItemResponse, self).__init__(error=error, **kwargs) + self.summary = None + self.results = None + self.error = error + + +class SearchFuzzyBatchResponse(BatchResponse): + """This object is returned from a successful Search Fuzzy Batch service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the batch request. + :vartype summary: ~azure.maps.search.models.BatchResponseSummary + :ivar batch_items: Array containing the batch results. + :vartype batch_items: list[~azure.maps.search.models.SearchFuzzyBatchItem] + """ + + _validation = { + 'summary': {'readonly': True}, + 'batch_items': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'BatchResponseSummary'}, + 'batch_items': {'key': 'batchItems', 'type': '[SearchFuzzyBatchItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchFuzzyBatchResponse, self).__init__(**kwargs) + self.batch_items = None + + +class SearchInsideGeometryRequestBody(msrest.serialization.Model): + """This type represents the request body for the Search Inside Geometry service. + + :param geometry: A valid ``GeoJSON`` object. Please refer to `RFC 7946 + `_ for details. + :type geometry: ~azure.maps.search.models.GeoJsonObject + """ + + _attribute_map = { + 'geometry': {'key': 'geometry', 'type': 'GeoJsonObject'}, + } + + def __init__( + self, + *, + geometry: Optional["GeoJsonObject"] = None, + **kwargs + ): + super(SearchInsideGeometryRequestBody, self).__init__(**kwargs) + self.geometry = geometry + + +class SearchPoiCategoryTreeResponse(msrest.serialization.Model): + """This object is returned from a successful POI Category Tree call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar poi_categories: Categories array. + :vartype poi_categories: list[~azure.maps.search.models.PoiCategoryResult] + """ + + _validation = { + 'poi_categories': {'readonly': True}, + } + + _attribute_map = { + 'poi_categories': {'key': 'poiCategories', 'type': '[PoiCategoryResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchPoiCategoryTreeResponse, self).__init__(**kwargs) + self.poi_categories = None + + +class SearchPolygonResponse(msrest.serialization.Model): + """This object is returned from a successful Search Polygon call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar additional_data: Results array. + :vartype additional_data: list[~azure.maps.search.models.SearchPolygonResult] + """ + + _validation = { + 'additional_data': {'readonly': True}, + } + + _attribute_map = { + 'additional_data': {'key': 'additionalData', 'type': '[SearchPolygonResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchPolygonResponse, self).__init__(**kwargs) + self.additional_data = None + + +class SearchPolygonResult(msrest.serialization.Model): + """SearchPolygonResult. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider_id: ID of the returned entity. + :vartype provider_id: str + :ivar error: Reason for the failure to obtain data for this provider. + :vartype error: str + :param geometry_data: Geometry data in GeoJSON format. Please refer to `RFC 7946 + `_ for details. Present only if "error" is not present. + :type geometry_data: ~azure.maps.search.models.GeoJsonObject + """ + + _validation = { + 'provider_id': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'provider_id': {'key': 'providerID', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'geometry_data': {'key': 'geometryData', 'type': 'GeoJsonObject'}, + } + + def __init__( + self, + *, + geometry_data: Optional["GeoJsonObject"] = None, + **kwargs + ): + super(SearchPolygonResult, self).__init__(**kwargs) + self.provider_id = None + self.error = None + self.geometry_data = geometry_data + + +class SearchResultAddress(msrest.serialization.Model): + """The address of the result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar building_number: Building Number property. + :vartype building_number: str + :ivar street: Street property. + :vartype street: str + :ivar cross_street: Cross Street property. + :vartype cross_street: str + :ivar street_number: Street Number property. + :vartype street_number: str + :ivar route_numbers: number of routes. + :vartype route_numbers: list[int] + :ivar street_name: Street Name property. + :vartype street_name: str + :ivar street_name_and_number: Street Name and Number property. + :vartype street_name_and_number: str + :ivar municipality: Municipality property. + :vartype municipality: str + :ivar municipality_subdivision: Municipality Subdivision property. + :vartype municipality_subdivision: str + :ivar country_tertiary_subdivision: Country Tertiary Subdivision property. + :vartype country_tertiary_subdivision: str + :ivar country_secondary_subdivision: Country Secondary Subdivision property. + :vartype country_secondary_subdivision: str + :ivar country_subdivision: Country Subdivision property. + :vartype country_subdivision: str + :ivar postal_code: Postal Code property. + :vartype postal_code: str + :ivar extended_postal_code: Extended Postal Code property. + :vartype extended_postal_code: str + :ivar country_code: Country Code property. + :vartype country_code: str + :ivar country: Country property. + :vartype country: str + :ivar country_code_iso3: Country Code ISO3 property. + :vartype country_code_iso3: str + :ivar freeform_address: Free form Address property. + :vartype freeform_address: str + :ivar country_subdivision_name: Country Subdivision Name property. + :vartype country_subdivision_name: str + :ivar local_name: An address component which represents the name of a geographic area or + locality that groups a number of addressable objects for addressing purposes, without being an + administrative unit. This field is used to build the ``freeformAddress`` property. + :vartype local_name: str + :ivar bounding_box: Bounding box coordinates. + :vartype bounding_box: any + """ + + _validation = { + 'building_number': {'readonly': True}, + 'street': {'readonly': True}, + 'cross_street': {'readonly': True}, + 'street_number': {'readonly': True}, + 'route_numbers': {'readonly': True}, + 'street_name': {'readonly': True}, + 'street_name_and_number': {'readonly': True}, + 'municipality': {'readonly': True}, + 'municipality_subdivision': {'readonly': True}, + 'country_tertiary_subdivision': {'readonly': True}, + 'country_secondary_subdivision': {'readonly': True}, + 'country_subdivision': {'readonly': True}, + 'postal_code': {'readonly': True}, + 'extended_postal_code': {'readonly': True}, + 'country_code': {'readonly': True}, + 'country': {'readonly': True}, + 'country_code_iso3': {'readonly': True}, + 'freeform_address': {'readonly': True}, + 'country_subdivision_name': {'readonly': True}, + 'local_name': {'readonly': True}, + 'bounding_box': {'readonly': True}, + } + + _attribute_map = { + 'building_number': {'key': 'buildingNumber', 'type': 'str'}, + 'street': {'key': 'street', 'type': 'str'}, + 'cross_street': {'key': 'crossStreet', 'type': 'str'}, + 'street_number': {'key': 'streetNumber', 'type': 'str'}, + 'route_numbers': {'key': 'routeNumbers', 'type': '[int]'}, + 'street_name': {'key': 'streetName', 'type': 'str'}, + 'street_name_and_number': {'key': 'streetNameAndNumber', 'type': 'str'}, + 'municipality': {'key': 'municipality', 'type': 'str'}, + 'municipality_subdivision': {'key': 'municipalitySubdivision', 'type': 'str'}, + 'country_tertiary_subdivision': {'key': 'countryTertiarySubdivision', 'type': 'str'}, + 'country_secondary_subdivision': {'key': 'countrySecondarySubdivision', 'type': 'str'}, + 'country_subdivision': {'key': 'countrySubdivision', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'extended_postal_code': {'key': 'extendedPostalCode', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'country_code_iso3': {'key': 'countryCodeISO3', 'type': 'str'}, + 'freeform_address': {'key': 'freeformAddress', 'type': 'str'}, + 'country_subdivision_name': {'key': 'countrySubdivisionName', 'type': 'str'}, + 'local_name': {'key': 'localName', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultAddress, self).__init__(**kwargs) + self.building_number = None + self.street = None + self.cross_street = None + self.street_number = None + self.route_numbers = None + self.street_name = None + self.street_name_and_number = None + self.municipality = None + self.municipality_subdivision = None + self.country_tertiary_subdivision = None + self.country_secondary_subdivision = None + self.country_subdivision = None + self.postal_code = None + self.extended_postal_code = None + self.country_code = None + self.country = None + self.country_code_iso3 = None + self.freeform_address = None + self.country_subdivision_name = None + self.local_name = None + self.bounding_box = None + + +class SearchResultAddressRanges(msrest.serialization.Model): + """Describes the address range on both sides of the street for a search result. Coordinates for the start and end locations of the address range are included. + + :param range_left: Address range on the left side of the street. + :type range_left: str + :param range_right: Address range on the right side of the street. + :type range_right: str + :param from_property: A location represented as a latitude and longitude using short names + 'lat' & 'lon'. + :type from_property: ~azure.maps.search.models.LatLongPairAbbreviated + :param to: A location represented as a latitude and longitude using short names 'lat' & 'lon'. + :type to: ~azure.maps.search.models.LatLongPairAbbreviated + """ + + _attribute_map = { + 'range_left': {'key': 'rangeLeft', 'type': 'str'}, + 'range_right': {'key': 'rangeRight', 'type': 'str'}, + 'from_property': {'key': 'from', 'type': 'LatLongPairAbbreviated'}, + 'to': {'key': 'to', 'type': 'LatLongPairAbbreviated'}, + } + + def __init__( + self, + *, + range_left: Optional[str] = None, + range_right: Optional[str] = None, + from_property: Optional["LatLongPairAbbreviated"] = None, + to: Optional["LatLongPairAbbreviated"] = None, + **kwargs + ): + super(SearchResultAddressRanges, self).__init__(**kwargs) + self.range_left = range_left + self.range_right = range_right + self.from_property = from_property + self.to = to + + +class SearchResultEntryPoint(msrest.serialization.Model): + """The entry point for the POI being returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of entry point. Value can be either *main* or *minor*. Possible values + include: "main", "minor". + :vartype type: str or ~azure.maps.search.models.EntryPointType + :param position: A location represented as a latitude and longitude using short names 'lat' & + 'lon'. + :type position: ~azure.maps.search.models.LatLongPairAbbreviated + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'position': {'key': 'position', 'type': 'LatLongPairAbbreviated'}, + } + + def __init__( + self, + *, + position: Optional["LatLongPairAbbreviated"] = None, + **kwargs + ): + super(SearchResultEntryPoint, self).__init__(**kwargs) + self.type = None + self.position = position + + +class SearchResultPoi(msrest.serialization.Model): + """Details of the returned POI including information such as the name, phone, url address, and classifications. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the POI property. + :vartype name: str + :ivar phone: Telephone number property. + :vartype phone: str + :ivar url: Website URL property. + :vartype url: str + :ivar category_set: The list of the most specific POI categories. + :vartype category_set: list[~azure.maps.search.models.SearchResultPoiCategorySet] + :ivar categories: **[Deprecated]** Use classifications instead. Categories array. + :vartype categories: list[str] + :ivar classifications: Classification array. + :vartype classifications: list[~azure.maps.search.models.SearchResultPoiClassification] + :ivar brands: Brands array. The name of the brand for the POI being returned. + :vartype brands: list[~azure.maps.search.models.SearchResultPoiBrand] + :param opening_hours: Opening hours for a POI (Points of Interest). + :type opening_hours: ~azure.maps.search.models.SearchResultPoiOpeningHours + """ + + _validation = { + 'name': {'readonly': True}, + 'phone': {'readonly': True}, + 'url': {'readonly': True}, + 'category_set': {'readonly': True}, + 'categories': {'readonly': True}, + 'classifications': {'readonly': True}, + 'brands': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'category_set': {'key': 'categorySet', 'type': '[SearchResultPoiCategorySet]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'classifications': {'key': 'classifications', 'type': '[SearchResultPoiClassification]'}, + 'brands': {'key': 'brands', 'type': '[SearchResultPoiBrand]'}, + 'opening_hours': {'key': 'openingHours', 'type': 'SearchResultPoiOpeningHours'}, + } + + def __init__( + self, + *, + opening_hours: Optional["SearchResultPoiOpeningHours"] = None, + **kwargs + ): + super(SearchResultPoi, self).__init__(**kwargs) + self.name = None + self.phone = None + self.url = None + self.category_set = None + self.categories = None + self.classifications = None + self.brands = None + self.opening_hours = opening_hours + + +class SearchResultPoiBrand(msrest.serialization.Model): + """The name of the brand for the POI being returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the brand. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiBrand, self).__init__(**kwargs) + self.name = None + + +class SearchResultPoiCategorySet(msrest.serialization.Model): + """POI category. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Category ID. + :vartype id: int + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiCategorySet, self).__init__(**kwargs) + self.id = None + + +class SearchResultPoiClassification(msrest.serialization.Model): + """The classification for the POI being returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Code property. + :vartype code: str + :ivar names: Names array. + :vartype names: list[~azure.maps.search.models.SearchResultPoiClassificationName] + """ + + _validation = { + 'code': {'readonly': True}, + 'names': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'names': {'key': 'names', 'type': '[SearchResultPoiClassificationName]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiClassification, self).__init__(**kwargs) + self.code = None + self.names = None + + +class SearchResultPoiClassificationName(msrest.serialization.Model): + """Name for the classification. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_locale: Name Locale property. + :vartype name_locale: str + :ivar name: Name property. + :vartype name: str + """ + + _validation = { + 'name_locale': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name_locale': {'key': 'nameLocale', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiClassificationName, self).__init__(**kwargs) + self.name_locale = None + self.name = None + + +class SearchResultPoiOpeningHours(msrest.serialization.Model): + """Opening hours for a POI (Points of Interest). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mode: Value used in the Request. + :vartype mode: str + :ivar time_ranges: List of time ranges for the next 7 days. + :vartype time_ranges: list[~azure.maps.search.models.SearchResultPoiOpeningHoursTimeRange] + """ + + _validation = { + 'mode': {'readonly': True}, + 'time_ranges': {'readonly': True}, + } + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[SearchResultPoiOpeningHoursTimeRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiOpeningHours, self).__init__(**kwargs) + self.mode = None + self.time_ranges = None + + +class SearchResultPoiOpeningHoursTimeRange(msrest.serialization.Model): + """Open time range for a day. + + :param start_time: The point in the next 7 days range when a given POI is being opened, or the + beginning of the range if it was opened before the range. + :type start_time: ~azure.maps.search.models.SearchResultPoiOpeningHoursTimeRangeTime + :param end_time: The point in the next 7 days range when a given POI is being closed, or the + beginning of the range if it was closed before the range. + :type end_time: ~azure.maps.search.models.SearchResultPoiOpeningHoursTimeRangeTime + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'SearchResultPoiOpeningHoursTimeRangeTime'}, + 'end_time': {'key': 'endTime', 'type': 'SearchResultPoiOpeningHoursTimeRangeTime'}, + } + + def __init__( + self, + *, + start_time: Optional["SearchResultPoiOpeningHoursTimeRangeTime"] = None, + end_time: Optional["SearchResultPoiOpeningHoursTimeRangeTime"] = None, + **kwargs + ): + super(SearchResultPoiOpeningHoursTimeRange, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + + +class SearchResultPoiOpeningHoursTimeRangeTime(msrest.serialization.Model): + """Represents a date and time. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar date: Represents current day in calendar year in POI time zone. + :vartype date: str + :ivar hour: Hours are in the 24 hour format in the local time of a POI; possible values are 0 - + 23. + :vartype hour: int + :ivar minute: Minutes are in the local time of a POI; possible values are 0 - 59. + :vartype minute: int + """ + + _validation = { + 'date': {'readonly': True}, + 'hour': {'readonly': True}, + 'minute': {'readonly': True}, + } + + _attribute_map = { + 'date': {'key': 'date', 'type': 'str'}, + 'hour': {'key': 'hour', 'type': 'int'}, + 'minute': {'key': 'minute', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchResultPoiOpeningHoursTimeRangeTime, self).__init__(**kwargs) + self.date = None + self.hour = None + self.minute = None + + +class SearchResultViewport(msrest.serialization.Model): + """The viewport that covers the result represented by the top-left and bottom-right coordinates of the viewport. + + :param top_left_point: A location represented as a latitude and longitude using short names + 'lat' & 'lon'. + :type top_left_point: ~azure.maps.search.models.LatLongPairAbbreviated + :param btm_right_point: A location represented as a latitude and longitude using short names + 'lat' & 'lon'. + :type btm_right_point: ~azure.maps.search.models.LatLongPairAbbreviated + """ + + _attribute_map = { + 'top_left_point': {'key': 'topLeftPoint', 'type': 'LatLongPairAbbreviated'}, + 'btm_right_point': {'key': 'btmRightPoint', 'type': 'LatLongPairAbbreviated'}, + } + + def __init__( + self, + *, + top_left_point: Optional["LatLongPairAbbreviated"] = None, + btm_right_point: Optional["LatLongPairAbbreviated"] = None, + **kwargs + ): + super(SearchResultViewport, self).__init__(**kwargs) + self.top_left_point = top_left_point + self.btm_right_point = btm_right_point + + +class SearchSummaryGeoBias(msrest.serialization.Model): + """Indication when the internal search engine has applied a geospatial bias to improve the ranking of results. In some methods, this can be affected by setting the lat and lon parameters where available. In other cases it is purely internal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar lat: Latitude property. + :vartype lat: float + :ivar lon: Longitude property. + :vartype lon: float + """ + + _validation = { + 'lat': {'readonly': True}, + 'lon': {'readonly': True}, + } + + _attribute_map = { + 'lat': {'key': 'lat', 'type': 'float'}, + 'lon': {'key': 'lon', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(SearchSummaryGeoBias, self).__init__(**kwargs) + self.lat = None + self.lon = None diff --git a/sdk/maps/azure-maps-search/azure/maps/search/models/_search_client_enums.py b/sdk/maps/azure-maps-search/azure/maps/search/models/_search_client_enums.py new file mode 100644 index 000000000000..d5e4d5cfe24c --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/models/_search_client_enums.py @@ -0,0 +1,197 @@ +# 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 ConnectorSet(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: These are the standard household connectors for a certain region. They are all AC single phase + #: and the standard Voltage and standard Amperage. + #: + #: See also: `Plug & socket types - World Standards + #: `_. + STANDARD_HOUSEHOLD_COUNTRY_SPECIFIC = "StandardHouseholdCountrySpecific" + #: Type 1 connector as defined in the IEC 62196-2 standard. Also called Yazaki after the original + #: manufacturer or SAE J1772 after the standard that first published it. Mostly used in + #: combination with 120V single phase or up to 240V single phase infrastructure. + IEC62196_TYPE1 = "IEC62196Type1" + #: Type 1 based combo connector as defined in the IEC 62196-3 standard. The connector is based on + #: the Type 1 connector – as defined in the IEC 62196-2 standard – with two additional direct + #: current (DC) contacts to allow DC fast charging. + IEC62196_TYPE1_CCS = "IEC62196Type1CCS" + #: Type 2 connector as defined in the IEC 62196-2 standard. Provided as a cable and plug attached + #: to the charging point. + IEC62196_TYPE2_CABLE_ATTACHED = "IEC62196Type2CableAttached" + #: Type 2 connector as defined in the IEC 62196-2 standard. Provided as a socket set into the + #: charging point. + IEC62196_TYPE2_OUTLET = "IEC62196Type2Outlet" + #: Type 2 based combo connector as defined in the IEC 62196-3 standard. The connector is based on + #: the Type 2 connector – as defined in the IEC 62196-2 standard – with two additional direct + #: current (DC) contacts to allow DC fast charging. + IEC62196_TYPE2_CCS = "IEC62196Type2CCS" + #: Type 3 connector as defined in the IEC 62196-2 standard. Also called Scame after the original + #: manufacturer. Mostly used in combination with up to 240V single phase or up to 420V three phase + #: infrastructure. + IEC62196_TYPE3 = "IEC62196Type3" + #: CHAdeMO connector named after an association formed by the Tokyo Electric Power Company and + #: industrial partners. Because of this is is also known as the TEPCO's connector. It supports + #: fast DC charging. + CHADEMO = "Chademo" + #: Industrial Blue connector is a connector defined in the IEC 60309 standard. It is sometime + #: referred to as by some combination of the standard, the color and the fact that is a single + #: phase connector. The connector usually has the "P+N+E, 6h" configuration. + IEC60309_AC1_PHASE_BLUE = "IEC60309AC1PhaseBlue" + #: Industrial White connector is a DC connector defined in the IEC 60309 standard. + IEC60309_DC_WHITE = "IEC60309DCWhite" + #: The Tesla connector is the regionally specific Tesla Supercharger connector. I.e. it refers to + #: either Tesla's proprietary connector, sometimes referred to as Tesla Port mostly limited to + #: North America or the modified Type 2 (DC over Type 2) in Europe. + TESLA = "Tesla" + +class EntityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Country name. + COUNTRY = "Country" + #: State or Province. + COUNTRY_SUBDIVISION = "CountrySubdivision" + #: County. + COUNTRY_SECONDARY_SUBDIVISION = "CountrySecondarySubdivision" + #: Named Area. + COUNTRY_TERTIARY_SUBDIVISION = "CountryTertiarySubdivision" + #: City / Town. + MUNICIPALITY = "Municipality" + #: Sub / Super City. + MUNICIPALITY_SUBDIVISION = "MunicipalitySubdivision" + #: Neighbourhood. + NEIGHBOURHOOD = "Neighbourhood" + #: Postal Code / Zip Code. + POSTAL_CODE_AREA = "PostalCodeArea" + +class EntryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of entry point. Value can be either *main* or *minor*. + """ + + MAIN = "main" + MINOR = "minor" + +class GeoJsonObjectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the ``GeoJSON`` type. Must be one of the nine valid GeoJSON object types - Point, + MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and + FeatureCollection. + """ + + #: ``GeoJSON Point`` geometry. + GEO_JSON_POINT = "Point" + #: ``GeoJSON MultiPoint`` geometry. + GEO_JSON_MULTI_POINT = "MultiPoint" + #: ``GeoJSON LineString`` geometry. + GEO_JSON_LINE_STRING = "LineString" + #: ``GeoJSON MultiLineString`` geometry. + GEO_JSON_MULTI_LINE_STRING = "MultiLineString" + #: ``GeoJSON Polygon`` geometry. + GEO_JSON_POLYGON = "Polygon" + #: ``GeoJSON MultiPolygon`` geometry. + GEO_JSON_MULTI_POLYGON = "MultiPolygon" + #: ``GeoJSON GeometryCollection`` geometry. + GEO_JSON_GEOMETRY_COLLECTION = "GeometryCollection" + #: ``GeoJSON Feature`` object. + GEO_JSON_FEATURE = "Feature" + #: ``GeoJSON FeatureCollection`` object. + GEO_JSON_FEATURE_COLLECTION = "FeatureCollection" + +class JsonFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + +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 OpeningHours(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Shows the hours of operation for the next week, starting with the current day in the local time + #: of the POI. + NEXT_SEVEN_DAYS = "nextSevenDays" + +class ResponseFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + #: `The Extensible Markup Language `_. + XML = "xml" + +class SearchIndexSet(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Address range interpolation. + ADDR = "Addr" + #: Geographies. + GEO = "Geo" + #: Point Addresses. + PAD = "PAD" + #: Points of interest. + POI = "POI" + #: Streets. + STR = "Str" + #: Cross Streets (Intersections). + XSTR = "Xstr" diff --git a/sdk/maps/azure-maps-search/azure/maps/search/operations/__init__.py b/sdk/maps/azure-maps-search/azure/maps/search/operations/__init__.py new file mode 100644 index 000000000000..4389fba0b784 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/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 ._search_client_operations import SearchClientOperationsMixin + +__all__ = [ + 'SearchClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-search/azure/maps/search/operations/_search_client_operations.py b/sdk/maps/azure-maps-search/azure/maps/search/operations/_search_client_operations.py new file mode 100644 index 000000000000..62e509a7e2ac --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/operations/_search_client_operations.py @@ -0,0 +1,5256 @@ +# 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 +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 azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SearchClientOperationsMixin(object): + + def get_search_polygon( + self, + geometries, # type: List[str] + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchPolygonResponse" + """**Get Polygon** + + **Applies to**\ : S1 pricing tier. + + The Get Polygon service allows you to request the geometry data such as a city or country + outline for a set of entities, previously retrieved from an Online Search request in GeoJSON + format. The geometry ID is returned in the dataSources object under "geometry" and "id" in + either a Search Address or Search Fuzzy call. + + Please note that any geometry ID retrieved from an Online Search endpoint has a limited + lifetime. The client should not store geometry IDs in persistent storage for later referral, + as the stability of these identifiers is not guaranteed for a long period of time. It is + expected that a request to the Polygon method is made within a few minutes of the request to + the Online Search method that provided the ID. The service allows for batch requests up to 20 + identifiers. + + :param geometries: Comma separated list of geometry UUIDs, previously retrieved from an Online + Search request. + :type geometries: list[str] + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchPolygonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchPolygonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchPolygonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_polygon.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['geometries'] = self._serialize.query("geometries", geometries, '[str]', 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('SearchPolygonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_polygon.metadata = {'url': '/search/polygon/{format}'} # type: ignore + + def get_search_fuzzy( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + typeahead=None, # type: Optional[bool] + limit=None, # type: Optional[int] + ofs=None, # type: Optional[int] + category_set=None, # type: Optional[List[int]] + country_set=None, # type: Optional[List[str]] + lat=None, # type: Optional[float] + lon=None, # type: Optional[float] + radius=None, # type: Optional[float] + top_left=None, # type: Optional[str] + btm_right=None, # type: Optional[str] + language=None, # type: Optional[str] + extended_postal_codes_for=None, # type: Optional[str] + min_fuzzy_level=None, # type: Optional[int] + max_fuzzy_level=None, # type: Optional[int] + idx_set=None, # type: Optional[List[Union[str, "_models.SearchIndexSet"]]] + brand_set=None, # type: Optional[List[str]] + connector_set=None, # type: Optional[List[Union[str, "_models.ConnectorSet"]]] + entity_type=None, # type: Optional[Union[str, "_models.EntityType"]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + opening_hours=None, # type: Optional[Union[str, "_models.OpeningHours"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Free Form Search** + + **Applies to**\ : S0 and S1 pricing tiers. + + The basic default API is Free Form Search which handles the most fuzzy of inputs handling any + combination of address or POI tokens. This search API is the canonical 'single line search'. + The Free Form Search API is a seamless combination of POI search and geocoding. The API can + also be weighted with a contextual position (lat./lon. pair), or fully constrained by a + coordinate and radius, or it can be executed more generally without any geo biasing anchor + point.:code:`
`:code:`
`We strongly advise you to use the 'countrySet' parameter to + specify only the countries for which your application needs coverage, as the default behavior + will be to search the entire world, potentially returning unnecessary + results.:code:`
`:code:`
` E.g.: ``countrySet``\ =US,FR :code:`
`:code:`
`Please + see `Search Coverage + `_ for a complete + list of all the supported countries.:code:`
`:code:`
`Most Search queries default to + ``maxFuzzyLevel``\ =2 to gain performance and also reduce unusual results. This new default can + be overridden as needed per request by passing in the query param ``maxFuzzyLevel``\ =3 or 4. + + :param query: The applicable query string (e.g., "seattle", "pizza"). Can *also* be specified + as a comma separated string composed by latitude followed by longitude (e.g., "47.641268, + -122.125679"). Must be properly URL encoded. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param min_fuzzy_level: Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum: + 4 + + + * + Level 1 has no spell checking. + + * + Level 2 uses normal n-gram spell checking. For example, query "restrant" can be matched to + "restaurant." + + * + Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell + checking is for "rstrnt" to "restaurant" matching. Shingle spell checking is for "mountainview" + to "mountain view" matching. + + * + Level 4 doesn’t add any more spell checking functions. + + The search engine will start looking for a match on the level defined by minFuzzyLevel, and + will stop searching at the level specified by maxFuzzyLevel. + :type min_fuzzy_level: int + :param max_fuzzy_level: Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum: + 4 + + + * + Level 1 has no spell checking. + + * + Level 2 uses normal n-gram spell checking. For example, query "restrant" can be matched to + "restaurant." + + * + Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell + checking is for "rstrnt" to "restaurant" matching. Shingle spell checking is for "mountainview" + to "mountain view" matching. + + * + Level 4 doesn’t add any more spell checking functions. + + The search engine will start looking for a match on the level defined by minFuzzyLevel, and + will stop searching at the level specified by maxFuzzyLevel. + :type max_fuzzy_level: int + :param idx_set: A comma separated list of indexes which should be utilized for the search. Item + order does not matter. Available indexes are: Addr = Address range interpolation, Geo = + Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross + Streets (intersections). + :type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet] + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_fuzzy.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if min_fuzzy_level is not None: + query_parameters['minFuzzyLevel'] = self._serialize.query("min_fuzzy_level", min_fuzzy_level, 'int', maximum=4, minimum=1) + if max_fuzzy_level is not None: + query_parameters['maxFuzzyLevel'] = self._serialize.query("max_fuzzy_level", max_fuzzy_level, 'int', maximum=4, minimum=1) + if idx_set is not None: + query_parameters['idxSet'] = self._serialize.query("idx_set", idx_set, '[str]', div=',') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, 'str') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_fuzzy.metadata = {'url': '/search/fuzzy/{format}'} # type: ignore + + def get_search_poi( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + typeahead=None, # type: Optional[bool] + limit=None, # type: Optional[int] + ofs=None, # type: Optional[int] + category_set=None, # type: Optional[List[int]] + country_set=None, # type: Optional[List[str]] + lat=None, # type: Optional[float] + lon=None, # type: Optional[float] + radius=None, # type: Optional[float] + top_left=None, # type: Optional[str] + btm_right=None, # type: Optional[str] + language=None, # type: Optional[str] + extended_postal_codes_for=None, # type: Optional[str] + brand_set=None, # type: Optional[List[str]] + connector_set=None, # type: Optional[List[Union[str, "_models.ConnectorSet"]]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + opening_hours=None, # type: Optional[Union[str, "_models.OpeningHours"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Get POI by Name** + + **Applies to**\ : S0 and S1 pricing tiers. + + Points of Interest (POI) Search allows you to request POI results by name. Search supports + additional query parameters such as language and filtering results by area of interest driven + by country or bounding box. Endpoint will return only POI results matching the query string. + Response includes POI details such as address, coordinate location and category. + + :param query: The POI name to search for (e.g., "statue of liberty", "starbucks"), must be + properly URL encoded. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **POI** = Points of Interest + + Value should be **POI** or **None** to disable extended postal codes. + + By default extended postal codes are included. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_poi.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_poi.metadata = {'url': '/search/poi/{format}'} # type: ignore + + def get_search_nearby( + self, + lat, # type: float + lon, # type: float + format="json", # type: Union[str, "_models.ResponseFormat"] + limit=None, # type: Optional[int] + ofs=None, # type: Optional[int] + category_set=None, # type: Optional[List[int]] + country_set=None, # type: Optional[List[str]] + radius=None, # type: Optional[float] + language=None, # type: Optional[str] + extended_postal_codes_for=None, # type: Optional[str] + brand_set=None, # type: Optional[List[str]] + connector_set=None, # type: Optional[List[Union[str, "_models.ConnectorSet"]]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Nearby Search** + + **Applies to**\ : S0 and S1 pricing tiers. + + If you have a use case for only retrieving POI results around a specific location, the nearby + search method may be the right choice. This endpoint will only return POI results, and does not + take in a search query parameter. + + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param radius: The radius in meters to for the results to be constrained to the defined area, + Min value is 1, Max Value is 50000. + :type radius: float + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_nearby.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['lat'] = self._serialize.query("lat", lat, 'float') + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + 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=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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_nearby.metadata = {'url': '/search/nearby/{format}'} # type: ignore + + def get_search_poi_category( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + typeahead=None, # type: Optional[bool] + limit=None, # type: Optional[int] + ofs=None, # type: Optional[int] + category_set=None, # type: Optional[List[int]] + country_set=None, # type: Optional[List[str]] + lat=None, # type: Optional[float] + lon=None, # type: Optional[float] + radius=None, # type: Optional[float] + top_left=None, # type: Optional[str] + btm_right=None, # type: Optional[str] + language=None, # type: Optional[str] + extended_postal_codes_for=None, # type: Optional[str] + brand_set=None, # type: Optional[List[str]] + connector_set=None, # type: Optional[List[Union[str, "_models.ConnectorSet"]]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + opening_hours=None, # type: Optional[Union[str, "_models.OpeningHours"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Get POI by Category** + + **Applies to**\ : S0 and S1 pricing tiers. + + Points of Interest (POI) Category Search allows you to request POI results from given category. + Search allows to query POIs from one category at a time. Endpoint will only return POI results + which are categorized as specified. Response includes POI details such as address, coordinate + location and classification. + + :param query: The POI category to search for (e.g., "AIRPORT", "RESTAURANT"), must be properly + URL encoded. Supported main categories can be requested by calling `Get Search POI Category + Tree API `_. List of available categories can also be + found `here `_. We + recommend to use POI Search Category Tree API to request the supported categories. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_poi_category.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_poi_category.metadata = {'url': '/search/poi/category/{format}'} # type: ignore + + def get_search_poi_category_tree( + self, + format="json", # type: Union[str, "_models.JsonFormat"] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchPoiCategoryTreeResponse" + """**Get POI Category Tree** + + **Applies to**\ : S0 and S1 pricing tiers. + + POI Category API provides a full list of supported Points of Interest (POI) categories and + subcategories together with their translations and synonyms. The returned content can be used + to provide more meaningful results through other Search Service APIs, like `Get Search POI + `_. + + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :param language: Language in which search results should be returned. Should be one of + supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When + data in specified language is not available for a specific field, default language is used + (English). + + Please refer to `Supported Languages + `_ for details. + :type language: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchPoiCategoryTreeResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchPoiCategoryTreeResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchPoiCategoryTreeResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_poi_category_tree.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 language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('SearchPoiCategoryTreeResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_poi_category_tree.metadata = {'url': '/search/poi/category/tree/{format}'} # type: ignore + + def get_search_address( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + typeahead=None, # type: Optional[bool] + limit=None, # type: Optional[int] + ofs=None, # type: Optional[int] + country_set=None, # type: Optional[List[str]] + lat=None, # type: Optional[float] + lon=None, # type: Optional[float] + radius=None, # type: Optional[float] + top_left=None, # type: Optional[str] + btm_right=None, # type: Optional[str] + language=None, # type: Optional[str] + extended_postal_codes_for=None, # type: Optional[str] + entity_type=None, # type: Optional[Union[str, "_models.EntityType"]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Address Geocoding** + + **Applies to**\ : S0 and S1 pricing tiers. + + In many cases, the complete search service might be too much, for instance if you are only + interested in traditional geocoding. Search can also be accessed for address look up + exclusively. The geocoding is performed by hitting the geocode endpoint with just the address + or partial address in question. The geocoding search index will be queried for everything above + the street level data. No POIs will be returned. Note that the geocoder is very tolerant of + typos and incomplete addresses. It will also handle everything from exact street addresses or + street or intersections as well as higher level geographies such as city centers, counties, + states etc. + + :param query: The address to search for (e.g., "1 Microsoft way, Redmond, WA"), must be + properly URL encoded. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param typeahead: Boolean. If the typeahead flag is set, the query will be interpreted as a + partial input and the search will enter predictive mode. + :type typeahead: bool + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param country_set: Comma separated string of country codes, e.g. FR,ES. This will limit the + search to the specified countries. + :type country_set: list[str] + :param lat: Latitude where results should be biased. E.g. 37.337. + :type lat: float + :param lon: Longitude where results should be biased. E.g. -121.89. + :type lon: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param top_left: Top left position of the bounding box. E.g. 37.553,-122.453. + :type top_left: str + :param btm_right: Bottom right position of the bounding box. E.g. 37.553,-122.453. + :type btm_right: str + :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 extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address.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['query'] = self._serialize.query("query", query, 'str') + if typeahead is not None: + query_parameters['typeahead'] = self._serialize.query("typeahead", typeahead, 'bool') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if country_set is not None: + query_parameters['countrySet'] = self._serialize.query("country_set", country_set, '[str]', div=',') + if lat is not None: + query_parameters['lat'] = self._serialize.query("lat", lat, 'float') + if lon is not None: + query_parameters['lon'] = self._serialize.query("lon", lon, 'float') + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if top_left is not None: + query_parameters['topLeft'] = self._serialize.query("top_left", top_left, 'str') + if btm_right is not None: + query_parameters['btmRight'] = self._serialize.query("btm_right", btm_right, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, '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=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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address.metadata = {'url': '/search/address/{format}'} # type: ignore + + def get_search_address_reverse( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + language=None, # type: Optional[str] + return_speed_limit=None, # type: Optional[bool] + heading=None, # type: Optional[float] + radius=None, # type: Optional[float] + number=None, # type: Optional[str] + return_road_use=None, # type: Optional[bool] + road_use=None, # type: Optional[str] + allow_freeform_newline=None, # type: Optional[bool] + return_match_type=None, # type: Optional[bool] + entity_type=None, # type: Optional[Union[str, "_models.EntityType"]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchAddressReverseResponse" + """**Reverse Geocode to an Address** + + **Applies to**\ : S0 and S1 pricing tiers. + + There may be times when you need to translate a coordinate (example: 37.786505, -122.3862) + into a human understandable street address. Most often this is needed in tracking applications + where you receive a GPS feed from the device or asset and wish to know what address where the + coordinate is located. This endpoint will return address information for a given coordinate. + + :param query: The applicable query specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :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 return_speed_limit: Boolean. To enable return of the posted speed limit. + :type return_speed_limit: bool + :param heading: The directional heading of the vehicle in degrees, for travel along a segment + of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can + include upto one decimal place. + :type heading: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :param number: If a number is sent in along with the request, the response may include the side + of the street (Left/Right) and also an offset position for that number. + :type number: str + :param return_road_use: Boolean. To enable return of the road use array for reverse geocodes at + street level. + :type return_road_use: bool + :param road_use: To restrict reverse geocodes to a certain type of road use. The road use array + for reverse geocodes can be one or more of LimitedAccess, Arterial, Terminal, Ramp, Rotary, + LocalStreet. + :type road_use: str + :param allow_freeform_newline: Format of newlines in the formatted address. + + If true, the address will contain newlines. + If false, newlines will be converted to commas. + :type allow_freeform_newline: bool + :param return_match_type: Include information on the type of match the geocoder achieved in the + response. + :type return_match_type: bool + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressReverseResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressReverseResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address_reverse.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if return_speed_limit is not None: + query_parameters['returnSpeedLimit'] = self._serialize.query("return_speed_limit", return_speed_limit, 'bool') + if heading is not None: + query_parameters['heading'] = self._serialize.query("heading", heading, 'float', maximum=360, minimum=-360) + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + if number is not None: + query_parameters['number'] = self._serialize.query("number", number, 'str') + if return_road_use is not None: + query_parameters['returnRoadUse'] = self._serialize.query("return_road_use", return_road_use, 'bool') + if road_use is not None: + query_parameters['roadUse'] = self._serialize.query("road_use", road_use, 'str') + if allow_freeform_newline is not None: + query_parameters['allowFreeformNewline'] = self._serialize.query("allow_freeform_newline", allow_freeform_newline, 'bool') + if return_match_type is not None: + query_parameters['returnMatchType'] = self._serialize.query("return_match_type", return_match_type, 'bool') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, '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=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('SearchAddressReverseResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address_reverse.metadata = {'url': '/search/address/reverse/{format}'} # type: ignore + + def get_search_address_reverse_cross_street( + self, + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + limit=None, # type: Optional[int] + heading=None, # type: Optional[float] + radius=None, # type: Optional[float] + language=None, # type: Optional[str] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchAddressReverseCrossStreetResponse" + """**Reverse Geocode to a Cross Street** + + **Applies to**\ : S0 and S1 pricing tiers. + + There may be times when you need to translate a coordinate (example: 37.786505, -122.3862) + into a human understandable cross street. Most often this is needed in tracking applications + where you receive a GPS feed from the device or asset and wish to know what address where the + coordinate is located. + This endpoint will return cross street information for a given coordinate. + + :param query: The applicable query specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param heading: The directional heading of the vehicle in degrees, for travel along a segment + of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can + include upto one decimal place. + :type heading: float + :param radius: The radius in meters to for the results to be constrained to the defined area. + :type radius: float + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressReverseCrossStreetResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressReverseCrossStreetResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseCrossStreetResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address_reverse_cross_street.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['query'] = self._serialize.query("query", query, 'str') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if heading is not None: + query_parameters['heading'] = self._serialize.query("heading", heading, 'float', maximum=360, minimum=-360) + if radius is not None: + query_parameters['radius'] = self._serialize.query("radius", radius, 'float') + 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=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('SearchAddressReverseCrossStreetResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address_reverse_cross_street.metadata = {'url': '/search/address/reverse/crossStreet/{format}'} # type: ignore + + def get_search_address_structured( + self, + format="json", # type: Union[str, "_models.ResponseFormat"] + language=None, # type: Optional[str] + country_code="US", # type: Optional[str] + limit=None, # type: Optional[int] + ofs=None, # type: Optional[int] + street_number=None, # type: Optional[str] + street_name=None, # type: Optional[str] + cross_street=None, # type: Optional[str] + municipality=None, # type: Optional[str] + municipality_subdivision=None, # type: Optional[str] + country_tertiary_subdivision=None, # type: Optional[str] + country_secondary_subdivision=None, # type: Optional[str] + country_subdivision=None, # type: Optional[str] + postal_code=None, # type: Optional[str] + extended_postal_codes_for=None, # type: Optional[str] + entity_type=None, # type: Optional[Union[str, "_models.EntityType"]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Structured Address Geocoding** + + **Applies to**\ : S0 and S1 pricing tiers. + + Azure Address Geocoding can also be accessed for structured address look up exclusively. The + geocoding search index will be queried for everything above the street level data. No POIs + will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. + It will also handle everything from exact street addresses or street or intersections as well + as higher level geographies such as city centers, counties, states etc. + + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :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 country_code: The 2 or 3 letter `ISO3166-1 + `_ country code portion of an address. E.g. + US. + :type country_code: str + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: int + :param ofs: Starting offset of the returned results within the full result set. Default: 0, + minimum: 0 and maximum: 1900. + :type ofs: int + :param street_number: The street number portion of an address. + :type street_number: str + :param street_name: The street name portion of an address. + :type street_name: str + :param cross_street: The cross street name for the structured address. + :type cross_street: str + :param municipality: The municipality portion of an address. + :type municipality: str + :param municipality_subdivision: The municipality subdivision (sub/super city) for the + structured address. + :type municipality_subdivision: str + :param country_tertiary_subdivision: The named area for the structured address. + :type country_tertiary_subdivision: str + :param country_secondary_subdivision: The county for the structured address. + :type country_secondary_subdivision: str + :param country_subdivision: The country subdivision portion of an address. + :type country_subdivision: str + :param postal_code: The postal code portion of an address. + :type postal_code: str + :param extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param entity_type: Specifies the level of filtering performed on geographies. Narrows the + search for specified geography entity types, e.g. return only municipality. The resulting + response will contain the geography ID as well as the entity type matched. If you provide more + than one entity as a comma separated list, endpoint will return the 'smallest entity + available'. Returned Geometry ID can be used to get the geometry of that geography via `Get + Search Polygon `_ API. The + following parameters are ignored when entityType is set: + + + * heading + * number + * returnRoadUse + * returnSpeedLimit + * roadUse + * returnMatchType. + :type entity_type: str or ~azure.maps.search.models.EntityType + :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.search.models.LocalizedMapView + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_search_address_structured.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 language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if country_code is not None: + query_parameters['countryCode'] = self._serialize.query("country_code", country_code, 'str') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if ofs is not None: + query_parameters['ofs'] = self._serialize.query("ofs", ofs, 'int', maximum=1900, minimum=0) + if street_number is not None: + query_parameters['streetNumber'] = self._serialize.query("street_number", street_number, 'str') + if street_name is not None: + query_parameters['streetName'] = self._serialize.query("street_name", street_name, 'str') + if cross_street is not None: + query_parameters['crossStreet'] = self._serialize.query("cross_street", cross_street, 'str') + if municipality is not None: + query_parameters['municipality'] = self._serialize.query("municipality", municipality, 'str') + if municipality_subdivision is not None: + query_parameters['municipalitySubdivision'] = self._serialize.query("municipality_subdivision", municipality_subdivision, 'str') + if country_tertiary_subdivision is not None: + query_parameters['countryTertiarySubdivision'] = self._serialize.query("country_tertiary_subdivision", country_tertiary_subdivision, 'str') + if country_secondary_subdivision is not None: + query_parameters['countrySecondarySubdivision'] = self._serialize.query("country_secondary_subdivision", country_secondary_subdivision, 'str') + if country_subdivision is not None: + query_parameters['countrySubdivision'] = self._serialize.query("country_subdivision", country_subdivision, 'str') + if postal_code is not None: + query_parameters['postalCode'] = self._serialize.query("postal_code", postal_code, 'str') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if entity_type is not None: + query_parameters['entityType'] = self._serialize.query("entity_type", entity_type, '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=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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_address_structured.metadata = {'url': '/search/address/structured/{format}'} # type: ignore + + def post_search_inside_geometry( + self, + query, # type: str + search_inside_geometry_request_body, # type: "_models.SearchInsideGeometryRequestBody" + format="json", # type: Union[str, "_models.ResponseFormat"] + limit=None, # type: Optional[int] + language=None, # type: Optional[str] + category_set=None, # type: Optional[List[int]] + extended_postal_codes_for=None, # type: Optional[str] + idx_set=None, # type: Optional[List[Union[str, "_models.SearchIndexSet"]]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + opening_hours=None, # type: Optional[Union[str, "_models.OpeningHours"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Applies to**\ : S0 and S1 pricing tiers. + + The Search Geometry endpoint allows you to perform a free form search inside a single geometry + or many of them. The search results that fall inside the geometry/geometries will be + returned.:code:`
`:code:`
`To send the geometry you will use a ``POST`` request where the + request body will contain the ``geometry`` object represented as a ``GeoJSON`` type and the + ``Content-Type`` header will be set to ``application/json``. The geographical features to be + searched can be modeled as Polygon and/or Circle geometries represented using any one of the + following ``GeoJSON`` types::code:`
  • **GeoJSON FeatureCollection**
    The `geometry` can + be represented as a `GeoJSON FeatureCollection` object. This is the recommended option if the + geometry contains both Polygons and Circles. The `FeatureCollection` can contain a max of 50 + `GeoJSON Feature` objects. Each `Feature` object should represent either a Polygon or a Circle + with the following conditions:
    • A `Feature` object for the + Polygon geometry can have a max of 50 coordinates and it's properties must be empty.
    • A + `Feature` object for the Circle geometry is composed of a _center_ represented using a `GeoJSON + Point` type and a _radius_ value (in meters) which must be specified in the object's properties + along with the _subType_ property whose value should be 'Circle'.
    `:code:`
    ` Please + see the Examples section below for a sample ``FeatureCollection`` + representation.:code:`
    `:code:`
    `
  • :code:`
  • **GeoJSON GeometryCollection**
    The + `geometry` can be represented as a `GeoJSON GeometryCollection` object. This is the recommended + option if the geometry contains a list of Polygons only. The `GeometryCollection` can contain a + max of 50 `GeoJSON Polygon` objects. Each `Polygon` object can have a max of 50 coordinates. + Please see the Examples section below for a sample `GeometryCollection` + representation.

  • `:code:`
  • **GeoJSON Polygon**
    The `geometry` can be + represented as a `GeoJSON Polygon` object. This is the recommended option if the geometry + contains a single Polygon. The `Polygon` object can have a max of 50 coordinates. Please see + the Examples section below for a sample `Polygon` + representation.

  • `
.:code:`
`:code:`
`. + + :param query: The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza"). + Must be properly URL encoded. + :type query: str + :param search_inside_geometry_request_body: This represents the geometry for one or more + geographical features (parks, state boundary etc.) to search in and should be a GeoJSON + compliant type. Please refer to `RFC 7946 `_ for details. + :type search_inside_geometry_request_body: ~azure.maps.search.models.SearchInsideGeometryRequestBody + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param limit: Maximum number of responses that will be returned. Default: 10, minimum: 1 and + maximum: 100. + :type limit: 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 category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param extended_postal_codes_for: Indexes for which extended postal codes should be included in + the results. + + Available indexes are: + + **Addr** = Address ranges + + **Geo** = Geographies + + **PAD** = Point Addresses + + **POI** = Points of Interest + + **Str** = Streets + + **XStr** = Cross Streets (intersections) + + Value should be a comma separated list of index types (in any order) or **None** for no + indexes. + + By default extended postal codes are included for all indexes except Geo. Extended postal code + lists for geographies can be quite long so they have to be explicitly requested when needed. + + Usage examples: + + extendedPostalCodesFor=POI + + extendedPostalCodesFor=PAD,Addr,POI + + extendedPostalCodesFor=None + + Extended postal code is returned as an **extendedPostalCode** property of an address. + Availability is region-dependent. + :type extended_postal_codes_for: str + :param idx_set: A comma separated list of indexes which should be utilized for the search. Item + order does not matter. Available indexes are: Addr = Address range interpolation, Geo = + Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross + Streets (intersections). + :type idx_set: list[str or ~azure.maps.search.models.SearchIndexSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_inside_geometry.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['query'] = self._serialize.query("query", query, 'str') + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=100, minimum=1) + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + if extended_postal_codes_for is not None: + query_parameters['extendedPostalCodesFor'] = self._serialize.query("extended_postal_codes_for", extended_postal_codes_for, 'str') + if idx_set is not None: + query_parameters['idxSet'] = self._serialize.query("idx_set", idx_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_inside_geometry_request_body, 'SearchInsideGeometryRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_inside_geometry.metadata = {'url': '/search/geometry/{format}'} # type: ignore + + def post_search_along_route( + self, + query, # type: str + max_detour_time, # type: int + search_along_route_request_body, # type: "_models.SearchAlongRouteRequestBody" + format="json", # type: Union[str, "_models.ResponseFormat"] + category_set=None, # type: Optional[List[int]] + limit=None, # type: Optional[int] + brand_set=None, # type: Optional[List[str]] + connector_set=None, # type: Optional[List[Union[str, "_models.ConnectorSet"]]] + localized_map_view=None, # type: Optional[Union[str, "_models.LocalizedMapView"]] + opening_hours=None, # type: Optional[Union[str, "_models.OpeningHours"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchCommonResponse" + """**Applies to**\ : S0 and S1 pricing tiers. + + The Search Along Route endpoint allows you to perform a fuzzy search for POIs along a specified + route. This search is constrained by specifying the ``maxDetourTime`` limiting + measure.:code:`
`:code:`
`To send the route-points you will use a ``POST`` request where + the request body will contain the ``route`` object represented as a ``GeoJSON LineString`` type + and the ``Content-Type`` header will be set to ``application/json``. Each route-point in + ``route`` is represented as a ``GeoJSON Position`` type i.e. an array where the *longitude* + value is followed by the *latitude* value and the *altitude* value is ignored. The ``route`` + should contain at least 2 route-points.:code:`
`:code:`
`It is possible that original + route will be altered, some of it's points may be skipped. If the route that passes through the + found point is faster than the original one, the ``detourTime`` value in the response is + negative. + + :param query: The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza"). + Must be properly URL encoded. + :type query: str + :param max_detour_time: Maximum detour time of the point of interest in seconds. Max value is + 3600 seconds. + :type max_detour_time: int + :param search_along_route_request_body: This represents the route to search along and should be + a valid ``GeoJSON LineString`` type. Please refer to `RFC 7946 + `_ for details. + :type search_along_route_request_body: ~azure.maps.search.models.SearchAlongRouteRequestBody + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.search.models.ResponseFormat + :param category_set: A comma-separated list of category set IDs which could be used to restrict + the result to specific Points of Interest categories. ID order does not matter. When multiple + category identifiers are provided, only POIs that belong to (at least) one of the categories + from the provided list will be returned. The list of supported categories can be discovered + using  `POI Categories API `_. Usage examples: + + + * + **categorySet=7315**\  (Search Points of Interest from category Restaurant) + + * + **categorySet=7315025,7315017**\  (Search Points of Interest of category either Italian or + French Restaurant). + :type category_set: list[int] + :param limit: Maximum number of responses that will be returned. Default value is 10. Max value + is 20. + :type limit: int + :param brand_set: A comma-separated list of brand names which could be used to restrict the + result to specific brands. Item order does not matter. When multiple brands are provided, only + results that belong to (at least) one of the provided list will be returned. Brands that + contain a "," in their name should be put into quotes. + + Usage examples: + + brandSet=Foo + + brandSet=Foo,Bar + + brandSet="A,B,C Comma",Bar. + :type brand_set: list[str] + :param connector_set: A comma-separated list of connector types which could be used to restrict + the result to Electric Vehicle Station supporting specific connector types. Item order does not + matter. When multiple connector types are provided, only results that belong to (at least) one + of the provided list will be returned. + + Available connector types are: + + + * ``StandardHouseholdCountrySpecific`` - These are the standard household connectors for a + certain region. They are all AC single phase and the standard Voltage and standard Amperage. + See also: `Plug & socket types - World Standards + `_. + * ``IEC62196Type1`` - Type 1 connector as defined in the IEC 62196-2 standard. Also called + Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. + Mostly used in combination with 120V single phase or up to 240V single phase infrastructure. + * ``IEC62196Type1CCS`` - Type 1 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type2CableAttached`` - Type 2 connector as defined in the IEC 62196-2 standard. + Provided as a cable and plug attached to the charging point. + * ``IEC62196Type2Outlet`` - Type 2 connector as defined in the IEC 62196-2 standard. Provided + as a socket set into the charging point. + * ``IEC62196Type2CCS`` - Type 2 based combo connector as defined in the IEC 62196-3 standard. + The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with + two additional direct current (DC) contacts to allow DC fast charging. + * ``IEC62196Type3`` - Type 3 connector as defined in the IEC 62196-2 standard. Also called + Scame after the original manufacturer. Mostly used in combination with up to 240V single phase + or up to 420V three phase infrastructure. + * ``Chademo`` - CHAdeMO connector named after an association formed by the Tokyo Electric + Power Company and industrial partners. Because of this is is also known as the TEPCO's + connector. It supports fast DC charging. + * ``IEC60309AC1PhaseBlue`` - Industrial Blue connector is a connector defined in the IEC 60309 + standard. It is sometime referred to as by some combination of the standard, the color and the + fact that is a single phase connector. The connector usually has the "P+N+E, 6h" configuration. + * ``IEC60309DCWhite`` - Industrial White connector is a DC connector defined in the IEC 60309 + standard. + * ``Tesla`` - The Tesla connector is the regionally specific Tesla Supercharger connector. + I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port + mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe. + + Usage examples: + + connectorSet=IEC62196Type2CableAttached + connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached. + :type connector_set: list[str or ~azure.maps.search.models.ConnectorSet] + :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.search.models.LocalizedMapView + :param opening_hours: Hours of operation for a POI (Points of Interest). The availability of + hours of operation will vary based on the data available. + Supported value: nextSevenDays. + :type opening_hours: str or ~azure.maps.search.models.OpeningHours + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchCommonResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchCommonResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchCommonResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_along_route.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['query'] = self._serialize.query("query", query, 'str') + if category_set is not None: + query_parameters['categorySet'] = self._serialize.query("category_set", category_set, '[int]', div=',') + query_parameters['maxDetourTime'] = self._serialize.query("max_detour_time", max_detour_time, 'int', maximum=3600) + if limit is not None: + query_parameters['limit'] = self._serialize.query("limit", limit, 'int', maximum=20) + if brand_set is not None: + query_parameters['brandSet'] = self._serialize.query("brand_set", brand_set, '[str]', div=',') + if connector_set is not None: + query_parameters['connectorSet'] = self._serialize.query("connector_set", connector_set, '[str]', div=',') + if localized_map_view is not None: + query_parameters['view'] = self._serialize.query("localized_map_view", localized_map_view, 'str') + if opening_hours is not None: + query_parameters['openingHours'] = self._serialize.query("opening_hours", opening_hours, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_along_route_request_body, 'SearchAlongRouteRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchCommonResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_along_route.metadata = {'url': '/search/alongRoute/{format}'} # type: ignore + + def post_search_fuzzy_batch_sync( + self, + search_fuzzy_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchFuzzyBatchResponse" + """**Search Fuzzy Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Fuzzy API + `_ using just a single + API call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search fuzzy* queries you will use a ``POST`` request where the request body will + contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set + to ``application/json``. Here's a sample request body containing 5 *search fuzzy* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + {"query": "?query=Statue Of Liberty&limit=2"}, + {"query": "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + {"query": "?query=Space Needle"}, + {"query": "?query=pizza&limit=10"} + ] + } + + A *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path, + api-version and subscription-key. It can accept any of the supported *search fuzzy* `URI + parameters + `_. The + string values in the *search fuzzy* query must be properly escaped (e.g. " character should be + escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ - + If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "atm" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "ATM at Wells Fargo" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "statue of liberty" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "Statue of Liberty" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "New York, NY 10004" + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process. + The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchFuzzyBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchFuzzyBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchFuzzyBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_fuzzy_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_fuzzy_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchFuzzyBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_fuzzy_batch_sync.metadata = {'url': '/search/fuzzy/batch/sync/{format}'} # type: ignore + + def _post_search_fuzzy_batch_initial( + self, + search_fuzzy_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SearchFuzzyBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchFuzzyBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_search_fuzzy_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_fuzzy_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_search_fuzzy_batch_initial.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + def begin_post_search_fuzzy_batch( + self, + search_fuzzy_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SearchFuzzyBatchResponse"] + """**Search Fuzzy Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Fuzzy API + `_ using just a single + API call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search fuzzy* queries you will use a ``POST`` request where the request body will + contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set + to ``application/json``. Here's a sample request body containing 5 *search fuzzy* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + {"query": "?query=Statue Of Liberty&limit=2"}, + {"query": "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + {"query": "?query=Space Needle"}, + {"query": "?query=pizza&limit=10"} + ] + } + + A *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path, + api-version and subscription-key. It can accept any of the supported *search fuzzy* `URI + parameters + `_. The + string values in the *search fuzzy* query must be properly escaped (e.g. " character should be + escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ - + If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "atm" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "ATM at Wells Fargo" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "statue of liberty" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "Statue of Liberty" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "New York, NY 10004" + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_fuzzy_batch_request_body: The list of search fuzzy queries/requests to process. + The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_fuzzy_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchFuzzyBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_search_fuzzy_batch_initial( + search_fuzzy_batch_request_body=search_fuzzy_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_search_fuzzy_batch.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + def _get_search_fuzzy_batch_initial( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SearchFuzzyBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchFuzzyBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_search_fuzzy_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_search_fuzzy_batch_initial.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + def begin_get_search_fuzzy_batch( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SearchFuzzyBatchResponse"] + """**Search Fuzzy Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Fuzzy API + `_ using just a single + API call. You can call Search Address Fuzzy Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/fuzzy/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search fuzzy* queries you will use a ``POST`` request where the request body will + contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will be set + to ``application/json``. Here's a sample request body containing 5 *search fuzzy* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=atm&lat=47.639769&lon=-122.128362&radius=5000&limit=5"}, + {"query": "?query=Statue Of Liberty&limit=2"}, + {"query": "?query=Starbucks&lat=47.639769&lon=-122.128362&radius=5000"}, + {"query": "?query=Space Needle"}, + {"query": "?query=pizza&limit=10"} + ] + } + + A *search fuzzy* query in a batch is just a partial URL *without* the protocol, base URL, path, + api-version and subscription-key. It can accept any of the supported *search fuzzy* `URI + parameters + `_. The + string values in the *search fuzzy* query must be properly escaped (e.g. " character should be + escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/fuzzy/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ - + If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "atm" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "ATM at Wells Fargo" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "3240 157th Ave NE, Redmond, WA 98052" + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "statue of liberty" + }, + "results": [ + { + "type": "POI", + "poi": { + "name": "Statue of Liberty" + }, + "address": { + "country": "United States Of America", + "freeformAddress": "New York, NY 10004" + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SearchFuzzyBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchFuzzyBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchFuzzyBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_search_fuzzy_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchFuzzyBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_search_fuzzy_batch.metadata = {'url': '/search/fuzzy/batch/{format}'} # type: ignore + + def post_search_address_batch_sync( + self, + search_address_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchAddressBatchResponse" + """**Search Address Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address API + `_ using just a single + API call. You can call Search Address Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 5 *search address* + queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + {"query": "?query=Pike Pl, Seattle, WA + 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + France&limit=1"} + ] + } + + A *search address* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *search address* + `URI parameters + `_. The + string values in the *search address* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "one microsoft way redmond wa 98052" + }, + "results": [ + { + "position": { + "lat": 47.63989, + "lon": -122.12509 + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "pike pl seattle wa 98101" + }, + "results": [ + { + "position": { + "lat": 47.60963, + "lon": -122.34215 + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_batch_request_body: The list of address geocoding queries/requests to + process. The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_address_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchAddressBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_address_batch_sync.metadata = {'url': '/search/address/batch/sync/{format}'} # type: ignore + + def _post_search_address_batch_initial( + self, + search_address_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SearchAddressBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_search_address_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_search_address_batch_initial.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + def begin_post_search_address_batch( + self, + search_address_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SearchAddressBatchResponse"] + """**Search Address Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address API + `_ using just a single + API call. You can call Search Address Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 5 *search address* + queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + {"query": "?query=Pike Pl, Seattle, WA + 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + France&limit=1"} + ] + } + + A *search address* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *search address* + `URI parameters + `_. The + string values in the *search address* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "one microsoft way redmond wa 98052" + }, + "results": [ + { + "position": { + "lat": 47.63989, + "lon": -122.12509 + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "pike pl seattle wa 98101" + }, + "results": [ + { + "position": { + "lat": 47.60963, + "lon": -122.34215 + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_batch_request_body: The list of address geocoding queries/requests to + process. The list can contain a max of 10,000 queries and must contain at least 1 query. + :type search_address_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SearchAddressBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_search_address_batch_initial( + search_address_batch_request_body=search_address_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_search_address_batch.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + def _get_search_address_batch_initial( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SearchAddressBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_search_address_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_search_address_batch_initial.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + def begin_get_search_address_batch( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SearchAddressBatchResponse"] + """**Search Address Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address API + `_ using just a single + API call. You can call Search Address Batch API to run either asynchronously (async) or + synchronously (sync). The async API allows caller to batch up to **10,000** queries and sync + API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address* queries you will use a ``POST`` request where the request body + will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header will + be set to ``application/json``. Here's a sample request body containing 5 *search address* + queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=400 Broad St, Seattle, WA 98109&limit=3"}, + {"query": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"}, + {"query": "?query=350 5th Ave, New York, NY 10118&limit=1"}, + {"query": "?query=Pike Pl, Seattle, WA + 98101&lat=47.610970&lon=-122.342469&radius=1000"}, + {"query": "?query=Champ de Mars, 5 Avenue Anatole France, 75007 Paris, + France&limit=1"} + ] + } + + A *search address* query in a batch is just a partial URL *without* the protocol, base URL, + path, api-version and subscription-key. It can accept any of the supported *search address* + `URI parameters + `_. The + string values in the *search address* query must be properly escaped (e.g. " character should + be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchCommonResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "query": "one microsoft way redmond wa 98052" + }, + "results": [ + { + "position": { + "lat": 47.63989, + "lon": -122.12509 + } + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "query": "pike pl seattle wa 98101" + }, + "results": [ + { + "position": { + "lat": 47.60963, + "lon": -122.34215 + } + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SearchAddressBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_search_address_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_search_address_batch.metadata = {'url': '/search/address/batch/{format}'} # type: ignore + + def post_search_address_reverse_batch_sync( + self, + search_address_reverse_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> "_models.SearchAddressReverseBatchResponse" + """**Search Address Reverse Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address Reverse API + `_ using just a + single API call. You can call Search Address Reverse Batch API to run either asynchronously + (async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries + and sync API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address reverse* queries you will use a ``POST`` request where the request + body will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header + will be set to ``application/json``. Here's a sample request body containing 5 *search address + reverse* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=48.858561,2.294911"}, + {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + {"query": "?query=47.621028,-122.348170"}, + {"query": "?query=43.722990,10.396695"}, + {"query": "?query=40.750958,-73.982336"} + ] + } + + A *search address reverse* query in a batch is just a partial URL *without* the protocol, base + URL, path, api-version and subscription-key. It can accept any of the supported *search address + reverse* `URI parameters + `_. + The string values in the *search address reverse* query must be properly escaped (e.g. " + character should be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchAddressReverseResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 11 + }, + "addresses": [ + { + "address": { + "country": "France", + "freeformAddress": "Avenue Anatole France, 75007 Paris" + }, + "position": "48.858490,2.294820" + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 1 + }, + "addresses": [ + { + "address": { + "country": "United States of America", + "freeformAddress": "157th Pl NE, Redmond WA 98052" + }, + "position": "47.640470,-122.129430" + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_reverse_batch_request_body: The list of reverse geocoding + queries/requests to process. The list can contain a max of 10,000 queries and must contain at + least 1 query. + :type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SearchAddressReverseBatchResponse, or the result of cls(response) + :rtype: ~azure.maps.search.models.SearchAddressReverseBatchResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseBatchResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 408: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post_search_address_reverse_batch_sync.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_reverse_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + 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('SearchAddressReverseBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post_search_address_reverse_batch_sync.metadata = {'url': '/search/address/reverse/batch/sync/{format}'} # type: ignore + + def _post_search_address_reverse_batch_initial( + self, + search_address_reverse_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SearchAddressReverseBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressReverseBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._post_search_address_reverse_batch_initial.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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(search_address_reverse_batch_request_body, 'BatchRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _post_search_address_reverse_batch_initial.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore + + def begin_post_search_address_reverse_batch( + self, + search_address_reverse_batch_request_body, # type: "_models.BatchRequestBody" + format="json", # type: Union[str, "_models.JsonFormat"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SearchAddressReverseBatchResponse"] + """**Search Address Reverse Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address Reverse API + `_ using just a + single API call. You can call Search Address Reverse Batch API to run either asynchronously + (async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries + and sync API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address reverse* queries you will use a ``POST`` request where the request + body will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header + will be set to ``application/json``. Here's a sample request body containing 5 *search address + reverse* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=48.858561,2.294911"}, + {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + {"query": "?query=47.621028,-122.348170"}, + {"query": "?query=43.722990,10.396695"}, + {"query": "?query=40.750958,-73.982336"} + ] + } + + A *search address reverse* query in a batch is just a partial URL *without* the protocol, base + URL, path, api-version and subscription-key. It can accept any of the supported *search address + reverse* `URI parameters + `_. + The string values in the *search address reverse* query must be properly escaped (e.g. " + character should be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchAddressReverseResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 11 + }, + "addresses": [ + { + "address": { + "country": "France", + "freeformAddress": "Avenue Anatole France, 75007 Paris" + }, + "position": "48.858490,2.294820" + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 1 + }, + "addresses": [ + { + "address": { + "country": "United States of America", + "freeformAddress": "157th Pl NE, Redmond WA 98052" + }, + "position": "47.640470,-122.129430" + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param search_address_reverse_batch_request_body: The list of reverse geocoding + queries/requests to process. The list can contain a max of 10,000 queries and must contain at + least 1 query. + :type search_address_reverse_batch_request_body: ~azure.maps.search.models.BatchRequestBody + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.search.models.JsonFormat + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_search_address_reverse_batch_initial( + search_address_reverse_batch_request_body=search_address_reverse_batch_request_body, + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_search_address_reverse_batch.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore + + def _get_search_address_reverse_batch_initial( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.SearchAddressReverseBatchResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SearchAddressReverseBatchResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self._get_search_address_reverse_batch_initial.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, 202]: + 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 = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _get_search_address_reverse_batch_initial.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore + + def begin_get_search_address_reverse_batch( + self, + format, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SearchAddressReverseBatchResponse"] + """**Search Address Reverse Batch API** + + **Applies to**\ : S1 pricing tier. + + The Search Address Batch API sends batches of queries to `Search Address Reverse API + `_ using just a + single API call. You can call Search Address Reverse Batch API to run either asynchronously + (async) or synchronously (sync). The async API allows caller to batch up to **10,000** queries + and sync API up to **100** queries. + + Submit Synchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Synchronous API is recommended for lightweight batch requests. When the service receives a + request, it will respond as soon as the batch items are calculated and there will be no + possibility to retrieve the results later. The Synchronous API will return a timeout error (a + 408 response) if the request takes longer than 60 seconds. The number of batch items is limited + to **100** for this API. + + .. code-block:: + + POST + https://atlas.microsoft.com/search/address/reverse/batch/sync/json?api-version=1.0&subscription-key={subscription-key} + + Submit Asynchronous Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The Asynchronous API is appropriate for processing big volumes of relatively complex search + requests + + + * It allows the retrieval of results in a separate call (multiple downloads are possible). + * The asynchronous API is optimized for reliability and is not expected to run into a timeout. + * The number of batch items is limited to **10,000** for this API. + + When you make a request by using async request, by default the service returns a 202 response + code along a redirect URL in the Location field of the response header. This URL should be + checked periodically until the response data or error information is available. + The asynchronous responses are stored for **14** days. The redirect URL returns a 404 response + if used after the expiration period. + + Please note that asynchronous batch request is a long-running request. Here's a typical + sequence of operations: + + + #. Client sends a Search Address Batch ``POST`` request to Azure Maps + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request has been accepted. + + HTTP ``Error`` - There was an error processing your Batch request. This could either be a + ``400 Bad Request`` or any other ``Error`` status code. + + + #. + If the batch request was accepted successfully, the ``Location`` header in the response + contains the URL to download the results of the batch request. + This status URI looks like following: + + .. code-block:: + + GET + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + + #. Client issues a ``GET`` request on the *download URL* obtained in Step 3 to download the + batch results. + + POST Body for Batch Request + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To send the *search address reverse* queries you will use a ``POST`` request where the request + body will contain the ``batchItems`` array in ``json`` format and the ``Content-Type`` header + will be set to ``application/json``. Here's a sample request body containing 5 *search address + reverse* queries: + + .. code-block:: json + + { + "batchItems": [ + {"query": "?query=48.858561,2.294911"}, + {"query": "?query=47.639765,-122.127896&radius=5000&limit=2"}, + {"query": "?query=47.621028,-122.348170"}, + {"query": "?query=43.722990,10.396695"}, + {"query": "?query=40.750958,-73.982336"} + ] + } + + A *search address reverse* query in a batch is just a partial URL *without* the protocol, base + URL, path, api-version and subscription-key. It can accept any of the supported *search address + reverse* `URI parameters + `_. + The string values in the *search address reverse* query must be properly escaped (e.g. " + character should be escaped with ) and it should also be properly URL-encoded. + + The async API allows caller to batch up to **10,000** queries and sync API up to **100** + queries, and the batch should contain at least **1** query. + + Download Asynchronous Batch Results + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + To download the async batch results you will issue a ``GET`` request to the batch download + endpoint. This *download URL* can be obtained from the ``Location`` header of a successful + ``POST`` batch request and looks like the following: + + .. code-block:: + + https://atlas.microsoft.com/search/address/reverse/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key} + + Here's the typical sequence of operations for downloading the batch results: + + + #. Client sends a ``GET`` request using the *download URL*. + #. + The server will respond with one of the following: + + .. + + HTTP ``202 Accepted`` - Batch request was accepted but is still being processed. Please + try again in some time. + + HTTP ``200 OK`` - Batch request successfully processed. The response body contains all + the batch results. + + + Batch Response Model + ^^^^^^^^^^^^^^^^^^^^ + + The returned data content is similar for async and sync requests. When downloading the results + of an async batch request, if the batch has finished processing, the response body contains the + batch response. This batch response contains a ``summary`` component that indicates the + ``totalRequests`` that were part of the original batch request and ``successfulRequests``\ i.e. + queries which were executed successfully. The batch response also includes a ``batchItems`` + array which contains a response for each and every query in the batch request. The + ``batchItems`` will contain the results in the exact same order the original queries were sent + in the batch request. Each item in ``batchItems`` contains ``statusCode`` and ``response`` + fields. Each ``response`` in ``batchItems`` is of one of the following types: + + + * + `\ ``SearchAddressReverseResponse`` + `_ + - If the query completed successfully. + + * + ``Error`` - If the query failed. The response will contain a ``code`` and a ``message`` in + this case. + + Here's a sample Batch Response with 2 *successful* and 1 *failed* result: + + .. code-block:: json + + { + "summary": { + "successfulRequests": 2, + "totalRequests": 3 + }, + "batchItems": [ + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 11 + }, + "addresses": [ + { + "address": { + "country": "France", + "freeformAddress": "Avenue Anatole France, 75007 Paris" + }, + "position": "48.858490,2.294820" + } + ] + } + }, + { + "statusCode": 200, + "response": + { + "summary": { + "queryTime": 1 + }, + "addresses": [ + { + "address": { + "country": "United States of America", + "freeformAddress": "157th Pl NE, Redmond WA 98052" + }, + "position": "47.640470,-122.129430" + } + ] + } + }, + { + "statusCode": 400, + "response": + { + "error": + { + "code": "400 BadRequest", + "message": "Bad request: one or more parameters were incorrectly + specified or are mutually exclusive." + } + } + } + ] + }. + + :param format: Batch id for querying the operation. + :type format: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be LROBasePolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SearchAddressReverseBatchResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.maps.search.models.SearchAddressReverseBatchResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchAddressReverseBatchResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_search_address_reverse_batch_initial( + format=format, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SearchAddressReverseBatchResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'format': self._serialize.url("format", format, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_search_address_reverse_batch.metadata = {'url': '/search/address/reverse/batch/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-search/azure/maps/search/py.typed b/sdk/maps/azure-maps-search/azure/maps/search/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-search/azure/maps/search/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-search/sdk_packaging.toml b/sdk/maps/azure-maps-search/sdk_packaging.toml new file mode 100644 index 000000000000..8460703a0925 --- /dev/null +++ b/sdk/maps/azure-maps-search/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-search" +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-search/setup.cfg b/sdk/maps/azure-maps-search/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-search/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-search/setup.py b/sdk/maps/azure-maps-search/setup.py new file mode 100644 index 000000000000..2a2db158393a --- /dev/null +++ b/sdk/maps/azure-maps-search/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-search" +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'], + } +) diff --git a/sdk/maps/azure-maps-traffic/CHANGELOG.md b/sdk/maps/azure-maps-traffic/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-traffic/MANIFEST.in b/sdk/maps/azure-maps-traffic/MANIFEST.in new file mode 100644 index 000000000000..cb7d3109cc06 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/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 + diff --git a/sdk/maps/azure-maps-traffic/README.md b/sdk/maps/azure-maps-traffic/README.md new file mode 100644 index 000000000000..691a24928e9e --- /dev/null +++ b/sdk/maps/azure-maps-traffic/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-traffic%2FREADME.png) diff --git a/sdk/maps/azure-maps-traffic/_meta.json b/sdk/maps/azure-maps-traffic/_meta.json new file mode 100644 index 000000000000..079477bd8e03 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "fd01f0058f99a0d2b145abbb7ade2cd90d9d3a82", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/Traffic/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/Traffic/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-traffic/azure/__init__.py b/sdk/maps/azure-maps-traffic/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-traffic/azure/maps/__init__.py b/sdk/maps/azure-maps-traffic/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/__init__.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/__init__.py new file mode 100644 index 000000000000..a725fdd54fa7 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/__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 ._traffic_client import TrafficClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['TrafficClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/_configuration.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_configuration.py new file mode 100644 index 000000000000..7f8aa657d927 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_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 TrafficClientConfiguration(Configuration): + """Configuration for TrafficClient. + + 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(TrafficClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-traffic/{}'.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-traffic/azure/maps/traffic/_metadata.json b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_metadata.json new file mode 100644 index 000000000000..905422a46707 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_metadata.json @@ -0,0 +1,168 @@ +{ + "chosen_version": "1.0", + "total_api_version_list": ["1.0"], + "client": { + "name": "TrafficClient", + "filename": "_traffic_client", + "description": "Azure Maps Traffic 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\": [\"TrafficClientConfiguration\"], \"._operations_mixin\": [\"TrafficClientOperationsMixin\"]}}}", + "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\": [\"TrafficClientConfiguration\"], \"._operations_mixin\": [\"TrafficClientOperationsMixin\"]}}}" + }, + "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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"IO\", \"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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"IO\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_traffic_flow_tile" : { + "sync": { + "signature": "def get_traffic_flow_tile(\n self,\n format, # type: Union[str, \"_models.TileFormat\"]\n style, # type: Union[str, \"_models.TrafficFlowTileStyle\"]\n zoom, # type: int\n x_tile_index, # type: int\n y_tile_index, # type: int\n thickness=None, # type: Optional[int]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Traffic Flow Tile**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Azure Flow Tile API serves 256 x 256 pixel tiles showing traffic flow. All tiles use the\nsame grid system. Because the traffic tiles use transparent images, they can be layered on top\nof map tiles to create a compound display. The Flow tiles use colors to indicate either the\nspeed of traffic on different road segments, or the difference between that speed and the\nfree-flow speed on the road segment in question.\n\n:param format: Desired format of the response. Possible values are png \u0026 pbf.\n:type format: str or ~azure.maps.traffic.models.TileFormat\n:param style: .. raw:: html\n\n \u003cp\u003eThe style to be used to render the tile.\u003c/p\u003e.\n:type style: str or ~azure.maps.traffic.models.TrafficFlowTileStyle\n:param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range:\n 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive).\n 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 x_tile_index: X coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type x_tile_index: int\n:param y_tile_index: Y coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type y_tile_index: int\n:param thickness: The value of the width of the line representing traffic. This value is a\n multiplier and the accepted values range from 1 - 20. The default value is 10. This parameter\n is not valid when format is pbf.\n:type thickness: int\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_traffic_flow_tile(\n self,\n format: Union[str, \"_models.TileFormat\"],\n style: Union[str, \"_models.TrafficFlowTileStyle\"],\n zoom: int,\n x_tile_index: int,\n y_tile_index: int,\n thickness: Optional[int] = None,\n **kwargs: Any\n) -\u003e IO:\n", + "doc": "\"\"\"**Traffic Flow Tile**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe Azure Flow Tile API serves 256 x 256 pixel tiles showing traffic flow. All tiles use the\nsame grid system. Because the traffic tiles use transparent images, they can be layered on top\nof map tiles to create a compound display. The Flow tiles use colors to indicate either the\nspeed of traffic on different road segments, or the difference between that speed and the\nfree-flow speed on the road segment in question.\n\n:param format: Desired format of the response. Possible values are png \u0026 pbf.\n:type format: str or ~azure.maps.traffic.models.TileFormat\n:param style: .. raw:: html\n\n \u003cp\u003eThe style to be used to render the tile.\u003c/p\u003e.\n:type style: str or ~azure.maps.traffic.models.TrafficFlowTileStyle\n:param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range:\n 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive).\n 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 x_tile_index: X coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type x_tile_index: int\n:param y_tile_index: Y coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type y_tile_index: int\n:param thickness: The value of the width of the line representing traffic. This value is a\n multiplier and the accepted values range from 1 - 20. The default value is 10. This parameter\n is not valid when format is pbf.\n:type thickness: int\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, style, zoom, x_tile_index, y_tile_index, thickness" + }, + "get_traffic_flow_segment" : { + "sync": { + "signature": "def get_traffic_flow_segment(\n self,\n style, # type: Union[str, \"_models.TrafficFlowSegmentStyle\"]\n zoom, # type: int\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n unit=None, # type: Optional[Union[str, \"_models.SpeedUnit\"]]\n thickness=None, # type: Optional[int]\n open_lr=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Traffic Flow Segment**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis service provides information about the speeds and travel times of the road fragment\nclosest to the given coordinates. It is designed to work alongside the Flow layer of the Render\nService to support clickable flow data visualizations. With this API, the client side can\nconnect any place in the map with flow data on the closest road and present it to the user.\n\n:param style: The style to be used to render the tile. Valid values are absolute which returns\n colors reflecting the absolute speed measured, relative which returns the speed relative to\n free-flow, Relative-delay which displays relative speeds only where they are different from the\n freeflow speeds.\n:type style: str or ~azure.maps.traffic.models.TrafficFlowSegmentStyle\n:param zoom: Zoom level for the desired tile. Zoom value must be in the range: 0-22\n (inclusive).\n 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 query: Coordinates of the point close to the road segment. They have to be\n comma-separated and calculated using EPSG4326 projection.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.traffic.models.ResponseFormat\n:param unit: Unit of speed in KMPH or MPH.\n:type unit: str or ~azure.maps.traffic.models.SpeedUnit\n:param thickness: The value of the width of the line representing traffic. This value is a\n multiplier and the accepted values range from 1 - 20. The default value is 10.\n:type thickness: int\n:param open_lr: Boolean on whether the response should include OpenLR code.\n:type open_lr: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: TrafficFlowSegmentResult, or the result of cls(response)\n:rtype: ~azure.maps.traffic.models.TrafficFlowSegmentResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_traffic_flow_segment(\n self,\n style: Union[str, \"_models.TrafficFlowSegmentStyle\"],\n zoom: int,\n query: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n unit: Optional[Union[str, \"_models.SpeedUnit\"]] = None,\n thickness: Optional[int] = None,\n open_lr: Optional[bool] = None,\n **kwargs: Any\n) -\u003e \"_models.TrafficFlowSegmentResult\":\n", + "doc": "\"\"\"**Traffic Flow Segment**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis service provides information about the speeds and travel times of the road fragment\nclosest to the given coordinates. It is designed to work alongside the Flow layer of the Render\nService to support clickable flow data visualizations. With this API, the client side can\nconnect any place in the map with flow data on the closest road and present it to the user.\n\n:param style: The style to be used to render the tile. Valid values are absolute which returns\n colors reflecting the absolute speed measured, relative which returns the speed relative to\n free-flow, Relative-delay which displays relative speeds only where they are different from the\n freeflow speeds.\n:type style: str or ~azure.maps.traffic.models.TrafficFlowSegmentStyle\n:param zoom: Zoom level for the desired tile. Zoom value must be in the range: 0-22\n (inclusive).\n 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 query: Coordinates of the point close to the road segment. They have to be\n comma-separated and calculated using EPSG4326 projection.\n:type query: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.traffic.models.ResponseFormat\n:param unit: Unit of speed in KMPH or MPH.\n:type unit: str or ~azure.maps.traffic.models.SpeedUnit\n:param thickness: The value of the width of the line representing traffic. This value is a\n multiplier and the accepted values range from 1 - 20. The default value is 10.\n:type thickness: int\n:param open_lr: Boolean on whether the response should include OpenLR code.\n:type open_lr: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: TrafficFlowSegmentResult, or the result of cls(response)\n:rtype: ~azure.maps.traffic.models.TrafficFlowSegmentResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "style, zoom, query, format, unit, thickness, open_lr" + }, + "get_traffic_incident_tile" : { + "sync": { + "signature": "def get_traffic_incident_tile(\n self,\n format, # type: Union[str, \"_models.TileFormat\"]\n style, # type: Union[str, \"_models.TrafficIncidentTileStyle\"]\n zoom, # type: int\n x_tile_index, # type: int\n y_tile_index, # type: int\n traffic_state=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Traffic Incident Tile**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis service serves 256 x 256 pixel tiles showing traffic incidents. All tiles use the same\ngrid system. Because the traffic tiles use transparent images, they can be layered on top of\nmap tiles to create a compound display. Traffic tiles render graphics to indicate traffic on\nthe roads in the specified area.\n\n:param format: Desired format of the response. Possible values are png \u0026 pbf.\n:type format: str or ~azure.maps.traffic.models.TileFormat\n:param style: The style to be used to render the tile. This parameter is not valid when format\n is pbf.\n:type style: str or ~azure.maps.traffic.models.TrafficIncidentTileStyle\n:param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range:\n 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive).\n 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 x_tile_index: X coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type x_tile_index: int\n:param y_tile_index: Y coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type y_tile_index: int\n:param traffic_state: Reference value for the state of traffic at a particular time, obtained\n from the Viewport API call, trafficModelId attribute in trafficState field. It is updated every\n minute, and is valid for two minutes before it times out. Use -1 to get the most recent\n traffic information. Default: most recent traffic information.\n:type traffic_state: 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_traffic_incident_tile(\n self,\n format: Union[str, \"_models.TileFormat\"],\n style: Union[str, \"_models.TrafficIncidentTileStyle\"],\n zoom: int,\n x_tile_index: int,\n y_tile_index: int,\n traffic_state: Optional[str] = None,\n **kwargs: Any\n) -\u003e IO:\n", + "doc": "\"\"\"**Traffic Incident Tile**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis service serves 256 x 256 pixel tiles showing traffic incidents. All tiles use the same\ngrid system. Because the traffic tiles use transparent images, they can be layered on top of\nmap tiles to create a compound display. Traffic tiles render graphics to indicate traffic on\nthe roads in the specified area.\n\n:param format: Desired format of the response. Possible values are png \u0026 pbf.\n:type format: str or ~azure.maps.traffic.models.TileFormat\n:param style: The style to be used to render the tile. This parameter is not valid when format\n is pbf.\n:type style: str or ~azure.maps.traffic.models.TrafficIncidentTileStyle\n:param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range:\n 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive).\n 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 x_tile_index: X coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type x_tile_index: int\n:param y_tile_index: Y coordinate of the tile on zoom grid. Value must be in the range [0,\n 2:code:`\u003csup\u003e`zoom`\u003c/sup\u003e` -1].\n\n Please see `Zoom Levels and Tile Grid\n \u003chttps://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid\u003e`_ for\n details.\n:type y_tile_index: int\n:param traffic_state: Reference value for the state of traffic at a particular time, obtained\n from the Viewport API call, trafficModelId attribute in trafficState field. It is updated every\n minute, and is valid for two minutes before it times out. Use -1 to get the most recent\n traffic information. Default: most recent traffic information.\n:type traffic_state: 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, style, zoom, x_tile_index, y_tile_index, traffic_state" + }, + "get_traffic_incident_detail" : { + "sync": { + "signature": "def get_traffic_incident_detail(\n self,\n style, # type: Union[str, \"_models.TrafficIncidentDetailStyle\"]\n boundingbox, # type: str\n bounding_zoom, # type: int\n trafficmodelid, # type: str\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n language=None, # type: Optional[str]\n projection=None, # type: Optional[Union[str, \"_models.ProjectionStandard\"]]\n geometries=None, # type: Optional[Union[str, \"_models.IncidentGeometryType\"]]\n expand_cluster=None, # type: Optional[bool]\n original_position=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Traffic Incident Detail**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis API provides information on traffic incidents inside a given bounding box, based on the\ncurrent Traffic Model ID. The Traffic Model ID is available to grant synchronization of data\nbetween calls and API\u0027s. The Traffic Model ID is a key value for determining the currency of\ntraffic incidents. It is updated every minute, and is valid for two minutes before it times\nout. It is used in rendering `incident tiles\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidenttile\u003e`_. It can be\nobtained from the `Viewport API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidentviewport\u003e`_.\n\n:param style: The style that will be used to render the tile in Traffic `Incident Tile API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidenttile\u003e`_. This will\n have an effect on the coordinates of traffic incidents in the reply.\n:type style: str or ~azure.maps.traffic.models.TrafficIncidentDetailStyle\n:param boundingbox: The ``boundingbox`` is represented by two value pairs describing it\u0027s\n corners (first pair for lower left corner and second for upper right). The pairs can either be\n specified using any of the ``projection``\\ \u0027s specified below (e.g., *minY,minX,maxY,maxX*\\ )\n or by two latitude-longitude pairs (e.g., *minLat,minLon,maxLat,maxLon*\\\n ).:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`NOTE: If latitude/longitude pairs are used, then the ``projection``\n parameter must be set to \"EPSG4326\".\n:type boundingbox: str\n:param bounding_zoom: Zoom level for desired tile. 0 to 22 for raster tiles, 0 through 22 for\n vector tiles.\n:type bounding_zoom: int\n:param trafficmodelid: Number referencing traffic model. This can be obtained from the\n `Viewport API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidentviewport\u003e`_. It is\n updated every minute, and is valid for two minutes before it times out. If the wrong Traffic\n Model ID is specified, the correct one will be returned by the interface. A value of -1 will\n always invoke the most recent traffic model.\n:type trafficmodelid: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.traffic.models.ResponseFormat\n:param language: `ISO 639-1 code \u003chttps://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\u003e`_ for\n the output language. Supported languages are ar, ca, cs, da, de, el, en, en-GB, en-US, es, et,\n fi, fr, he, hu, id, in*, it, lt, lv, nb, nl, no, pl, pt, ro, ru, sk, sv, th, tr, zh.\n\n Please refer to `Supported Languages\n \u003chttps://docs.microsoft.com/en-us/azure/azure-maps/supported-languages\u003e`_ for details. When\n invalid language code is provided response is returned in English. When incident cause or\n description does not have translation, English description is returned.\n:type language: str\n:param projection: The projection used to specify the coordinates in the request and response.\n `EPSG900913 \u003chttp://docs.openlayers.org/library/spherical_mercator.html\u003e`_ (default) or\n `EPSG4326 \u003chttp://spatialreference.org/ref/epsg/4326/\u003e`_.\n:type projection: str or ~azure.maps.traffic.models.ProjectionStandard\n:param geometries: The type of vector geometry added to incidents (returned in the :code:`\u003cv\u003e`\n element of the response).\n:type geometries: str or ~azure.maps.traffic.models.IncidentGeometryType\n:param expand_cluster: Boolean to indicate whether to list all traffic incidents in a cluster\n separately.\n:type expand_cluster: bool\n:param original_position: Boolean on whether to return the original position of the incident\n (:code:`\u003cop\u003e`) as well as the one shifted to the beginning of the traffic tube (:code:`\u003cop\u003e`).\n:type original_position: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: TrafficIncidentDetailResult, or the result of cls(response)\n:rtype: ~azure.maps.traffic.models.TrafficIncidentDetailResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_traffic_incident_detail(\n self,\n style: Union[str, \"_models.TrafficIncidentDetailStyle\"],\n boundingbox: str,\n bounding_zoom: int,\n trafficmodelid: str,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n language: Optional[str] = None,\n projection: Optional[Union[str, \"_models.ProjectionStandard\"]] = None,\n geometries: Optional[Union[str, \"_models.IncidentGeometryType\"]] = None,\n expand_cluster: Optional[bool] = None,\n original_position: Optional[bool] = None,\n **kwargs: Any\n) -\u003e \"_models.TrafficIncidentDetailResult\":\n", + "doc": "\"\"\"**Traffic Incident Detail**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis API provides information on traffic incidents inside a given bounding box, based on the\ncurrent Traffic Model ID. The Traffic Model ID is available to grant synchronization of data\nbetween calls and API\u0027s. The Traffic Model ID is a key value for determining the currency of\ntraffic incidents. It is updated every minute, and is valid for two minutes before it times\nout. It is used in rendering `incident tiles\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidenttile\u003e`_. It can be\nobtained from the `Viewport API\n\u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidentviewport\u003e`_.\n\n:param style: The style that will be used to render the tile in Traffic `Incident Tile API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidenttile\u003e`_. This will\n have an effect on the coordinates of traffic incidents in the reply.\n:type style: str or ~azure.maps.traffic.models.TrafficIncidentDetailStyle\n:param boundingbox: The ``boundingbox`` is represented by two value pairs describing it\u0027s\n corners (first pair for lower left corner and second for upper right). The pairs can either be\n specified using any of the ``projection``\\ \u0027s specified below (e.g., *minY,minX,maxY,maxX*\\ )\n or by two latitude-longitude pairs (e.g., *minLat,minLon,maxLat,maxLon*\\\n ).:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`NOTE: If latitude/longitude pairs are used, then the ``projection``\n parameter must be set to \"EPSG4326\".\n:type boundingbox: str\n:param bounding_zoom: Zoom level for desired tile. 0 to 22 for raster tiles, 0 through 22 for\n vector tiles.\n:type bounding_zoom: int\n:param trafficmodelid: Number referencing traffic model. This can be obtained from the\n `Viewport API\n \u003chttps://docs.microsoft.com/en-us/rest/api/maps/traffic/gettrafficincidentviewport\u003e`_. It is\n updated every minute, and is valid for two minutes before it times out. If the wrong Traffic\n Model ID is specified, the correct one will be returned by the interface. A value of -1 will\n always invoke the most recent traffic model.\n:type trafficmodelid: str\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.traffic.models.ResponseFormat\n:param language: `ISO 639-1 code \u003chttps://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\u003e`_ for\n the output language. Supported languages are ar, ca, cs, da, de, el, en, en-GB, en-US, es, et,\n fi, fr, he, hu, id, in*, it, lt, lv, nb, nl, no, pl, pt, ro, ru, sk, sv, th, tr, zh.\n\n Please refer to `Supported Languages\n \u003chttps://docs.microsoft.com/en-us/azure/azure-maps/supported-languages\u003e`_ for details. When\n invalid language code is provided response is returned in English. When incident cause or\n description does not have translation, English description is returned.\n:type language: str\n:param projection: The projection used to specify the coordinates in the request and response.\n `EPSG900913 \u003chttp://docs.openlayers.org/library/spherical_mercator.html\u003e`_ (default) or\n `EPSG4326 \u003chttp://spatialreference.org/ref/epsg/4326/\u003e`_.\n:type projection: str or ~azure.maps.traffic.models.ProjectionStandard\n:param geometries: The type of vector geometry added to incidents (returned in the :code:`\u003cv\u003e`\n element of the response).\n:type geometries: str or ~azure.maps.traffic.models.IncidentGeometryType\n:param expand_cluster: Boolean to indicate whether to list all traffic incidents in a cluster\n separately.\n:type expand_cluster: bool\n:param original_position: Boolean on whether to return the original position of the incident\n (:code:`\u003cop\u003e`) as well as the one shifted to the beginning of the traffic tube (:code:`\u003cop\u003e`).\n:type original_position: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: TrafficIncidentDetailResult, or the result of cls(response)\n:rtype: ~azure.maps.traffic.models.TrafficIncidentDetailResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "style, boundingbox, bounding_zoom, trafficmodelid, format, language, projection, geometries, expand_cluster, original_position" + }, + "get_traffic_incident_viewport" : { + "sync": { + "signature": "def get_traffic_incident_viewport(\n self,\n boundingbox, # type: str\n boundingzoom, # type: int\n overviewbox, # type: str\n overviewzoom, # type: int\n format=\"json\", # type: Union[str, \"_models.ResponseFormat\"]\n copyright=True, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Traffic Incident Viewport**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis API returns legal and technical information for the viewport described in the request. It\nshould be called by client applications whenever the viewport changes (for instance, through\nzooming, panning, going to a location, or displaying a route). The request should contain the\nbounding box and zoom level of the viewport whose information is needed. The return will\ncontain map version information, as well as the current Traffic Model ID and copyright IDs.\nThe Traffic Model ID returned by the Viewport Description is used by other APIs to retrieve\nlast traffic information for further processing.\n\n:param boundingbox: Bounding box of the map viewport in `EPSG900913\n \u003chttp://docs.openlayers.org/library/spherical_mercator.html\u003e`_ projection. The ``boundingbox``\n is represented by two value pairs describing it\u0027s corners (first pair for lower left corner and\n second for upper right). All values should be separated by commas (e.g., *minY,minX,maxY,maxX*\\\n ). The maximum size of the bounding box that can be passed is dependent on the requested zoom\n level. The width and height cannot exceed 4092 pixels when rendered on the given zoom\n level.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`NOTE: Bounding boxes that cross the 180\u00b0 meridian require special\n treatment. For such boxes, the eastern *maxX* value will be negative, and thus less than the\n *minX* value west of the 180\u00b0 meridian. To address that, the value 40075016.6855874 should be\n added to the true *maxX* value before it is passed in the request.\n:type boundingbox: str\n:param boundingzoom: Zoom level of the map viewport. Used to determine whether the view can be\n zoomed in.\n:type boundingzoom: int\n:param overviewbox: Bounding box of the overview map in `EPSG900913\n \u003chttp://docs.openlayers.org/library/spherical_mercator.html\u003e`_\n projection.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Used in case the overview box/mini map has different\n copyright data than the main map. If there is no mini map, the same coordinates as\n ``boundingBox`` is used.\n:type overviewbox: str\n:param overviewzoom: Zoom level of the overview map. If there is no mini map, use the same zoom\n level as boundingZoom.\n:type overviewzoom: int\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.traffic.models.ResponseFormat\n:param copyright: Determines what copyright information to return. When true the copyright text\n is returned; when false only the copyright index is returned.\n:type copyright: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: TrafficIncidentViewportResult, or the result of cls(response)\n:rtype: ~azure.maps.traffic.models.TrafficIncidentViewportResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_traffic_incident_viewport(\n self,\n boundingbox: str,\n boundingzoom: int,\n overviewbox: str,\n overviewzoom: int,\n format: Union[str, \"_models.ResponseFormat\"] = \"json\",\n copyright: Optional[bool] = True,\n **kwargs: Any\n) -\u003e \"_models.TrafficIncidentViewportResult\":\n", + "doc": "\"\"\"**Traffic Incident Viewport**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThis API returns legal and technical information for the viewport described in the request. It\nshould be called by client applications whenever the viewport changes (for instance, through\nzooming, panning, going to a location, or displaying a route). The request should contain the\nbounding box and zoom level of the viewport whose information is needed. The return will\ncontain map version information, as well as the current Traffic Model ID and copyright IDs.\nThe Traffic Model ID returned by the Viewport Description is used by other APIs to retrieve\nlast traffic information for further processing.\n\n:param boundingbox: Bounding box of the map viewport in `EPSG900913\n \u003chttp://docs.openlayers.org/library/spherical_mercator.html\u003e`_ projection. The ``boundingbox``\n is represented by two value pairs describing it\u0027s corners (first pair for lower left corner and\n second for upper right). All values should be separated by commas (e.g., *minY,minX,maxY,maxX*\\\n ). The maximum size of the bounding box that can be passed is dependent on the requested zoom\n level. The width and height cannot exceed 4092 pixels when rendered on the given zoom\n level.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`NOTE: Bounding boxes that cross the 180\u00b0 meridian require special\n treatment. For such boxes, the eastern *maxX* value will be negative, and thus less than the\n *minX* value west of the 180\u00b0 meridian. To address that, the value 40075016.6855874 should be\n added to the true *maxX* value before it is passed in the request.\n:type boundingbox: str\n:param boundingzoom: Zoom level of the map viewport. Used to determine whether the view can be\n zoomed in.\n:type boundingzoom: int\n:param overviewbox: Bounding box of the overview map in `EPSG900913\n \u003chttp://docs.openlayers.org/library/spherical_mercator.html\u003e`_\n projection.:code:`\u003cbr\u003e`:code:`\u003cbr\u003e`Used in case the overview box/mini map has different\n copyright data than the main map. If there is no mini map, the same coordinates as\n ``boundingBox`` is used.\n:type overviewbox: str\n:param overviewzoom: Zoom level of the overview map. If there is no mini map, use the same zoom\n level as boundingZoom.\n:type overviewzoom: int\n:param format: Desired format of the response. Value can be either *json* or *xml*.\n:type format: str or ~azure.maps.traffic.models.ResponseFormat\n:param copyright: Determines what copyright information to return. When true the copyright text\n is returned; when false only the copyright index is returned.\n:type copyright: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: TrafficIncidentViewportResult, or the result of cls(response)\n:rtype: ~azure.maps.traffic.models.TrafficIncidentViewportResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "boundingbox, boundingzoom, overviewbox, overviewzoom, format, copyright" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/_traffic_client.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_traffic_client.py new file mode 100644 index 000000000000..f305903fdfa9 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_traffic_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 TrafficClientConfiguration +from .operations import TrafficClientOperationsMixin +from . import models + + +class TrafficClient(TrafficClientOperationsMixin): + """Azure Maps Traffic 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 = TrafficClientConfiguration(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: () -> TrafficClient + 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-traffic/azure/maps/traffic/_version.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_version.py new file mode 100644 index 000000000000..b9995fb385b0 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/_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 = "1.0-preview" diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/__init__.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/__init__.py new file mode 100644 index 000000000000..8a8023f2c29d --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/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 ._traffic_client import TrafficClient +__all__ = ['TrafficClient'] diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/_configuration.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/_configuration.py new file mode 100644 index 000000000000..d2c1db8b0ef6 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/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 TrafficClientConfiguration(Configuration): + """Configuration for TrafficClient. + + 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(TrafficClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-traffic/{}'.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-traffic/azure/maps/traffic/aio/_traffic_client.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/_traffic_client.py new file mode 100644 index 000000000000..8ae7a5e40753 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/_traffic_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 TrafficClientConfiguration +from .operations import TrafficClientOperationsMixin +from .. import models + + +class TrafficClient(TrafficClientOperationsMixin): + """Azure Maps Traffic 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 = TrafficClientConfiguration(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) -> "TrafficClient": + 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-traffic/azure/maps/traffic/aio/operations/__init__.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/operations/__init__.py new file mode 100644 index 000000000000..be72f9aa2245 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/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 ._traffic_client_operations import TrafficClientOperationsMixin + +__all__ = [ + 'TrafficClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/operations/_traffic_client_operations.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/operations/_traffic_client_operations.py new file mode 100644 index 000000000000..db5f23c97463 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/aio/operations/_traffic_client_operations.py @@ -0,0 +1,564 @@ +# 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, Callable, Dict, Generic, IO, 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 TrafficClientOperationsMixin: + + async def get_traffic_flow_tile( + self, + format: Union[str, "_models.TileFormat"], + style: Union[str, "_models.TrafficFlowTileStyle"], + zoom: int, + x_tile_index: int, + y_tile_index: int, + thickness: Optional[int] = None, + **kwargs: Any + ) -> IO: + """**Traffic Flow Tile** + + **Applies to**\ : S0 and S1 pricing tiers. + + The Azure Flow Tile API serves 256 x 256 pixel tiles showing traffic flow. All tiles use the + same grid system. Because the traffic tiles use transparent images, they can be layered on top + of map tiles to create a compound display. The Flow tiles use colors to indicate either the + speed of traffic on different road segments, or the difference between that speed and the + free-flow speed on the road segment in question. + + :param format: Desired format of the response. Possible values are png & pbf. + :type format: str or ~azure.maps.traffic.models.TileFormat + :param style: .. raw:: html + +

The style to be used to render the tile.

. + :type style: str or ~azure.maps.traffic.models.TrafficFlowTileStyle + :param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range: + 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive). + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param x_tile_index: 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_tile_index: int + :param y_tile_index: 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_tile_index: int + :param thickness: The value of the width of the line representing traffic. This value is a + multiplier and the accepted values range from 1 - 20. The default value is 10. This parameter + is not valid when format is pbf. + :type thickness: int + :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 = "1.0" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_traffic_flow_tile.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['x'] = self._serialize.query("x_tile_index", x_tile_index, 'int') + query_parameters['y'] = self._serialize.query("y_tile_index", y_tile_index, 'int') + if thickness is not None: + query_parameters['thickness'] = self._serialize.query("thickness", thickness, 'int', maximum=20, minimum=1) + + # 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_traffic_flow_tile.metadata = {'url': '/traffic/flow/tile/{format}'} # type: ignore + + async def get_traffic_flow_segment( + self, + style: Union[str, "_models.TrafficFlowSegmentStyle"], + zoom: int, + query: str, + format: Union[str, "_models.ResponseFormat"] = "json", + unit: Optional[Union[str, "_models.SpeedUnit"]] = None, + thickness: Optional[int] = None, + open_lr: Optional[bool] = None, + **kwargs: Any + ) -> "_models.TrafficFlowSegmentResult": + """**Traffic Flow Segment** + + **Applies to**\ : S0 and S1 pricing tiers. + + This service provides information about the speeds and travel times of the road fragment + closest to the given coordinates. It is designed to work alongside the Flow layer of the Render + Service to support clickable flow data visualizations. With this API, the client side can + connect any place in the map with flow data on the closest road and present it to the user. + + :param style: The style to be used to render the tile. Valid values are absolute which returns + colors reflecting the absolute speed measured, relative which returns the speed relative to + free-flow, Relative-delay which displays relative speeds only where they are different from the + freeflow speeds. + :type style: str or ~azure.maps.traffic.models.TrafficFlowSegmentStyle + :param zoom: Zoom level for the desired tile. Zoom value must be in the range: 0-22 + (inclusive). + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param query: Coordinates of the point close to the road segment. They have to be + comma-separated and calculated using EPSG4326 projection. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.traffic.models.ResponseFormat + :param unit: Unit of speed in KMPH or MPH. + :type unit: str or ~azure.maps.traffic.models.SpeedUnit + :param thickness: The value of the width of the line representing traffic. This value is a + multiplier and the accepted values range from 1 - 20. The default value is 10. + :type thickness: int + :param open_lr: Boolean on whether the response should include OpenLR code. + :type open_lr: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrafficFlowSegmentResult, or the result of cls(response) + :rtype: ~azure.maps.traffic.models.TrafficFlowSegmentResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TrafficFlowSegmentResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_traffic_flow_segment.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if thickness is not None: + query_parameters['thickness'] = self._serialize.query("thickness", thickness, 'int', maximum=20, minimum=1) + if open_lr is not None: + query_parameters['openLr'] = self._serialize.query("open_lr", open_lr, 'bool') + + # 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('TrafficFlowSegmentResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_traffic_flow_segment.metadata = {'url': '/traffic/flow/segment/{format}'} # type: ignore + + async def get_traffic_incident_tile( + self, + format: Union[str, "_models.TileFormat"], + style: Union[str, "_models.TrafficIncidentTileStyle"], + zoom: int, + x_tile_index: int, + y_tile_index: int, + traffic_state: Optional[str] = None, + **kwargs: Any + ) -> IO: + """**Traffic Incident Tile** + + **Applies to**\ : S0 and S1 pricing tiers. + + This service serves 256 x 256 pixel tiles showing traffic incidents. All tiles use the same + grid system. Because the traffic tiles use transparent images, they can be layered on top of + map tiles to create a compound display. Traffic tiles render graphics to indicate traffic on + the roads in the specified area. + + :param format: Desired format of the response. Possible values are png & pbf. + :type format: str or ~azure.maps.traffic.models.TileFormat + :param style: The style to be used to render the tile. This parameter is not valid when format + is pbf. + :type style: str or ~azure.maps.traffic.models.TrafficIncidentTileStyle + :param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range: + 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive). + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param x_tile_index: 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_tile_index: int + :param y_tile_index: 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_tile_index: int + :param traffic_state: Reference value for the state of traffic at a particular time, obtained + from the Viewport API call, trafficModelId attribute in trafficState field. It is updated every + minute, and is valid for two minutes before it times out. Use -1 to get the most recent + traffic information. Default: most recent traffic information. + :type traffic_state: 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 = "1.0" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_traffic_incident_tile.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['x'] = self._serialize.query("x_tile_index", x_tile_index, 'int') + query_parameters['y'] = self._serialize.query("y_tile_index", y_tile_index, 'int') + if traffic_state is not None: + query_parameters['t'] = self._serialize.query("traffic_state", traffic_state, '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_traffic_incident_tile.metadata = {'url': '/traffic/incident/tile/{format}'} # type: ignore + + async def get_traffic_incident_detail( + self, + style: Union[str, "_models.TrafficIncidentDetailStyle"], + boundingbox: str, + bounding_zoom: int, + trafficmodelid: str, + format: Union[str, "_models.ResponseFormat"] = "json", + language: Optional[str] = None, + projection: Optional[Union[str, "_models.ProjectionStandard"]] = None, + geometries: Optional[Union[str, "_models.IncidentGeometryType"]] = None, + expand_cluster: Optional[bool] = None, + original_position: Optional[bool] = None, + **kwargs: Any + ) -> "_models.TrafficIncidentDetailResult": + """**Traffic Incident Detail** + + **Applies to**\ : S0 and S1 pricing tiers. + + This API provides information on traffic incidents inside a given bounding box, based on the + current Traffic Model ID. The Traffic Model ID is available to grant synchronization of data + between calls and API's. The Traffic Model ID is a key value for determining the currency of + traffic incidents. It is updated every minute, and is valid for two minutes before it times + out. It is used in rendering `incident tiles + `_. It can be + obtained from the `Viewport API + `_. + + :param style: The style that will be used to render the tile in Traffic `Incident Tile API + `_. This will + have an effect on the coordinates of traffic incidents in the reply. + :type style: str or ~azure.maps.traffic.models.TrafficIncidentDetailStyle + :param boundingbox: The ``boundingbox`` is represented by two value pairs describing it's + corners (first pair for lower left corner and second for upper right). The pairs can either be + specified using any of the ``projection``\ 's specified below (e.g., *minY,minX,maxY,maxX*\ ) + or by two latitude-longitude pairs (e.g., *minLat,minLon,maxLat,maxLon*\ + ).:code:`
`:code:`
`NOTE: If latitude/longitude pairs are used, then the ``projection`` + parameter must be set to "EPSG4326". + :type boundingbox: str + :param bounding_zoom: Zoom level for desired tile. 0 to 22 for raster tiles, 0 through 22 for + vector tiles. + :type bounding_zoom: int + :param trafficmodelid: Number referencing traffic model. This can be obtained from the + `Viewport API + `_. It is + updated every minute, and is valid for two minutes before it times out. If the wrong Traffic + Model ID is specified, the correct one will be returned by the interface. A value of -1 will + always invoke the most recent traffic model. + :type trafficmodelid: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.traffic.models.ResponseFormat + :param language: `ISO 639-1 code `_ for + the output language. Supported languages are ar, ca, cs, da, de, el, en, en-GB, en-US, es, et, + fi, fr, he, hu, id, in*, it, lt, lv, nb, nl, no, pl, pt, ro, ru, sk, sv, th, tr, zh. + + Please refer to `Supported Languages + `_ for details. When + invalid language code is provided response is returned in English. When incident cause or + description does not have translation, English description is returned. + :type language: str + :param projection: The projection used to specify the coordinates in the request and response. + `EPSG900913 `_ (default) or + `EPSG4326 `_. + :type projection: str or ~azure.maps.traffic.models.ProjectionStandard + :param geometries: The type of vector geometry added to incidents (returned in the :code:`` + element of the response). + :type geometries: str or ~azure.maps.traffic.models.IncidentGeometryType + :param expand_cluster: Boolean to indicate whether to list all traffic incidents in a cluster + separately. + :type expand_cluster: bool + :param original_position: Boolean on whether to return the original position of the incident + (:code:``) as well as the one shifted to the beginning of the traffic tube (:code:``). + :type original_position: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrafficIncidentDetailResult, or the result of cls(response) + :rtype: ~azure.maps.traffic.models.TrafficIncidentDetailResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TrafficIncidentDetailResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_traffic_incident_detail.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['boundingbox'] = self._serialize.query("boundingbox", boundingbox, 'str') + query_parameters['boundingZoom'] = self._serialize.query("bounding_zoom", bounding_zoom, 'int', maximum=22, minimum=0) + query_parameters['trafficmodelid'] = self._serialize.query("trafficmodelid", trafficmodelid, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if projection is not None: + query_parameters['projection'] = self._serialize.query("projection", projection, 'str') + if geometries is not None: + query_parameters['geometries'] = self._serialize.query("geometries", geometries, 'str') + if expand_cluster is not None: + query_parameters['expandCluster'] = self._serialize.query("expand_cluster", expand_cluster, 'bool') + if original_position is not None: + query_parameters['originalPosition'] = self._serialize.query("original_position", original_position, 'bool') + + # 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('TrafficIncidentDetailResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_traffic_incident_detail.metadata = {'url': '/traffic/incident/detail/{format}'} # type: ignore + + async def get_traffic_incident_viewport( + self, + boundingbox: str, + boundingzoom: int, + overviewbox: str, + overviewzoom: int, + format: Union[str, "_models.ResponseFormat"] = "json", + copyright: Optional[bool] = True, + **kwargs: Any + ) -> "_models.TrafficIncidentViewportResult": + """**Traffic Incident Viewport** + + **Applies to**\ : S0 and S1 pricing tiers. + + This API returns legal and technical information for the viewport described in the request. It + should be called by client applications whenever the viewport changes (for instance, through + zooming, panning, going to a location, or displaying a route). The request should contain the + bounding box and zoom level of the viewport whose information is needed. The return will + contain map version information, as well as the current Traffic Model ID and copyright IDs. + The Traffic Model ID returned by the Viewport Description is used by other APIs to retrieve + last traffic information for further processing. + + :param boundingbox: Bounding box of the map viewport in `EPSG900913 + `_ projection. The ``boundingbox`` + is represented by two value pairs describing it's corners (first pair for lower left corner and + second for upper right). All values should be separated by commas (e.g., *minY,minX,maxY,maxX*\ + ). The maximum size of the bounding box that can be passed is dependent on the requested zoom + level. The width and height cannot exceed 4092 pixels when rendered on the given zoom + level.:code:`
`:code:`
`NOTE: Bounding boxes that cross the 180° meridian require special + treatment. For such boxes, the eastern *maxX* value will be negative, and thus less than the + *minX* value west of the 180° meridian. To address that, the value 40075016.6855874 should be + added to the true *maxX* value before it is passed in the request. + :type boundingbox: str + :param boundingzoom: Zoom level of the map viewport. Used to determine whether the view can be + zoomed in. + :type boundingzoom: int + :param overviewbox: Bounding box of the overview map in `EPSG900913 + `_ + projection.:code:`
`:code:`
`Used in case the overview box/mini map has different + copyright data than the main map. If there is no mini map, the same coordinates as + ``boundingBox`` is used. + :type overviewbox: str + :param overviewzoom: Zoom level of the overview map. If there is no mini map, use the same zoom + level as boundingZoom. + :type overviewzoom: int + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.traffic.models.ResponseFormat + :param copyright: Determines what copyright information to return. When true the copyright text + is returned; when false only the copyright index is returned. + :type copyright: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrafficIncidentViewportResult, or the result of cls(response) + :rtype: ~azure.maps.traffic.models.TrafficIncidentViewportResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TrafficIncidentViewportResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_traffic_incident_viewport.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['boundingbox'] = self._serialize.query("boundingbox", boundingbox, 'str') + query_parameters['boundingzoom'] = self._serialize.query("boundingzoom", boundingzoom, 'int', maximum=22, minimum=0) + query_parameters['overviewbox'] = self._serialize.query("overviewbox", overviewbox, 'str') + query_parameters['overviewzoom'] = self._serialize.query("overviewzoom", overviewzoom, 'int', maximum=22, minimum=0) + if copyright is not None: + query_parameters['copyright'] = self._serialize.query("copyright", copyright, 'bool') + + # 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('TrafficIncidentViewportResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_traffic_incident_viewport.metadata = {'url': '/traffic/incident/viewport/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/__init__.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/__init__.py new file mode 100644 index 000000000000..611194f75030 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/__init__.py @@ -0,0 +1,82 @@ +# 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 ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import LatLongPair + from ._models_py3 import TrafficFlowSegmentResult + from ._models_py3 import TrafficFlowSegmentResultFlowSegmentData + from ._models_py3 import TrafficFlowSegmentResultFlowSegmentDataCoordinates + from ._models_py3 import TrafficIncidentDetailResult + from ._models_py3 import TrafficIncidentDetailResultTm + from ._models_py3 import TrafficIncidentPoi + from ._models_py3 import TrafficIncidentPoiCbl + from ._models_py3 import TrafficIncidentPoiCtr + from ._models_py3 import TrafficIncidentPoiP + from ._models_py3 import TrafficIncidentViewportResult + from ._models_py3 import TrafficIncidentViewportResultViewpResp + from ._models_py3 import TrafficIncidentViewportResultViewpRespTrafficState +except (SyntaxError, ImportError): + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import LatLongPair # type: ignore + from ._models import TrafficFlowSegmentResult # type: ignore + from ._models import TrafficFlowSegmentResultFlowSegmentData # type: ignore + from ._models import TrafficFlowSegmentResultFlowSegmentDataCoordinates # type: ignore + from ._models import TrafficIncidentDetailResult # type: ignore + from ._models import TrafficIncidentDetailResultTm # type: ignore + from ._models import TrafficIncidentPoi # type: ignore + from ._models import TrafficIncidentPoiCbl # type: ignore + from ._models import TrafficIncidentPoiCtr # type: ignore + from ._models import TrafficIncidentPoiP # type: ignore + from ._models import TrafficIncidentViewportResult # type: ignore + from ._models import TrafficIncidentViewportResultViewpResp # type: ignore + from ._models import TrafficIncidentViewportResultViewpRespTrafficState # type: ignore + +from ._traffic_client_enums import ( + IncidentGeometryType, + ProjectionStandard, + ResponseFormat, + SpeedUnit, + TileFormat, + TrafficFlowSegmentStyle, + TrafficFlowTileStyle, + TrafficIncidentDetailStyle, + TrafficIncidentTileStyle, +) + +__all__ = [ + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'LatLongPair', + 'TrafficFlowSegmentResult', + 'TrafficFlowSegmentResultFlowSegmentData', + 'TrafficFlowSegmentResultFlowSegmentDataCoordinates', + 'TrafficIncidentDetailResult', + 'TrafficIncidentDetailResultTm', + 'TrafficIncidentPoi', + 'TrafficIncidentPoiCbl', + 'TrafficIncidentPoiCtr', + 'TrafficIncidentPoiP', + 'TrafficIncidentViewportResult', + 'TrafficIncidentViewportResultViewpResp', + 'TrafficIncidentViewportResultViewpRespTrafficState', + 'IncidentGeometryType', + 'ProjectionStandard', + 'ResponseFormat', + 'SpeedUnit', + 'TileFormat', + 'TrafficFlowSegmentStyle', + 'TrafficFlowTileStyle', + 'TrafficIncidentDetailStyle', + 'TrafficIncidentTileStyle', +] diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_models.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_models.py new file mode 100644 index 000000000000..1d6c8e29b7bc --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_models.py @@ -0,0 +1,599 @@ +# 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 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.traffic.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.traffic.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.traffic.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 LatLongPair(msrest.serialization.Model): + """A location represented as a latitude and longitude. + + :param latitude: Latitude property. + :type latitude: float + :param longitude: Longitude property. + :type longitude: float + """ + + _attribute_map = { + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(LatLongPair, self).__init__(**kwargs) + self.latitude = kwargs.get('latitude', None) + self.longitude = kwargs.get('longitude', None) + + +class TrafficFlowSegmentResult(msrest.serialization.Model): + """This object is returned from a successful Traffic Flow Segment call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar flow_segment_data: Flow Segment Data property. + :vartype flow_segment_data: ~azure.maps.traffic.models.TrafficFlowSegmentResultFlowSegmentData + """ + + _validation = { + 'flow_segment_data': {'readonly': True}, + } + + _attribute_map = { + 'flow_segment_data': {'key': 'flowSegmentData', 'type': 'TrafficFlowSegmentResultFlowSegmentData'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficFlowSegmentResult, self).__init__(**kwargs) + self.flow_segment_data = None + + +class TrafficFlowSegmentResultFlowSegmentData(msrest.serialization.Model): + """Flow Segment Data property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar frc: Functional Road Class. This indicates the road type: + 0: Motorway, freeway or other major road. + 1: Major road, less important than a motorway. + 2: Other major road. + 3: Secondary road. + 4: Local connecting road. + 5: Local road of high importance. + 6: Local road. + :vartype frc: str + :ivar current_speed: The current average speed at the selected point, in the units requested. + This is calculated from the currentTravelTime and the length of the selected segment. + :vartype current_speed: int + :ivar free_flow_speed: The free flow speed expected under ideal conditions, expressed in the + units requested. This is related to the freeFlowTravelTime. + :vartype free_flow_speed: int + :ivar current_travel_time: Current travel time in seconds based on fused real-time measurements + between the defined locations in the specified direction. + :vartype current_travel_time: int + :ivar free_flow_travel_time: The travel time in seconds which would be expected under ideal + free flow conditions. + :vartype free_flow_travel_time: int + :ivar confidence: The confidence is a measure of the quality of the provided travel time and + speed. A value of 1 means full confidence, that the response contains the highest quality data. + Lower values indicate the degree that the response may vary from the actual conditions on the + road. Any value greater than 0.6 means the information was based on real-time probe input. A + value of 0.5 means the reported speed is based on historical info. A value between 0.5 and + 0.6 has a calculated weighted average between historical and live speeds. + :vartype confidence: float + :param coordinates: Includes the coordinates describing the shape of the segment. Coordinates + are shifted from the road depending on the zoom level to support high quality visualization in + every scale. + :type coordinates: + ~azure.maps.traffic.models.TrafficFlowSegmentResultFlowSegmentDataCoordinates + :ivar version: This indicates the software version that generated the response. + :vartype version: str + :ivar openlr: OpenLR code for segment. + :vartype openlr: float + """ + + _validation = { + 'frc': {'readonly': True}, + 'current_speed': {'readonly': True}, + 'free_flow_speed': {'readonly': True}, + 'current_travel_time': {'readonly': True}, + 'free_flow_travel_time': {'readonly': True}, + 'confidence': {'readonly': True}, + 'version': {'readonly': True}, + 'openlr': {'readonly': True}, + } + + _attribute_map = { + 'frc': {'key': 'frc', 'type': 'str'}, + 'current_speed': {'key': 'currentSpeed', 'type': 'int'}, + 'free_flow_speed': {'key': 'freeFlowSpeed', 'type': 'int'}, + 'current_travel_time': {'key': 'currentTravelTime', 'type': 'int'}, + 'free_flow_travel_time': {'key': 'freeFlowTravelTime', 'type': 'int'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'coordinates': {'key': 'coordinates', 'type': 'TrafficFlowSegmentResultFlowSegmentDataCoordinates'}, + 'version': {'key': '@version', 'type': 'str'}, + 'openlr': {'key': 'openlr', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficFlowSegmentResultFlowSegmentData, self).__init__(**kwargs) + self.frc = None + self.current_speed = None + self.free_flow_speed = None + self.current_travel_time = None + self.free_flow_travel_time = None + self.confidence = None + self.coordinates = kwargs.get('coordinates', None) + self.version = None + self.openlr = None + + +class TrafficFlowSegmentResultFlowSegmentDataCoordinates(msrest.serialization.Model): + """Includes the coordinates describing the shape of the segment. Coordinates are shifted from the road depending on the zoom level to support high quality visualization in every scale. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar coordinate: Coordinate array. + :vartype coordinate: list[~azure.maps.traffic.models.LatLongPair] + """ + + _validation = { + 'coordinate': {'readonly': True}, + } + + _attribute_map = { + 'coordinate': {'key': 'coordinate', 'type': '[LatLongPair]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficFlowSegmentResultFlowSegmentDataCoordinates, self).__init__(**kwargs) + self.coordinate = None + + +class TrafficIncidentDetailResult(msrest.serialization.Model): + """This object is returned from a successful Traffic incident Detail call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tm: Main response element. + :vartype tm: ~azure.maps.traffic.models.TrafficIncidentDetailResultTm + """ + + _validation = { + 'tm': {'readonly': True}, + } + + _attribute_map = { + 'tm': {'key': 'tm', 'type': 'TrafficIncidentDetailResultTm'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentDetailResult, self).__init__(**kwargs) + self.tm = None + + +class TrafficIncidentDetailResultTm(msrest.serialization.Model): + """Main response element. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ID of the traffic incident. + :vartype id: str + :ivar poi: A single traffic incident, or a cluster of traffic incidents. + :vartype poi: list[~azure.maps.traffic.models.TrafficIncidentPoi] + """ + + _validation = { + 'id': {'readonly': True}, + 'poi': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': '@id', 'type': 'str'}, + 'poi': {'key': 'poi', 'type': '[TrafficIncidentPoi]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentDetailResultTm, self).__init__(**kwargs) + self.id = None + self.poi = None + + +class TrafficIncidentPoi(msrest.serialization.Model): + """TrafficIncidentPoi. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ID of the traffic incident. + :vartype id: str + :ivar p: The point where an icon of the cluster or raw incident should be drawn, expressed in + the requested projection. This is affected by traffic style, zoom level and road type. + :vartype p: ~azure.maps.traffic.models.TrafficIncidentPoiP + :ivar ic: The icon category associated with this incident. Values are numbers in the range + 0-13, with the following meanings -- 0: Unknown, 1: Accident, 2: Fog, 3: Dangerous Conditions, + 4: Rain, 5: Ice, 6: Jam, 7: Lane Closed, 8: Road Closed, 9: Road Works, 10: Wind, 11: Flooding, + 12: Detour, 13: Cluster. + :vartype ic: int + :ivar ty: The magnitude of delay associated with incident. These values correspond to incident + colors in the traffic tiles. + :vartype ty: int + :ivar cbl: Bottom left coordinate of the cluster in the projection of the request. + :vartype cbl: ~azure.maps.traffic.models.TrafficIncidentPoiCbl + :ivar ctr: Top right coordinate of the cluster in the projection of the request. + :vartype ctr: ~azure.maps.traffic.models.TrafficIncidentPoiCtr + :ivar cs: Cluster size: the number of incidents in the cluster. + :vartype cs: int + :ivar l: Length of the incident in meters. + :vartype l: int + :ivar r: The road number(s) affected by the incident. Multiple road numbers will delimited by + slashes. + :vartype r: str + :ivar dl: Delay caused by the incident in seconds (except in road closures). + :vartype dl: int + :ivar t: To: the name of the intersection or location where the traffic due to the incident + ends. + :vartype t: str + :ivar f: From: the name of the intersection or location where the traffic due to the incident + starts. + :vartype f: str + :ivar d: Description of the incident in the language requested. + :vartype d: str + :ivar c: Cause of the incident, where available, in the language requested. + :vartype c: str + """ + + _validation = { + 'id': {'readonly': True}, + 'p': {'readonly': True}, + 'ic': {'readonly': True}, + 'ty': {'readonly': True}, + 'cbl': {'readonly': True}, + 'ctr': {'readonly': True}, + 'cs': {'readonly': True}, + 'l': {'readonly': True}, + 'r': {'readonly': True}, + 'dl': {'readonly': True}, + 't': {'readonly': True}, + 'f': {'readonly': True}, + 'd': {'readonly': True}, + 'c': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'p': {'key': 'p', 'type': 'TrafficIncidentPoiP'}, + 'ic': {'key': 'ic', 'type': 'int'}, + 'ty': {'key': 'ty', 'type': 'int'}, + 'cbl': {'key': 'cbl', 'type': 'TrafficIncidentPoiCbl'}, + 'ctr': {'key': 'ctr', 'type': 'TrafficIncidentPoiCtr'}, + 'cs': {'key': 'cs', 'type': 'int'}, + 'l': {'key': 'l', 'type': 'int'}, + 'r': {'key': 'r', 'type': 'str'}, + 'dl': {'key': 'dl', 'type': 'int'}, + 't': {'key': 't', 'type': 'str'}, + 'f': {'key': 'f', 'type': 'str'}, + 'd': {'key': 'd', 'type': 'str'}, + 'c': {'key': 'c', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoi, self).__init__(**kwargs) + self.id = None + self.p = None + self.ic = None + self.ty = None + self.cbl = None + self.ctr = None + self.cs = None + self.l = None + self.r = None + self.dl = None + self.t = None + self.f = None + self.d = None + self.c = None + + +class TrafficIncidentPoiCbl(msrest.serialization.Model): + """Bottom left coordinate of the cluster in the projection of the request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar x: x coordinate. + :vartype x: float + :ivar y: y coordinate. + :vartype y: float + """ + + _validation = { + 'x': {'readonly': True}, + 'y': {'readonly': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoiCbl, self).__init__(**kwargs) + self.x = None + self.y = None + + +class TrafficIncidentPoiCtr(msrest.serialization.Model): + """Top right coordinate of the cluster in the projection of the request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar x: x coordinate. + :vartype x: float + :ivar y: y coordinate. + :vartype y: float + """ + + _validation = { + 'x': {'readonly': True}, + 'y': {'readonly': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoiCtr, self).__init__(**kwargs) + self.x = None + self.y = None + + +class TrafficIncidentPoiP(msrest.serialization.Model): + """The point where an icon of the cluster or raw incident should be drawn, expressed in the requested projection. This is affected by traffic style, zoom level and road type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar x: x coordinate. + :vartype x: float + :ivar y: y coordinate. + :vartype y: float + """ + + _validation = { + 'x': {'readonly': True}, + 'y': {'readonly': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoiP, self).__init__(**kwargs) + self.x = None + self.y = None + + +class TrafficIncidentViewportResult(msrest.serialization.Model): + """This object is returned from a successful Traffic Incident Viewport call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar viewp_resp: Viewport Response object. + :vartype viewp_resp: ~azure.maps.traffic.models.TrafficIncidentViewportResultViewpResp + """ + + _validation = { + 'viewp_resp': {'readonly': True}, + } + + _attribute_map = { + 'viewp_resp': {'key': 'viewpResp', 'type': 'TrafficIncidentViewportResultViewpResp'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentViewportResult, self).__init__(**kwargs) + self.viewp_resp = None + + +class TrafficIncidentViewportResultViewpResp(msrest.serialization.Model): + """Viewport Response object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar traffic_state: Traffic State array. + :vartype traffic_state: + ~azure.maps.traffic.models.TrafficIncidentViewportResultViewpRespTrafficState + :ivar copyright_ids: Copyright Ids property. + :vartype copyright_ids: str + :ivar version: @Version property. + :vartype version: str + :ivar maps: @maps property. + :vartype maps: str + """ + + _validation = { + 'traffic_state': {'readonly': True}, + 'copyright_ids': {'readonly': True}, + 'version': {'readonly': True}, + 'maps': {'readonly': True}, + } + + _attribute_map = { + 'traffic_state': {'key': 'trafficState', 'type': 'TrafficIncidentViewportResultViewpRespTrafficState'}, + 'copyright_ids': {'key': 'copyrightIds', 'type': 'str'}, + 'version': {'key': '@version', 'type': 'str'}, + 'maps': {'key': '@maps', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentViewportResultViewpResp, self).__init__(**kwargs) + self.traffic_state = None + self.copyright_ids = None + self.version = None + self.maps = None + + +class TrafficIncidentViewportResultViewpRespTrafficState(msrest.serialization.Model): + """Traffic State array. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar traffic_age: @Traffic Age property. + :vartype traffic_age: int + :ivar traffic_model_id: @Traffic Model Id property. + :vartype traffic_model_id: str + """ + + _validation = { + 'traffic_age': {'readonly': True}, + 'traffic_model_id': {'readonly': True}, + } + + _attribute_map = { + 'traffic_age': {'key': '@trafficAge', 'type': 'int'}, + 'traffic_model_id': {'key': '@trafficModelId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentViewportResultViewpRespTrafficState, self).__init__(**kwargs) + self.traffic_age = None + self.traffic_model_id = None diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_models_py3.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_models_py3.py new file mode 100644 index 000000000000..395a15818a44 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_models_py3.py @@ -0,0 +1,608 @@ +# 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 Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +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.traffic.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.traffic.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.traffic.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 LatLongPair(msrest.serialization.Model): + """A location represented as a latitude and longitude. + + :param latitude: Latitude property. + :type latitude: float + :param longitude: Longitude property. + :type longitude: float + """ + + _attribute_map = { + 'latitude': {'key': 'latitude', 'type': 'float'}, + 'longitude': {'key': 'longitude', 'type': 'float'}, + } + + def __init__( + self, + *, + latitude: Optional[float] = None, + longitude: Optional[float] = None, + **kwargs + ): + super(LatLongPair, self).__init__(**kwargs) + self.latitude = latitude + self.longitude = longitude + + +class TrafficFlowSegmentResult(msrest.serialization.Model): + """This object is returned from a successful Traffic Flow Segment call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar flow_segment_data: Flow Segment Data property. + :vartype flow_segment_data: ~azure.maps.traffic.models.TrafficFlowSegmentResultFlowSegmentData + """ + + _validation = { + 'flow_segment_data': {'readonly': True}, + } + + _attribute_map = { + 'flow_segment_data': {'key': 'flowSegmentData', 'type': 'TrafficFlowSegmentResultFlowSegmentData'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficFlowSegmentResult, self).__init__(**kwargs) + self.flow_segment_data = None + + +class TrafficFlowSegmentResultFlowSegmentData(msrest.serialization.Model): + """Flow Segment Data property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar frc: Functional Road Class. This indicates the road type: + 0: Motorway, freeway or other major road. + 1: Major road, less important than a motorway. + 2: Other major road. + 3: Secondary road. + 4: Local connecting road. + 5: Local road of high importance. + 6: Local road. + :vartype frc: str + :ivar current_speed: The current average speed at the selected point, in the units requested. + This is calculated from the currentTravelTime and the length of the selected segment. + :vartype current_speed: int + :ivar free_flow_speed: The free flow speed expected under ideal conditions, expressed in the + units requested. This is related to the freeFlowTravelTime. + :vartype free_flow_speed: int + :ivar current_travel_time: Current travel time in seconds based on fused real-time measurements + between the defined locations in the specified direction. + :vartype current_travel_time: int + :ivar free_flow_travel_time: The travel time in seconds which would be expected under ideal + free flow conditions. + :vartype free_flow_travel_time: int + :ivar confidence: The confidence is a measure of the quality of the provided travel time and + speed. A value of 1 means full confidence, that the response contains the highest quality data. + Lower values indicate the degree that the response may vary from the actual conditions on the + road. Any value greater than 0.6 means the information was based on real-time probe input. A + value of 0.5 means the reported speed is based on historical info. A value between 0.5 and + 0.6 has a calculated weighted average between historical and live speeds. + :vartype confidence: float + :param coordinates: Includes the coordinates describing the shape of the segment. Coordinates + are shifted from the road depending on the zoom level to support high quality visualization in + every scale. + :type coordinates: + ~azure.maps.traffic.models.TrafficFlowSegmentResultFlowSegmentDataCoordinates + :ivar version: This indicates the software version that generated the response. + :vartype version: str + :ivar openlr: OpenLR code for segment. + :vartype openlr: float + """ + + _validation = { + 'frc': {'readonly': True}, + 'current_speed': {'readonly': True}, + 'free_flow_speed': {'readonly': True}, + 'current_travel_time': {'readonly': True}, + 'free_flow_travel_time': {'readonly': True}, + 'confidence': {'readonly': True}, + 'version': {'readonly': True}, + 'openlr': {'readonly': True}, + } + + _attribute_map = { + 'frc': {'key': 'frc', 'type': 'str'}, + 'current_speed': {'key': 'currentSpeed', 'type': 'int'}, + 'free_flow_speed': {'key': 'freeFlowSpeed', 'type': 'int'}, + 'current_travel_time': {'key': 'currentTravelTime', 'type': 'int'}, + 'free_flow_travel_time': {'key': 'freeFlowTravelTime', 'type': 'int'}, + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'coordinates': {'key': 'coordinates', 'type': 'TrafficFlowSegmentResultFlowSegmentDataCoordinates'}, + 'version': {'key': '@version', 'type': 'str'}, + 'openlr': {'key': 'openlr', 'type': 'float'}, + } + + def __init__( + self, + *, + coordinates: Optional["TrafficFlowSegmentResultFlowSegmentDataCoordinates"] = None, + **kwargs + ): + super(TrafficFlowSegmentResultFlowSegmentData, self).__init__(**kwargs) + self.frc = None + self.current_speed = None + self.free_flow_speed = None + self.current_travel_time = None + self.free_flow_travel_time = None + self.confidence = None + self.coordinates = coordinates + self.version = None + self.openlr = None + + +class TrafficFlowSegmentResultFlowSegmentDataCoordinates(msrest.serialization.Model): + """Includes the coordinates describing the shape of the segment. Coordinates are shifted from the road depending on the zoom level to support high quality visualization in every scale. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar coordinate: Coordinate array. + :vartype coordinate: list[~azure.maps.traffic.models.LatLongPair] + """ + + _validation = { + 'coordinate': {'readonly': True}, + } + + _attribute_map = { + 'coordinate': {'key': 'coordinate', 'type': '[LatLongPair]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficFlowSegmentResultFlowSegmentDataCoordinates, self).__init__(**kwargs) + self.coordinate = None + + +class TrafficIncidentDetailResult(msrest.serialization.Model): + """This object is returned from a successful Traffic incident Detail call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tm: Main response element. + :vartype tm: ~azure.maps.traffic.models.TrafficIncidentDetailResultTm + """ + + _validation = { + 'tm': {'readonly': True}, + } + + _attribute_map = { + 'tm': {'key': 'tm', 'type': 'TrafficIncidentDetailResultTm'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentDetailResult, self).__init__(**kwargs) + self.tm = None + + +class TrafficIncidentDetailResultTm(msrest.serialization.Model): + """Main response element. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ID of the traffic incident. + :vartype id: str + :ivar poi: A single traffic incident, or a cluster of traffic incidents. + :vartype poi: list[~azure.maps.traffic.models.TrafficIncidentPoi] + """ + + _validation = { + 'id': {'readonly': True}, + 'poi': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': '@id', 'type': 'str'}, + 'poi': {'key': 'poi', 'type': '[TrafficIncidentPoi]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentDetailResultTm, self).__init__(**kwargs) + self.id = None + self.poi = None + + +class TrafficIncidentPoi(msrest.serialization.Model): + """TrafficIncidentPoi. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ID of the traffic incident. + :vartype id: str + :ivar p: The point where an icon of the cluster or raw incident should be drawn, expressed in + the requested projection. This is affected by traffic style, zoom level and road type. + :vartype p: ~azure.maps.traffic.models.TrafficIncidentPoiP + :ivar ic: The icon category associated with this incident. Values are numbers in the range + 0-13, with the following meanings -- 0: Unknown, 1: Accident, 2: Fog, 3: Dangerous Conditions, + 4: Rain, 5: Ice, 6: Jam, 7: Lane Closed, 8: Road Closed, 9: Road Works, 10: Wind, 11: Flooding, + 12: Detour, 13: Cluster. + :vartype ic: int + :ivar ty: The magnitude of delay associated with incident. These values correspond to incident + colors in the traffic tiles. + :vartype ty: int + :ivar cbl: Bottom left coordinate of the cluster in the projection of the request. + :vartype cbl: ~azure.maps.traffic.models.TrafficIncidentPoiCbl + :ivar ctr: Top right coordinate of the cluster in the projection of the request. + :vartype ctr: ~azure.maps.traffic.models.TrafficIncidentPoiCtr + :ivar cs: Cluster size: the number of incidents in the cluster. + :vartype cs: int + :ivar l: Length of the incident in meters. + :vartype l: int + :ivar r: The road number(s) affected by the incident. Multiple road numbers will delimited by + slashes. + :vartype r: str + :ivar dl: Delay caused by the incident in seconds (except in road closures). + :vartype dl: int + :ivar t: To: the name of the intersection or location where the traffic due to the incident + ends. + :vartype t: str + :ivar f: From: the name of the intersection or location where the traffic due to the incident + starts. + :vartype f: str + :ivar d: Description of the incident in the language requested. + :vartype d: str + :ivar c: Cause of the incident, where available, in the language requested. + :vartype c: str + """ + + _validation = { + 'id': {'readonly': True}, + 'p': {'readonly': True}, + 'ic': {'readonly': True}, + 'ty': {'readonly': True}, + 'cbl': {'readonly': True}, + 'ctr': {'readonly': True}, + 'cs': {'readonly': True}, + 'l': {'readonly': True}, + 'r': {'readonly': True}, + 'dl': {'readonly': True}, + 't': {'readonly': True}, + 'f': {'readonly': True}, + 'd': {'readonly': True}, + 'c': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'p': {'key': 'p', 'type': 'TrafficIncidentPoiP'}, + 'ic': {'key': 'ic', 'type': 'int'}, + 'ty': {'key': 'ty', 'type': 'int'}, + 'cbl': {'key': 'cbl', 'type': 'TrafficIncidentPoiCbl'}, + 'ctr': {'key': 'ctr', 'type': 'TrafficIncidentPoiCtr'}, + 'cs': {'key': 'cs', 'type': 'int'}, + 'l': {'key': 'l', 'type': 'int'}, + 'r': {'key': 'r', 'type': 'str'}, + 'dl': {'key': 'dl', 'type': 'int'}, + 't': {'key': 't', 'type': 'str'}, + 'f': {'key': 'f', 'type': 'str'}, + 'd': {'key': 'd', 'type': 'str'}, + 'c': {'key': 'c', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoi, self).__init__(**kwargs) + self.id = None + self.p = None + self.ic = None + self.ty = None + self.cbl = None + self.ctr = None + self.cs = None + self.l = None + self.r = None + self.dl = None + self.t = None + self.f = None + self.d = None + self.c = None + + +class TrafficIncidentPoiCbl(msrest.serialization.Model): + """Bottom left coordinate of the cluster in the projection of the request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar x: x coordinate. + :vartype x: float + :ivar y: y coordinate. + :vartype y: float + """ + + _validation = { + 'x': {'readonly': True}, + 'y': {'readonly': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoiCbl, self).__init__(**kwargs) + self.x = None + self.y = None + + +class TrafficIncidentPoiCtr(msrest.serialization.Model): + """Top right coordinate of the cluster in the projection of the request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar x: x coordinate. + :vartype x: float + :ivar y: y coordinate. + :vartype y: float + """ + + _validation = { + 'x': {'readonly': True}, + 'y': {'readonly': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoiCtr, self).__init__(**kwargs) + self.x = None + self.y = None + + +class TrafficIncidentPoiP(msrest.serialization.Model): + """The point where an icon of the cluster or raw incident should be drawn, expressed in the requested projection. This is affected by traffic style, zoom level and road type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar x: x coordinate. + :vartype x: float + :ivar y: y coordinate. + :vartype y: float + """ + + _validation = { + 'x': {'readonly': True}, + 'y': {'readonly': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentPoiP, self).__init__(**kwargs) + self.x = None + self.y = None + + +class TrafficIncidentViewportResult(msrest.serialization.Model): + """This object is returned from a successful Traffic Incident Viewport call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar viewp_resp: Viewport Response object. + :vartype viewp_resp: ~azure.maps.traffic.models.TrafficIncidentViewportResultViewpResp + """ + + _validation = { + 'viewp_resp': {'readonly': True}, + } + + _attribute_map = { + 'viewp_resp': {'key': 'viewpResp', 'type': 'TrafficIncidentViewportResultViewpResp'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentViewportResult, self).__init__(**kwargs) + self.viewp_resp = None + + +class TrafficIncidentViewportResultViewpResp(msrest.serialization.Model): + """Viewport Response object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar traffic_state: Traffic State array. + :vartype traffic_state: + ~azure.maps.traffic.models.TrafficIncidentViewportResultViewpRespTrafficState + :ivar copyright_ids: Copyright Ids property. + :vartype copyright_ids: str + :ivar version: @Version property. + :vartype version: str + :ivar maps: @maps property. + :vartype maps: str + """ + + _validation = { + 'traffic_state': {'readonly': True}, + 'copyright_ids': {'readonly': True}, + 'version': {'readonly': True}, + 'maps': {'readonly': True}, + } + + _attribute_map = { + 'traffic_state': {'key': 'trafficState', 'type': 'TrafficIncidentViewportResultViewpRespTrafficState'}, + 'copyright_ids': {'key': 'copyrightIds', 'type': 'str'}, + 'version': {'key': '@version', 'type': 'str'}, + 'maps': {'key': '@maps', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentViewportResultViewpResp, self).__init__(**kwargs) + self.traffic_state = None + self.copyright_ids = None + self.version = None + self.maps = None + + +class TrafficIncidentViewportResultViewpRespTrafficState(msrest.serialization.Model): + """Traffic State array. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar traffic_age: @Traffic Age property. + :vartype traffic_age: int + :ivar traffic_model_id: @Traffic Model Id property. + :vartype traffic_model_id: str + """ + + _validation = { + 'traffic_age': {'readonly': True}, + 'traffic_model_id': {'readonly': True}, + } + + _attribute_map = { + 'traffic_age': {'key': '@trafficAge', 'type': 'int'}, + 'traffic_model_id': {'key': '@trafficModelId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficIncidentViewportResultViewpRespTrafficState, self).__init__(**kwargs) + self.traffic_age = None + self.traffic_model_id = None diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_traffic_client_enums.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_traffic_client_enums.py new file mode 100644 index 000000000000..c2df8085b8f2 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/models/_traffic_client_enums.py @@ -0,0 +1,107 @@ +# 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 IncidentGeometryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Places incidents precisely on the road. + ORIGINAL = "original" + #: Moves the incident slightly (depending on zoom level) to indicate specific road lanes. + SHIFTED = "shifted" + +class ProjectionStandard(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `EPSG900913 `_. + EPSG900913 = "EPSG900913" + #: `EPSG4326 `_. + EPSG4326 = "EPSG4326" + +class ResponseFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + #: `The Extensible Markup Language `_. + XML = "xml" + +class SpeedUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Kilometers Per Hour. + KMPH = "KMPH" + #: Miles Per Hour. + MPH = "MPH" + +class TileFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: An image in the png format. Supports zoom levels 0 through 18. + PNG = "png" + #: Vector graphic in the pbf format. Supports zoom levels 0 through 22. + PBF = "pbf" + +class TrafficFlowSegmentStyle(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + ABSOLUTE = "absolute" + RELATIVE = "relative" + RELATIVE_DELAY = "relative-delay" + +class TrafficFlowTileStyle(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Colors will reflect the absolute speed measured. Absolute speed is the capability to access the + #: full speed. + ABSOLUTE = "absolute" + #: This is the speed relative to free-flow, highlighting areas of congestion visualizing the + #: traffic flow. Free-flow refers to conditions where there is no congestion and traffic can + #: follow the speed limits. The most used option to visualize traffic flow on a map. + RELATIVE = "relative" + #: Displays relative colors only where they are different from the free-flow speeds. This option + #: will only highlights areas of congestion. + RELATIVE_DELAY = "relative-delay" + #: Displays relative colors but a larger difference from freeflow is required for segments to + #: change the color. This mode only valid when format is png. + REDUCED_SENSITIVITY = "reduced-sensitivity" + +class TrafficIncidentDetailStyle(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Creates traffic lines with colored chevrons indicating severity. + S1 = "s1" + #: Creates plain lines with certain degree of glow. + S2 = "s2" + #: Creates plain lines with certain degree of glow. + S3 = "s3" + #: Night style. + NIGHT = "night" + +class TrafficIncidentTileStyle(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Creates traffic lines with colored chevrons indicating severity. + S1 = "s1" + #: Creates plain lines with certain degree of glow. + S2 = "s2" + #: Creates plain lines with certain degree of glow. + S3 = "s3" + #: Night style. + NIGHT = "night" diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/operations/__init__.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/operations/__init__.py new file mode 100644 index 000000000000..be72f9aa2245 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/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 ._traffic_client_operations import TrafficClientOperationsMixin + +__all__ = [ + 'TrafficClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/operations/_traffic_client_operations.py b/sdk/maps/azure-maps-traffic/azure/maps/traffic/operations/_traffic_client_operations.py new file mode 100644 index 000000000000..5a0066915b3b --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/operations/_traffic_client_operations.py @@ -0,0 +1,573 @@ +# 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 +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, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TrafficClientOperationsMixin(object): + + def get_traffic_flow_tile( + self, + format, # type: Union[str, "_models.TileFormat"] + style, # type: Union[str, "_models.TrafficFlowTileStyle"] + zoom, # type: int + x_tile_index, # type: int + y_tile_index, # type: int + thickness=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> IO + """**Traffic Flow Tile** + + **Applies to**\ : S0 and S1 pricing tiers. + + The Azure Flow Tile API serves 256 x 256 pixel tiles showing traffic flow. All tiles use the + same grid system. Because the traffic tiles use transparent images, they can be layered on top + of map tiles to create a compound display. The Flow tiles use colors to indicate either the + speed of traffic on different road segments, or the difference between that speed and the + free-flow speed on the road segment in question. + + :param format: Desired format of the response. Possible values are png & pbf. + :type format: str or ~azure.maps.traffic.models.TileFormat + :param style: .. raw:: html + +

The style to be used to render the tile.

. + :type style: str or ~azure.maps.traffic.models.TrafficFlowTileStyle + :param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range: + 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive). + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param x_tile_index: 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_tile_index: int + :param y_tile_index: 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_tile_index: int + :param thickness: The value of the width of the line representing traffic. This value is a + multiplier and the accepted values range from 1 - 20. The default value is 10. This parameter + is not valid when format is pbf. + :type thickness: int + :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 = "1.0" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_traffic_flow_tile.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['x'] = self._serialize.query("x_tile_index", x_tile_index, 'int') + query_parameters['y'] = self._serialize.query("y_tile_index", y_tile_index, 'int') + if thickness is not None: + query_parameters['thickness'] = self._serialize.query("thickness", thickness, 'int', maximum=20, minimum=1) + + # 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_traffic_flow_tile.metadata = {'url': '/traffic/flow/tile/{format}'} # type: ignore + + def get_traffic_flow_segment( + self, + style, # type: Union[str, "_models.TrafficFlowSegmentStyle"] + zoom, # type: int + query, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + unit=None, # type: Optional[Union[str, "_models.SpeedUnit"]] + thickness=None, # type: Optional[int] + open_lr=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.TrafficFlowSegmentResult" + """**Traffic Flow Segment** + + **Applies to**\ : S0 and S1 pricing tiers. + + This service provides information about the speeds and travel times of the road fragment + closest to the given coordinates. It is designed to work alongside the Flow layer of the Render + Service to support clickable flow data visualizations. With this API, the client side can + connect any place in the map with flow data on the closest road and present it to the user. + + :param style: The style to be used to render the tile. Valid values are absolute which returns + colors reflecting the absolute speed measured, relative which returns the speed relative to + free-flow, Relative-delay which displays relative speeds only where they are different from the + freeflow speeds. + :type style: str or ~azure.maps.traffic.models.TrafficFlowSegmentStyle + :param zoom: Zoom level for the desired tile. Zoom value must be in the range: 0-22 + (inclusive). + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param query: Coordinates of the point close to the road segment. They have to be + comma-separated and calculated using EPSG4326 projection. + :type query: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.traffic.models.ResponseFormat + :param unit: Unit of speed in KMPH or MPH. + :type unit: str or ~azure.maps.traffic.models.SpeedUnit + :param thickness: The value of the width of the line representing traffic. This value is a + multiplier and the accepted values range from 1 - 20. The default value is 10. + :type thickness: int + :param open_lr: Boolean on whether the response should include OpenLR code. + :type open_lr: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrafficFlowSegmentResult, or the result of cls(response) + :rtype: ~azure.maps.traffic.models.TrafficFlowSegmentResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TrafficFlowSegmentResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_traffic_flow_segment.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if thickness is not None: + query_parameters['thickness'] = self._serialize.query("thickness", thickness, 'int', maximum=20, minimum=1) + if open_lr is not None: + query_parameters['openLr'] = self._serialize.query("open_lr", open_lr, 'bool') + + # 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('TrafficFlowSegmentResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_traffic_flow_segment.metadata = {'url': '/traffic/flow/segment/{format}'} # type: ignore + + def get_traffic_incident_tile( + self, + format, # type: Union[str, "_models.TileFormat"] + style, # type: Union[str, "_models.TrafficIncidentTileStyle"] + zoom, # type: int + x_tile_index, # type: int + y_tile_index, # type: int + traffic_state=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> IO + """**Traffic Incident Tile** + + **Applies to**\ : S0 and S1 pricing tiers. + + This service serves 256 x 256 pixel tiles showing traffic incidents. All tiles use the same + grid system. Because the traffic tiles use transparent images, they can be layered on top of + map tiles to create a compound display. Traffic tiles render graphics to indicate traffic on + the roads in the specified area. + + :param format: Desired format of the response. Possible values are png & pbf. + :type format: str or ~azure.maps.traffic.models.TileFormat + :param style: The style to be used to render the tile. This parameter is not valid when format + is pbf. + :type style: str or ~azure.maps.traffic.models.TrafficIncidentTileStyle + :param zoom: Zoom level for the desired tile. For *raster* tiles, value must be in the range: + 0-22 (inclusive). For *vector* tiles, value must be in the range: 0-22 (inclusive). + Please see `Zoom Levels and Tile Grid + `_ + for details. + :type zoom: int + :param x_tile_index: 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_tile_index: int + :param y_tile_index: 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_tile_index: int + :param traffic_state: Reference value for the state of traffic at a particular time, obtained + from the Viewport API call, trafficModelId attribute in trafficState field. It is updated every + minute, and is valid for two minutes before it times out. Use -1 to get the most recent + traffic information. Default: most recent traffic information. + :type traffic_state: 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 = "1.0" + accept = "application/json, image/jpeg, image/png, image/pbf, application/vnd.mapbox-vector-tile" + + # Construct URL + url = self.get_traffic_incident_tile.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['zoom'] = self._serialize.query("zoom", zoom, 'int') + query_parameters['x'] = self._serialize.query("x_tile_index", x_tile_index, 'int') + query_parameters['y'] = self._serialize.query("y_tile_index", y_tile_index, 'int') + if traffic_state is not None: + query_parameters['t'] = self._serialize.query("traffic_state", traffic_state, '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_traffic_incident_tile.metadata = {'url': '/traffic/incident/tile/{format}'} # type: ignore + + def get_traffic_incident_detail( + self, + style, # type: Union[str, "_models.TrafficIncidentDetailStyle"] + boundingbox, # type: str + bounding_zoom, # type: int + trafficmodelid, # type: str + format="json", # type: Union[str, "_models.ResponseFormat"] + language=None, # type: Optional[str] + projection=None, # type: Optional[Union[str, "_models.ProjectionStandard"]] + geometries=None, # type: Optional[Union[str, "_models.IncidentGeometryType"]] + expand_cluster=None, # type: Optional[bool] + original_position=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.TrafficIncidentDetailResult" + """**Traffic Incident Detail** + + **Applies to**\ : S0 and S1 pricing tiers. + + This API provides information on traffic incidents inside a given bounding box, based on the + current Traffic Model ID. The Traffic Model ID is available to grant synchronization of data + between calls and API's. The Traffic Model ID is a key value for determining the currency of + traffic incidents. It is updated every minute, and is valid for two minutes before it times + out. It is used in rendering `incident tiles + `_. It can be + obtained from the `Viewport API + `_. + + :param style: The style that will be used to render the tile in Traffic `Incident Tile API + `_. This will + have an effect on the coordinates of traffic incidents in the reply. + :type style: str or ~azure.maps.traffic.models.TrafficIncidentDetailStyle + :param boundingbox: The ``boundingbox`` is represented by two value pairs describing it's + corners (first pair for lower left corner and second for upper right). The pairs can either be + specified using any of the ``projection``\ 's specified below (e.g., *minY,minX,maxY,maxX*\ ) + or by two latitude-longitude pairs (e.g., *minLat,minLon,maxLat,maxLon*\ + ).:code:`
`:code:`
`NOTE: If latitude/longitude pairs are used, then the ``projection`` + parameter must be set to "EPSG4326". + :type boundingbox: str + :param bounding_zoom: Zoom level for desired tile. 0 to 22 for raster tiles, 0 through 22 for + vector tiles. + :type bounding_zoom: int + :param trafficmodelid: Number referencing traffic model. This can be obtained from the + `Viewport API + `_. It is + updated every minute, and is valid for two minutes before it times out. If the wrong Traffic + Model ID is specified, the correct one will be returned by the interface. A value of -1 will + always invoke the most recent traffic model. + :type trafficmodelid: str + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.traffic.models.ResponseFormat + :param language: `ISO 639-1 code `_ for + the output language. Supported languages are ar, ca, cs, da, de, el, en, en-GB, en-US, es, et, + fi, fr, he, hu, id, in*, it, lt, lv, nb, nl, no, pl, pt, ro, ru, sk, sv, th, tr, zh. + + Please refer to `Supported Languages + `_ for details. When + invalid language code is provided response is returned in English. When incident cause or + description does not have translation, English description is returned. + :type language: str + :param projection: The projection used to specify the coordinates in the request and response. + `EPSG900913 `_ (default) or + `EPSG4326 `_. + :type projection: str or ~azure.maps.traffic.models.ProjectionStandard + :param geometries: The type of vector geometry added to incidents (returned in the :code:`` + element of the response). + :type geometries: str or ~azure.maps.traffic.models.IncidentGeometryType + :param expand_cluster: Boolean to indicate whether to list all traffic incidents in a cluster + separately. + :type expand_cluster: bool + :param original_position: Boolean on whether to return the original position of the incident + (:code:``) as well as the one shifted to the beginning of the traffic tube (:code:``). + :type original_position: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrafficIncidentDetailResult, or the result of cls(response) + :rtype: ~azure.maps.traffic.models.TrafficIncidentDetailResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TrafficIncidentDetailResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_traffic_incident_detail.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['style'] = self._serialize.query("style", style, 'str') + query_parameters['boundingbox'] = self._serialize.query("boundingbox", boundingbox, 'str') + query_parameters['boundingZoom'] = self._serialize.query("bounding_zoom", bounding_zoom, 'int', maximum=22, minimum=0) + query_parameters['trafficmodelid'] = self._serialize.query("trafficmodelid", trafficmodelid, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if projection is not None: + query_parameters['projection'] = self._serialize.query("projection", projection, 'str') + if geometries is not None: + query_parameters['geometries'] = self._serialize.query("geometries", geometries, 'str') + if expand_cluster is not None: + query_parameters['expandCluster'] = self._serialize.query("expand_cluster", expand_cluster, 'bool') + if original_position is not None: + query_parameters['originalPosition'] = self._serialize.query("original_position", original_position, 'bool') + + # 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('TrafficIncidentDetailResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_traffic_incident_detail.metadata = {'url': '/traffic/incident/detail/{format}'} # type: ignore + + def get_traffic_incident_viewport( + self, + boundingbox, # type: str + boundingzoom, # type: int + overviewbox, # type: str + overviewzoom, # type: int + format="json", # type: Union[str, "_models.ResponseFormat"] + copyright=True, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.TrafficIncidentViewportResult" + """**Traffic Incident Viewport** + + **Applies to**\ : S0 and S1 pricing tiers. + + This API returns legal and technical information for the viewport described in the request. It + should be called by client applications whenever the viewport changes (for instance, through + zooming, panning, going to a location, or displaying a route). The request should contain the + bounding box and zoom level of the viewport whose information is needed. The return will + contain map version information, as well as the current Traffic Model ID and copyright IDs. + The Traffic Model ID returned by the Viewport Description is used by other APIs to retrieve + last traffic information for further processing. + + :param boundingbox: Bounding box of the map viewport in `EPSG900913 + `_ projection. The ``boundingbox`` + is represented by two value pairs describing it's corners (first pair for lower left corner and + second for upper right). All values should be separated by commas (e.g., *minY,minX,maxY,maxX*\ + ). The maximum size of the bounding box that can be passed is dependent on the requested zoom + level. The width and height cannot exceed 4092 pixels when rendered on the given zoom + level.:code:`
`:code:`
`NOTE: Bounding boxes that cross the 180° meridian require special + treatment. For such boxes, the eastern *maxX* value will be negative, and thus less than the + *minX* value west of the 180° meridian. To address that, the value 40075016.6855874 should be + added to the true *maxX* value before it is passed in the request. + :type boundingbox: str + :param boundingzoom: Zoom level of the map viewport. Used to determine whether the view can be + zoomed in. + :type boundingzoom: int + :param overviewbox: Bounding box of the overview map in `EPSG900913 + `_ + projection.:code:`
`:code:`
`Used in case the overview box/mini map has different + copyright data than the main map. If there is no mini map, the same coordinates as + ``boundingBox`` is used. + :type overviewbox: str + :param overviewzoom: Zoom level of the overview map. If there is no mini map, use the same zoom + level as boundingZoom. + :type overviewzoom: int + :param format: Desired format of the response. Value can be either *json* or *xml*. + :type format: str or ~azure.maps.traffic.models.ResponseFormat + :param copyright: Determines what copyright information to return. When true the copyright text + is returned; when false only the copyright index is returned. + :type copyright: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrafficIncidentViewportResult, or the result of cls(response) + :rtype: ~azure.maps.traffic.models.TrafficIncidentViewportResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TrafficIncidentViewportResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_traffic_incident_viewport.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['boundingbox'] = self._serialize.query("boundingbox", boundingbox, 'str') + query_parameters['boundingzoom'] = self._serialize.query("boundingzoom", boundingzoom, 'int', maximum=22, minimum=0) + query_parameters['overviewbox'] = self._serialize.query("overviewbox", overviewbox, 'str') + query_parameters['overviewzoom'] = self._serialize.query("overviewzoom", overviewzoom, 'int', maximum=22, minimum=0) + if copyright is not None: + query_parameters['copyright'] = self._serialize.query("copyright", copyright, 'bool') + + # 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('TrafficIncidentViewportResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_traffic_incident_viewport.metadata = {'url': '/traffic/incident/viewport/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-traffic/azure/maps/traffic/py.typed b/sdk/maps/azure-maps-traffic/azure/maps/traffic/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/azure/maps/traffic/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-traffic/sdk_packaging.toml b/sdk/maps/azure-maps-traffic/sdk_packaging.toml new file mode 100644 index 000000000000..811a2e3c5df7 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-traffic" +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-traffic/setup.cfg b/sdk/maps/azure-maps-traffic/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-traffic/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-traffic/setup.py b/sdk/maps/azure-maps-traffic/setup.py new file mode 100644 index 000000000000..4dd2ccdff666 --- /dev/null +++ b/sdk/maps/azure-maps-traffic/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-traffic" +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'], + } +) diff --git a/sdk/maps/azure-maps-weather/CHANGELOG.md b/sdk/maps/azure-maps-weather/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/maps/azure-maps-weather/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/maps/azure-maps-weather/MANIFEST.in b/sdk/maps/azure-maps-weather/MANIFEST.in new file mode 100644 index 000000000000..cb7d3109cc06 --- /dev/null +++ b/sdk/maps/azure-maps-weather/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 + diff --git a/sdk/maps/azure-maps-weather/README.md b/sdk/maps/azure-maps-weather/README.md new file mode 100644 index 000000000000..afd2ea570c4c --- /dev/null +++ b/sdk/maps/azure-maps-weather/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-weather%2FREADME.png) diff --git a/sdk/maps/azure-maps-weather/_meta.json b/sdk/maps/azure-maps-weather/_meta.json new file mode 100644 index 000000000000..c5163ac2a54b --- /dev/null +++ b/sdk/maps/azure-maps-weather/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "fd01f0058f99a0d2b145abbb7ade2cd90d9d3a82", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/maps/data-plane/Weather/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/Weather/readme.md" +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-weather/azure/__init__.py b/sdk/maps/azure-maps-weather/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-weather/azure/maps/__init__.py b/sdk/maps/azure-maps-weather/azure/maps/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/__init__.py b/sdk/maps/azure-maps-weather/azure/maps/weather/__init__.py new file mode 100644 index 000000000000..ad3c3b6be5b2 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/__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 ._weather_client import WeatherClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['WeatherClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/_configuration.py b/sdk/maps/azure-maps-weather/azure/maps/weather/_configuration.py new file mode 100644 index 000000000000..2d541f504a46 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/_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 WeatherClientConfiguration(Configuration): + """Configuration for WeatherClient. + + 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(WeatherClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-weather/{}'.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-weather/azure/maps/weather/_metadata.json b/sdk/maps/azure-maps-weather/azure/maps/weather/_metadata.json new file mode 100644 index 000000000000..b46aa6e0e4a8 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/_metadata.json @@ -0,0 +1,204 @@ +{ + "chosen_version": "1.0", + "total_api_version_list": ["1.0"], + "client": { + "name": "WeatherClient", + "filename": "_weather_client", + "description": "WeatherClient.", + "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\": [\"WeatherClientConfiguration\"], \"._operations_mixin\": [\"WeatherClientOperationsMixin\"]}}}", + "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\": [\"WeatherClientConfiguration\"], \"._operations_mixin\": [\"WeatherClientOperationsMixin\"]}}}" + }, + "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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"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\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_hourly_forecast" : { + "sync": { + "signature": "def get_hourly_forecast(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n unit=None, # type: Optional[Union[str, \"_models.WeatherDataUnit\"]]\n duration=None, # type: Optional[int]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Hourly Forecast**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nRequest detailed weather forecast by the hour for the next 1, 12, 24 (1 day), 72 (3 days), 120\n(5 days), and 240 hours (10 days) for the given the given coordinate location. The API returns\ndetails such as temperature, humidity, wind, precipitation, and ultraviolet (UV) index.\n\nIn S0 you can request hourly forecast for the next 1, 12, 24 hours (1 day), and 72 hours (3\ndays). In S1 you can also request hourly forecast for the next 120 (5 days) and 240 hours (10\ndays).\n\n:param query: Coordinates of the location for which hourly forecast information is requested.\n The applicable query is specified as a comma separated string composed by latitude followed by\n longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param duration: Time frame of the returned weather forecast. By default, the forecast data for\n next hour will be returned. Available values are\n\n\n * ``1`` - Return forecast data for the next hour. Default value.\n * ``12`` - Return hourly forecast for next 12 hours.\n * ``24`` - Return hourly forecast for next 24 hours.\n * ``72`` - Return hourly forecast for next 72 hours (3 days).\n * ``120`` - Return hourly forecast for next 120 hours (5 days). Only available in S1 SKU.\n * ``240`` - Return hourly forecast for next 240 hours (10 days). Only available in S1 SKU.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: HourlyForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.HourlyForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_hourly_forecast(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n unit: Optional[Union[str, \"_models.WeatherDataUnit\"]] = None,\n duration: Optional[int] = None,\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.HourlyForecastResponse\":\n", + "doc": "\"\"\"**Get Hourly Forecast**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nRequest detailed weather forecast by the hour for the next 1, 12, 24 (1 day), 72 (3 days), 120\n(5 days), and 240 hours (10 days) for the given the given coordinate location. The API returns\ndetails such as temperature, humidity, wind, precipitation, and ultraviolet (UV) index.\n\nIn S0 you can request hourly forecast for the next 1, 12, 24 hours (1 day), and 72 hours (3\ndays). In S1 you can also request hourly forecast for the next 120 (5 days) and 240 hours (10\ndays).\n\n:param query: Coordinates of the location for which hourly forecast information is requested.\n The applicable query is specified as a comma separated string composed by latitude followed by\n longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param duration: Time frame of the returned weather forecast. By default, the forecast data for\n next hour will be returned. Available values are\n\n\n * ``1`` - Return forecast data for the next hour. Default value.\n * ``12`` - Return hourly forecast for next 12 hours.\n * ``24`` - Return hourly forecast for next 24 hours.\n * ``72`` - Return hourly forecast for next 72 hours (3 days).\n * ``120`` - Return hourly forecast for next 120 hours (5 days). Only available in S1 SKU.\n * ``240`` - Return hourly forecast for next 240 hours (10 days). Only available in S1 SKU.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: HourlyForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.HourlyForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, unit, duration, language" + }, + "get_minute_forecast" : { + "sync": { + "signature": "def get_minute_forecast(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n interval=None, # type: Optional[int]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Minute Forecast**\n\n**Applies to**\\ : S1 pricing tier.\n\nGet Minute Forecast service returns minute-by-minute forecasts for a given location for the\nnext 120 minutes. Users can request weather forecasts in the interval of 1, 5 and 15 minutes.\nThe response will include details such as the type of precipitation (including rain, snow, or a\nmixture of both), start time, and precipitation intensity value (dBZ).\n\n:param query: Coordinates of the location for which minute forecast information is requested.\n The applicable query is specified as a comma separated string composed by latitude followed by\n longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param interval: Specifies time interval in minutes for the returned weather forecast.\n Supported values are\n\n\n * ``1`` - Retrieve forecast for 1-minute intervals. Returned by default.\n * ``5`` - Retrieve forecasts for 5-minute intervals.\n * ``15`` - Retrieve forecasts for 15-minute intervals.\n:type interval: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: MinuteForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.MinuteForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_minute_forecast(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n interval: Optional[int] = None,\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.MinuteForecastResponse\":\n", + "doc": "\"\"\"**Get Minute Forecast**\n\n**Applies to**\\ : S1 pricing tier.\n\nGet Minute Forecast service returns minute-by-minute forecasts for a given location for the\nnext 120 minutes. Users can request weather forecasts in the interval of 1, 5 and 15 minutes.\nThe response will include details such as the type of precipitation (including rain, snow, or a\nmixture of both), start time, and precipitation intensity value (dBZ).\n\n:param query: Coordinates of the location for which minute forecast information is requested.\n The applicable query is specified as a comma separated string composed by latitude followed by\n longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param interval: Specifies time interval in minutes for the returned weather forecast.\n Supported values are\n\n\n * ``1`` - Retrieve forecast for 1-minute intervals. Returned by default.\n * ``5`` - Retrieve forecasts for 5-minute intervals.\n * ``15`` - Retrieve forecasts for 15-minute intervals.\n:type interval: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: MinuteForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.MinuteForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, interval, language" + }, + "get_quarter_day_forecast" : { + "sync": { + "signature": "def get_quarter_day_forecast(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n unit=None, # type: Optional[Union[str, \"_models.WeatherDataUnit\"]]\n duration=None, # type: Optional[int]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Quarter-Day Forecast**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nService returns detailed weather forecast by quarter-day for the next 1, 5, 10, or 15 days for\na given location. Response data is presented by quarters of the day - morning, afternoon,\nevening, and overnight. Details such as temperature, humidity, wind, precipitation, and UV\nindex are returned.\n\n:param query: Coordinates of the location for which quarter-day forecast information is\n requested. The applicable query is specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param duration: Specifies for how many days the quester-day forecast responses are returned.\n Supported values are:\n\n\n * ``1`` - Return forecast data for the next day. Returned by default.\n * ``5`` - Return forecast data for the next 5 days.\n * ``10`` - Return forecast data for next 10 days.\n * ``15`` - Return forecast data for the next 15 days.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: QuarterDayForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.QuarterDayForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_quarter_day_forecast(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n unit: Optional[Union[str, \"_models.WeatherDataUnit\"]] = None,\n duration: Optional[int] = None,\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.QuarterDayForecastResponse\":\n", + "doc": "\"\"\"**Get Quarter-Day Forecast**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nService returns detailed weather forecast by quarter-day for the next 1, 5, 10, or 15 days for\na given location. Response data is presented by quarters of the day - morning, afternoon,\nevening, and overnight. Details such as temperature, humidity, wind, precipitation, and UV\nindex are returned.\n\n:param query: Coordinates of the location for which quarter-day forecast information is\n requested. The applicable query is specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param duration: Specifies for how many days the quester-day forecast responses are returned.\n Supported values are:\n\n\n * ``1`` - Return forecast data for the next day. Returned by default.\n * ``5`` - Return forecast data for the next 5 days.\n * ``10`` - Return forecast data for next 10 days.\n * ``15`` - Return forecast data for the next 15 days.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: QuarterDayForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.QuarterDayForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, unit, duration, language" + }, + "get_current_conditions" : { + "sync": { + "signature": "def get_current_conditions(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n unit=None, # type: Optional[Union[str, \"_models.WeatherDataUnit\"]]\n details=None, # type: Optional[str]\n duration=None, # type: Optional[int]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Current Conditions**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nGet Current Conditions service returns detailed current weather conditions such as\nprecipitation, temperature and wind for a given coordinate location. Also, observations from\nthe past 6 or 24 hours for a particular location can be retrieved. The basic information\nreturned with the response include details such as observation date and time, brief description\nof the weather conditions, weather icon, precipitation indicator flags, and temperature.\nAdditional details such as RealFeel\u2122 Temperature and UV index are also returned.\n\n:param query: Coordinates of the location for which current conditions information is\n requested. The applicable query is specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param details: Return full details for the current conditions. Available values are\n\n\n * ``true`` - Returns full details. By default all details are returned.\n * ``false`` - Returns a truncated version of the current condition data, which includes\n observation date time, weather phrase, icon code, precipitation indicator flag, and\n temperature.\n:type details: str\n:param duration: Time frame of the returned weather conditions. By default, the most current\n weather conditions will be returned. Default value is 0. Supported values are:\n\n\n * ``0`` - Return the most current weather conditions.\n * ``6`` - Return weather conditions from past 6 hours.\n * ``24`` - Return weather conditions from past 24 hours.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CurrentConditionsResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.CurrentConditionsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_current_conditions(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n unit: Optional[Union[str, \"_models.WeatherDataUnit\"]] = None,\n details: Optional[str] = None,\n duration: Optional[int] = None,\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.CurrentConditionsResponse\":\n", + "doc": "\"\"\"**Get Current Conditions**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nGet Current Conditions service returns detailed current weather conditions such as\nprecipitation, temperature and wind for a given coordinate location. Also, observations from\nthe past 6 or 24 hours for a particular location can be retrieved. The basic information\nreturned with the response include details such as observation date and time, brief description\nof the weather conditions, weather icon, precipitation indicator flags, and temperature.\nAdditional details such as RealFeel\u2122 Temperature and UV index are also returned.\n\n:param query: Coordinates of the location for which current conditions information is\n requested. The applicable query is specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param details: Return full details for the current conditions. Available values are\n\n\n * ``true`` - Returns full details. By default all details are returned.\n * ``false`` - Returns a truncated version of the current condition data, which includes\n observation date time, weather phrase, icon code, precipitation indicator flag, and\n temperature.\n:type details: str\n:param duration: Time frame of the returned weather conditions. By default, the most current\n weather conditions will be returned. Default value is 0. Supported values are:\n\n\n * ``0`` - Return the most current weather conditions.\n * ``6`` - Return weather conditions from past 6 hours.\n * ``24`` - Return weather conditions from past 24 hours.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CurrentConditionsResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.CurrentConditionsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, unit, details, duration, language" + }, + "get_daily_forecast" : { + "sync": { + "signature": "def get_daily_forecast(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n unit=None, # type: Optional[Union[str, \"_models.WeatherDataUnit\"]]\n duration=None, # type: Optional[int]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Daily Forecast**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe service returns detailed weather forecast such as temperature and wind by day for the next\n1, 5, 10, 15, 25, or 45 days for a given coordinate location. The response include details\nsuch as temperature, wind, precipitation, air quality, and UV index.\n\nIn S0 you can request daily forecast for the next 1, 5, 10, and 15 days. In S1 you can also\nrequest daily forecast for the next 25 days, and 45 days.\n\n:param query: Coordinates of the location for which current conditions information is\n requested. The applicable query is specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param duration: Specifies for how many days the daily forecast responses are returned.\n Available values are\n\n\n * ``1`` - Return forecast data for the next day. Returned by default.\n * ``5`` - Return forecast data for the next 5 days.\n * ``10`` - Return forecast data for the next 10 days.\n * ``25`` - Return forecast data for the next 25 days. Only available in S1 SKU.\n * ``45`` - Return forecast data for the next 45 days. Only available in S1 SKU.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DailyForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.DailyForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_daily_forecast(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n unit: Optional[Union[str, \"_models.WeatherDataUnit\"]] = None,\n duration: Optional[int] = None,\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.DailyForecastResponse\":\n", + "doc": "\"\"\"**Get Daily Forecast**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThe service returns detailed weather forecast such as temperature and wind by day for the next\n1, 5, 10, 15, 25, or 45 days for a given coordinate location. The response include details\nsuch as temperature, wind, precipitation, air quality, and UV index.\n\nIn S0 you can request daily forecast for the next 1, 5, 10, and 15 days. In S1 you can also\nrequest daily forecast for the next 25 days, and 45 days.\n\n:param query: Coordinates of the location for which current conditions information is\n requested. The applicable query is specified as a comma separated string composed by latitude\n followed by longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\n:param unit: Specifies to return the data in either metric units or imperial units. Default\n value is metric.\n:type unit: str or ~azure.maps.weather.models.WeatherDataUnit\n:param duration: Specifies for how many days the daily forecast responses are returned.\n Available values are\n\n\n * ``1`` - Return forecast data for the next day. Returned by default.\n * ``5`` - Return forecast data for the next 5 days.\n * ``10`` - Return forecast data for the next 10 days.\n * ``25`` - Return forecast data for the next 25 days. Only available in S1 SKU.\n * ``45`` - Return forecast data for the next 45 days. Only available in S1 SKU.\n:type duration: 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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DailyForecastResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.DailyForecastResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, unit, duration, language" + }, + "get_weather_along_route" : { + "sync": { + "signature": "def get_weather_along_route(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n language=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Weather along route**\n\n **Applies to**\\ : S1 pricing tier.\n\n Weather along a route API returns hyper local (one kilometer or less), up-to-the-minute\nweather nowcasts, weather hazard assessments, and notifications along a route described as a\nsequence of waypoints.\n This includes a list of weather hazards affecting the waypoint or route, and the aggregated\nhazard index for each waypoint might be used to paint each portion of a route according to how\nsafe it is for the driver. When submitting the waypoints, it is recommended to stay within, or\nclose to, the distance that can be traveled within 120-mins or shortly after. Data is updated\nevery five minutes.\n\n The service supplements Azure Maps `Route Service\n\u003chttps://docs.microsoft.com/rest/api/maps/route\u003e`_ that allows you to first request a route\nbetween an origin and a destination and use that as an input for Weather Along Route endpoint.\n\n In addition, the service supports scenarios to generate weather notifications for waypoints\nthat experience an increase in intensity of a weather hazard. For example, if the vehicle is\nexpected to begin experiencing heavy rain as it reaches a waypoint, a weather notification for\nheavy rain will be generated for that waypoint allowing the end product to display a heavy rain\nnotification before the driver reaches that waypoint.\n The trigger for when to display the notification for a waypoint could be based, for example,\non a `geofence \u003chttps://docs.microsoft.com/azure/azure-maps/tutorial-iot-hub-maps\u003e`_\\ , or\nselectable distance to the waypoint.\n\n The API covers all regions of the planet except latitudes above Greenland and Antarctica.\n\n:param query: Coordinates through which the route is calculated, separated by colon (:) and\n entered in chronological order. A minimum of two waypoints is required. A single API call may\n contain up to 60 waypoints.\n A waypoint indicates location, ETA, and optional heading: latitude,longitude,ETA,heading,\n where\n\n\n * ``Latitude`` - Latitude coordinate in decimal degrees.\n * ``Longitude`` - Longitude coordinate in decimal degrees.\n * ``ETA (estimated time of arrival)`` - The number of minutes from the present time that it\n will take for the vehicle to reach the waypoint. Allowed range is from 0.0 to 120.0 minutes.\n * ``Heading`` - An optional value indicating the vehicle heading as it passes the waypoint.\n Expressed in clockwise degrees relative to true north. This is issued to calculate sun glare as\n a driving hazard. Allowed range is from 0.0 to 360.0 degrees. If not provided, a heading will\n automatically be derived based on the position of neighboring waypoints.\n\n It is recommended to stay within, or close to, the distance that can be traveled within\n 120-mins or shortly after. This way a more accurate assessment can be provided for the trip and\n prevent isolated events not being captured between waypoints. Information can and should be\n updated along the route (especially for trips greater than 2 hours) to continuously pull new\n waypoints moving forward, but also to ensure that forecast information for content such as\n precipitation type and intensity is accurate as storms develop and dissipate over time.\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: WeatherAlongRouteResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.WeatherAlongRouteResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_weather_along_route(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n language: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.WeatherAlongRouteResponse\":\n", + "doc": "\"\"\"**Get Weather along route**\n\n **Applies to**\\ : S1 pricing tier.\n\n Weather along a route API returns hyper local (one kilometer or less), up-to-the-minute\nweather nowcasts, weather hazard assessments, and notifications along a route described as a\nsequence of waypoints.\n This includes a list of weather hazards affecting the waypoint or route, and the aggregated\nhazard index for each waypoint might be used to paint each portion of a route according to how\nsafe it is for the driver. When submitting the waypoints, it is recommended to stay within, or\nclose to, the distance that can be traveled within 120-mins or shortly after. Data is updated\nevery five minutes.\n\n The service supplements Azure Maps `Route Service\n\u003chttps://docs.microsoft.com/rest/api/maps/route\u003e`_ that allows you to first request a route\nbetween an origin and a destination and use that as an input for Weather Along Route endpoint.\n\n In addition, the service supports scenarios to generate weather notifications for waypoints\nthat experience an increase in intensity of a weather hazard. For example, if the vehicle is\nexpected to begin experiencing heavy rain as it reaches a waypoint, a weather notification for\nheavy rain will be generated for that waypoint allowing the end product to display a heavy rain\nnotification before the driver reaches that waypoint.\n The trigger for when to display the notification for a waypoint could be based, for example,\non a `geofence \u003chttps://docs.microsoft.com/azure/azure-maps/tutorial-iot-hub-maps\u003e`_\\ , or\nselectable distance to the waypoint.\n\n The API covers all regions of the planet except latitudes above Greenland and Antarctica.\n\n:param query: Coordinates through which the route is calculated, separated by colon (:) and\n entered in chronological order. A minimum of two waypoints is required. A single API call may\n contain up to 60 waypoints.\n A waypoint indicates location, ETA, and optional heading: latitude,longitude,ETA,heading,\n where\n\n\n * ``Latitude`` - Latitude coordinate in decimal degrees.\n * ``Longitude`` - Longitude coordinate in decimal degrees.\n * ``ETA (estimated time of arrival)`` - The number of minutes from the present time that it\n will take for the vehicle to reach the waypoint. Allowed range is from 0.0 to 120.0 minutes.\n * ``Heading`` - An optional value indicating the vehicle heading as it passes the waypoint.\n Expressed in clockwise degrees relative to true north. This is issued to calculate sun glare as\n a driving hazard. Allowed range is from 0.0 to 360.0 degrees. If not provided, a heading will\n automatically be derived based on the position of neighboring waypoints.\n\n It is recommended to stay within, or close to, the distance that can be traveled within\n 120-mins or shortly after. This way a more accurate assessment can be provided for the trip and\n prevent isolated events not being captured between waypoints. Information can and should be\n updated along the route (especially for trips greater than 2 hours) to continuously pull new\n waypoints moving forward, but also to ensure that forecast information for content such as\n precipitation type and intensity is accurate as storms develop and dissipate over time.\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\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:keyword callable cls: A custom type or function that will be passed the direct response\n:return: WeatherAlongRouteResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.WeatherAlongRouteResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, language" + }, + "get_severe_weather_alerts" : { + "sync": { + "signature": "def get_severe_weather_alerts(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n language=None, # type: Optional[str]\n details=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Severe Weather Alerts**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nSevere weather phenomenon can significantly impact our everyday life and business operations.\nFor example, severe weather conditions such as tropical storms, high winds or flooding can\nclose roads and force logistics companies to reroute their fleet causing delays in reaching\ndestinations and breaking the cold chain of refrigerated food products.\u202f Azure Maps\nSevere\u202fWeather\u202fAlerts API returns the severe\u202fweather\u202falerts that are available worldwide\nfrom\u202fboth\u202fofficial Government Meteorological Agencies and leading global\u202fto\nregional\u202fweather\u202falert providers. The service can return details such as alert type, category,\nlevel and detailed description about the active severe alerts for the requested location,\u202flike\nhurricanes, thunderstorms, lightning, heat waves or forest fires.\n\n:param query: Coordinates of the location for which severe weather alerts are requested. The\n applicable query is specified as a comma separated string composed by latitude followed by\n longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\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 details: Return full details for the severe weather alerts. Available values are\n\n\n * ``true`` - Returns full details. By default all details are returned.\n * ``false`` - Returns a truncated version of the alerts data, which excludes the area-specific\n full description of alert details (\\ ``alertDetails``\\ ).\n:type details: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SevereWeatherAlertsResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.SevereWeatherAlertsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_severe_weather_alerts(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n language: Optional[str] = None,\n details: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.SevereWeatherAlertsResponse\":\n", + "doc": "\"\"\"**Get Severe Weather Alerts**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nSevere weather phenomenon can significantly impact our everyday life and business operations.\nFor example, severe weather conditions such as tropical storms, high winds or flooding can\nclose roads and force logistics companies to reroute their fleet causing delays in reaching\ndestinations and breaking the cold chain of refrigerated food products.\u202f Azure Maps\nSevere\u202fWeather\u202fAlerts API returns the severe\u202fweather\u202falerts that are available worldwide\nfrom\u202fboth\u202fofficial Government Meteorological Agencies and leading global\u202fto\nregional\u202fweather\u202falert providers. The service can return details such as alert type, category,\nlevel and detailed description about the active severe alerts for the requested location,\u202flike\nhurricanes, thunderstorms, lightning, heat waves or forest fires.\n\n:param query: Coordinates of the location for which severe weather alerts are requested. The\n applicable query is specified as a comma separated string composed by latitude followed by\n longitude e.g. \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\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 details: Return full details for the severe weather alerts. Available values are\n\n\n * ``true`` - Returns full details. By default all details are returned.\n * ``false`` - Returns a truncated version of the alerts data, which excludes the area-specific\n full description of alert details (\\ ``alertDetails``\\ ).\n:type details: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SevereWeatherAlertsResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.SevereWeatherAlertsResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, language, details" + }, + "get_daily_indices" : { + "sync": { + "signature": "def get_daily_indices(\n self,\n query, # type: str\n format=\"json\", # type: Union[str, \"_models.JsonFormat\"]\n language=None, # type: Optional[str]\n duration=None, # type: Optional[int]\n index_id=None, # type: Optional[int]\n index_group_id=None, # type: Optional[int]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"**Get Daily Indices**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThere may be times when you want to know if the weather conditions are optimal for a specific\nactivity, for example, for outdoor construction, indoor activities, running or farming\nincluding soil moisture information. Azure Maps Indices API returns index values that will\nguide end users to plan future activities. For example, a health mobile application can notify\nusers that today is good weather for running or for other outdoors activities like for playing\ngolf, and retail stores can optimize their digital marketing campaigns based on predicted index\nvalues. The service returns in daily indices values for current and next 5, 10 and 15 days\nstarting from current day.\n\n:param query: Coordinates of the location for which daily indices are requested. The applicable\n query is specified as a comma separated string composed by latitude followed by longitude e.g.\n \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\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 duration: Specifies for how many days the daily indices are returned. By default, the\n indices data for the current day will be returned. When requesting future indices data, the\n current day is included in the response as day 1. Available values are\n\n\n * ``1`` - Return daily index data for the current day. Default value.\n * ``5`` - Return 5 days of daily index data starting from the current day.\n * ``10`` - Return 10 days of daily index data starting from the current day.\n * ``15`` - Return 15 days of daily index data starting from the current day.\n:type duration: int\n:param index_id: Numeric index identifier that can be used for restricting returned results to\n the corresponding index type. Cannot be paired with ``indexGroupId``. Please refer to `Weather\n Service Concepts \u003chttps://aka.ms/AzureMapsWeatherConcepts\u003e`_ for details and to see the\n supported indices.\n:type index_id: int\n:param index_group_id: Numeric index group identifier that can be used for restricting returned\n results to the corresponding subset of indices (index group). Cannot be paired with\n ``indexId``. Please refer to `Weather Service Concepts\n \u003chttps://aka.ms/AzureMapsWeatherConcepts\u003e`_ for details and to see the supported index groups.\n:type index_group_id: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DailyIndicesResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.DailyIndicesResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_daily_indices(\n self,\n query: str,\n format: Union[str, \"_models.JsonFormat\"] = \"json\",\n language: Optional[str] = None,\n duration: Optional[int] = None,\n index_id: Optional[int] = None,\n index_group_id: Optional[int] = None,\n **kwargs: Any\n) -\u003e \"_models.DailyIndicesResponse\":\n", + "doc": "\"\"\"**Get Daily Indices**\n\n**Applies to**\\ : S0 and S1 pricing tiers.\n\nThere may be times when you want to know if the weather conditions are optimal for a specific\nactivity, for example, for outdoor construction, indoor activities, running or farming\nincluding soil moisture information. Azure Maps Indices API returns index values that will\nguide end users to plan future activities. For example, a health mobile application can notify\nusers that today is good weather for running or for other outdoors activities like for playing\ngolf, and retail stores can optimize their digital marketing campaigns based on predicted index\nvalues. The service returns in daily indices values for current and next 5, 10 and 15 days\nstarting from current day.\n\n:param query: Coordinates of the location for which daily indices are requested. The applicable\n query is specified as a comma separated string composed by latitude followed by longitude e.g.\n \"47.641268,-122.125679\".\n:type query: str\n:param format: Desired format of the response. Only ``json`` format is supported.\n:type format: str or ~azure.maps.weather.models.JsonFormat\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 duration: Specifies for how many days the daily indices are returned. By default, the\n indices data for the current day will be returned. When requesting future indices data, the\n current day is included in the response as day 1. Available values are\n\n\n * ``1`` - Return daily index data for the current day. Default value.\n * ``5`` - Return 5 days of daily index data starting from the current day.\n * ``10`` - Return 10 days of daily index data starting from the current day.\n * ``15`` - Return 15 days of daily index data starting from the current day.\n:type duration: int\n:param index_id: Numeric index identifier that can be used for restricting returned results to\n the corresponding index type. Cannot be paired with ``indexGroupId``. Please refer to `Weather\n Service Concepts \u003chttps://aka.ms/AzureMapsWeatherConcepts\u003e`_ for details and to see the\n supported indices.\n:type index_id: int\n:param index_group_id: Numeric index group identifier that can be used for restricting returned\n results to the corresponding subset of indices (index group). Cannot be paired with\n ``indexId``. Please refer to `Weather Service Concepts\n \u003chttps://aka.ms/AzureMapsWeatherConcepts\u003e`_ for details and to see the supported index groups.\n:type index_group_id: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DailyIndicesResponse, or the result of cls(response)\n:rtype: ~azure.maps.weather.models.DailyIndicesResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "query, format, language, duration, index_id, index_group_id" + } + } + } +} \ No newline at end of file diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/_version.py b/sdk/maps/azure-maps-weather/azure/maps/weather/_version.py new file mode 100644 index 000000000000..b9995fb385b0 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/_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 = "1.0-preview" diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/_weather_client.py b/sdk/maps/azure-maps-weather/azure/maps/weather/_weather_client.py new file mode 100644 index 000000000000..98c5ad797868 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/_weather_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 WeatherClientConfiguration +from .operations import WeatherClientOperationsMixin +from . import models + + +class WeatherClient(WeatherClientOperationsMixin): + """WeatherClient. + + :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 = WeatherClientConfiguration(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: () -> WeatherClient + 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-weather/azure/maps/weather/aio/__init__.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/__init__.py new file mode 100644 index 000000000000..3e1c7559ff00 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/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 ._weather_client import WeatherClient +__all__ = ['WeatherClient'] diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/aio/_configuration.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/_configuration.py new file mode 100644 index 000000000000..a6ba59fd95fb --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/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 WeatherClientConfiguration(Configuration): + """Configuration for WeatherClient. + + 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(WeatherClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.client_id = client_id + self.api_version = "1.0" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://atlas.microsoft.com/.default']) + kwargs.setdefault('sdk_moniker', 'maps-weather/{}'.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-weather/azure/maps/weather/aio/_weather_client.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/_weather_client.py new file mode 100644 index 000000000000..4096be7ccd8e --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/_weather_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 WeatherClientConfiguration +from .operations import WeatherClientOperationsMixin +from .. import models + + +class WeatherClient(WeatherClientOperationsMixin): + """WeatherClient. + + :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 = WeatherClientConfiguration(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) -> "WeatherClient": + 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-weather/azure/maps/weather/aio/operations/__init__.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/__init__.py new file mode 100644 index 000000000000..d1504ebe3a7a --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/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 ._weather_client_operations import WeatherClientOperationsMixin + +__all__ = [ + 'WeatherClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_weather_client_operations.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_weather_client_operations.py new file mode 100644 index 000000000000..f0abeaad6f0a --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_weather_client_operations.py @@ -0,0 +1,841 @@ +# 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, Callable, Dict, Generic, 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 WeatherClientOperationsMixin: + + async def get_hourly_forecast( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + duration: Optional[int] = None, + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.HourlyForecastResponse": + """**Get Hourly Forecast** + + **Applies to**\ : S0 and S1 pricing tiers. + + Request detailed weather forecast by the hour for the next 1, 12, 24 (1 day), 72 (3 days), 120 + (5 days), and 240 hours (10 days) for the given the given coordinate location. The API returns + details such as temperature, humidity, wind, precipitation, and ultraviolet (UV) index. + + In S0 you can request hourly forecast for the next 1, 12, 24 hours (1 day), and 72 hours (3 + days). In S1 you can also request hourly forecast for the next 120 (5 days) and 240 hours (10 + days). + + :param query: Coordinates of the location for which hourly forecast information is requested. + The applicable query is specified as a comma separated string composed by latitude followed by + longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param duration: Time frame of the returned weather forecast. By default, the forecast data for + next hour will be returned. Available values are + + + * ``1`` - Return forecast data for the next hour. Default value. + * ``12`` - Return hourly forecast for next 12 hours. + * ``24`` - Return hourly forecast for next 24 hours. + * ``72`` - Return hourly forecast for next 72 hours (3 days). + * ``120`` - Return hourly forecast for next 120 hours (5 days). Only available in S1 SKU. + * ``240`` - Return hourly forecast for next 240 hours (10 days). Only available in S1 SKU. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HourlyForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.HourlyForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HourlyForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_hourly_forecast.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('HourlyForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hourly_forecast.metadata = {'url': '/weather/forecast/hourly/{format}'} # type: ignore + + async def get_minute_forecast( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + interval: Optional[int] = None, + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.MinuteForecastResponse": + """**Get Minute Forecast** + + **Applies to**\ : S1 pricing tier. + + Get Minute Forecast service returns minute-by-minute forecasts for a given location for the + next 120 minutes. Users can request weather forecasts in the interval of 1, 5 and 15 minutes. + The response will include details such as the type of precipitation (including rain, snow, or a + mixture of both), start time, and precipitation intensity value (dBZ). + + :param query: Coordinates of the location for which minute forecast information is requested. + The applicable query is specified as a comma separated string composed by latitude followed by + longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param interval: Specifies time interval in minutes for the returned weather forecast. + Supported values are + + + * ``1`` - Retrieve forecast for 1-minute intervals. Returned by default. + * ``5`` - Retrieve forecasts for 5-minute intervals. + * ``15`` - Retrieve forecasts for 15-minute intervals. + :type interval: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MinuteForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.MinuteForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MinuteForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_minute_forecast.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['query'] = self._serialize.query("query", query, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('MinuteForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_minute_forecast.metadata = {'url': '/weather/forecast/minute/{format}'} # type: ignore + + async def get_quarter_day_forecast( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + duration: Optional[int] = None, + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.QuarterDayForecastResponse": + """**Get Quarter-Day Forecast** + + **Applies to**\ : S0 and S1 pricing tiers. + + Service returns detailed weather forecast by quarter-day for the next 1, 5, 10, or 15 days for + a given location. Response data is presented by quarters of the day - morning, afternoon, + evening, and overnight. Details such as temperature, humidity, wind, precipitation, and UV + index are returned. + + :param query: Coordinates of the location for which quarter-day forecast information is + requested. The applicable query is specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param duration: Specifies for how many days the quester-day forecast responses are returned. + Supported values are: + + + * ``1`` - Return forecast data for the next day. Returned by default. + * ``5`` - Return forecast data for the next 5 days. + * ``10`` - Return forecast data for next 10 days. + * ``15`` - Return forecast data for the next 15 days. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QuarterDayForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.QuarterDayForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuarterDayForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_quarter_day_forecast.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('QuarterDayForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_quarter_day_forecast.metadata = {'url': '/weather/forecast/quarterDay/{format}'} # type: ignore + + async def get_current_conditions( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + details: Optional[str] = None, + duration: Optional[int] = None, + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.CurrentConditionsResponse": + """**Get Current Conditions** + + **Applies to**\ : S0 and S1 pricing tiers. + + Get Current Conditions service returns detailed current weather conditions such as + precipitation, temperature and wind for a given coordinate location. Also, observations from + the past 6 or 24 hours for a particular location can be retrieved. The basic information + returned with the response include details such as observation date and time, brief description + of the weather conditions, weather icon, precipitation indicator flags, and temperature. + Additional details such as RealFeel™ Temperature and UV index are also returned. + + :param query: Coordinates of the location for which current conditions information is + requested. The applicable query is specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param details: Return full details for the current conditions. Available values are + + + * ``true`` - Returns full details. By default all details are returned. + * ``false`` - Returns a truncated version of the current condition data, which includes + observation date time, weather phrase, icon code, precipitation indicator flag, and + temperature. + :type details: str + :param duration: Time frame of the returned weather conditions. By default, the most current + weather conditions will be returned. Default value is 0. Supported values are: + + + * ``0`` - Return the most current weather conditions. + * ``6`` - Return weather conditions from past 6 hours. + * ``24`` - Return weather conditions from past 24 hours. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CurrentConditionsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.CurrentConditionsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentConditionsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_current_conditions.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if details is not None: + query_parameters['details'] = self._serialize.query("details", details, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('CurrentConditionsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_current_conditions.metadata = {'url': '/weather/currentConditions/{format}'} # type: ignore + + async def get_daily_forecast( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + duration: Optional[int] = None, + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.DailyForecastResponse": + """**Get Daily Forecast** + + **Applies to**\ : S0 and S1 pricing tiers. + + The service returns detailed weather forecast such as temperature and wind by day for the next + 1, 5, 10, 15, 25, or 45 days for a given coordinate location. The response include details + such as temperature, wind, precipitation, air quality, and UV index. + + In S0 you can request daily forecast for the next 1, 5, 10, and 15 days. In S1 you can also + request daily forecast for the next 25 days, and 45 days. + + :param query: Coordinates of the location for which current conditions information is + requested. The applicable query is specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param duration: Specifies for how many days the daily forecast responses are returned. + Available values are + + + * ``1`` - Return forecast data for the next day. Returned by default. + * ``5`` - Return forecast data for the next 5 days. + * ``10`` - Return forecast data for the next 10 days. + * ``25`` - Return forecast data for the next 25 days. Only available in S1 SKU. + * ``45`` - Return forecast data for the next 45 days. Only available in S1 SKU. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_daily_forecast.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('DailyForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_forecast.metadata = {'url': '/weather/forecast/daily/{format}'} # type: ignore + + async def get_weather_along_route( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + language: Optional[str] = None, + **kwargs: Any + ) -> "_models.WeatherAlongRouteResponse": + """**Get Weather along route** + + **Applies to**\ : S1 pricing tier. + + Weather along a route API returns hyper local (one kilometer or less), up-to-the-minute + weather nowcasts, weather hazard assessments, and notifications along a route described as a + sequence of waypoints. + This includes a list of weather hazards affecting the waypoint or route, and the aggregated + hazard index for each waypoint might be used to paint each portion of a route according to how + safe it is for the driver. When submitting the waypoints, it is recommended to stay within, or + close to, the distance that can be traveled within 120-mins or shortly after. Data is updated + every five minutes. + + The service supplements Azure Maps `Route Service + `_ that allows you to first request a route + between an origin and a destination and use that as an input for Weather Along Route endpoint. + + In addition, the service supports scenarios to generate weather notifications for waypoints + that experience an increase in intensity of a weather hazard. For example, if the vehicle is + expected to begin experiencing heavy rain as it reaches a waypoint, a weather notification for + heavy rain will be generated for that waypoint allowing the end product to display a heavy rain + notification before the driver reaches that waypoint. + The trigger for when to display the notification for a waypoint could be based, for example, + on a `geofence `_\ , or + selectable distance to the waypoint. + + The API covers all regions of the planet except latitudes above Greenland and Antarctica. + + :param query: Coordinates through which the route is calculated, separated by colon (:) and + entered in chronological order. A minimum of two waypoints is required. A single API call may + contain up to 60 waypoints. + A waypoint indicates location, ETA, and optional heading: latitude,longitude,ETA,heading, + where + + + * ``Latitude`` - Latitude coordinate in decimal degrees. + * ``Longitude`` - Longitude coordinate in decimal degrees. + * ``ETA (estimated time of arrival)`` - The number of minutes from the present time that it + will take for the vehicle to reach the waypoint. Allowed range is from 0.0 to 120.0 minutes. + * ``Heading`` - An optional value indicating the vehicle heading as it passes the waypoint. + Expressed in clockwise degrees relative to true north. This is issued to calculate sun glare as + a driving hazard. Allowed range is from 0.0 to 360.0 degrees. If not provided, a heading will + automatically be derived based on the position of neighboring waypoints. + + It is recommended to stay within, or close to, the distance that can be traveled within + 120-mins or shortly after. This way a more accurate assessment can be provided for the trip and + prevent isolated events not being captured between waypoints. Information can and should be + updated along the route (especially for trips greater than 2 hours) to continuously pull new + waypoints moving forward, but also to ensure that forecast information for content such as + precipitation type and intensity is accurate as storms develop and dissipate over time. + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WeatherAlongRouteResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.WeatherAlongRouteResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WeatherAlongRouteResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_weather_along_route.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('WeatherAlongRouteResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_weather_along_route.metadata = {'url': '/weather/route/{format}'} # type: ignore + + async def get_severe_weather_alerts( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + language: Optional[str] = None, + details: Optional[str] = None, + **kwargs: Any + ) -> "_models.SevereWeatherAlertsResponse": + """**Get Severe Weather Alerts** + + **Applies to**\ : S0 and S1 pricing tiers. + + Severe weather phenomenon can significantly impact our everyday life and business operations. + For example, severe weather conditions such as tropical storms, high winds or flooding can + close roads and force logistics companies to reroute their fleet causing delays in reaching + destinations and breaking the cold chain of refrigerated food products.  Azure Maps + Severe Weather Alerts API returns the severe weather alerts that are available worldwide + from both official Government Meteorological Agencies and leading global to + regional weather alert providers. The service can return details such as alert type, category, + level and detailed description about the active severe alerts for the requested location, like + hurricanes, thunderstorms, lightning, heat waves or forest fires. + + :param query: Coordinates of the location for which severe weather alerts are requested. The + applicable query is specified as a comma separated string composed by latitude followed by + longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :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 details: Return full details for the severe weather alerts. Available values are + + + * ``true`` - Returns full details. By default all details are returned. + * ``false`` - Returns a truncated version of the alerts data, which excludes the area-specific + full description of alert details (\ ``alertDetails``\ ). + :type details: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SevereWeatherAlertsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.SevereWeatherAlertsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SevereWeatherAlertsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_severe_weather_alerts.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if details is not None: + query_parameters['details'] = self._serialize.query("details", details, '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('SevereWeatherAlertsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_severe_weather_alerts.metadata = {'url': '/weather/severe/alerts/{format}'} # type: ignore + + async def get_daily_indices( + self, + query: str, + format: Union[str, "_models.JsonFormat"] = "json", + language: Optional[str] = None, + duration: Optional[int] = None, + index_id: Optional[int] = None, + index_group_id: Optional[int] = None, + **kwargs: Any + ) -> "_models.DailyIndicesResponse": + """**Get Daily Indices** + + **Applies to**\ : S0 and S1 pricing tiers. + + There may be times when you want to know if the weather conditions are optimal for a specific + activity, for example, for outdoor construction, indoor activities, running or farming + including soil moisture information. Azure Maps Indices API returns index values that will + guide end users to plan future activities. For example, a health mobile application can notify + users that today is good weather for running or for other outdoors activities like for playing + golf, and retail stores can optimize their digital marketing campaigns based on predicted index + values. The service returns in daily indices values for current and next 5, 10 and 15 days + starting from current day. + + :param query: Coordinates of the location for which daily indices are requested. The applicable + query is specified as a comma separated string composed by latitude followed by longitude e.g. + "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :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 duration: Specifies for how many days the daily indices are returned. By default, the + indices data for the current day will be returned. When requesting future indices data, the + current day is included in the response as day 1. Available values are + + + * ``1`` - Return daily index data for the current day. Default value. + * ``5`` - Return 5 days of daily index data starting from the current day. + * ``10`` - Return 10 days of daily index data starting from the current day. + * ``15`` - Return 15 days of daily index data starting from the current day. + :type duration: int + :param index_id: Numeric index identifier that can be used for restricting returned results to + the corresponding index type. Cannot be paired with ``indexGroupId``. Please refer to `Weather + Service Concepts `_ for details and to see the + supported indices. + :type index_id: int + :param index_group_id: Numeric index group identifier that can be used for restricting returned + results to the corresponding subset of indices (index group). Cannot be paired with + ``indexId``. Please refer to `Weather Service Concepts + `_ for details and to see the supported index groups. + :type index_group_id: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyIndicesResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyIndicesResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyIndicesResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_daily_indices.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if index_id is not None: + query_parameters['indexId'] = self._serialize.query("index_id", index_id, 'int') + if index_group_id is not None: + query_parameters['indexGroupId'] = self._serialize.query("index_group_id", index_group_id, 'int') + + # 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('DailyIndicesResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_indices.metadata = {'url': '/weather/indices/daily/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/models/__init__.py b/sdk/maps/azure-maps-weather/azure/maps/weather/models/__init__.py new file mode 100644 index 000000000000..2689b86af729 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/__init__.py @@ -0,0 +1,165 @@ +# 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 AirAndPollen + from ._models_py3 import AlertArea + from ._models_py3 import ColorValue + from ._models_py3 import CurrentConditions + from ._models_py3 import CurrentConditionsResponse + from ._models_py3 import DailyForecast + from ._models_py3 import DailyForecastResponse + from ._models_py3 import DailyForecastSummary + from ._models_py3 import DailyIndex + from ._models_py3 import DailyIndicesResponse + from ._models_py3 import DayOrNight + from ._models_py3 import DegreeDaySummary + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import ForecastInterval + from ._models_py3 import HazardDetail + from ._models_py3 import HourlyForecast + from ._models_py3 import HourlyForecastResponse + from ._models_py3 import IntervalSummary + from ._models_py3 import LatestStatus + from ._models_py3 import LocalSource + from ._models_py3 import MinuteForecastResponse + from ._models_py3 import MinuteForecastSummary + from ._models_py3 import PrecipitationSummary + from ._models_py3 import PressureTendency + from ._models_py3 import QuarterDayForecast + from ._models_py3 import QuarterDayForecastResponse + from ._models_py3 import SevereWeatherAlert + from ._models_py3 import SevereWeatherAlertDescription + from ._models_py3 import SevereWeatherAlertsResponse + from ._models_py3 import SunGlare + from ._models_py3 import TemperatureSummary + from ._models_py3 import TemperatureSummaryPast12Hours + from ._models_py3 import TemperatureSummaryPast24Hours + from ._models_py3 import TemperatureSummaryPast6Hours + from ._models_py3 import WeatherAlongRoutePrecipitation + from ._models_py3 import WeatherAlongRouteResponse + from ._models_py3 import WeatherAlongRouteSummary + from ._models_py3 import WeatherHazards + from ._models_py3 import WeatherNotification + from ._models_py3 import WeatherUnit + from ._models_py3 import WeatherUnitRange + from ._models_py3 import WeatherWaypoint + from ._models_py3 import WindDetails + from ._models_py3 import WindDirection + from ._models_py3 import WindSpeed +except (SyntaxError, ImportError): + from ._models import AirAndPollen # type: ignore + from ._models import AlertArea # type: ignore + from ._models import ColorValue # type: ignore + from ._models import CurrentConditions # type: ignore + from ._models import CurrentConditionsResponse # type: ignore + from ._models import DailyForecast # type: ignore + from ._models import DailyForecastResponse # type: ignore + from ._models import DailyForecastSummary # type: ignore + from ._models import DailyIndex # type: ignore + from ._models import DailyIndicesResponse # type: ignore + from ._models import DayOrNight # type: ignore + from ._models import DegreeDaySummary # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ForecastInterval # type: ignore + from ._models import HazardDetail # type: ignore + from ._models import HourlyForecast # type: ignore + from ._models import HourlyForecastResponse # type: ignore + from ._models import IntervalSummary # type: ignore + from ._models import LatestStatus # type: ignore + from ._models import LocalSource # type: ignore + from ._models import MinuteForecastResponse # type: ignore + from ._models import MinuteForecastSummary # type: ignore + from ._models import PrecipitationSummary # type: ignore + from ._models import PressureTendency # type: ignore + from ._models import QuarterDayForecast # type: ignore + from ._models import QuarterDayForecastResponse # type: ignore + from ._models import SevereWeatherAlert # type: ignore + from ._models import SevereWeatherAlertDescription # type: ignore + from ._models import SevereWeatherAlertsResponse # type: ignore + from ._models import SunGlare # type: ignore + from ._models import TemperatureSummary # type: ignore + from ._models import TemperatureSummaryPast12Hours # type: ignore + from ._models import TemperatureSummaryPast24Hours # type: ignore + from ._models import TemperatureSummaryPast6Hours # type: ignore + from ._models import WeatherAlongRoutePrecipitation # type: ignore + from ._models import WeatherAlongRouteResponse # type: ignore + from ._models import WeatherAlongRouteSummary # type: ignore + from ._models import WeatherHazards # type: ignore + from ._models import WeatherNotification # type: ignore + from ._models import WeatherUnit # type: ignore + from ._models import WeatherUnitRange # type: ignore + from ._models import WeatherWaypoint # type: ignore + from ._models import WindDetails # type: ignore + from ._models import WindDirection # type: ignore + from ._models import WindSpeed # type: ignore + +from ._weather_client_enums import ( + DayQuarter, + JsonFormat, + LatestStatusKeyword, + WeatherDataUnit, +) + +__all__ = [ + 'AirAndPollen', + 'AlertArea', + 'ColorValue', + 'CurrentConditions', + 'CurrentConditionsResponse', + 'DailyForecast', + 'DailyForecastResponse', + 'DailyForecastSummary', + 'DailyIndex', + 'DailyIndicesResponse', + 'DayOrNight', + 'DegreeDaySummary', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'ForecastInterval', + 'HazardDetail', + 'HourlyForecast', + 'HourlyForecastResponse', + 'IntervalSummary', + 'LatestStatus', + 'LocalSource', + 'MinuteForecastResponse', + 'MinuteForecastSummary', + 'PrecipitationSummary', + 'PressureTendency', + 'QuarterDayForecast', + 'QuarterDayForecastResponse', + 'SevereWeatherAlert', + 'SevereWeatherAlertDescription', + 'SevereWeatherAlertsResponse', + 'SunGlare', + 'TemperatureSummary', + 'TemperatureSummaryPast12Hours', + 'TemperatureSummaryPast24Hours', + 'TemperatureSummaryPast6Hours', + 'WeatherAlongRoutePrecipitation', + 'WeatherAlongRouteResponse', + 'WeatherAlongRouteSummary', + 'WeatherHazards', + 'WeatherNotification', + 'WeatherUnit', + 'WeatherUnitRange', + 'WeatherWaypoint', + 'WindDetails', + 'WindDirection', + 'WindSpeed', + 'DayQuarter', + 'JsonFormat', + 'LatestStatusKeyword', + 'WeatherDataUnit', +] diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models.py b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models.py new file mode 100644 index 000000000000..59ba544c97da --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models.py @@ -0,0 +1,1940 @@ +# 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 AirAndPollen(msrest.serialization.Model): + """AirAndPollen. + + :param name: Name of the pollen or pollutant. For example, grass, mold, weed, air quality, tree + and UV index. + :type name: str + :param value: Value of the given type above. Values associated with mold, grass, weed and tree + are in units of parts per cubic meter. Both air quality and UV are indices, so they are + unitless. + :type value: int + :param category: Category of the air quality or pollution type. For example, low, high, good, + moderate, unhealthy, hazardous. + :type category: str + :param category_value: Value associated with the air quality or pollution category. These + values range from 1 to 6. 1 implying good conditions, 6 implying hazardous conditions. + :type category_value: int + :param type: Only exists for air quality. Examples include ozone and particle pollution. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + 'category': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AirAndPollen, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.category = kwargs.get('category', None) + self.category_value = kwargs.get('category_value', None) + self.type = kwargs.get('type', None) + + +class AlertArea(msrest.serialization.Model): + """Information about a severe weather alert issued within an affected area(s). If multiple alerts are active for the same location, the alerts will be returned in order of ``priority`` within the API response, with the highest priority alert being returned at the top of the response. + + :param name: The name of an area which is affected by the alert. The location that was + requested falls under the alert area. + :type name: str + :param summary: Text summarizing the alert in the returned area. + :type summary: str + :param start_time: The start date and time of the alert in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. If the alert crosses multiple time zones the returned time in the + response is the local time to the requested coordinate location. + :type start_time: ~datetime.datetime + :param end_time: The end date and time of the alert in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. If the alert crosses multiple time zones the returned time in the + response is the local time to the requested coordinate location. + :type end_time: ~datetime.datetime + :param latest_status: The latest status of the alert in the current area. + :type latest_status: ~azure.maps.weather.models.LatestStatus + :param alert_details: Full details associated with the alert. Returned if ``details``\ =True. + This field is always returned in the language(s) of choice by the issuing provider and Azure + Maps only returns what is created by the provider. Please note, some countries/regions may + offer their native language and English. Language parameter won’t apply to this field. + :type alert_details: str + :param alert_details_language_code: Language of the ``alertDetails``. This field helps to + point out that the language of the ``alertDetails`` may differ from the requested language + parameter. Returned if ``details``\ =True. Language code has been derived from the ISO 639-1 + Alpha-2 codes. + :type alert_details_language_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'latest_status': {'key': 'latestStatus', 'type': 'LatestStatus'}, + 'alert_details': {'key': 'alertDetails', 'type': 'str'}, + 'alert_details_language_code': {'key': 'alertDetailsLanguageCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertArea, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.summary = kwargs.get('summary', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.latest_status = kwargs.get('latest_status', None) + self.alert_details = kwargs.get('alert_details', None) + self.alert_details_language_code = kwargs.get('alert_details_language_code', None) + + +class ColorValue(msrest.serialization.Model): + """ColorValue. + + :param red: Red component of the RGB value. + :type red: int + :param green: Green component of the RGB value. + :type green: int + :param blue: Blue component of the RGB value. + :type blue: int + :param hex: Hexadecimal color value. + :type hex: str + """ + + _attribute_map = { + 'red': {'key': 'red', 'type': 'int'}, + 'green': {'key': 'green', 'type': 'int'}, + 'blue': {'key': 'blue', 'type': 'int'}, + 'hex': {'key': 'hex', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ColorValue, self).__init__(**kwargs) + self.red = kwargs.get('red', None) + self.green = kwargs.get('green', None) + self.blue = kwargs.get('blue', None) + self.hex = kwargs.get('hex', None) + + +class CurrentConditions(msrest.serialization.Model): + """CurrentConditions. + + :param date_time: Date and time of the current observation displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type date_time: ~datetime.datetime + :param phrase: Phrase description of the current weather condition. Displayed in specified + language. + :type phrase: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param is_day_time: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_day_time: bool + :param temperature: Temperature being returned. + :type temperature: ~azure.maps.weather.models.WeatherUnit + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnit + :param real_feel_temperature_shade: RealFeel™ Temperature being returned. Describes what the + temperature really feels like in the shade. + :type real_feel_temperature_shade: ~azure.maps.weather.models.WeatherUnit + :param relative_humidity: Relative humidity is the amount of water vapor present in air + expressed as a percentage of the amount needed for saturation at the same temperature. + :type relative_humidity: int + :param dew_point: The dewpoint temperature in specified unit. The dewpoint temperature is the + temperature that the air must be cooled to in order to reach saturation. + :type dew_point: ~azure.maps.weather.models.WeatherUnit + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param uv_index: Measure of the strength of the ultraviolet radiation from the sun. Supported + values are: + + + * ``0-2`` - Low danger from the sun's UV rays or the average person. + * ``3-5`` - Moderate risk of harm from unprotected sun exposure. + * ``6-7`` - High risk of harm from unprotected sun exposure. + * ``8-10`` - Very high risk of harm from unprotected sun exposure. + * ``11+`` - Extreme risk of harm from unprotected sun exposure. + :type uv_index: int + :param uv_index_phrase: Phrase associated with the ``uvIndex``. + :type uv_index_phrase: str + :param visibility: Visibility in specified unit. A measure of the distance at which an object + or light can be clearly discerned. + :type visibility: ~azure.maps.weather.models.WeatherUnit + :param obstructions_to_visibility: Cause of limited visibility. + :type obstructions_to_visibility: str + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + :param ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the height of + the base of the lowest clouds. + :type ceiling: ~azure.maps.weather.models.WeatherUnit + :param pressure: Atmospheric pressure in specified unit. + :type pressure: ~azure.maps.weather.models.WeatherUnit + :param pressure_tendency: Atmospheric pressure change. + :type pressure_tendency: ~azure.maps.weather.models.PressureTendency + :param past24_hour_temperature_departure: Departure from the temperature observed 24 hours ago + in specified unit. + :type past24_hour_temperature_departure: ~azure.maps.weather.models.WeatherUnit + :param apparent_temperature: Perceived outdoor temperature caused by the combination of air + temperature, relative humidity, and wind speed in specified unit. + :type apparent_temperature: ~azure.maps.weather.models.WeatherUnit + :param wind_chill_temperature: Perceived air temperature on exposed skin due to wind. + :type wind_chill_temperature: ~azure.maps.weather.models.WeatherUnit + :param wet_bulb_temperature: The temperature to which air may be cooled by evaporating water + into it at constant pressure until it reaches saturation. + :type wet_bulb_temperature: ~azure.maps.weather.models.WeatherUnit + :param precipitation_summary: Summary of precipitation amounts over the past 24 hours. + :type precipitation_summary: ~azure.maps.weather.models.PrecipitationSummary + :param temperature_summary: Summary of temperature fluctuations over the past 6, 12, and 24 + hours. + :type temperature_summary: ~azure.maps.weather.models.TemperatureSummary + """ + + _attribute_map = { + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'is_day_time': {'key': 'isDayTime', 'type': 'bool'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnit'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnit'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherUnit'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherUnit'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_phrase': {'key': 'uvIndexPhrase', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherUnit'}, + 'obstructions_to_visibility': {'key': 'obstructionsToVisibility', 'type': 'str'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'ceiling': {'key': 'ceiling', 'type': 'WeatherUnit'}, + 'pressure': {'key': 'pressure', 'type': 'WeatherUnit'}, + 'pressure_tendency': {'key': 'pressureTendency', 'type': 'PressureTendency'}, + 'past24_hour_temperature_departure': {'key': 'past24HourTemperatureDeparture', 'type': 'WeatherUnit'}, + 'apparent_temperature': {'key': 'apparentTemperature', 'type': 'WeatherUnit'}, + 'wind_chill_temperature': {'key': 'windChillTemperature', 'type': 'WeatherUnit'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherUnit'}, + 'precipitation_summary': {'key': 'precipitationSummary', 'type': 'PrecipitationSummary'}, + 'temperature_summary': {'key': 'temperatureSummary', 'type': 'TemperatureSummary'}, + } + + def __init__( + self, + **kwargs + ): + super(CurrentConditions, self).__init__(**kwargs) + self.date_time = kwargs.get('date_time', None) + self.phrase = kwargs.get('phrase', None) + self.icon_code = kwargs.get('icon_code', None) + self.has_precipitation = kwargs.get('has_precipitation', None) + self.is_day_time = kwargs.get('is_day_time', None) + self.temperature = kwargs.get('temperature', None) + self.real_feel_temperature = kwargs.get('real_feel_temperature', None) + self.real_feel_temperature_shade = kwargs.get('real_feel_temperature_shade', None) + self.relative_humidity = kwargs.get('relative_humidity', None) + self.dew_point = kwargs.get('dew_point', None) + self.wind = kwargs.get('wind', None) + self.wind_gust = kwargs.get('wind_gust', None) + self.uv_index = kwargs.get('uv_index', None) + self.uv_index_phrase = kwargs.get('uv_index_phrase', None) + self.visibility = kwargs.get('visibility', None) + self.obstructions_to_visibility = kwargs.get('obstructions_to_visibility', None) + self.cloud_cover = kwargs.get('cloud_cover', None) + self.ceiling = kwargs.get('ceiling', None) + self.pressure = kwargs.get('pressure', None) + self.pressure_tendency = kwargs.get('pressure_tendency', None) + self.past24_hour_temperature_departure = kwargs.get('past24_hour_temperature_departure', None) + self.apparent_temperature = kwargs.get('apparent_temperature', None) + self.wind_chill_temperature = kwargs.get('wind_chill_temperature', None) + self.wet_bulb_temperature = kwargs.get('wet_bulb_temperature', None) + self.precipitation_summary = kwargs.get('precipitation_summary', None) + self.temperature_summary = kwargs.get('temperature_summary', None) + + +class CurrentConditionsResponse(msrest.serialization.Model): + """CurrentConditionsResponse. + + :param results: Detailed current weather conditions. + :type results: list[~azure.maps.weather.models.CurrentConditions] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[CurrentConditions]'}, + } + + def __init__( + self, + **kwargs + ): + super(CurrentConditionsResponse, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class DailyForecast(msrest.serialization.Model): + """DailyForecast. + + :param date: Date and time of the current observation displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type date: ~datetime.datetime + :param temperature: Temperature values for the day. + :type temperature: ~azure.maps.weather.models.WeatherUnitRange + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnitRange + :param real_feel_temperature_shade: RealFeel™ Temperature being returned. Describes what the + temperature really feels like in the shade. + :type real_feel_temperature_shade: ~azure.maps.weather.models.WeatherUnitRange + :param hours_of_sun: Hours of sun. + :type hours_of_sun: float + :param degree_day_summary: Summary of Heating Degree Day or Cooling Degree Day information. + :type degree_day_summary: ~azure.maps.weather.models.DegreeDaySummary + :param air_and_pollen: airAndPollen. + :type air_and_pollen: list[~azure.maps.weather.models.AirAndPollen] + :param day: Day. + :type day: ~azure.maps.weather.models.DayOrNight + :param night: Night. + :type night: ~azure.maps.weather.models.DayOrNight + :param sources: Source(s) of the forecast data. + :type sources: list[str] + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnitRange'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherUnitRange'}, + 'hours_of_sun': {'key': 'hoursOfSun', 'type': 'float'}, + 'degree_day_summary': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'air_and_pollen': {'key': 'airAndPollen', 'type': '[AirAndPollen]'}, + 'day': {'key': 'day', 'type': 'DayOrNight'}, + 'night': {'key': 'night', 'type': 'DayOrNight'}, + 'sources': {'key': 'sources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyForecast, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.temperature = kwargs.get('temperature', None) + self.real_feel_temperature = kwargs.get('real_feel_temperature', None) + self.real_feel_temperature_shade = kwargs.get('real_feel_temperature_shade', None) + self.hours_of_sun = kwargs.get('hours_of_sun', None) + self.degree_day_summary = kwargs.get('degree_day_summary', None) + self.air_and_pollen = kwargs.get('air_and_pollen', None) + self.day = kwargs.get('day', None) + self.night = kwargs.get('night', None) + self.sources = kwargs.get('sources', None) + + +class DailyForecastResponse(msrest.serialization.Model): + """DailyForecastResponse. + + :param summary: Summary for the main conditions for the requested time period. Notice that + summary can cover only part of the time period. + :type summary: ~azure.maps.weather.models.DailyForecastSummary + :param forecasts: Forecast data for each requested day. + :type forecasts: list[~azure.maps.weather.models.DailyForecast] + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'DailyForecastSummary'}, + 'forecasts': {'key': 'forecasts', 'type': '[DailyForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyForecastResponse, self).__init__(**kwargs) + self.summary = kwargs.get('summary', None) + self.forecasts = kwargs.get('forecasts', None) + + +class DailyForecastSummary(msrest.serialization.Model): + """Summary for the main conditions for the requested time period. Notice that summary can cover only part of the time period. + + :param start_date: Date and time that the summary is in effect, displayed in ISO 8601 format, + for example, 2019-10-27T19:39:57-08:00. + :type start_date: ~datetime.datetime + :param end_date: Date and time that the summary period ends, displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type end_date: ~datetime.datetime + :param severity: severity. + :type severity: int + :param phrase: Summary phrase of the daily forecast. Displayed in specified language. + :type phrase: str + :param category: one or 2 word(s) to summarize the phrase. + :type category: str + """ + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'severity': {'key': 'severity', 'type': 'int'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyForecastSummary, self).__init__(**kwargs) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.severity = kwargs.get('severity', None) + self.phrase = kwargs.get('phrase', None) + self.category = kwargs.get('category', None) + + +class DailyIndex(msrest.serialization.Model): + """Information about a daily index. + + :param index_name: Name of the index, for example, "Construction", "Outdoor Activity", "Flight + Delays". + :type index_name: str + :param index_id: Numeric ID used to identify the specific index. Please refer to `Weather + Service Concepts `_ for details and to see the + supported index IDs. For example, the index ID can support UI visualization scenarios. + :type index_id: int + :param date_time: Date and time of the current observation displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type date_time: ~datetime.datetime + :param value: Index value. Ranges from 0.0 to 10.0. Please refer to `Weather Service Concepts + `_ for details and to see the supported ranges. + :type value: float + :param category: Textual description for ``categoryValue`` corresponding to the level that the + index value falls under, for example "Very Good". + :type category: str + :param category_value: Level that the index value falls under, represented by an integer. This + value can be 1 through 5 and should be used in combination with the ``ascending`` flag because + it can differ among indices. For example, the following values apply for Mosquito Activity: + Low=1, Moderate=2, High=3, Very High=4, and Extreme=5. + :type category_value: int + :param ascending: Describes the direction of the ``value`` and ``categoryValue``. For example, + when ``ascending``\ =True, the poorest index value is 0 and the best index value is 10. When + ``ascending``\ =True, the poorest index value is 10 and the best index value is 0. + :type ascending: bool + :param description: A textual explanation that can be used for display purposes to summarize + the index value and category. For example, when the index value for Flight Delays is very good, + the description will be "Conditions are excellent for flying!". + :type description: str + """ + + _attribute_map = { + 'index_name': {'key': 'indexName', 'type': 'str'}, + 'index_id': {'key': 'indexId', 'type': 'int'}, + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, + 'category': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'ascending': {'key': 'ascending', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyIndex, self).__init__(**kwargs) + self.index_name = kwargs.get('index_name', None) + self.index_id = kwargs.get('index_id', None) + self.date_time = kwargs.get('date_time', None) + self.value = kwargs.get('value', None) + self.category = kwargs.get('category', None) + self.category_value = kwargs.get('category_value', None) + self.ascending = kwargs.get('ascending', None) + self.description = kwargs.get('description', None) + + +class DailyIndicesResponse(msrest.serialization.Model): + """This object is returned from a successful Get Daily Indices call. + + :param results: A list of all daily indices for the queried location. + :type results: list[~azure.maps.weather.models.DailyIndex] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[DailyIndex]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyIndicesResponse, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class DayOrNight(msrest.serialization.Model): + """DayOrNight. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param icon_phrase: Phrase description of the icon. Displayed in specified language. For + example, 'Sunny'. + :type icon_phrase: str + :param local_source: Local weather data provider information. + :type local_source: ~azure.maps.weather.models.LocalSource + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param precipitation_type: Specifies the type of precipitation ("rain" "snow" "ice" or "mix"). + If dbz = zero, precipitationType is not present in the response. + :type precipitation_type: str + :param precipitation_intensity: Description of the intensity. + :type precipitation_intensity: str + :param short_phrase: Phrase description of the forecast in specified language. Azure Maps + attempts to keep this phrase under 30 characters in length, but some languages/weather events + may result in a longer phrase length, exceeding 30 characters. + :type short_phrase: str + :param long_phrase: Phrase description of the forecast in specified language. Azure Maps + attempts to keep this phrase under 100 characters in length, but some languages/weather events + may result in a longer phrase length, exceeding 100 characters. + :type long_phrase: str + :param precipitation_probability: Percent representing the probability of precipitation. For + example, '20'. + :type precipitation_probability: int + :param thunderstorm_probability: Percent representing the probability of a thunderstorm. For + example, '80'. + :type thunderstorm_probability: int + :param rain_probability: Percent representing the probability of rain. For example, '40'. + :type rain_probability: int + :param snow_probability: Percent representing the probability of snow. For example, '30'. + :type snow_probability: int + :param ice_probability: Percent representing the probability of ice. For example, '30'. + :type ice_probability: int + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param total_liquid: Total liquid equivalent of precipitation during the forecast period. + :type total_liquid: ~azure.maps.weather.models.WeatherUnit + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherUnit + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherUnit + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherUnit + :param hours_of_precipitation: Hours of precipitation. + :type hours_of_precipitation: float + :param hours_of_rain: Hours of rain. + :type hours_of_rain: float + :param hours_of_snow: Hours of snow. + :type hours_of_snow: float + :param hours_of_ice: Hours of ice. + :type hours_of_ice: float + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'icon_phrase': {'key': 'iconPhrase', 'type': 'str'}, + 'local_source': {'key': 'localSource', 'type': 'LocalSource'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'precipitation_type': {'key': 'precipitationType', 'type': 'str'}, + 'precipitation_intensity': {'key': 'precipitationIntensity', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'long_phrase': {'key': 'longPhrase', 'type': 'str'}, + 'precipitation_probability': {'key': 'precipitationProbability', 'type': 'int'}, + 'thunderstorm_probability': {'key': 'thunderstormProbability', 'type': 'int'}, + 'rain_probability': {'key': 'rainProbability', 'type': 'int'}, + 'snow_probability': {'key': 'snowProbability', 'type': 'int'}, + 'ice_probability': {'key': 'iceProbability', 'type': 'int'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'total_liquid': {'key': 'totalLiquid', 'type': 'WeatherUnit'}, + 'rain': {'key': 'rain', 'type': 'WeatherUnit'}, + 'snow': {'key': 'snow', 'type': 'WeatherUnit'}, + 'ice': {'key': 'ice', 'type': 'WeatherUnit'}, + 'hours_of_precipitation': {'key': 'hoursOfPrecipitation', 'type': 'float'}, + 'hours_of_rain': {'key': 'hoursOfRain', 'type': 'float'}, + 'hours_of_snow': {'key': 'hoursOfSnow', 'type': 'float'}, + 'hours_of_ice': {'key': 'hoursOfIce', 'type': 'float'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DayOrNight, self).__init__(**kwargs) + self.icon_code = kwargs.get('icon_code', None) + self.icon_phrase = kwargs.get('icon_phrase', None) + self.local_source = kwargs.get('local_source', None) + self.has_precipitation = kwargs.get('has_precipitation', None) + self.precipitation_type = kwargs.get('precipitation_type', None) + self.precipitation_intensity = kwargs.get('precipitation_intensity', None) + self.short_phrase = kwargs.get('short_phrase', None) + self.long_phrase = kwargs.get('long_phrase', None) + self.precipitation_probability = kwargs.get('precipitation_probability', None) + self.thunderstorm_probability = kwargs.get('thunderstorm_probability', None) + self.rain_probability = kwargs.get('rain_probability', None) + self.snow_probability = kwargs.get('snow_probability', None) + self.ice_probability = kwargs.get('ice_probability', None) + self.wind = kwargs.get('wind', None) + self.wind_gust = kwargs.get('wind_gust', None) + self.total_liquid = kwargs.get('total_liquid', None) + self.rain = kwargs.get('rain', None) + self.snow = kwargs.get('snow', None) + self.ice = kwargs.get('ice', None) + self.hours_of_precipitation = kwargs.get('hours_of_precipitation', None) + self.hours_of_rain = kwargs.get('hours_of_rain', None) + self.hours_of_snow = kwargs.get('hours_of_snow', None) + self.hours_of_ice = kwargs.get('hours_of_ice', None) + self.cloud_cover = kwargs.get('cloud_cover', None) + + +class DegreeDaySummary(msrest.serialization.Model): + """DegreeDaySummary. + + :param heating: Number of degrees that the mean temperature is below 65 degrees F/ 18 degree C. + :type heating: ~azure.maps.weather.models.WeatherUnit + :param cooling: Number of degrees that the mean temperature is above 65 degrees F/ 18 degree C. + :type cooling: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'heating': {'key': 'heating', 'type': 'WeatherUnit'}, + 'cooling': {'key': 'cooling', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(DegreeDaySummary, self).__init__(**kwargs) + self.heating = kwargs.get('heating', None) + self.cooling = kwargs.get('cooling', 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.weather.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.weather.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.weather.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 ForecastInterval(msrest.serialization.Model): + """ForecastInterval. + + :param start_time: The date and time for the start of the interval in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type start_time: ~datetime.datetime + :param minute: The first minute for the interval. + :type minute: int + :param dbz: A unit that represents forecasted precipitation intensity. + :type dbz: float + :param short_phrase: A short phrase describing precipitation condition for the interval. + :type short_phrase: str + :param threshold: Key that specifies the threshold value. Along with precipitationType, can be + used to determine the simplifiedColor. If dbz is zero, not present in the response. + :type threshold: str + :param color: The full spectrum color that maps to the dBZ (decibel relative to Z). If dbz is + zero, color is not present in the response. + :type color: ~azure.maps.weather.models.ColorValue + :param simplified_color: The band color that maps to the precipitation type and threshold. If + dbz is zero, not present in the response. + :type simplified_color: ~azure.maps.weather.models.ColorValue + :param precipitation_type: Specifies the type of precipitation ("rain" "snow" "ice" or "mix"). + If dbz is zero, precipitationType is not present in the response. + :type precipitation_type: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'minute': {'key': 'minute', 'type': 'int'}, + 'dbz': {'key': 'dbz', 'type': 'float'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'str'}, + 'color': {'key': 'color', 'type': 'ColorValue'}, + 'simplified_color': {'key': 'simplifiedColor', 'type': 'ColorValue'}, + 'precipitation_type': {'key': 'precipitationType', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastInterval, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.minute = kwargs.get('minute', None) + self.dbz = kwargs.get('dbz', None) + self.short_phrase = kwargs.get('short_phrase', None) + self.threshold = kwargs.get('threshold', None) + self.color = kwargs.get('color', None) + self.simplified_color = kwargs.get('simplified_color', None) + self.precipitation_type = kwargs.get('precipitation_type', None) + self.icon_code = kwargs.get('icon_code', None) + self.cloud_cover = kwargs.get('cloud_cover', None) + + +class HazardDetail(msrest.serialization.Model): + """HazardDetail. + + :param hazard_index: A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + :type hazard_index: int + :param hazard_code: A unique identifier (non-displayable) for each type of hazard: LightRain, + ModerateRain, HeavyRain, LightMix, ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, + LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, Lightning, + SevereLightning, WindModerate, WindHigh, WindExtreme, FloodWarning, FlashFloodWarning, + TornadoWarning, TsunamiWarning, SevereThunderstormWarning. + :type hazard_code: str + :param short_phrase: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_phrase: str + """ + + _attribute_map = { + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HazardDetail, self).__init__(**kwargs) + self.hazard_index = kwargs.get('hazard_index', None) + self.hazard_code = kwargs.get('hazard_code', None) + self.short_phrase = kwargs.get('short_phrase', None) + + +class HourlyForecast(msrest.serialization.Model): + """HourlyForecast. + + :param date: Date and time of the forecast in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. + :type date: ~datetime.datetime + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param icon_phrase: Phrase description of the weather icon. + :type icon_phrase: str + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param is_daylight: Specifies whether or not it is daylight. True indicates day light. + :type is_daylight: bool + :param temperature: Temperature being returned. + :type temperature: ~azure.maps.weather.models.WeatherUnit + :param real_feel_temperature: RealFeel™ Temperature being returned. Describes what the + temperature really feels like in the shade. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnit + :param wet_bulb_temperature: The temperature to which air may be cooled by evaporating water + into it at constant pressure until it reaches saturation. + :type wet_bulb_temperature: ~azure.maps.weather.models.WeatherUnit + :param dew_point: The dewpoint temperature in specified unit. The dewpoint temperature is the + temperature that the air must be cooled to in order to reach saturation. + :type dew_point: ~azure.maps.weather.models.WeatherUnit + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param relative_humidity: Relative humidity is the amount of water vapor present in air + expressed as a percentage of the amount needed for saturation at the same temperature. + :type relative_humidity: int + :param visibility: Visibility in specified unit. A measure of the distance at which an object + or light can be clearly discerned. + :type visibility: ~azure.maps.weather.models.WeatherUnit + :param ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the height of + the base of the lowest clouds. + :type ceiling: ~azure.maps.weather.models.WeatherUnit + :param uv_index: Measure of the strength of the ultraviolet radiation from the sun. Supported + values are: + + + * ``0-2`` - Low danger from the sun's UV rays or the average person. + * ``3-5`` - Moderate risk of harm from unprotected sun exposure. + * ``6-7`` - High risk of harm from unprotected sun exposure. + * ``8-10`` - Very high risk of harm from unprotected sun exposure. + * ``11+`` - Extreme risk of harm from unprotected sun exposure. + :type uv_index: int + :param uv_index_phrase: Phrase associated with the ``uvIndex``. + :type uv_index_phrase: str + :param precipitation_probability: Percent representing the probability of precipitation. For + example, '20'. + :type precipitation_probability: int + :param rain_probability: Percent representing the probability of rain. For example, '50'. + :type rain_probability: int + :param snow_probability: Percent representing the probability of snow. For example, '50'. + :type snow_probability: int + :param ice_probability: Percent representing the probability of snow. For example, '5'. + :type ice_probability: int + :param total_liquid: Total liquid equivalent of precipitation during the forecast period. + :type total_liquid: ~azure.maps.weather.models.WeatherUnit + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherUnit + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherUnit + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherUnit + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'icon_phrase': {'key': 'iconPhrase', 'type': 'str'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'is_daylight': {'key': 'isDaylight', 'type': 'bool'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnit'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnit'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherUnit'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherUnit'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherUnit'}, + 'ceiling': {'key': 'ceiling', 'type': 'WeatherUnit'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_phrase': {'key': 'uvIndexPhrase', 'type': 'str'}, + 'precipitation_probability': {'key': 'precipitationProbability', 'type': 'int'}, + 'rain_probability': {'key': 'rainProbability', 'type': 'int'}, + 'snow_probability': {'key': 'snowProbability', 'type': 'int'}, + 'ice_probability': {'key': 'iceProbability', 'type': 'int'}, + 'total_liquid': {'key': 'totalLiquid', 'type': 'WeatherUnit'}, + 'rain': {'key': 'rain', 'type': 'WeatherUnit'}, + 'snow': {'key': 'snow', 'type': 'WeatherUnit'}, + 'ice': {'key': 'ice', 'type': 'WeatherUnit'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HourlyForecast, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.icon_code = kwargs.get('icon_code', None) + self.icon_phrase = kwargs.get('icon_phrase', None) + self.has_precipitation = kwargs.get('has_precipitation', None) + self.is_daylight = kwargs.get('is_daylight', None) + self.temperature = kwargs.get('temperature', None) + self.real_feel_temperature = kwargs.get('real_feel_temperature', None) + self.wet_bulb_temperature = kwargs.get('wet_bulb_temperature', None) + self.dew_point = kwargs.get('dew_point', None) + self.wind = kwargs.get('wind', None) + self.wind_gust = kwargs.get('wind_gust', None) + self.relative_humidity = kwargs.get('relative_humidity', None) + self.visibility = kwargs.get('visibility', None) + self.ceiling = kwargs.get('ceiling', None) + self.uv_index = kwargs.get('uv_index', None) + self.uv_index_phrase = kwargs.get('uv_index_phrase', None) + self.precipitation_probability = kwargs.get('precipitation_probability', None) + self.rain_probability = kwargs.get('rain_probability', None) + self.snow_probability = kwargs.get('snow_probability', None) + self.ice_probability = kwargs.get('ice_probability', None) + self.total_liquid = kwargs.get('total_liquid', None) + self.rain = kwargs.get('rain', None) + self.snow = kwargs.get('snow', None) + self.ice = kwargs.get('ice', None) + self.cloud_cover = kwargs.get('cloud_cover', None) + + +class HourlyForecastResponse(msrest.serialization.Model): + """HourlyForecastResponse. + + :param forecasts: Forecast data for each returned hour. + :type forecasts: list[~azure.maps.weather.models.HourlyForecast] + """ + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[HourlyForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(HourlyForecastResponse, self).__init__(**kwargs) + self.forecasts = kwargs.get('forecasts', None) + + +class IntervalSummary(msrest.serialization.Model): + """IntervalSummary. + + :param start_minute: The first minute to which the summary applies. + :type start_minute: int + :param end_minute: The last minute to which the summary applies. + :type end_minute: int + :param total_minutes: The number of minutes for which the summary applies. + :type total_minutes: int + :param short_phrase: Short summary phrase. Phrase length is approximately 25 characters. + :type short_phrase: str + :param brief_phrase: Brief summary phrase. Phrase length is approximately 60 characters. + :type brief_phrase: str + :param long_phrase: Long summary phrase. Phrase length is 60+ characters. + :type long_phrase: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + """ + + _attribute_map = { + 'start_minute': {'key': 'startMinute', 'type': 'int'}, + 'end_minute': {'key': 'endMinute', 'type': 'int'}, + 'total_minutes': {'key': 'totalMinutes', 'type': 'int'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_phrase': {'key': 'briefPhrase', 'type': 'str'}, + 'long_phrase': {'key': 'longPhrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(IntervalSummary, self).__init__(**kwargs) + self.start_minute = kwargs.get('start_minute', None) + self.end_minute = kwargs.get('end_minute', None) + self.total_minutes = kwargs.get('total_minutes', None) + self.short_phrase = kwargs.get('short_phrase', None) + self.brief_phrase = kwargs.get('brief_phrase', None) + self.long_phrase = kwargs.get('long_phrase', None) + self.icon_code = kwargs.get('icon_code', None) + + +class LatestStatus(msrest.serialization.Model): + """The latest status on the alert in the current area. + + :param localized: The latest status keyword for the alert, in the specified language. By + default, returned in English (en-US). + :type localized: str + :param english: Latest status keyword for the alert, in English (en-US). Possible values + include: "New", "Extend", "Cancel", "Correct", "Expire", "Upgrade", "Continue", "Update". + :type english: str or ~azure.maps.weather.models.LatestStatusKeyword + """ + + _attribute_map = { + 'localized': {'key': 'localized', 'type': 'str'}, + 'english': {'key': 'english', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LatestStatus, self).__init__(**kwargs) + self.localized = kwargs.get('localized', None) + self.english = kwargs.get('english', None) + + +class LocalSource(msrest.serialization.Model): + """Local weather data provider information. + + :param id: Numeric identifier, unique to the local data provider. + :type id: int + :param name: Name of the local data provider. Name is displayed in the language specified by + language code in URL, if available. Otherwise, Name is displayed in English or the language in + which the name was provided. + :type name: str + :param weather_code: Weather code provided by the local data provider. This weather code allows + the forecast to be matched to icons provided by the local data provider instead of Azure Maps + icons. + :type weather_code: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'weather_code': {'key': 'weatherCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocalSource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.weather_code = kwargs.get('weather_code', None) + + +class MinuteForecastResponse(msrest.serialization.Model): + """MinuteForecastResponse. + + :param summary: Phrase summaries for the entire forecast period. + :type summary: ~azure.maps.weather.models.MinuteForecastSummary + :param interval_summaries: Summary information for each interval in the forecast. The Summaries + breaks down each potential interval where precipitation starts and stops. + :type interval_summaries: list[~azure.maps.weather.models.IntervalSummary] + :param intervals: Forecast data for each interval in the forecast. + :type intervals: list[~azure.maps.weather.models.ForecastInterval] + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'MinuteForecastSummary'}, + 'interval_summaries': {'key': 'intervalSummaries', 'type': '[IntervalSummary]'}, + 'intervals': {'key': 'intervals', 'type': '[ForecastInterval]'}, + } + + def __init__( + self, + **kwargs + ): + super(MinuteForecastResponse, self).__init__(**kwargs) + self.summary = kwargs.get('summary', None) + self.interval_summaries = kwargs.get('interval_summaries', None) + self.intervals = kwargs.get('intervals', None) + + +class MinuteForecastSummary(msrest.serialization.Model): + """Phrase summaries for the entire forecast period. + + :param brief_phrase60: Summary phrase for the next 60 minutes. Phrase length is approximately + 60 characters. + :type brief_phrase60: str + :param short_phrase: Short summary phrase for the next 120 minutes. Phrase length is + approximately 25 characters. + :type short_phrase: str + :param brief_phrase: Summary phrase for the next 120 minutes. Phrase length is approximately 60 + characters. + :type brief_phrase: str + :param long_phrase: Long summary phrase for the next 120 minutes. Phrase length is 60+ + characters. + :type long_phrase: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + """ + + _attribute_map = { + 'brief_phrase60': {'key': 'briefPhrase60', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_phrase': {'key': 'briefPhrase', 'type': 'str'}, + 'long_phrase': {'key': 'longPhrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(MinuteForecastSummary, self).__init__(**kwargs) + self.brief_phrase60 = kwargs.get('brief_phrase60', None) + self.short_phrase = kwargs.get('short_phrase', None) + self.brief_phrase = kwargs.get('brief_phrase', None) + self.long_phrase = kwargs.get('long_phrase', None) + self.icon_code = kwargs.get('icon_code', None) + + +class PrecipitationSummary(msrest.serialization.Model): + """PrecipitationSummary. + + :param past_hour: The amount of precipitation (liquid equivalent) that has fallen in the past + hour. + :type past_hour: ~azure.maps.weather.models.WeatherUnit + :param past3_hours: The amount of precipitation (liquid equivalent) that has fallen in the past + three hours. + :type past3_hours: ~azure.maps.weather.models.WeatherUnit + :param past6_hours: The amount of precipitation (liquid equivalent) that has fallen in the past + six hours. Contains Metric and Imperial Values. + :type past6_hours: ~azure.maps.weather.models.WeatherUnit + :param past9_hours: The amount of precipitation (liquid equivalent) that has fallen in the past + nine hours. + :type past9_hours: ~azure.maps.weather.models.WeatherUnit + :param past12_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past 12 hours. + :type past12_hours: ~azure.maps.weather.models.WeatherUnit + :param past18_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past 18 hours. + :type past18_hours: ~azure.maps.weather.models.WeatherUnit + :param past24_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past 24 hours. + :type past24_hours: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'past_hour': {'key': 'pastHour', 'type': 'WeatherUnit'}, + 'past3_hours': {'key': 'past3Hours', 'type': 'WeatherUnit'}, + 'past6_hours': {'key': 'past6Hours', 'type': 'WeatherUnit'}, + 'past9_hours': {'key': 'past9Hours', 'type': 'WeatherUnit'}, + 'past12_hours': {'key': 'past12Hours', 'type': 'WeatherUnit'}, + 'past18_hours': {'key': 'past18Hours', 'type': 'WeatherUnit'}, + 'past24_hours': {'key': 'past24Hours', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(PrecipitationSummary, self).__init__(**kwargs) + self.past_hour = kwargs.get('past_hour', None) + self.past3_hours = kwargs.get('past3_hours', None) + self.past6_hours = kwargs.get('past6_hours', None) + self.past9_hours = kwargs.get('past9_hours', None) + self.past12_hours = kwargs.get('past12_hours', None) + self.past18_hours = kwargs.get('past18_hours', None) + self.past24_hours = kwargs.get('past24_hours', None) + + +class PressureTendency(msrest.serialization.Model): + """PressureTendency. + + :param localized_description: Description of the pressure tendency in specified language. + :type localized_description: str + :param code: Pressure tendency code regardless of language. One of F=Falling, S=Steady, + R=Rising. + :type code: str + """ + + _attribute_map = { + 'localized_description': {'key': 'localizedDescription', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PressureTendency, self).__init__(**kwargs) + self.localized_description = kwargs.get('localized_description', None) + self.code = kwargs.get('code', None) + + +class QuarterDayForecast(msrest.serialization.Model): + """QuarterDayForecast. + + :param date: Date of the forecast as example, 2019-10-27T00:00:00. + :type date: str + :param effective_date: Date and time of the beginning of the forecast quarter displayed in ISO + 8601 format, for example, 2019-10-27T19:39:57-08:00. + :type effective_date: ~datetime.datetime + :param quarter: Quarter of the day. Possible values include: 0, 1, 2, 3. + :type quarter: str or ~azure.maps.weather.models.DayQuarter + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param icon_phrase: Phrase description of the icon. Displayed in specified language. For + example, 'Sunny'. + :type icon_phrase: str + :param phrase: Short summary phrase summary for quarter. + :type phrase: str + :param temperature: Temperature values for the quarter. + :type temperature: ~azure.maps.weather.models.WeatherUnitRange + :param real_feel_temperature: RealFeel™ Temperature values for the quarter. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnitRange + :param dew_point: The dewpoint temperature in specified unit. The dewpoint temperature is the + temperature that the air must be cooled to in order to reach saturation. + :type dew_point: ~azure.maps.weather.models.WeatherUnit + :param relative_humidity: Relative humidity is the amount of water vapor present in air + expressed as a percentage of the amount needed for saturation at the same temperature. + :type relative_humidity: int + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param visibility: Visibility in specified unit. A measure of the distance at which an object + or light can be clearly discerned. + :type visibility: ~azure.maps.weather.models.WeatherUnit + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param precipitation_type: Specifies the type of precipitation ("rain" "snow" "ice" or "mix"). + If dbz = zero, precipitationType is not present in the response. + :type precipitation_type: str + :param precipitation_intensity: Description of the intensity. + :type precipitation_intensity: str + :param precipitation_probability: Percent representing the probability of precipitation. For + example, '20'. + :type precipitation_probability: int + :param thunderstorm_probability: Percent representing the probability of a thunderstorm. For + example, '10'. + :type thunderstorm_probability: int + :param total_liquid: Total liquid equivalent of precipitation during the forecast period. + :type total_liquid: ~azure.maps.weather.models.WeatherUnit + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherUnit + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherUnit + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'str'}, + 'effective_date': {'key': 'effectiveDate', 'type': 'iso-8601'}, + 'quarter': {'key': 'quarter', 'type': 'int'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'icon_phrase': {'key': 'iconPhrase', 'type': 'str'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnitRange'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherUnit'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherUnit'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'precipitation_type': {'key': 'precipitationType', 'type': 'str'}, + 'precipitation_intensity': {'key': 'precipitationIntensity', 'type': 'str'}, + 'precipitation_probability': {'key': 'precipitationProbability', 'type': 'int'}, + 'thunderstorm_probability': {'key': 'thunderstormProbability', 'type': 'int'}, + 'total_liquid': {'key': 'totalLiquid', 'type': 'WeatherUnit'}, + 'rain': {'key': 'rain', 'type': 'WeatherUnit'}, + 'snow': {'key': 'snow', 'type': 'WeatherUnit'}, + 'ice': {'key': 'ice', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(QuarterDayForecast, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.effective_date = kwargs.get('effective_date', None) + self.quarter = kwargs.get('quarter', None) + self.icon_code = kwargs.get('icon_code', None) + self.icon_phrase = kwargs.get('icon_phrase', None) + self.phrase = kwargs.get('phrase', None) + self.temperature = kwargs.get('temperature', None) + self.real_feel_temperature = kwargs.get('real_feel_temperature', None) + self.dew_point = kwargs.get('dew_point', None) + self.relative_humidity = kwargs.get('relative_humidity', None) + self.wind = kwargs.get('wind', None) + self.wind_gust = kwargs.get('wind_gust', None) + self.visibility = kwargs.get('visibility', None) + self.cloud_cover = kwargs.get('cloud_cover', None) + self.has_precipitation = kwargs.get('has_precipitation', None) + self.precipitation_type = kwargs.get('precipitation_type', None) + self.precipitation_intensity = kwargs.get('precipitation_intensity', None) + self.precipitation_probability = kwargs.get('precipitation_probability', None) + self.thunderstorm_probability = kwargs.get('thunderstorm_probability', None) + self.total_liquid = kwargs.get('total_liquid', None) + self.rain = kwargs.get('rain', None) + self.snow = kwargs.get('snow', None) + self.ice = kwargs.get('ice', None) + + +class QuarterDayForecastResponse(msrest.serialization.Model): + """QuarterDayForecastResponse. + + :param forecasts: Forecast data for each quarter in the response. + :type forecasts: list[~azure.maps.weather.models.QuarterDayForecast] + """ + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[QuarterDayForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuarterDayForecastResponse, self).__init__(**kwargs) + self.forecasts = kwargs.get('forecasts', None) + + +class SevereWeatherAlert(msrest.serialization.Model): + """Information about a severe weather alert. + + :param country_code: 2-character ISO 3166-1 Alpha-2 country code, for example, "US". + :type country_code: str + :param alert_id: A unique numerical identifier for a weather alert. + :type alert_id: int + :param description: Description of the alert. + :type description: ~azure.maps.weather.models.SevereWeatherAlertDescription + :param category: Category of the alert. + :type category: str + :param priority: Number signifying the importance or ranking order of the given alert within + the country/region it has originated. A lower number signifies a higher priority. For example, + 1 is the highest priority. The number varies by country/region and can change over time as each + country/region evolves their alert systems. + :type priority: int + :param class_property: Classification of the alert. This field is not available for all + countries and therefore not always returned. + :type class_property: str + :param level: Severity level of the alert. This field is not available for all countries and + therefore not always returned. + :type level: str + :param source: The provider of the alert information. By default the source is returned in + English (en-US). The alerts are from official Government Meteorological Agencies and leading + global weather alert providers. + :type source: str + :param source_id: A numerical identifier associated with the source provider name of the alert + data. + :type source_id: int + :param disclaimer: A disclaimer regarding the source of the alert information. This field is + not always available. For example, disclaimer may include details about the delays or potential + issues related to the alarm. + :type disclaimer: str + :param alert_areas: Information about the alert specific to the affected area(s). + :type alert_areas: list[~azure.maps.weather.models.AlertArea] + """ + + _attribute_map = { + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'alert_id': {'key': 'alertId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'SevereWeatherAlertDescription'}, + 'category': {'key': 'category', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'class_property': {'key': 'class', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'source_id': {'key': 'sourceId', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'alert_areas': {'key': 'alertAreas', 'type': '[AlertArea]'}, + } + + def __init__( + self, + **kwargs + ): + super(SevereWeatherAlert, self).__init__(**kwargs) + self.country_code = kwargs.get('country_code', None) + self.alert_id = kwargs.get('alert_id', None) + self.description = kwargs.get('description', None) + self.category = kwargs.get('category', None) + self.priority = kwargs.get('priority', None) + self.class_property = kwargs.get('class_property', None) + self.level = kwargs.get('level', None) + self.source = kwargs.get('source', None) + self.source_id = kwargs.get('source_id', None) + self.disclaimer = kwargs.get('disclaimer', None) + self.alert_areas = kwargs.get('alert_areas', None) + + +class SevereWeatherAlertDescription(msrest.serialization.Model): + """Description of a severe weather alert. + + :param localized: Description of the alert in the specified language. By default English + (en-US) is returned if the language parameter is not specified in the request. + :type localized: str + :param english: Description of the alert in English (en-US). + :type english: str + """ + + _attribute_map = { + 'localized': {'key': 'localized', 'type': 'str'}, + 'english': {'key': 'english', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SevereWeatherAlertDescription, self).__init__(**kwargs) + self.localized = kwargs.get('localized', None) + self.english = kwargs.get('english', None) + + +class SevereWeatherAlertsResponse(msrest.serialization.Model): + """This object is returned from a successful Get Severe Weather Alerts call. + + :param results: A list of all severe weather alerts for the queried location. + :type results: list[~azure.maps.weather.models.SevereWeatherAlert] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[SevereWeatherAlert]'}, + } + + def __init__( + self, + **kwargs + ): + super(SevereWeatherAlertsResponse, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class SunGlare(msrest.serialization.Model): + """A rating that indicates how blinding the sun is for the driver. + + :param calculated_vehicle_heading: If the vehicle heading value is not provided for a waypoint, + then the service will calculate a heading based upon the location of neighboring waypoints if + provided. + :type calculated_vehicle_heading: int + :param glare_index: An index from 0 to 100 indicating sun glare intensity for a driver. A value + of 50 and above can be considered a hazard for some drivers and a value of 100 signifies the + driver is driving straight into the sun and atmospheric conditions are clear allowing for the + full intensity of the sun to blind the driver. + :type glare_index: int + """ + + _attribute_map = { + 'calculated_vehicle_heading': {'key': 'calculatedVehicleHeading', 'type': 'int'}, + 'glare_index': {'key': 'glareIndex', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SunGlare, self).__init__(**kwargs) + self.calculated_vehicle_heading = kwargs.get('calculated_vehicle_heading', None) + self.glare_index = kwargs.get('glare_index', None) + + +class TemperatureSummary(msrest.serialization.Model): + """TemperatureSummary. + + :param past6_hours: Summary of temperature fluctuations over the past 6 hours. + :type past6_hours: ~azure.maps.weather.models.TemperatureSummaryPast6Hours + :param past12_hours: Summary of temperature fluctuations over the past 12 hours. + :type past12_hours: ~azure.maps.weather.models.TemperatureSummaryPast12Hours + :param past24_hours: Summary of temperature fluctuations over the past 24 hours. + :type past24_hours: ~azure.maps.weather.models.TemperatureSummaryPast24Hours + """ + + _attribute_map = { + 'past6_hours': {'key': 'past6Hours', 'type': 'TemperatureSummaryPast6Hours'}, + 'past12_hours': {'key': 'past12Hours', 'type': 'TemperatureSummaryPast12Hours'}, + 'past24_hours': {'key': 'past24Hours', 'type': 'TemperatureSummaryPast24Hours'}, + } + + def __init__( + self, + **kwargs + ): + super(TemperatureSummary, self).__init__(**kwargs) + self.past6_hours = kwargs.get('past6_hours', None) + self.past12_hours = kwargs.get('past12_hours', None) + self.past24_hours = kwargs.get('past24_hours', None) + + +class TemperatureSummaryPast12Hours(msrest.serialization.Model): + """Summary of temperature fluctuations over the past 12 hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(TemperatureSummaryPast12Hours, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + + +class TemperatureSummaryPast24Hours(msrest.serialization.Model): + """Summary of temperature fluctuations over the past 24 hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(TemperatureSummaryPast24Hours, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + + +class TemperatureSummaryPast6Hours(msrest.serialization.Model): + """Summary of temperature fluctuations over the past 6 hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(TemperatureSummaryPast6Hours, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + + +class WeatherAlongRoutePrecipitation(msrest.serialization.Model): + """Precipitation forecast of the weather along the route. + + :param dbz: The forecasted precipitation intensity in dBZ (decibels relative to Z) from 0.0 to + 100.0. + :type dbz: float + :param type: Precipitation type. If precipitation should occur, the type that it will be: + "RAIN," "HAIL," "SNOW," "ICE," or "MIX.". + :type type: str + """ + + _attribute_map = { + 'dbz': {'key': 'dbz', 'type': 'float'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherAlongRoutePrecipitation, self).__init__(**kwargs) + self.dbz = kwargs.get('dbz', None) + self.type = kwargs.get('type', None) + + +class WeatherAlongRouteResponse(msrest.serialization.Model): + """This object is returned from a successful Weather Along Route. + + :param summary: Short summary of the weather along the route. + :type summary: ~azure.maps.weather.models.WeatherAlongRouteSummary + :param waypoints: Data for each waypoint returned in the same order as specified in the + request. + :type waypoints: list[~azure.maps.weather.models.WeatherWaypoint] + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'WeatherAlongRouteSummary'}, + 'waypoints': {'key': 'waypoints', 'type': '[WeatherWaypoint]'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherAlongRouteResponse, self).__init__(**kwargs) + self.summary = kwargs.get('summary', None) + self.waypoints = kwargs.get('waypoints', None) + + +class WeatherAlongRouteSummary(msrest.serialization.Model): + """Short summary of the weather along the route. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param hazards: Description of the weather hazard affecting the trip. + :type hazards: ~azure.maps.weather.models.WeatherHazards + """ + + _attribute_map = { + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'hazards': {'key': 'hazards', 'type': 'WeatherHazards'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherAlongRouteSummary, self).__init__(**kwargs) + self.icon_code = kwargs.get('icon_code', None) + self.hazards = kwargs.get('hazards', None) + + +class WeatherHazards(msrest.serialization.Model): + """Description of the weather hazard affecting the trip. + + :param max_hazard_index: A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + :type max_hazard_index: int + :param hazard_details: Details of the weather hazards affecting the trip. + :type hazard_details: list[~azure.maps.weather.models.HazardDetail] + """ + + _attribute_map = { + 'max_hazard_index': {'key': 'maxHazardIndex', 'type': 'int'}, + 'hazard_details': {'key': 'hazardDetails', 'type': '[HazardDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherHazards, self).__init__(**kwargs) + self.max_hazard_index = kwargs.get('max_hazard_index', None) + self.hazard_details = kwargs.get('hazard_details', None) + + +class WeatherNotification(msrest.serialization.Model): + """WeatherNotification. + + :param type: A type of notification generated to warn drivers of the onset of a hazard, or + increase in intensity of a hazard. + :type type: str + :param hazard_index: A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + :type hazard_index: int + :param hazard_code: A unique identifier (non-displayable) for each type of hazard: LightRain, + ModerateRain, HeavyRain, LightMix, ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, + LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, Lightning, + SevereLightning, WindModerate, WindHigh, WindExtreme, FloodWarning, FlashFloodWarning, + TornadoWarning, TsunamiWarning, SevereThunderstormWarning. + :type hazard_code: str + :param short_phrase: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_phrase: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherNotification, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.hazard_index = kwargs.get('hazard_index', None) + self.hazard_code = kwargs.get('hazard_code', None) + self.short_phrase = kwargs.get('short_phrase', None) + + +class WeatherUnit(msrest.serialization.Model): + """Specific value of a given unit related to weather. + + :param value: Rounded value. + :type value: float + :param unit: Type of unit for the returned value. + :type unit: str + :param unit_type: Numeric ID value associated with the type of unit being displayed. Can be + used for unit translation. Please refer to `Weather Service Concepts + `_ for details. + :type unit_type: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherUnit, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.unit = kwargs.get('unit', None) + self.unit_type = kwargs.get('unit_type', None) + + +class WeatherUnitRange(msrest.serialization.Model): + """Returned temperature values. + + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherUnitRange, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + + +class WeatherWaypoint(msrest.serialization.Model): + """WeatherWaypoint. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param short_phrase: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_phrase: str + :param is_day_time: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_day_time: bool + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + :param temperature: Specific value of a given unit related to weather. + :type temperature: ~azure.maps.weather.models.WeatherUnit + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind details being returned including speed and direction. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param precipitation: Precipitation forecast of the weather along the route. + :type precipitation: ~azure.maps.weather.models.WeatherAlongRoutePrecipitation + :param lightning_count: Estimation of thunderstorm intensity on an open scale. A value of 0 + means there is no thunderstorm; values of 1 and higher mean there is a thunderstorm in + increasing intensity. + :type lightning_count: int + :param sun_glare: A rating that indicates how blinding the sun is for the driver. + :type sun_glare: ~azure.maps.weather.models.SunGlare + :param hazards: Description of the weather hazard affecting the trip. + :type hazards: ~azure.maps.weather.models.WeatherHazards + :param notifications: List of weather hazard notifications. + :type notifications: list[~azure.maps.weather.models.WeatherNotification] + """ + + _attribute_map = { + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'is_day_time': {'key': 'isDayTime', 'type': 'bool'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnit'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherAlongRoutePrecipitation'}, + 'lightning_count': {'key': 'lightningCount', 'type': 'int'}, + 'sun_glare': {'key': 'sunGlare', 'type': 'SunGlare'}, + 'hazards': {'key': 'hazards', 'type': 'WeatherHazards'}, + 'notifications': {'key': 'notifications', 'type': '[WeatherNotification]'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherWaypoint, self).__init__(**kwargs) + self.icon_code = kwargs.get('icon_code', None) + self.short_phrase = kwargs.get('short_phrase', None) + self.is_day_time = kwargs.get('is_day_time', None) + self.cloud_cover = kwargs.get('cloud_cover', None) + self.temperature = kwargs.get('temperature', None) + self.wind = kwargs.get('wind', None) + self.wind_gust = kwargs.get('wind_gust', None) + self.precipitation = kwargs.get('precipitation', None) + self.lightning_count = kwargs.get('lightning_count', None) + self.sun_glare = kwargs.get('sun_glare', None) + self.hazards = kwargs.get('hazards', None) + self.notifications = kwargs.get('notifications', None) + + +class WindDetails(msrest.serialization.Model): + """Wind details being returned including speed and direction. + + :param direction: Wind direction. + :type direction: ~azure.maps.weather.models.WindDirection + :param speed: Speed of the wind in specified unit. + :type speed: ~azure.maps.weather.models.WindSpeed + """ + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'WindDirection'}, + 'speed': {'key': 'speed', 'type': 'WindSpeed'}, + } + + def __init__( + self, + **kwargs + ): + super(WindDetails, self).__init__(**kwargs) + self.direction = kwargs.get('direction', None) + self.speed = kwargs.get('speed', None) + + +class WindDirection(msrest.serialization.Model): + """Wind direction. + + :param degrees: Wind direction in Azimuth degrees, starting at true North and continuing in + clockwise direction. North is 0 degrees, east is 90 degrees, south is 180 degrees, west is 270 + degrees. Possible values 0-359. + :type degrees: int + :param localized_description: Direction abbreviation in the specified language. + :type localized_description: str + """ + + _attribute_map = { + 'degrees': {'key': 'degrees', 'type': 'int'}, + 'localized_description': {'key': 'localizedDescription', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WindDirection, self).__init__(**kwargs) + self.degrees = kwargs.get('degrees', None) + self.localized_description = kwargs.get('localized_description', None) + + +class WindSpeed(msrest.serialization.Model): + """Speed of wind in specified unit. + + :param value: Rounded value of the speed. + :type value: float + :param unit: Type of unit for the speed value. + :type unit: str + :param unit_type: Numeric ID value associated with the type of unit being displayed. Can be + used for unit translation. Please refer to `Weather Service Concepts + `_ for details. + :type unit_type: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(WindSpeed, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.unit = kwargs.get('unit', None) + self.unit_type = kwargs.get('unit_type', None) diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models_py3.py b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models_py3.py new file mode 100644 index 000000000000..80b9287ca944 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models_py3.py @@ -0,0 +1,2239 @@ +# 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 List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._weather_client_enums import * + + +class AirAndPollen(msrest.serialization.Model): + """AirAndPollen. + + :param name: Name of the pollen or pollutant. For example, grass, mold, weed, air quality, tree + and UV index. + :type name: str + :param value: Value of the given type above. Values associated with mold, grass, weed and tree + are in units of parts per cubic meter. Both air quality and UV are indices, so they are + unitless. + :type value: int + :param category: Category of the air quality or pollution type. For example, low, high, good, + moderate, unhealthy, hazardous. + :type category: str + :param category_value: Value associated with the air quality or pollution category. These + values range from 1 to 6. 1 implying good conditions, 6 implying hazardous conditions. + :type category_value: int + :param type: Only exists for air quality. Examples include ozone and particle pollution. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + 'category': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[int] = None, + category: Optional[str] = None, + category_value: Optional[int] = None, + type: Optional[str] = None, + **kwargs + ): + super(AirAndPollen, self).__init__(**kwargs) + self.name = name + self.value = value + self.category = category + self.category_value = category_value + self.type = type + + +class AlertArea(msrest.serialization.Model): + """Information about a severe weather alert issued within an affected area(s). If multiple alerts are active for the same location, the alerts will be returned in order of ``priority`` within the API response, with the highest priority alert being returned at the top of the response. + + :param name: The name of an area which is affected by the alert. The location that was + requested falls under the alert area. + :type name: str + :param summary: Text summarizing the alert in the returned area. + :type summary: str + :param start_time: The start date and time of the alert in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. If the alert crosses multiple time zones the returned time in the + response is the local time to the requested coordinate location. + :type start_time: ~datetime.datetime + :param end_time: The end date and time of the alert in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. If the alert crosses multiple time zones the returned time in the + response is the local time to the requested coordinate location. + :type end_time: ~datetime.datetime + :param latest_status: The latest status of the alert in the current area. + :type latest_status: ~azure.maps.weather.models.LatestStatus + :param alert_details: Full details associated with the alert. Returned if ``details``\ =True. + This field is always returned in the language(s) of choice by the issuing provider and Azure + Maps only returns what is created by the provider. Please note, some countries/regions may + offer their native language and English. Language parameter won’t apply to this field. + :type alert_details: str + :param alert_details_language_code: Language of the ``alertDetails``. This field helps to + point out that the language of the ``alertDetails`` may differ from the requested language + parameter. Returned if ``details``\ =True. Language code has been derived from the ISO 639-1 + Alpha-2 codes. + :type alert_details_language_code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'latest_status': {'key': 'latestStatus', 'type': 'LatestStatus'}, + 'alert_details': {'key': 'alertDetails', 'type': 'str'}, + 'alert_details_language_code': {'key': 'alertDetailsLanguageCode', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + summary: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + latest_status: Optional["LatestStatus"] = None, + alert_details: Optional[str] = None, + alert_details_language_code: Optional[str] = None, + **kwargs + ): + super(AlertArea, self).__init__(**kwargs) + self.name = name + self.summary = summary + self.start_time = start_time + self.end_time = end_time + self.latest_status = latest_status + self.alert_details = alert_details + self.alert_details_language_code = alert_details_language_code + + +class ColorValue(msrest.serialization.Model): + """ColorValue. + + :param red: Red component of the RGB value. + :type red: int + :param green: Green component of the RGB value. + :type green: int + :param blue: Blue component of the RGB value. + :type blue: int + :param hex: Hexadecimal color value. + :type hex: str + """ + + _attribute_map = { + 'red': {'key': 'red', 'type': 'int'}, + 'green': {'key': 'green', 'type': 'int'}, + 'blue': {'key': 'blue', 'type': 'int'}, + 'hex': {'key': 'hex', 'type': 'str'}, + } + + def __init__( + self, + *, + red: Optional[int] = None, + green: Optional[int] = None, + blue: Optional[int] = None, + hex: Optional[str] = None, + **kwargs + ): + super(ColorValue, self).__init__(**kwargs) + self.red = red + self.green = green + self.blue = blue + self.hex = hex + + +class CurrentConditions(msrest.serialization.Model): + """CurrentConditions. + + :param date_time: Date and time of the current observation displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type date_time: ~datetime.datetime + :param phrase: Phrase description of the current weather condition. Displayed in specified + language. + :type phrase: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param is_day_time: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_day_time: bool + :param temperature: Temperature being returned. + :type temperature: ~azure.maps.weather.models.WeatherUnit + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnit + :param real_feel_temperature_shade: RealFeel™ Temperature being returned. Describes what the + temperature really feels like in the shade. + :type real_feel_temperature_shade: ~azure.maps.weather.models.WeatherUnit + :param relative_humidity: Relative humidity is the amount of water vapor present in air + expressed as a percentage of the amount needed for saturation at the same temperature. + :type relative_humidity: int + :param dew_point: The dewpoint temperature in specified unit. The dewpoint temperature is the + temperature that the air must be cooled to in order to reach saturation. + :type dew_point: ~azure.maps.weather.models.WeatherUnit + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param uv_index: Measure of the strength of the ultraviolet radiation from the sun. Supported + values are: + + + * ``0-2`` - Low danger from the sun's UV rays or the average person. + * ``3-5`` - Moderate risk of harm from unprotected sun exposure. + * ``6-7`` - High risk of harm from unprotected sun exposure. + * ``8-10`` - Very high risk of harm from unprotected sun exposure. + * ``11+`` - Extreme risk of harm from unprotected sun exposure. + :type uv_index: int + :param uv_index_phrase: Phrase associated with the ``uvIndex``. + :type uv_index_phrase: str + :param visibility: Visibility in specified unit. A measure of the distance at which an object + or light can be clearly discerned. + :type visibility: ~azure.maps.weather.models.WeatherUnit + :param obstructions_to_visibility: Cause of limited visibility. + :type obstructions_to_visibility: str + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + :param ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the height of + the base of the lowest clouds. + :type ceiling: ~azure.maps.weather.models.WeatherUnit + :param pressure: Atmospheric pressure in specified unit. + :type pressure: ~azure.maps.weather.models.WeatherUnit + :param pressure_tendency: Atmospheric pressure change. + :type pressure_tendency: ~azure.maps.weather.models.PressureTendency + :param past24_hour_temperature_departure: Departure from the temperature observed 24 hours ago + in specified unit. + :type past24_hour_temperature_departure: ~azure.maps.weather.models.WeatherUnit + :param apparent_temperature: Perceived outdoor temperature caused by the combination of air + temperature, relative humidity, and wind speed in specified unit. + :type apparent_temperature: ~azure.maps.weather.models.WeatherUnit + :param wind_chill_temperature: Perceived air temperature on exposed skin due to wind. + :type wind_chill_temperature: ~azure.maps.weather.models.WeatherUnit + :param wet_bulb_temperature: The temperature to which air may be cooled by evaporating water + into it at constant pressure until it reaches saturation. + :type wet_bulb_temperature: ~azure.maps.weather.models.WeatherUnit + :param precipitation_summary: Summary of precipitation amounts over the past 24 hours. + :type precipitation_summary: ~azure.maps.weather.models.PrecipitationSummary + :param temperature_summary: Summary of temperature fluctuations over the past 6, 12, and 24 + hours. + :type temperature_summary: ~azure.maps.weather.models.TemperatureSummary + """ + + _attribute_map = { + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'is_day_time': {'key': 'isDayTime', 'type': 'bool'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnit'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnit'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherUnit'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherUnit'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_phrase': {'key': 'uvIndexPhrase', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherUnit'}, + 'obstructions_to_visibility': {'key': 'obstructionsToVisibility', 'type': 'str'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'ceiling': {'key': 'ceiling', 'type': 'WeatherUnit'}, + 'pressure': {'key': 'pressure', 'type': 'WeatherUnit'}, + 'pressure_tendency': {'key': 'pressureTendency', 'type': 'PressureTendency'}, + 'past24_hour_temperature_departure': {'key': 'past24HourTemperatureDeparture', 'type': 'WeatherUnit'}, + 'apparent_temperature': {'key': 'apparentTemperature', 'type': 'WeatherUnit'}, + 'wind_chill_temperature': {'key': 'windChillTemperature', 'type': 'WeatherUnit'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherUnit'}, + 'precipitation_summary': {'key': 'precipitationSummary', 'type': 'PrecipitationSummary'}, + 'temperature_summary': {'key': 'temperatureSummary', 'type': 'TemperatureSummary'}, + } + + def __init__( + self, + *, + date_time: Optional[datetime.datetime] = None, + phrase: Optional[str] = None, + icon_code: Optional[int] = None, + has_precipitation: Optional[bool] = None, + is_day_time: Optional[bool] = None, + temperature: Optional["WeatherUnit"] = None, + real_feel_temperature: Optional["WeatherUnit"] = None, + real_feel_temperature_shade: Optional["WeatherUnit"] = None, + relative_humidity: Optional[int] = None, + dew_point: Optional["WeatherUnit"] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + uv_index: Optional[int] = None, + uv_index_phrase: Optional[str] = None, + visibility: Optional["WeatherUnit"] = None, + obstructions_to_visibility: Optional[str] = None, + cloud_cover: Optional[int] = None, + ceiling: Optional["WeatherUnit"] = None, + pressure: Optional["WeatherUnit"] = None, + pressure_tendency: Optional["PressureTendency"] = None, + past24_hour_temperature_departure: Optional["WeatherUnit"] = None, + apparent_temperature: Optional["WeatherUnit"] = None, + wind_chill_temperature: Optional["WeatherUnit"] = None, + wet_bulb_temperature: Optional["WeatherUnit"] = None, + precipitation_summary: Optional["PrecipitationSummary"] = None, + temperature_summary: Optional["TemperatureSummary"] = None, + **kwargs + ): + super(CurrentConditions, self).__init__(**kwargs) + self.date_time = date_time + self.phrase = phrase + self.icon_code = icon_code + self.has_precipitation = has_precipitation + self.is_day_time = is_day_time + self.temperature = temperature + self.real_feel_temperature = real_feel_temperature + self.real_feel_temperature_shade = real_feel_temperature_shade + self.relative_humidity = relative_humidity + self.dew_point = dew_point + self.wind = wind + self.wind_gust = wind_gust + self.uv_index = uv_index + self.uv_index_phrase = uv_index_phrase + self.visibility = visibility + self.obstructions_to_visibility = obstructions_to_visibility + self.cloud_cover = cloud_cover + self.ceiling = ceiling + self.pressure = pressure + self.pressure_tendency = pressure_tendency + self.past24_hour_temperature_departure = past24_hour_temperature_departure + self.apparent_temperature = apparent_temperature + self.wind_chill_temperature = wind_chill_temperature + self.wet_bulb_temperature = wet_bulb_temperature + self.precipitation_summary = precipitation_summary + self.temperature_summary = temperature_summary + + +class CurrentConditionsResponse(msrest.serialization.Model): + """CurrentConditionsResponse. + + :param results: Detailed current weather conditions. + :type results: list[~azure.maps.weather.models.CurrentConditions] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[CurrentConditions]'}, + } + + def __init__( + self, + *, + results: Optional[List["CurrentConditions"]] = None, + **kwargs + ): + super(CurrentConditionsResponse, self).__init__(**kwargs) + self.results = results + + +class DailyForecast(msrest.serialization.Model): + """DailyForecast. + + :param date: Date and time of the current observation displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type date: ~datetime.datetime + :param temperature: Temperature values for the day. + :type temperature: ~azure.maps.weather.models.WeatherUnitRange + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnitRange + :param real_feel_temperature_shade: RealFeel™ Temperature being returned. Describes what the + temperature really feels like in the shade. + :type real_feel_temperature_shade: ~azure.maps.weather.models.WeatherUnitRange + :param hours_of_sun: Hours of sun. + :type hours_of_sun: float + :param degree_day_summary: Summary of Heating Degree Day or Cooling Degree Day information. + :type degree_day_summary: ~azure.maps.weather.models.DegreeDaySummary + :param air_and_pollen: airAndPollen. + :type air_and_pollen: list[~azure.maps.weather.models.AirAndPollen] + :param day: Day. + :type day: ~azure.maps.weather.models.DayOrNight + :param night: Night. + :type night: ~azure.maps.weather.models.DayOrNight + :param sources: Source(s) of the forecast data. + :type sources: list[str] + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnitRange'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherUnitRange'}, + 'hours_of_sun': {'key': 'hoursOfSun', 'type': 'float'}, + 'degree_day_summary': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'air_and_pollen': {'key': 'airAndPollen', 'type': '[AirAndPollen]'}, + 'day': {'key': 'day', 'type': 'DayOrNight'}, + 'night': {'key': 'night', 'type': 'DayOrNight'}, + 'sources': {'key': 'sources', 'type': '[str]'}, + } + + def __init__( + self, + *, + date: Optional[datetime.datetime] = None, + temperature: Optional["WeatherUnitRange"] = None, + real_feel_temperature: Optional["WeatherUnitRange"] = None, + real_feel_temperature_shade: Optional["WeatherUnitRange"] = None, + hours_of_sun: Optional[float] = None, + degree_day_summary: Optional["DegreeDaySummary"] = None, + air_and_pollen: Optional[List["AirAndPollen"]] = None, + day: Optional["DayOrNight"] = None, + night: Optional["DayOrNight"] = None, + sources: Optional[List[str]] = None, + **kwargs + ): + super(DailyForecast, self).__init__(**kwargs) + self.date = date + self.temperature = temperature + self.real_feel_temperature = real_feel_temperature + self.real_feel_temperature_shade = real_feel_temperature_shade + self.hours_of_sun = hours_of_sun + self.degree_day_summary = degree_day_summary + self.air_and_pollen = air_and_pollen + self.day = day + self.night = night + self.sources = sources + + +class DailyForecastResponse(msrest.serialization.Model): + """DailyForecastResponse. + + :param summary: Summary for the main conditions for the requested time period. Notice that + summary can cover only part of the time period. + :type summary: ~azure.maps.weather.models.DailyForecastSummary + :param forecasts: Forecast data for each requested day. + :type forecasts: list[~azure.maps.weather.models.DailyForecast] + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'DailyForecastSummary'}, + 'forecasts': {'key': 'forecasts', 'type': '[DailyForecast]'}, + } + + def __init__( + self, + *, + summary: Optional["DailyForecastSummary"] = None, + forecasts: Optional[List["DailyForecast"]] = None, + **kwargs + ): + super(DailyForecastResponse, self).__init__(**kwargs) + self.summary = summary + self.forecasts = forecasts + + +class DailyForecastSummary(msrest.serialization.Model): + """Summary for the main conditions for the requested time period. Notice that summary can cover only part of the time period. + + :param start_date: Date and time that the summary is in effect, displayed in ISO 8601 format, + for example, 2019-10-27T19:39:57-08:00. + :type start_date: ~datetime.datetime + :param end_date: Date and time that the summary period ends, displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type end_date: ~datetime.datetime + :param severity: severity. + :type severity: int + :param phrase: Summary phrase of the daily forecast. Displayed in specified language. + :type phrase: str + :param category: one or 2 word(s) to summarize the phrase. + :type category: str + """ + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'severity': {'key': 'severity', 'type': 'int'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__( + self, + *, + start_date: Optional[datetime.datetime] = None, + end_date: Optional[datetime.datetime] = None, + severity: Optional[int] = None, + phrase: Optional[str] = None, + category: Optional[str] = None, + **kwargs + ): + super(DailyForecastSummary, self).__init__(**kwargs) + self.start_date = start_date + self.end_date = end_date + self.severity = severity + self.phrase = phrase + self.category = category + + +class DailyIndex(msrest.serialization.Model): + """Information about a daily index. + + :param index_name: Name of the index, for example, "Construction", "Outdoor Activity", "Flight + Delays". + :type index_name: str + :param index_id: Numeric ID used to identify the specific index. Please refer to `Weather + Service Concepts `_ for details and to see the + supported index IDs. For example, the index ID can support UI visualization scenarios. + :type index_id: int + :param date_time: Date and time of the current observation displayed in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type date_time: ~datetime.datetime + :param value: Index value. Ranges from 0.0 to 10.0. Please refer to `Weather Service Concepts + `_ for details and to see the supported ranges. + :type value: float + :param category: Textual description for ``categoryValue`` corresponding to the level that the + index value falls under, for example "Very Good". + :type category: str + :param category_value: Level that the index value falls under, represented by an integer. This + value can be 1 through 5 and should be used in combination with the ``ascending`` flag because + it can differ among indices. For example, the following values apply for Mosquito Activity: + Low=1, Moderate=2, High=3, Very High=4, and Extreme=5. + :type category_value: int + :param ascending: Describes the direction of the ``value`` and ``categoryValue``. For example, + when ``ascending``\ =True, the poorest index value is 0 and the best index value is 10. When + ``ascending``\ =True, the poorest index value is 10 and the best index value is 0. + :type ascending: bool + :param description: A textual explanation that can be used for display purposes to summarize + the index value and category. For example, when the index value for Flight Delays is very good, + the description will be "Conditions are excellent for flying!". + :type description: str + """ + + _attribute_map = { + 'index_name': {'key': 'indexName', 'type': 'str'}, + 'index_id': {'key': 'indexId', 'type': 'int'}, + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, + 'category': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'ascending': {'key': 'ascending', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + index_name: Optional[str] = None, + index_id: Optional[int] = None, + date_time: Optional[datetime.datetime] = None, + value: Optional[float] = None, + category: Optional[str] = None, + category_value: Optional[int] = None, + ascending: Optional[bool] = None, + description: Optional[str] = None, + **kwargs + ): + super(DailyIndex, self).__init__(**kwargs) + self.index_name = index_name + self.index_id = index_id + self.date_time = date_time + self.value = value + self.category = category + self.category_value = category_value + self.ascending = ascending + self.description = description + + +class DailyIndicesResponse(msrest.serialization.Model): + """This object is returned from a successful Get Daily Indices call. + + :param results: A list of all daily indices for the queried location. + :type results: list[~azure.maps.weather.models.DailyIndex] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[DailyIndex]'}, + } + + def __init__( + self, + *, + results: Optional[List["DailyIndex"]] = None, + **kwargs + ): + super(DailyIndicesResponse, self).__init__(**kwargs) + self.results = results + + +class DayOrNight(msrest.serialization.Model): + """DayOrNight. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param icon_phrase: Phrase description of the icon. Displayed in specified language. For + example, 'Sunny'. + :type icon_phrase: str + :param local_source: Local weather data provider information. + :type local_source: ~azure.maps.weather.models.LocalSource + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param precipitation_type: Specifies the type of precipitation ("rain" "snow" "ice" or "mix"). + If dbz = zero, precipitationType is not present in the response. + :type precipitation_type: str + :param precipitation_intensity: Description of the intensity. + :type precipitation_intensity: str + :param short_phrase: Phrase description of the forecast in specified language. Azure Maps + attempts to keep this phrase under 30 characters in length, but some languages/weather events + may result in a longer phrase length, exceeding 30 characters. + :type short_phrase: str + :param long_phrase: Phrase description of the forecast in specified language. Azure Maps + attempts to keep this phrase under 100 characters in length, but some languages/weather events + may result in a longer phrase length, exceeding 100 characters. + :type long_phrase: str + :param precipitation_probability: Percent representing the probability of precipitation. For + example, '20'. + :type precipitation_probability: int + :param thunderstorm_probability: Percent representing the probability of a thunderstorm. For + example, '80'. + :type thunderstorm_probability: int + :param rain_probability: Percent representing the probability of rain. For example, '40'. + :type rain_probability: int + :param snow_probability: Percent representing the probability of snow. For example, '30'. + :type snow_probability: int + :param ice_probability: Percent representing the probability of ice. For example, '30'. + :type ice_probability: int + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param total_liquid: Total liquid equivalent of precipitation during the forecast period. + :type total_liquid: ~azure.maps.weather.models.WeatherUnit + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherUnit + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherUnit + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherUnit + :param hours_of_precipitation: Hours of precipitation. + :type hours_of_precipitation: float + :param hours_of_rain: Hours of rain. + :type hours_of_rain: float + :param hours_of_snow: Hours of snow. + :type hours_of_snow: float + :param hours_of_ice: Hours of ice. + :type hours_of_ice: float + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'icon_phrase': {'key': 'iconPhrase', 'type': 'str'}, + 'local_source': {'key': 'localSource', 'type': 'LocalSource'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'precipitation_type': {'key': 'precipitationType', 'type': 'str'}, + 'precipitation_intensity': {'key': 'precipitationIntensity', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'long_phrase': {'key': 'longPhrase', 'type': 'str'}, + 'precipitation_probability': {'key': 'precipitationProbability', 'type': 'int'}, + 'thunderstorm_probability': {'key': 'thunderstormProbability', 'type': 'int'}, + 'rain_probability': {'key': 'rainProbability', 'type': 'int'}, + 'snow_probability': {'key': 'snowProbability', 'type': 'int'}, + 'ice_probability': {'key': 'iceProbability', 'type': 'int'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'total_liquid': {'key': 'totalLiquid', 'type': 'WeatherUnit'}, + 'rain': {'key': 'rain', 'type': 'WeatherUnit'}, + 'snow': {'key': 'snow', 'type': 'WeatherUnit'}, + 'ice': {'key': 'ice', 'type': 'WeatherUnit'}, + 'hours_of_precipitation': {'key': 'hoursOfPrecipitation', 'type': 'float'}, + 'hours_of_rain': {'key': 'hoursOfRain', 'type': 'float'}, + 'hours_of_snow': {'key': 'hoursOfSnow', 'type': 'float'}, + 'hours_of_ice': {'key': 'hoursOfIce', 'type': 'float'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + *, + icon_code: Optional[int] = None, + icon_phrase: Optional[str] = None, + local_source: Optional["LocalSource"] = None, + has_precipitation: Optional[bool] = None, + precipitation_type: Optional[str] = None, + precipitation_intensity: Optional[str] = None, + short_phrase: Optional[str] = None, + long_phrase: Optional[str] = None, + precipitation_probability: Optional[int] = None, + thunderstorm_probability: Optional[int] = None, + rain_probability: Optional[int] = None, + snow_probability: Optional[int] = None, + ice_probability: Optional[int] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + total_liquid: Optional["WeatherUnit"] = None, + rain: Optional["WeatherUnit"] = None, + snow: Optional["WeatherUnit"] = None, + ice: Optional["WeatherUnit"] = None, + hours_of_precipitation: Optional[float] = None, + hours_of_rain: Optional[float] = None, + hours_of_snow: Optional[float] = None, + hours_of_ice: Optional[float] = None, + cloud_cover: Optional[int] = None, + **kwargs + ): + super(DayOrNight, self).__init__(**kwargs) + self.icon_code = icon_code + self.icon_phrase = icon_phrase + self.local_source = local_source + self.has_precipitation = has_precipitation + self.precipitation_type = precipitation_type + self.precipitation_intensity = precipitation_intensity + self.short_phrase = short_phrase + self.long_phrase = long_phrase + self.precipitation_probability = precipitation_probability + self.thunderstorm_probability = thunderstorm_probability + self.rain_probability = rain_probability + self.snow_probability = snow_probability + self.ice_probability = ice_probability + self.wind = wind + self.wind_gust = wind_gust + self.total_liquid = total_liquid + self.rain = rain + self.snow = snow + self.ice = ice + self.hours_of_precipitation = hours_of_precipitation + self.hours_of_rain = hours_of_rain + self.hours_of_snow = hours_of_snow + self.hours_of_ice = hours_of_ice + self.cloud_cover = cloud_cover + + +class DegreeDaySummary(msrest.serialization.Model): + """DegreeDaySummary. + + :param heating: Number of degrees that the mean temperature is below 65 degrees F/ 18 degree C. + :type heating: ~azure.maps.weather.models.WeatherUnit + :param cooling: Number of degrees that the mean temperature is above 65 degrees F/ 18 degree C. + :type cooling: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'heating': {'key': 'heating', 'type': 'WeatherUnit'}, + 'cooling': {'key': 'cooling', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + heating: Optional["WeatherUnit"] = None, + cooling: Optional["WeatherUnit"] = None, + **kwargs + ): + super(DegreeDaySummary, self).__init__(**kwargs) + self.heating = heating + self.cooling = cooling + + +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.weather.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.maps.weather.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.weather.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 ForecastInterval(msrest.serialization.Model): + """ForecastInterval. + + :param start_time: The date and time for the start of the interval in ISO 8601 format, for + example, 2019-10-27T19:39:57-08:00. + :type start_time: ~datetime.datetime + :param minute: The first minute for the interval. + :type minute: int + :param dbz: A unit that represents forecasted precipitation intensity. + :type dbz: float + :param short_phrase: A short phrase describing precipitation condition for the interval. + :type short_phrase: str + :param threshold: Key that specifies the threshold value. Along with precipitationType, can be + used to determine the simplifiedColor. If dbz is zero, not present in the response. + :type threshold: str + :param color: The full spectrum color that maps to the dBZ (decibel relative to Z). If dbz is + zero, color is not present in the response. + :type color: ~azure.maps.weather.models.ColorValue + :param simplified_color: The band color that maps to the precipitation type and threshold. If + dbz is zero, not present in the response. + :type simplified_color: ~azure.maps.weather.models.ColorValue + :param precipitation_type: Specifies the type of precipitation ("rain" "snow" "ice" or "mix"). + If dbz is zero, precipitationType is not present in the response. + :type precipitation_type: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'minute': {'key': 'minute', 'type': 'int'}, + 'dbz': {'key': 'dbz', 'type': 'float'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'str'}, + 'color': {'key': 'color', 'type': 'ColorValue'}, + 'simplified_color': {'key': 'simplifiedColor', 'type': 'ColorValue'}, + 'precipitation_type': {'key': 'precipitationType', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + minute: Optional[int] = None, + dbz: Optional[float] = None, + short_phrase: Optional[str] = None, + threshold: Optional[str] = None, + color: Optional["ColorValue"] = None, + simplified_color: Optional["ColorValue"] = None, + precipitation_type: Optional[str] = None, + icon_code: Optional[int] = None, + cloud_cover: Optional[int] = None, + **kwargs + ): + super(ForecastInterval, self).__init__(**kwargs) + self.start_time = start_time + self.minute = minute + self.dbz = dbz + self.short_phrase = short_phrase + self.threshold = threshold + self.color = color + self.simplified_color = simplified_color + self.precipitation_type = precipitation_type + self.icon_code = icon_code + self.cloud_cover = cloud_cover + + +class HazardDetail(msrest.serialization.Model): + """HazardDetail. + + :param hazard_index: A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + :type hazard_index: int + :param hazard_code: A unique identifier (non-displayable) for each type of hazard: LightRain, + ModerateRain, HeavyRain, LightMix, ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, + LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, Lightning, + SevereLightning, WindModerate, WindHigh, WindExtreme, FloodWarning, FlashFloodWarning, + TornadoWarning, TsunamiWarning, SevereThunderstormWarning. + :type hazard_code: str + :param short_phrase: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_phrase: str + """ + + _attribute_map = { + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + } + + def __init__( + self, + *, + hazard_index: Optional[int] = None, + hazard_code: Optional[str] = None, + short_phrase: Optional[str] = None, + **kwargs + ): + super(HazardDetail, self).__init__(**kwargs) + self.hazard_index = hazard_index + self.hazard_code = hazard_code + self.short_phrase = short_phrase + + +class HourlyForecast(msrest.serialization.Model): + """HourlyForecast. + + :param date: Date and time of the forecast in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. + :type date: ~datetime.datetime + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param icon_phrase: Phrase description of the weather icon. + :type icon_phrase: str + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param is_daylight: Specifies whether or not it is daylight. True indicates day light. + :type is_daylight: bool + :param temperature: Temperature being returned. + :type temperature: ~azure.maps.weather.models.WeatherUnit + :param real_feel_temperature: RealFeel™ Temperature being returned. Describes what the + temperature really feels like in the shade. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnit + :param wet_bulb_temperature: The temperature to which air may be cooled by evaporating water + into it at constant pressure until it reaches saturation. + :type wet_bulb_temperature: ~azure.maps.weather.models.WeatherUnit + :param dew_point: The dewpoint temperature in specified unit. The dewpoint temperature is the + temperature that the air must be cooled to in order to reach saturation. + :type dew_point: ~azure.maps.weather.models.WeatherUnit + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param relative_humidity: Relative humidity is the amount of water vapor present in air + expressed as a percentage of the amount needed for saturation at the same temperature. + :type relative_humidity: int + :param visibility: Visibility in specified unit. A measure of the distance at which an object + or light can be clearly discerned. + :type visibility: ~azure.maps.weather.models.WeatherUnit + :param ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the height of + the base of the lowest clouds. + :type ceiling: ~azure.maps.weather.models.WeatherUnit + :param uv_index: Measure of the strength of the ultraviolet radiation from the sun. Supported + values are: + + + * ``0-2`` - Low danger from the sun's UV rays or the average person. + * ``3-5`` - Moderate risk of harm from unprotected sun exposure. + * ``6-7`` - High risk of harm from unprotected sun exposure. + * ``8-10`` - Very high risk of harm from unprotected sun exposure. + * ``11+`` - Extreme risk of harm from unprotected sun exposure. + :type uv_index: int + :param uv_index_phrase: Phrase associated with the ``uvIndex``. + :type uv_index_phrase: str + :param precipitation_probability: Percent representing the probability of precipitation. For + example, '20'. + :type precipitation_probability: int + :param rain_probability: Percent representing the probability of rain. For example, '50'. + :type rain_probability: int + :param snow_probability: Percent representing the probability of snow. For example, '50'. + :type snow_probability: int + :param ice_probability: Percent representing the probability of snow. For example, '5'. + :type ice_probability: int + :param total_liquid: Total liquid equivalent of precipitation during the forecast period. + :type total_liquid: ~azure.maps.weather.models.WeatherUnit + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherUnit + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherUnit + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherUnit + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'icon_phrase': {'key': 'iconPhrase', 'type': 'str'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'is_daylight': {'key': 'isDaylight', 'type': 'bool'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnit'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnit'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherUnit'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherUnit'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherUnit'}, + 'ceiling': {'key': 'ceiling', 'type': 'WeatherUnit'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_phrase': {'key': 'uvIndexPhrase', 'type': 'str'}, + 'precipitation_probability': {'key': 'precipitationProbability', 'type': 'int'}, + 'rain_probability': {'key': 'rainProbability', 'type': 'int'}, + 'snow_probability': {'key': 'snowProbability', 'type': 'int'}, + 'ice_probability': {'key': 'iceProbability', 'type': 'int'}, + 'total_liquid': {'key': 'totalLiquid', 'type': 'WeatherUnit'}, + 'rain': {'key': 'rain', 'type': 'WeatherUnit'}, + 'snow': {'key': 'snow', 'type': 'WeatherUnit'}, + 'ice': {'key': 'ice', 'type': 'WeatherUnit'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + *, + date: Optional[datetime.datetime] = None, + icon_code: Optional[int] = None, + icon_phrase: Optional[str] = None, + has_precipitation: Optional[bool] = None, + is_daylight: Optional[bool] = None, + temperature: Optional["WeatherUnit"] = None, + real_feel_temperature: Optional["WeatherUnit"] = None, + wet_bulb_temperature: Optional["WeatherUnit"] = None, + dew_point: Optional["WeatherUnit"] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + relative_humidity: Optional[int] = None, + visibility: Optional["WeatherUnit"] = None, + ceiling: Optional["WeatherUnit"] = None, + uv_index: Optional[int] = None, + uv_index_phrase: Optional[str] = None, + precipitation_probability: Optional[int] = None, + rain_probability: Optional[int] = None, + snow_probability: Optional[int] = None, + ice_probability: Optional[int] = None, + total_liquid: Optional["WeatherUnit"] = None, + rain: Optional["WeatherUnit"] = None, + snow: Optional["WeatherUnit"] = None, + ice: Optional["WeatherUnit"] = None, + cloud_cover: Optional[int] = None, + **kwargs + ): + super(HourlyForecast, self).__init__(**kwargs) + self.date = date + self.icon_code = icon_code + self.icon_phrase = icon_phrase + self.has_precipitation = has_precipitation + self.is_daylight = is_daylight + self.temperature = temperature + self.real_feel_temperature = real_feel_temperature + self.wet_bulb_temperature = wet_bulb_temperature + self.dew_point = dew_point + self.wind = wind + self.wind_gust = wind_gust + self.relative_humidity = relative_humidity + self.visibility = visibility + self.ceiling = ceiling + self.uv_index = uv_index + self.uv_index_phrase = uv_index_phrase + self.precipitation_probability = precipitation_probability + self.rain_probability = rain_probability + self.snow_probability = snow_probability + self.ice_probability = ice_probability + self.total_liquid = total_liquid + self.rain = rain + self.snow = snow + self.ice = ice + self.cloud_cover = cloud_cover + + +class HourlyForecastResponse(msrest.serialization.Model): + """HourlyForecastResponse. + + :param forecasts: Forecast data for each returned hour. + :type forecasts: list[~azure.maps.weather.models.HourlyForecast] + """ + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[HourlyForecast]'}, + } + + def __init__( + self, + *, + forecasts: Optional[List["HourlyForecast"]] = None, + **kwargs + ): + super(HourlyForecastResponse, self).__init__(**kwargs) + self.forecasts = forecasts + + +class IntervalSummary(msrest.serialization.Model): + """IntervalSummary. + + :param start_minute: The first minute to which the summary applies. + :type start_minute: int + :param end_minute: The last minute to which the summary applies. + :type end_minute: int + :param total_minutes: The number of minutes for which the summary applies. + :type total_minutes: int + :param short_phrase: Short summary phrase. Phrase length is approximately 25 characters. + :type short_phrase: str + :param brief_phrase: Brief summary phrase. Phrase length is approximately 60 characters. + :type brief_phrase: str + :param long_phrase: Long summary phrase. Phrase length is 60+ characters. + :type long_phrase: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + """ + + _attribute_map = { + 'start_minute': {'key': 'startMinute', 'type': 'int'}, + 'end_minute': {'key': 'endMinute', 'type': 'int'}, + 'total_minutes': {'key': 'totalMinutes', 'type': 'int'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_phrase': {'key': 'briefPhrase', 'type': 'str'}, + 'long_phrase': {'key': 'longPhrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + } + + def __init__( + self, + *, + start_minute: Optional[int] = None, + end_minute: Optional[int] = None, + total_minutes: Optional[int] = None, + short_phrase: Optional[str] = None, + brief_phrase: Optional[str] = None, + long_phrase: Optional[str] = None, + icon_code: Optional[int] = None, + **kwargs + ): + super(IntervalSummary, self).__init__(**kwargs) + self.start_minute = start_minute + self.end_minute = end_minute + self.total_minutes = total_minutes + self.short_phrase = short_phrase + self.brief_phrase = brief_phrase + self.long_phrase = long_phrase + self.icon_code = icon_code + + +class LatestStatus(msrest.serialization.Model): + """The latest status on the alert in the current area. + + :param localized: The latest status keyword for the alert, in the specified language. By + default, returned in English (en-US). + :type localized: str + :param english: Latest status keyword for the alert, in English (en-US). Possible values + include: "New", "Extend", "Cancel", "Correct", "Expire", "Upgrade", "Continue", "Update". + :type english: str or ~azure.maps.weather.models.LatestStatusKeyword + """ + + _attribute_map = { + 'localized': {'key': 'localized', 'type': 'str'}, + 'english': {'key': 'english', 'type': 'str'}, + } + + def __init__( + self, + *, + localized: Optional[str] = None, + english: Optional[Union[str, "LatestStatusKeyword"]] = None, + **kwargs + ): + super(LatestStatus, self).__init__(**kwargs) + self.localized = localized + self.english = english + + +class LocalSource(msrest.serialization.Model): + """Local weather data provider information. + + :param id: Numeric identifier, unique to the local data provider. + :type id: int + :param name: Name of the local data provider. Name is displayed in the language specified by + language code in URL, if available. Otherwise, Name is displayed in English or the language in + which the name was provided. + :type name: str + :param weather_code: Weather code provided by the local data provider. This weather code allows + the forecast to be matched to icons provided by the local data provider instead of Azure Maps + icons. + :type weather_code: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'weather_code': {'key': 'weatherCode', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[int] = None, + name: Optional[str] = None, + weather_code: Optional[str] = None, + **kwargs + ): + super(LocalSource, self).__init__(**kwargs) + self.id = id + self.name = name + self.weather_code = weather_code + + +class MinuteForecastResponse(msrest.serialization.Model): + """MinuteForecastResponse. + + :param summary: Phrase summaries for the entire forecast period. + :type summary: ~azure.maps.weather.models.MinuteForecastSummary + :param interval_summaries: Summary information for each interval in the forecast. The Summaries + breaks down each potential interval where precipitation starts and stops. + :type interval_summaries: list[~azure.maps.weather.models.IntervalSummary] + :param intervals: Forecast data for each interval in the forecast. + :type intervals: list[~azure.maps.weather.models.ForecastInterval] + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'MinuteForecastSummary'}, + 'interval_summaries': {'key': 'intervalSummaries', 'type': '[IntervalSummary]'}, + 'intervals': {'key': 'intervals', 'type': '[ForecastInterval]'}, + } + + def __init__( + self, + *, + summary: Optional["MinuteForecastSummary"] = None, + interval_summaries: Optional[List["IntervalSummary"]] = None, + intervals: Optional[List["ForecastInterval"]] = None, + **kwargs + ): + super(MinuteForecastResponse, self).__init__(**kwargs) + self.summary = summary + self.interval_summaries = interval_summaries + self.intervals = intervals + + +class MinuteForecastSummary(msrest.serialization.Model): + """Phrase summaries for the entire forecast period. + + :param brief_phrase60: Summary phrase for the next 60 minutes. Phrase length is approximately + 60 characters. + :type brief_phrase60: str + :param short_phrase: Short summary phrase for the next 120 minutes. Phrase length is + approximately 25 characters. + :type short_phrase: str + :param brief_phrase: Summary phrase for the next 120 minutes. Phrase length is approximately 60 + characters. + :type brief_phrase: str + :param long_phrase: Long summary phrase for the next 120 minutes. Phrase length is 60+ + characters. + :type long_phrase: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + """ + + _attribute_map = { + 'brief_phrase60': {'key': 'briefPhrase60', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_phrase': {'key': 'briefPhrase', 'type': 'str'}, + 'long_phrase': {'key': 'longPhrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + } + + def __init__( + self, + *, + brief_phrase60: Optional[str] = None, + short_phrase: Optional[str] = None, + brief_phrase: Optional[str] = None, + long_phrase: Optional[str] = None, + icon_code: Optional[int] = None, + **kwargs + ): + super(MinuteForecastSummary, self).__init__(**kwargs) + self.brief_phrase60 = brief_phrase60 + self.short_phrase = short_phrase + self.brief_phrase = brief_phrase + self.long_phrase = long_phrase + self.icon_code = icon_code + + +class PrecipitationSummary(msrest.serialization.Model): + """PrecipitationSummary. + + :param past_hour: The amount of precipitation (liquid equivalent) that has fallen in the past + hour. + :type past_hour: ~azure.maps.weather.models.WeatherUnit + :param past3_hours: The amount of precipitation (liquid equivalent) that has fallen in the past + three hours. + :type past3_hours: ~azure.maps.weather.models.WeatherUnit + :param past6_hours: The amount of precipitation (liquid equivalent) that has fallen in the past + six hours. Contains Metric and Imperial Values. + :type past6_hours: ~azure.maps.weather.models.WeatherUnit + :param past9_hours: The amount of precipitation (liquid equivalent) that has fallen in the past + nine hours. + :type past9_hours: ~azure.maps.weather.models.WeatherUnit + :param past12_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past 12 hours. + :type past12_hours: ~azure.maps.weather.models.WeatherUnit + :param past18_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past 18 hours. + :type past18_hours: ~azure.maps.weather.models.WeatherUnit + :param past24_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past 24 hours. + :type past24_hours: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'past_hour': {'key': 'pastHour', 'type': 'WeatherUnit'}, + 'past3_hours': {'key': 'past3Hours', 'type': 'WeatherUnit'}, + 'past6_hours': {'key': 'past6Hours', 'type': 'WeatherUnit'}, + 'past9_hours': {'key': 'past9Hours', 'type': 'WeatherUnit'}, + 'past12_hours': {'key': 'past12Hours', 'type': 'WeatherUnit'}, + 'past18_hours': {'key': 'past18Hours', 'type': 'WeatherUnit'}, + 'past24_hours': {'key': 'past24Hours', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + past_hour: Optional["WeatherUnit"] = None, + past3_hours: Optional["WeatherUnit"] = None, + past6_hours: Optional["WeatherUnit"] = None, + past9_hours: Optional["WeatherUnit"] = None, + past12_hours: Optional["WeatherUnit"] = None, + past18_hours: Optional["WeatherUnit"] = None, + past24_hours: Optional["WeatherUnit"] = None, + **kwargs + ): + super(PrecipitationSummary, self).__init__(**kwargs) + self.past_hour = past_hour + self.past3_hours = past3_hours + self.past6_hours = past6_hours + self.past9_hours = past9_hours + self.past12_hours = past12_hours + self.past18_hours = past18_hours + self.past24_hours = past24_hours + + +class PressureTendency(msrest.serialization.Model): + """PressureTendency. + + :param localized_description: Description of the pressure tendency in specified language. + :type localized_description: str + :param code: Pressure tendency code regardless of language. One of F=Falling, S=Steady, + R=Rising. + :type code: str + """ + + _attribute_map = { + 'localized_description': {'key': 'localizedDescription', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + localized_description: Optional[str] = None, + code: Optional[str] = None, + **kwargs + ): + super(PressureTendency, self).__init__(**kwargs) + self.localized_description = localized_description + self.code = code + + +class QuarterDayForecast(msrest.serialization.Model): + """QuarterDayForecast. + + :param date: Date of the forecast as example, 2019-10-27T00:00:00. + :type date: str + :param effective_date: Date and time of the beginning of the forecast quarter displayed in ISO + 8601 format, for example, 2019-10-27T19:39:57-08:00. + :type effective_date: ~datetime.datetime + :param quarter: Quarter of the day. Possible values include: 0, 1, 2, 3. + :type quarter: str or ~azure.maps.weather.models.DayQuarter + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param icon_phrase: Phrase description of the icon. Displayed in specified language. For + example, 'Sunny'. + :type icon_phrase: str + :param phrase: Short summary phrase summary for quarter. + :type phrase: str + :param temperature: Temperature values for the quarter. + :type temperature: ~azure.maps.weather.models.WeatherUnitRange + :param real_feel_temperature: RealFeel™ Temperature values for the quarter. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherUnitRange + :param dew_point: The dewpoint temperature in specified unit. The dewpoint temperature is the + temperature that the air must be cooled to in order to reach saturation. + :type dew_point: ~azure.maps.weather.models.WeatherUnit + :param relative_humidity: Relative humidity is the amount of water vapor present in air + expressed as a percentage of the amount needed for saturation at the same temperature. + :type relative_humidity: int + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind gust. Wind gust is a sudden, brief increase in speed of the wind. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param visibility: Visibility in specified unit. A measure of the distance at which an object + or light can be clearly discerned. + :type visibility: ~azure.maps.weather.models.WeatherUnit + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + :param has_precipitation: Indicates the presence or absence of precipitation. True indicates + the presence of precipitation, false indicates the absence of precipitation. + :type has_precipitation: bool + :param precipitation_type: Specifies the type of precipitation ("rain" "snow" "ice" or "mix"). + If dbz = zero, precipitationType is not present in the response. + :type precipitation_type: str + :param precipitation_intensity: Description of the intensity. + :type precipitation_intensity: str + :param precipitation_probability: Percent representing the probability of precipitation. For + example, '20'. + :type precipitation_probability: int + :param thunderstorm_probability: Percent representing the probability of a thunderstorm. For + example, '10'. + :type thunderstorm_probability: int + :param total_liquid: Total liquid equivalent of precipitation during the forecast period. + :type total_liquid: ~azure.maps.weather.models.WeatherUnit + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherUnit + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherUnit + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'str'}, + 'effective_date': {'key': 'effectiveDate', 'type': 'iso-8601'}, + 'quarter': {'key': 'quarter', 'type': 'int'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'icon_phrase': {'key': 'iconPhrase', 'type': 'str'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherUnitRange'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherUnit'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherUnit'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'precipitation_type': {'key': 'precipitationType', 'type': 'str'}, + 'precipitation_intensity': {'key': 'precipitationIntensity', 'type': 'str'}, + 'precipitation_probability': {'key': 'precipitationProbability', 'type': 'int'}, + 'thunderstorm_probability': {'key': 'thunderstormProbability', 'type': 'int'}, + 'total_liquid': {'key': 'totalLiquid', 'type': 'WeatherUnit'}, + 'rain': {'key': 'rain', 'type': 'WeatherUnit'}, + 'snow': {'key': 'snow', 'type': 'WeatherUnit'}, + 'ice': {'key': 'ice', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + date: Optional[str] = None, + effective_date: Optional[datetime.datetime] = None, + quarter: Optional[Union[int, "DayQuarter"]] = None, + icon_code: Optional[int] = None, + icon_phrase: Optional[str] = None, + phrase: Optional[str] = None, + temperature: Optional["WeatherUnitRange"] = None, + real_feel_temperature: Optional["WeatherUnitRange"] = None, + dew_point: Optional["WeatherUnit"] = None, + relative_humidity: Optional[int] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + visibility: Optional["WeatherUnit"] = None, + cloud_cover: Optional[int] = None, + has_precipitation: Optional[bool] = None, + precipitation_type: Optional[str] = None, + precipitation_intensity: Optional[str] = None, + precipitation_probability: Optional[int] = None, + thunderstorm_probability: Optional[int] = None, + total_liquid: Optional["WeatherUnit"] = None, + rain: Optional["WeatherUnit"] = None, + snow: Optional["WeatherUnit"] = None, + ice: Optional["WeatherUnit"] = None, + **kwargs + ): + super(QuarterDayForecast, self).__init__(**kwargs) + self.date = date + self.effective_date = effective_date + self.quarter = quarter + self.icon_code = icon_code + self.icon_phrase = icon_phrase + self.phrase = phrase + self.temperature = temperature + self.real_feel_temperature = real_feel_temperature + self.dew_point = dew_point + self.relative_humidity = relative_humidity + self.wind = wind + self.wind_gust = wind_gust + self.visibility = visibility + self.cloud_cover = cloud_cover + self.has_precipitation = has_precipitation + self.precipitation_type = precipitation_type + self.precipitation_intensity = precipitation_intensity + self.precipitation_probability = precipitation_probability + self.thunderstorm_probability = thunderstorm_probability + self.total_liquid = total_liquid + self.rain = rain + self.snow = snow + self.ice = ice + + +class QuarterDayForecastResponse(msrest.serialization.Model): + """QuarterDayForecastResponse. + + :param forecasts: Forecast data for each quarter in the response. + :type forecasts: list[~azure.maps.weather.models.QuarterDayForecast] + """ + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[QuarterDayForecast]'}, + } + + def __init__( + self, + *, + forecasts: Optional[List["QuarterDayForecast"]] = None, + **kwargs + ): + super(QuarterDayForecastResponse, self).__init__(**kwargs) + self.forecasts = forecasts + + +class SevereWeatherAlert(msrest.serialization.Model): + """Information about a severe weather alert. + + :param country_code: 2-character ISO 3166-1 Alpha-2 country code, for example, "US". + :type country_code: str + :param alert_id: A unique numerical identifier for a weather alert. + :type alert_id: int + :param description: Description of the alert. + :type description: ~azure.maps.weather.models.SevereWeatherAlertDescription + :param category: Category of the alert. + :type category: str + :param priority: Number signifying the importance or ranking order of the given alert within + the country/region it has originated. A lower number signifies a higher priority. For example, + 1 is the highest priority. The number varies by country/region and can change over time as each + country/region evolves their alert systems. + :type priority: int + :param class_property: Classification of the alert. This field is not available for all + countries and therefore not always returned. + :type class_property: str + :param level: Severity level of the alert. This field is not available for all countries and + therefore not always returned. + :type level: str + :param source: The provider of the alert information. By default the source is returned in + English (en-US). The alerts are from official Government Meteorological Agencies and leading + global weather alert providers. + :type source: str + :param source_id: A numerical identifier associated with the source provider name of the alert + data. + :type source_id: int + :param disclaimer: A disclaimer regarding the source of the alert information. This field is + not always available. For example, disclaimer may include details about the delays or potential + issues related to the alarm. + :type disclaimer: str + :param alert_areas: Information about the alert specific to the affected area(s). + :type alert_areas: list[~azure.maps.weather.models.AlertArea] + """ + + _attribute_map = { + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'alert_id': {'key': 'alertId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'SevereWeatherAlertDescription'}, + 'category': {'key': 'category', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'class_property': {'key': 'class', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'source_id': {'key': 'sourceId', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'alert_areas': {'key': 'alertAreas', 'type': '[AlertArea]'}, + } + + def __init__( + self, + *, + country_code: Optional[str] = None, + alert_id: Optional[int] = None, + description: Optional["SevereWeatherAlertDescription"] = None, + category: Optional[str] = None, + priority: Optional[int] = None, + class_property: Optional[str] = None, + level: Optional[str] = None, + source: Optional[str] = None, + source_id: Optional[int] = None, + disclaimer: Optional[str] = None, + alert_areas: Optional[List["AlertArea"]] = None, + **kwargs + ): + super(SevereWeatherAlert, self).__init__(**kwargs) + self.country_code = country_code + self.alert_id = alert_id + self.description = description + self.category = category + self.priority = priority + self.class_property = class_property + self.level = level + self.source = source + self.source_id = source_id + self.disclaimer = disclaimer + self.alert_areas = alert_areas + + +class SevereWeatherAlertDescription(msrest.serialization.Model): + """Description of a severe weather alert. + + :param localized: Description of the alert in the specified language. By default English + (en-US) is returned if the language parameter is not specified in the request. + :type localized: str + :param english: Description of the alert in English (en-US). + :type english: str + """ + + _attribute_map = { + 'localized': {'key': 'localized', 'type': 'str'}, + 'english': {'key': 'english', 'type': 'str'}, + } + + def __init__( + self, + *, + localized: Optional[str] = None, + english: Optional[str] = None, + **kwargs + ): + super(SevereWeatherAlertDescription, self).__init__(**kwargs) + self.localized = localized + self.english = english + + +class SevereWeatherAlertsResponse(msrest.serialization.Model): + """This object is returned from a successful Get Severe Weather Alerts call. + + :param results: A list of all severe weather alerts for the queried location. + :type results: list[~azure.maps.weather.models.SevereWeatherAlert] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[SevereWeatherAlert]'}, + } + + def __init__( + self, + *, + results: Optional[List["SevereWeatherAlert"]] = None, + **kwargs + ): + super(SevereWeatherAlertsResponse, self).__init__(**kwargs) + self.results = results + + +class SunGlare(msrest.serialization.Model): + """A rating that indicates how blinding the sun is for the driver. + + :param calculated_vehicle_heading: If the vehicle heading value is not provided for a waypoint, + then the service will calculate a heading based upon the location of neighboring waypoints if + provided. + :type calculated_vehicle_heading: int + :param glare_index: An index from 0 to 100 indicating sun glare intensity for a driver. A value + of 50 and above can be considered a hazard for some drivers and a value of 100 signifies the + driver is driving straight into the sun and atmospheric conditions are clear allowing for the + full intensity of the sun to blind the driver. + :type glare_index: int + """ + + _attribute_map = { + 'calculated_vehicle_heading': {'key': 'calculatedVehicleHeading', 'type': 'int'}, + 'glare_index': {'key': 'glareIndex', 'type': 'int'}, + } + + def __init__( + self, + *, + calculated_vehicle_heading: Optional[int] = None, + glare_index: Optional[int] = None, + **kwargs + ): + super(SunGlare, self).__init__(**kwargs) + self.calculated_vehicle_heading = calculated_vehicle_heading + self.glare_index = glare_index + + +class TemperatureSummary(msrest.serialization.Model): + """TemperatureSummary. + + :param past6_hours: Summary of temperature fluctuations over the past 6 hours. + :type past6_hours: ~azure.maps.weather.models.TemperatureSummaryPast6Hours + :param past12_hours: Summary of temperature fluctuations over the past 12 hours. + :type past12_hours: ~azure.maps.weather.models.TemperatureSummaryPast12Hours + :param past24_hours: Summary of temperature fluctuations over the past 24 hours. + :type past24_hours: ~azure.maps.weather.models.TemperatureSummaryPast24Hours + """ + + _attribute_map = { + 'past6_hours': {'key': 'past6Hours', 'type': 'TemperatureSummaryPast6Hours'}, + 'past12_hours': {'key': 'past12Hours', 'type': 'TemperatureSummaryPast12Hours'}, + 'past24_hours': {'key': 'past24Hours', 'type': 'TemperatureSummaryPast24Hours'}, + } + + def __init__( + self, + *, + past6_hours: Optional["TemperatureSummaryPast6Hours"] = None, + past12_hours: Optional["TemperatureSummaryPast12Hours"] = None, + past24_hours: Optional["TemperatureSummaryPast24Hours"] = None, + **kwargs + ): + super(TemperatureSummary, self).__init__(**kwargs) + self.past6_hours = past6_hours + self.past12_hours = past12_hours + self.past24_hours = past24_hours + + +class TemperatureSummaryPast12Hours(msrest.serialization.Model): + """Summary of temperature fluctuations over the past 12 hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + minimum: Optional["WeatherUnit"] = None, + maximum: Optional["WeatherUnit"] = None, + **kwargs + ): + super(TemperatureSummaryPast12Hours, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + + +class TemperatureSummaryPast24Hours(msrest.serialization.Model): + """Summary of temperature fluctuations over the past 24 hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + minimum: Optional["WeatherUnit"] = None, + maximum: Optional["WeatherUnit"] = None, + **kwargs + ): + super(TemperatureSummaryPast24Hours, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + + +class TemperatureSummaryPast6Hours(msrest.serialization.Model): + """Summary of temperature fluctuations over the past 6 hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + minimum: Optional["WeatherUnit"] = None, + maximum: Optional["WeatherUnit"] = None, + **kwargs + ): + super(TemperatureSummaryPast6Hours, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + + +class WeatherAlongRoutePrecipitation(msrest.serialization.Model): + """Precipitation forecast of the weather along the route. + + :param dbz: The forecasted precipitation intensity in dBZ (decibels relative to Z) from 0.0 to + 100.0. + :type dbz: float + :param type: Precipitation type. If precipitation should occur, the type that it will be: + "RAIN," "HAIL," "SNOW," "ICE," or "MIX.". + :type type: str + """ + + _attribute_map = { + 'dbz': {'key': 'dbz', 'type': 'float'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + dbz: Optional[float] = None, + type: Optional[str] = None, + **kwargs + ): + super(WeatherAlongRoutePrecipitation, self).__init__(**kwargs) + self.dbz = dbz + self.type = type + + +class WeatherAlongRouteResponse(msrest.serialization.Model): + """This object is returned from a successful Weather Along Route. + + :param summary: Short summary of the weather along the route. + :type summary: ~azure.maps.weather.models.WeatherAlongRouteSummary + :param waypoints: Data for each waypoint returned in the same order as specified in the + request. + :type waypoints: list[~azure.maps.weather.models.WeatherWaypoint] + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'WeatherAlongRouteSummary'}, + 'waypoints': {'key': 'waypoints', 'type': '[WeatherWaypoint]'}, + } + + def __init__( + self, + *, + summary: Optional["WeatherAlongRouteSummary"] = None, + waypoints: Optional[List["WeatherWaypoint"]] = None, + **kwargs + ): + super(WeatherAlongRouteResponse, self).__init__(**kwargs) + self.summary = summary + self.waypoints = waypoints + + +class WeatherAlongRouteSummary(msrest.serialization.Model): + """Short summary of the weather along the route. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param hazards: Description of the weather hazard affecting the trip. + :type hazards: ~azure.maps.weather.models.WeatherHazards + """ + + _attribute_map = { + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'hazards': {'key': 'hazards', 'type': 'WeatherHazards'}, + } + + def __init__( + self, + *, + icon_code: Optional[int] = None, + hazards: Optional["WeatherHazards"] = None, + **kwargs + ): + super(WeatherAlongRouteSummary, self).__init__(**kwargs) + self.icon_code = icon_code + self.hazards = hazards + + +class WeatherHazards(msrest.serialization.Model): + """Description of the weather hazard affecting the trip. + + :param max_hazard_index: A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + :type max_hazard_index: int + :param hazard_details: Details of the weather hazards affecting the trip. + :type hazard_details: list[~azure.maps.weather.models.HazardDetail] + """ + + _attribute_map = { + 'max_hazard_index': {'key': 'maxHazardIndex', 'type': 'int'}, + 'hazard_details': {'key': 'hazardDetails', 'type': '[HazardDetail]'}, + } + + def __init__( + self, + *, + max_hazard_index: Optional[int] = None, + hazard_details: Optional[List["HazardDetail"]] = None, + **kwargs + ): + super(WeatherHazards, self).__init__(**kwargs) + self.max_hazard_index = max_hazard_index + self.hazard_details = hazard_details + + +class WeatherNotification(msrest.serialization.Model): + """WeatherNotification. + + :param type: A type of notification generated to warn drivers of the onset of a hazard, or + increase in intensity of a hazard. + :type type: str + :param hazard_index: A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + :type hazard_index: int + :param hazard_code: A unique identifier (non-displayable) for each type of hazard: LightRain, + ModerateRain, HeavyRain, LightMix, ModerateMix, HeavyMix, LightSnow, ModerateSnow, HeavySnow, + LightIce, ModerateIce, HeavyIce, Hail, LargeHail, SunGlare, SunGlareHigh, Lightning, + SevereLightning, WindModerate, WindHigh, WindExtreme, FloodWarning, FlashFloodWarning, + TornadoWarning, TsunamiWarning, SevereThunderstormWarning. + :type hazard_code: str + :param short_phrase: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_phrase: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + hazard_index: Optional[int] = None, + hazard_code: Optional[str] = None, + short_phrase: Optional[str] = None, + **kwargs + ): + super(WeatherNotification, self).__init__(**kwargs) + self.type = type + self.hazard_index = hazard_index + self.hazard_code = hazard_code + self.short_phrase = short_phrase + + +class WeatherUnit(msrest.serialization.Model): + """Specific value of a given unit related to weather. + + :param value: Rounded value. + :type value: float + :param unit: Type of unit for the returned value. + :type unit: str + :param unit_type: Numeric ID value associated with the type of unit being displayed. Can be + used for unit translation. Please refer to `Weather Service Concepts + `_ for details. + :type unit_type: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[float] = None, + unit: Optional[str] = None, + unit_type: Optional[int] = None, + **kwargs + ): + super(WeatherUnit, self).__init__(**kwargs) + self.value = value + self.unit = unit + self.unit_type = unit_type + + +class WeatherUnitRange(msrest.serialization.Model): + """Returned temperature values. + + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherUnit + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherUnit + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherUnit'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherUnit'}, + } + + def __init__( + self, + *, + minimum: Optional["WeatherUnit"] = None, + maximum: Optional["WeatherUnit"] = None, + **kwargs + ): + super(WeatherUnitRange, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + + +class WeatherWaypoint(msrest.serialization.Model): + """WeatherWaypoint. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + :type icon_code: int + :param short_phrase: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_phrase: str + :param is_day_time: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_day_time: bool + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + :param temperature: Specific value of a given unit related to weather. + :type temperature: ~azure.maps.weather.models.WeatherUnit + :param wind: Wind details being returned including speed and direction. + :type wind: ~azure.maps.weather.models.WindDetails + :param wind_gust: Wind details being returned including speed and direction. + :type wind_gust: ~azure.maps.weather.models.WindDetails + :param precipitation: Precipitation forecast of the weather along the route. + :type precipitation: ~azure.maps.weather.models.WeatherAlongRoutePrecipitation + :param lightning_count: Estimation of thunderstorm intensity on an open scale. A value of 0 + means there is no thunderstorm; values of 1 and higher mean there is a thunderstorm in + increasing intensity. + :type lightning_count: int + :param sun_glare: A rating that indicates how blinding the sun is for the driver. + :type sun_glare: ~azure.maps.weather.models.SunGlare + :param hazards: Description of the weather hazard affecting the trip. + :type hazards: ~azure.maps.weather.models.WeatherHazards + :param notifications: List of weather hazard notifications. + :type notifications: list[~azure.maps.weather.models.WeatherNotification] + """ + + _attribute_map = { + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'short_phrase': {'key': 'shortPhrase', 'type': 'str'}, + 'is_day_time': {'key': 'isDayTime', 'type': 'bool'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnit'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherAlongRoutePrecipitation'}, + 'lightning_count': {'key': 'lightningCount', 'type': 'int'}, + 'sun_glare': {'key': 'sunGlare', 'type': 'SunGlare'}, + 'hazards': {'key': 'hazards', 'type': 'WeatherHazards'}, + 'notifications': {'key': 'notifications', 'type': '[WeatherNotification]'}, + } + + def __init__( + self, + *, + icon_code: Optional[int] = None, + short_phrase: Optional[str] = None, + is_day_time: Optional[bool] = None, + cloud_cover: Optional[int] = None, + temperature: Optional["WeatherUnit"] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + precipitation: Optional["WeatherAlongRoutePrecipitation"] = None, + lightning_count: Optional[int] = None, + sun_glare: Optional["SunGlare"] = None, + hazards: Optional["WeatherHazards"] = None, + notifications: Optional[List["WeatherNotification"]] = None, + **kwargs + ): + super(WeatherWaypoint, self).__init__(**kwargs) + self.icon_code = icon_code + self.short_phrase = short_phrase + self.is_day_time = is_day_time + self.cloud_cover = cloud_cover + self.temperature = temperature + self.wind = wind + self.wind_gust = wind_gust + self.precipitation = precipitation + self.lightning_count = lightning_count + self.sun_glare = sun_glare + self.hazards = hazards + self.notifications = notifications + + +class WindDetails(msrest.serialization.Model): + """Wind details being returned including speed and direction. + + :param direction: Wind direction. + :type direction: ~azure.maps.weather.models.WindDirection + :param speed: Speed of the wind in specified unit. + :type speed: ~azure.maps.weather.models.WindSpeed + """ + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'WindDirection'}, + 'speed': {'key': 'speed', 'type': 'WindSpeed'}, + } + + def __init__( + self, + *, + direction: Optional["WindDirection"] = None, + speed: Optional["WindSpeed"] = None, + **kwargs + ): + super(WindDetails, self).__init__(**kwargs) + self.direction = direction + self.speed = speed + + +class WindDirection(msrest.serialization.Model): + """Wind direction. + + :param degrees: Wind direction in Azimuth degrees, starting at true North and continuing in + clockwise direction. North is 0 degrees, east is 90 degrees, south is 180 degrees, west is 270 + degrees. Possible values 0-359. + :type degrees: int + :param localized_description: Direction abbreviation in the specified language. + :type localized_description: str + """ + + _attribute_map = { + 'degrees': {'key': 'degrees', 'type': 'int'}, + 'localized_description': {'key': 'localizedDescription', 'type': 'str'}, + } + + def __init__( + self, + *, + degrees: Optional[int] = None, + localized_description: Optional[str] = None, + **kwargs + ): + super(WindDirection, self).__init__(**kwargs) + self.degrees = degrees + self.localized_description = localized_description + + +class WindSpeed(msrest.serialization.Model): + """Speed of wind in specified unit. + + :param value: Rounded value of the speed. + :type value: float + :param unit: Type of unit for the speed value. + :type unit: str + :param unit_type: Numeric ID value associated with the type of unit being displayed. Can be + used for unit translation. Please refer to `Weather Service Concepts + `_ for details. + :type unit_type: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[float] = None, + unit: Optional[str] = None, + unit_type: Optional[int] = None, + **kwargs + ): + super(WindSpeed, self).__init__(**kwargs) + self.value = value + self.unit = unit + self.unit_type = unit_type diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/models/_weather_client_enums.py b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_weather_client_enums.py new file mode 100644 index 000000000000..f57491775061 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_weather_client_enums.py @@ -0,0 +1,76 @@ +# 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 DayQuarter(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """Quarter of the day. + """ + + #: 7:00 am - 1:00 pm / 7:00- 13:00. + ZERO = 0 + #: 1:00 pm - 7:00 pm/ 13:00- 19:00. + ONE = 1 + #: 7:00 pm - 1:00 am/ 19:00 - 01:00. + TWO = 2 + #: 1:00 am - 7:00 am/ 01:00 - 07:00. + THREE = 3 + +class JsonFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: `The JavaScript Object Notation Data Interchange Format + #: `_. + JSON = "json" + +class LatestStatusKeyword(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Keyword for the latest status of the alert. + """ + + #: "New" - the status of an alert upon initial issuance. + NEW = "New" + #: "Extend" - the alert has been extended in time, in area, or both since its initial issuance. + EXTEND = "Extend" + #: "Cancel" - the alert has been canceled prior to its original expiration time. + CANCEL = "Cancel" + #: "Correct" - the alert has been modified to correct a previous error. + CORRECT = "Correct" + #: "Expire" - the alert has expired and is no longer active. + EXPIRE = "Expire" + #: "Upgrade" - the alert has been upgraded to a higher class or category since its initial + #: issuance. + UPGRADE = "Upgrade" + #: "Continue" - the alert has been updated since its initial issuance, but no changes were made to + #: ``alertAreas``\ , ``startTime``\ , ``endTime``\ , or ``class``. + CONTINUE_ENUM = "Continue" + #: "Update" - the alert has been updated since its initial issuance. + UPDATE = "Update" + +class WeatherDataUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + #: Return data in metric units. Some example units of metric system are Celsius and kilometer. + METRIC = "metric" + #: Return data in imperial units. Some example units of imperial system are Fahrenheit and mile. + IMPERIAL = "imperial" diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/operations/__init__.py b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/__init__.py new file mode 100644 index 000000000000..d1504ebe3a7a --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/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 ._weather_client_operations import WeatherClientOperationsMixin + +__all__ = [ + 'WeatherClientOperationsMixin', +] diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_weather_client_operations.py b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_weather_client_operations.py new file mode 100644 index 000000000000..8ee3a9c73b2a --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_weather_client_operations.py @@ -0,0 +1,853 @@ +# 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 +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, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WeatherClientOperationsMixin(object): + + def get_hourly_forecast( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + duration=None, # type: Optional[int] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.HourlyForecastResponse" + """**Get Hourly Forecast** + + **Applies to**\ : S0 and S1 pricing tiers. + + Request detailed weather forecast by the hour for the next 1, 12, 24 (1 day), 72 (3 days), 120 + (5 days), and 240 hours (10 days) for the given the given coordinate location. The API returns + details such as temperature, humidity, wind, precipitation, and ultraviolet (UV) index. + + In S0 you can request hourly forecast for the next 1, 12, 24 hours (1 day), and 72 hours (3 + days). In S1 you can also request hourly forecast for the next 120 (5 days) and 240 hours (10 + days). + + :param query: Coordinates of the location for which hourly forecast information is requested. + The applicable query is specified as a comma separated string composed by latitude followed by + longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param duration: Time frame of the returned weather forecast. By default, the forecast data for + next hour will be returned. Available values are + + + * ``1`` - Return forecast data for the next hour. Default value. + * ``12`` - Return hourly forecast for next 12 hours. + * ``24`` - Return hourly forecast for next 24 hours. + * ``72`` - Return hourly forecast for next 72 hours (3 days). + * ``120`` - Return hourly forecast for next 120 hours (5 days). Only available in S1 SKU. + * ``240`` - Return hourly forecast for next 240 hours (10 days). Only available in S1 SKU. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HourlyForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.HourlyForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HourlyForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_hourly_forecast.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('HourlyForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hourly_forecast.metadata = {'url': '/weather/forecast/hourly/{format}'} # type: ignore + + def get_minute_forecast( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + interval=None, # type: Optional[int] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.MinuteForecastResponse" + """**Get Minute Forecast** + + **Applies to**\ : S1 pricing tier. + + Get Minute Forecast service returns minute-by-minute forecasts for a given location for the + next 120 minutes. Users can request weather forecasts in the interval of 1, 5 and 15 minutes. + The response will include details such as the type of precipitation (including rain, snow, or a + mixture of both), start time, and precipitation intensity value (dBZ). + + :param query: Coordinates of the location for which minute forecast information is requested. + The applicable query is specified as a comma separated string composed by latitude followed by + longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param interval: Specifies time interval in minutes for the returned weather forecast. + Supported values are + + + * ``1`` - Retrieve forecast for 1-minute intervals. Returned by default. + * ``5`` - Retrieve forecasts for 5-minute intervals. + * ``15`` - Retrieve forecasts for 15-minute intervals. + :type interval: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MinuteForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.MinuteForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MinuteForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_minute_forecast.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['query'] = self._serialize.query("query", query, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('MinuteForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_minute_forecast.metadata = {'url': '/weather/forecast/minute/{format}'} # type: ignore + + def get_quarter_day_forecast( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + duration=None, # type: Optional[int] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.QuarterDayForecastResponse" + """**Get Quarter-Day Forecast** + + **Applies to**\ : S0 and S1 pricing tiers. + + Service returns detailed weather forecast by quarter-day for the next 1, 5, 10, or 15 days for + a given location. Response data is presented by quarters of the day - morning, afternoon, + evening, and overnight. Details such as temperature, humidity, wind, precipitation, and UV + index are returned. + + :param query: Coordinates of the location for which quarter-day forecast information is + requested. The applicable query is specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param duration: Specifies for how many days the quester-day forecast responses are returned. + Supported values are: + + + * ``1`` - Return forecast data for the next day. Returned by default. + * ``5`` - Return forecast data for the next 5 days. + * ``10`` - Return forecast data for next 10 days. + * ``15`` - Return forecast data for the next 15 days. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QuarterDayForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.QuarterDayForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuarterDayForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_quarter_day_forecast.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('QuarterDayForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_quarter_day_forecast.metadata = {'url': '/weather/forecast/quarterDay/{format}'} # type: ignore + + def get_current_conditions( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + details=None, # type: Optional[str] + duration=None, # type: Optional[int] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CurrentConditionsResponse" + """**Get Current Conditions** + + **Applies to**\ : S0 and S1 pricing tiers. + + Get Current Conditions service returns detailed current weather conditions such as + precipitation, temperature and wind for a given coordinate location. Also, observations from + the past 6 or 24 hours for a particular location can be retrieved. The basic information + returned with the response include details such as observation date and time, brief description + of the weather conditions, weather icon, precipitation indicator flags, and temperature. + Additional details such as RealFeel™ Temperature and UV index are also returned. + + :param query: Coordinates of the location for which current conditions information is + requested. The applicable query is specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param details: Return full details for the current conditions. Available values are + + + * ``true`` - Returns full details. By default all details are returned. + * ``false`` - Returns a truncated version of the current condition data, which includes + observation date time, weather phrase, icon code, precipitation indicator flag, and + temperature. + :type details: str + :param duration: Time frame of the returned weather conditions. By default, the most current + weather conditions will be returned. Default value is 0. Supported values are: + + + * ``0`` - Return the most current weather conditions. + * ``6`` - Return weather conditions from past 6 hours. + * ``24`` - Return weather conditions from past 24 hours. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CurrentConditionsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.CurrentConditionsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentConditionsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_current_conditions.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if details is not None: + query_parameters['details'] = self._serialize.query("details", details, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('CurrentConditionsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_current_conditions.metadata = {'url': '/weather/currentConditions/{format}'} # type: ignore + + def get_daily_forecast( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + duration=None, # type: Optional[int] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DailyForecastResponse" + """**Get Daily Forecast** + + **Applies to**\ : S0 and S1 pricing tiers. + + The service returns detailed weather forecast such as temperature and wind by day for the next + 1, 5, 10, 15, 25, or 45 days for a given coordinate location. The response include details + such as temperature, wind, precipitation, air quality, and UV index. + + In S0 you can request daily forecast for the next 1, 5, 10, and 15 days. In S1 you can also + request daily forecast for the next 25 days, and 45 days. + + :param query: Coordinates of the location for which current conditions information is + requested. The applicable query is specified as a comma separated string composed by latitude + followed by longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :param unit: Specifies to return the data in either metric units or imperial units. Default + value is metric. + :type unit: str or ~azure.maps.weather.models.WeatherDataUnit + :param duration: Specifies for how many days the daily forecast responses are returned. + Available values are + + + * ``1`` - Return forecast data for the next day. Returned by default. + * ``5`` - Return forecast data for the next 5 days. + * ``10`` - Return forecast data for the next 10 days. + * ``25`` - Return forecast data for the next 25 days. Only available in S1 SKU. + * ``45`` - Return forecast data for the next 45 days. Only available in S1 SKU. + :type duration: 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyForecastResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyForecastResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyForecastResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_daily_forecast.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['query'] = self._serialize.query("query", query, 'str') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('DailyForecastResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_forecast.metadata = {'url': '/weather/forecast/daily/{format}'} # type: ignore + + def get_weather_along_route( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + language=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.WeatherAlongRouteResponse" + """**Get Weather along route** + + **Applies to**\ : S1 pricing tier. + + Weather along a route API returns hyper local (one kilometer or less), up-to-the-minute + weather nowcasts, weather hazard assessments, and notifications along a route described as a + sequence of waypoints. + This includes a list of weather hazards affecting the waypoint or route, and the aggregated + hazard index for each waypoint might be used to paint each portion of a route according to how + safe it is for the driver. When submitting the waypoints, it is recommended to stay within, or + close to, the distance that can be traveled within 120-mins or shortly after. Data is updated + every five minutes. + + The service supplements Azure Maps `Route Service + `_ that allows you to first request a route + between an origin and a destination and use that as an input for Weather Along Route endpoint. + + In addition, the service supports scenarios to generate weather notifications for waypoints + that experience an increase in intensity of a weather hazard. For example, if the vehicle is + expected to begin experiencing heavy rain as it reaches a waypoint, a weather notification for + heavy rain will be generated for that waypoint allowing the end product to display a heavy rain + notification before the driver reaches that waypoint. + The trigger for when to display the notification for a waypoint could be based, for example, + on a `geofence `_\ , or + selectable distance to the waypoint. + + The API covers all regions of the planet except latitudes above Greenland and Antarctica. + + :param query: Coordinates through which the route is calculated, separated by colon (:) and + entered in chronological order. A minimum of two waypoints is required. A single API call may + contain up to 60 waypoints. + A waypoint indicates location, ETA, and optional heading: latitude,longitude,ETA,heading, + where + + + * ``Latitude`` - Latitude coordinate in decimal degrees. + * ``Longitude`` - Longitude coordinate in decimal degrees. + * ``ETA (estimated time of arrival)`` - The number of minutes from the present time that it + will take for the vehicle to reach the waypoint. Allowed range is from 0.0 to 120.0 minutes. + * ``Heading`` - An optional value indicating the vehicle heading as it passes the waypoint. + Expressed in clockwise degrees relative to true north. This is issued to calculate sun glare as + a driving hazard. Allowed range is from 0.0 to 360.0 degrees. If not provided, a heading will + automatically be derived based on the position of neighboring waypoints. + + It is recommended to stay within, or close to, the distance that can be traveled within + 120-mins or shortly after. This way a more accurate assessment can be provided for the trip and + prevent isolated events not being captured between waypoints. Information can and should be + updated along the route (especially for trips greater than 2 hours) to continuously pull new + waypoints moving forward, but also to ensure that forecast information for content such as + precipitation type and intensity is accurate as storms develop and dissipate over time. + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WeatherAlongRouteResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.WeatherAlongRouteResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WeatherAlongRouteResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_weather_along_route.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, '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('WeatherAlongRouteResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_weather_along_route.metadata = {'url': '/weather/route/{format}'} # type: ignore + + def get_severe_weather_alerts( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + language=None, # type: Optional[str] + details=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.SevereWeatherAlertsResponse" + """**Get Severe Weather Alerts** + + **Applies to**\ : S0 and S1 pricing tiers. + + Severe weather phenomenon can significantly impact our everyday life and business operations. + For example, severe weather conditions such as tropical storms, high winds or flooding can + close roads and force logistics companies to reroute their fleet causing delays in reaching + destinations and breaking the cold chain of refrigerated food products.  Azure Maps + Severe Weather Alerts API returns the severe weather alerts that are available worldwide + from both official Government Meteorological Agencies and leading global to + regional weather alert providers. The service can return details such as alert type, category, + level and detailed description about the active severe alerts for the requested location, like + hurricanes, thunderstorms, lightning, heat waves or forest fires. + + :param query: Coordinates of the location for which severe weather alerts are requested. The + applicable query is specified as a comma separated string composed by latitude followed by + longitude e.g. "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :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 details: Return full details for the severe weather alerts. Available values are + + + * ``true`` - Returns full details. By default all details are returned. + * ``false`` - Returns a truncated version of the alerts data, which excludes the area-specific + full description of alert details (\ ``alertDetails``\ ). + :type details: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SevereWeatherAlertsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.SevereWeatherAlertsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SevereWeatherAlertsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_severe_weather_alerts.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if details is not None: + query_parameters['details'] = self._serialize.query("details", details, '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('SevereWeatherAlertsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_severe_weather_alerts.metadata = {'url': '/weather/severe/alerts/{format}'} # type: ignore + + def get_daily_indices( + self, + query, # type: str + format="json", # type: Union[str, "_models.JsonFormat"] + language=None, # type: Optional[str] + duration=None, # type: Optional[int] + index_id=None, # type: Optional[int] + index_group_id=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "_models.DailyIndicesResponse" + """**Get Daily Indices** + + **Applies to**\ : S0 and S1 pricing tiers. + + There may be times when you want to know if the weather conditions are optimal for a specific + activity, for example, for outdoor construction, indoor activities, running or farming + including soil moisture information. Azure Maps Indices API returns index values that will + guide end users to plan future activities. For example, a health mobile application can notify + users that today is good weather for running or for other outdoors activities like for playing + golf, and retail stores can optimize their digital marketing campaigns based on predicted index + values. The service returns in daily indices values for current and next 5, 10 and 15 days + starting from current day. + + :param query: Coordinates of the location for which daily indices are requested. The applicable + query is specified as a comma separated string composed by latitude followed by longitude e.g. + "47.641268,-122.125679". + :type query: str + :param format: Desired format of the response. Only ``json`` format is supported. + :type format: str or ~azure.maps.weather.models.JsonFormat + :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 duration: Specifies for how many days the daily indices are returned. By default, the + indices data for the current day will be returned. When requesting future indices data, the + current day is included in the response as day 1. Available values are + + + * ``1`` - Return daily index data for the current day. Default value. + * ``5`` - Return 5 days of daily index data starting from the current day. + * ``10`` - Return 10 days of daily index data starting from the current day. + * ``15`` - Return 15 days of daily index data starting from the current day. + :type duration: int + :param index_id: Numeric index identifier that can be used for restricting returned results to + the corresponding index type. Cannot be paired with ``indexGroupId``. Please refer to `Weather + Service Concepts `_ for details and to see the + supported indices. + :type index_id: int + :param index_group_id: Numeric index group identifier that can be used for restricting returned + results to the corresponding subset of indices (index group). Cannot be paired with + ``indexId``. Please refer to `Weather Service Concepts + `_ for details and to see the supported index groups. + :type index_group_id: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyIndicesResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyIndicesResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyIndicesResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "1.0" + accept = "application/json" + + # Construct URL + url = self.get_daily_indices.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['query'] = self._serialize.query("query", query, 'str') + if language is not None: + query_parameters['language'] = self._serialize.query("language", language, 'str') + if duration is not None: + query_parameters['duration'] = self._serialize.query("duration", duration, 'int') + if index_id is not None: + query_parameters['indexId'] = self._serialize.query("index_id", index_id, 'int') + if index_group_id is not None: + query_parameters['indexGroupId'] = self._serialize.query("index_group_id", index_group_id, 'int') + + # 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('DailyIndicesResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_indices.metadata = {'url': '/weather/indices/daily/{format}'} # type: ignore diff --git a/sdk/maps/azure-maps-weather/azure/maps/weather/py.typed b/sdk/maps/azure-maps-weather/azure/maps/weather/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/maps/azure-maps-weather/sdk_packaging.toml b/sdk/maps/azure-maps-weather/sdk_packaging.toml new file mode 100644 index 000000000000..6da98be60717 --- /dev/null +++ b/sdk/maps/azure-maps-weather/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-maps-weather" +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-weather/setup.cfg b/sdk/maps/azure-maps-weather/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/maps/azure-maps-weather/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/maps/azure-maps-weather/setup.py b/sdk/maps/azure-maps-weather/setup.py new file mode 100644 index 000000000000..11e39506e882 --- /dev/null +++ b/sdk/maps/azure-maps-weather/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-weather" +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'], + } +)