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/LICENSE.txt b/sdk/maps/azure-maps-weather/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/maps/azure-maps-weather/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/maps/azure-maps-weather/MANIFEST.in b/sdk/maps/azure-maps-weather/MANIFEST.in new file mode 100644 index 000000000000..b954cce330c9 --- /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 +include LICENSE.txt 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..e20b6c7a30cb --- /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": "4346e2bb48a2f3bbbf3393e27621b21332e97c19", + "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..9ad03801e7ac --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/_metadata.json @@ -0,0 +1,205 @@ +{ + "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": { + "weather": "WeatherOperations" + }, + "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_hourly_forecast" : { + "sync": { + "signature": "def get_hourly_forecast(\n self,\n coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, format, unit, duration, language" + }, + "get_minute_forecast" : { + "sync": { + "signature": "def get_minute_forecast(\n self,\n coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, format, interval, language" + }, + "get_quarter_day_forecast" : { + "sync": { + "signature": "def get_quarter_day_forecast(\n self,\n coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, format, unit, duration, language" + }, + "get_current_conditions" : { + "sync": { + "signature": "def get_current_conditions(\n self,\n coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, format, unit, details, duration, language" + }, + "get_daily_forecast" : { + "sync": { + "signature": "def get_daily_forecast(\n self,\n coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, 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 coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, format, language, details" + }, + "get_daily_indices" : { + "sync": { + "signature": "def get_daily_indices(\n self,\n coordinates, # type: List[float]\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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 coordinates: List[float],\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 coordinates: The applicable query specified as a comma separated string composed by\n latitude followed by longitude e.g. \"47.641268,-122.125679\".\n:type coordinates: list[float]\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": "coordinates, 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..061347490316 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/_weather_client.py @@ -0,0 +1,86 @@ +# 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 .operations import WeatherOperations +from . import models + + +class WeatherClient(WeatherClientOperationsMixin): + """WeatherClient. + + :ivar weather: WeatherOperations operations + :vartype weather: azure.maps.weather.operations.WeatherOperations + :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) + + self.weather = WeatherOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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..6831f261970a --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/_weather_client.py @@ -0,0 +1,79 @@ +# 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 .operations import WeatherOperations +from .. import models + + +class WeatherClient(WeatherClientOperationsMixin): + """WeatherClient. + + :ivar weather: WeatherOperations operations + :vartype weather: azure.maps.weather.aio.operations.WeatherOperations + :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) + + self.weather = WeatherOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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..33af3a6d4ce1 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 +from ._weather_operations import WeatherOperations + +__all__ = [ + 'WeatherClientOperationsMixin', + 'WeatherOperations', +] 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..9a2018698c81 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_weather_client_operations.py @@ -0,0 +1,834 @@ +# 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 WeatherClientOperationsMixin: + + async def get_hourly_forecast( + self, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates: List[float], + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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/aio/operations/_weather_operations.py b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_weather_operations.py new file mode 100644 index 000000000000..28791e75d5ef --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/aio/operations/_weather_operations.py @@ -0,0 +1,303 @@ +# 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 ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WeatherOperations: + """WeatherOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.maps.weather.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_daily_historical_actuals( + self, + coordinates: List[float], + start_date: datetime.date, + end_date: datetime.date, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + **kwargs: Any + ) -> "_models.DailyHistoricalActualsResponse": + """**Get Daily Historical Actuals** + + **Applies to**\ : Gen 1 (S0 and S1) and Gen 2 pricing tiers. + + Get Daily Historical Actuals service returns climatology data such as past daily actual + observed temperatures, precipitation, snowfall, snow depth and cooling/heating degree day + information, for the day at a given coordinate location. The data is requested for a specified + date range, up to 31 days in a single API request. Generally, historical data may be available + as far back as the last 5 to 40+ years, depending on the location. + + :param coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :param start_date: Start date in ISO 8601 format, for example, 2019-10-27. The date range + supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not + exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type start_date: ~datetime.date + :param end_date: End date in ISO 8601 format, for example, 2019-10-28. The date range supported + is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a + maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type end_date: ~datetime.date + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyHistoricalActualsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyHistoricalActualsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyHistoricalActualsResponse"] + 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_historical_actuals.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("coordinates", coordinates, '[float]', div=',') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'date') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'date') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, '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('DailyHistoricalActualsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_historical_actuals.metadata = {'url': '/weather/historical/actuals/daily/{format}'} # type: ignore + + async def get_daily_historical_records( + self, + coordinates: List[float], + start_date: datetime.date, + end_date: datetime.date, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + **kwargs: Any + ) -> "_models.DailyHistoricalRecordsResponse": + """**Get Daily Historical Records** + + **Applies to**\ : Gen 1 (S0 and S1) and Gen 2 pricing tiers. + + Get Daily Historical Records service returns climatology data such as past daily record + temperatures, precipitation and snowfall at a given coordinate location. Availability of + records data will vary by location. Generally, historical data may be available as far back as + the last 5 to 40+ years, depending on the location. + + :param coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :param start_date: Start date in ISO 8601 format, for example, 2019-10-27. The date range + supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not + exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type start_date: ~datetime.date + :param end_date: End date in ISO 8601 format, for example, 2019-10-28. The date range supported + is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a + maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type end_date: ~datetime.date + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyHistoricalRecordsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyHistoricalRecordsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyHistoricalRecordsResponse"] + 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_historical_records.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("coordinates", coordinates, '[float]', div=',') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'date') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'date') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, '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('DailyHistoricalRecordsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_historical_records.metadata = {'url': '/weather/historical/records/daily/{format}'} # type: ignore + + async def get_daily_historical_normals( + self, + coordinates: List[float], + start_date: datetime.date, + end_date: datetime.date, + format: Union[str, "_models.JsonFormat"] = "json", + unit: Optional[Union[str, "_models.WeatherDataUnit"]] = None, + **kwargs: Any + ) -> "_models.DailyHistoricalNormalsResponse": + """**Get Daily Historical Normals** + + **Applies to**\ : Gen 1 (S0 and S1) and Gen 2 pricing tiers. + + Get Daily Historical Normals service returns climatology data such as past daily normal + temperatures, precipitation and cooling/heating degree day information for the day at a given + coordinate location. Normals are a 30-year average for temperatures and precipitation for a + specific location. As is standard practice in climatology, the 30-year average covers years + 1991-2020, this data will be used for one decade and then will reset in the year 2030. + Generally, historical data may be available as far back as the last 5 to 40+ years, depending + on the location. + + :param coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :param start_date: Start date in ISO 8601 format, for example, 2019-10-27. The date range + supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not + exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type start_date: ~datetime.date + :param end_date: End date in ISO 8601 format, for example, 2019-10-28. The date range supported + is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a + maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type end_date: ~datetime.date + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyHistoricalNormalsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyHistoricalNormalsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyHistoricalNormalsResponse"] + 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_historical_normals.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("coordinates", coordinates, '[float]', div=',') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'date') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'date') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, '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('DailyHistoricalNormalsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_historical_normals.metadata = {'url': '/weather/historical/normals/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..95199f85c2a6 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/__init__.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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AirAndPollen + from ._models_py3 import AlertDetails + from ._models_py3 import ColorValue + from ._models_py3 import CurrentConditions + from ._models_py3 import CurrentConditionsResponse + from ._models_py3 import DailyForecast + from ._models_py3 import DailyForecastDetail + from ._models_py3 import DailyForecastResponse + from ._models_py3 import DailyForecastSummary + from ._models_py3 import DailyHistoricalActuals + from ._models_py3 import DailyHistoricalActualsResponse + from ._models_py3 import DailyHistoricalNormals + from ._models_py3 import DailyHistoricalNormalsResponse + from ._models_py3 import DailyHistoricalRecords + from ._models_py3 import DailyHistoricalRecordsResponse + from ._models_py3 import DailyIndex + from ._models_py3 import DailyIndicesResponse + 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 PastHoursTemperature + 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 WaypointForecast + 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 WeatherUnitMaxMinAvg + from ._models_py3 import WeatherUnitYear + from ._models_py3 import WeatherUnitYearMax + from ._models_py3 import WeatherUnitYearMaxMinAvg + from ._models_py3 import WeatherValue + from ._models_py3 import WeatherValueRange + 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 AlertDetails # 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 DailyForecastDetail # type: ignore + from ._models import DailyForecastResponse # type: ignore + from ._models import DailyForecastSummary # type: ignore + from ._models import DailyHistoricalActuals # type: ignore + from ._models import DailyHistoricalActualsResponse # type: ignore + from ._models import DailyHistoricalNormals # type: ignore + from ._models import DailyHistoricalNormalsResponse # type: ignore + from ._models import DailyHistoricalRecords # type: ignore + from ._models import DailyHistoricalRecordsResponse # type: ignore + from ._models import DailyIndex # type: ignore + from ._models import DailyIndicesResponse # 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 PastHoursTemperature # 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 WaypointForecast # 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 WeatherUnitMaxMinAvg # type: ignore + from ._models import WeatherUnitYear # type: ignore + from ._models import WeatherUnitYearMax # type: ignore + from ._models import WeatherUnitYearMaxMinAvg # type: ignore + from ._models import WeatherValue # type: ignore + from ._models import WeatherValueRange # 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, + HazardIndex, + IconCode, + JsonFormat, + LatestStatusKeyword, + PrecipitationType, + UnitType, + WeatherDataUnit, +) + +__all__ = [ + 'AirAndPollen', + 'AlertDetails', + 'ColorValue', + 'CurrentConditions', + 'CurrentConditionsResponse', + 'DailyForecast', + 'DailyForecastDetail', + 'DailyForecastResponse', + 'DailyForecastSummary', + 'DailyHistoricalActuals', + 'DailyHistoricalActualsResponse', + 'DailyHistoricalNormals', + 'DailyHistoricalNormalsResponse', + 'DailyHistoricalRecords', + 'DailyHistoricalRecordsResponse', + 'DailyIndex', + 'DailyIndicesResponse', + 'DegreeDaySummary', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'ForecastInterval', + 'HazardDetail', + 'HourlyForecast', + 'HourlyForecastResponse', + 'IntervalSummary', + 'LatestStatus', + 'LocalSource', + 'MinuteForecastResponse', + 'MinuteForecastSummary', + 'PastHoursTemperature', + 'PrecipitationSummary', + 'PressureTendency', + 'QuarterDayForecast', + 'QuarterDayForecastResponse', + 'SevereWeatherAlert', + 'SevereWeatherAlertDescription', + 'SevereWeatherAlertsResponse', + 'SunGlare', + 'TemperatureSummary', + 'WaypointForecast', + 'WeatherAlongRoutePrecipitation', + 'WeatherAlongRouteResponse', + 'WeatherAlongRouteSummary', + 'WeatherHazards', + 'WeatherNotification', + 'WeatherUnitMaxMinAvg', + 'WeatherUnitYear', + 'WeatherUnitYearMax', + 'WeatherUnitYearMaxMinAvg', + 'WeatherValue', + 'WeatherValueRange', + 'WindDetails', + 'WindDirection', + 'WindSpeed', + 'DayQuarter', + 'HazardIndex', + 'IconCode', + 'JsonFormat', + 'LatestStatusKeyword', + 'PrecipitationType', + 'UnitType', + '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..037cdee49d60 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models.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. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AirAndPollen(msrest.serialization.Model): + """AirAndPollen. + + :param description: Name of the pollen or pollutant. For example, grass, mold, weed, air + quality, tree and UV index. + :type description: 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 air_quality_type: Only exists for air quality. Examples include ozone and particle + pollution. + :type air_quality_type: str + """ + + _attribute_map = { + 'description': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + 'category': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'air_quality_type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AirAndPollen, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.value = kwargs.get('value', None) + self.category = kwargs.get('category', None) + self.category_value = kwargs.get('category_value', None) + self.air_quality_type = kwargs.get('air_quality_type', None) + + +class AlertDetails(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 description: Text summarizing the alert in the returned area. + :type description: 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 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 details: str + :param language: 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 language: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'summary', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'latest_status': {'key': 'latestStatus', 'type': 'LatestStatus'}, + 'details': {'key': 'alertDetails', 'type': 'str'}, + 'language': {'key': 'alertDetailsLanguageCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', 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.details = kwargs.get('details', None) + self.language = kwargs.get('language', 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 description: Phrase description of the current weather condition. Displayed in + specified language. + :type description: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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_daytime: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_daytime: bool + :param temperature: Temperature being returned. + :type temperature: ~azure.maps.weather.models.WeatherValue + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherValue + :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.WeatherValue + :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.WeatherValue + :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_description: Phrase associated with the ``uvIndex``. + :type uv_index_description: 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.WeatherValue + :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 cloud_ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the + height of the base of the lowest clouds. + :type cloud_ceiling: ~azure.maps.weather.models.WeatherValue + :param pressure: Atmospheric pressure in specified unit. + :type pressure: ~azure.maps.weather.models.WeatherValue + :param pressure_tendency: Atmospheric pressure change. + :type pressure_tendency: ~azure.maps.weather.models.PressureTendency + :param past_twenty_four_hour_temperature_departure: Departure from the temperature observed 24 + hours ago in specified unit. + :type past_twenty_four_hour_temperature_departure: ~azure.maps.weather.models.WeatherValue + :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.WeatherValue + :param wind_chill_temperature: Perceived air temperature on exposed skin due to wind. + :type wind_chill_temperature: ~azure.maps.weather.models.WeatherValue + :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.WeatherValue + :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'}, + 'description': {'key': 'phrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'is_daytime': {'key': 'isDayTime', 'type': 'bool'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherValue'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValue'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherValue'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherValue'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_description': {'key': 'uvIndexPhrase', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherValue'}, + 'obstructions_to_visibility': {'key': 'obstructionsToVisibility', 'type': 'str'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'cloud_ceiling': {'key': 'ceiling', 'type': 'WeatherValue'}, + 'pressure': {'key': 'pressure', 'type': 'WeatherValue'}, + 'pressure_tendency': {'key': 'pressureTendency', 'type': 'PressureTendency'}, + 'past_twenty_four_hour_temperature_departure': {'key': 'pastTwentyFourHourTemperatureDeparture', 'type': 'WeatherValue'}, + 'apparent_temperature': {'key': 'apparentTemperature', 'type': 'WeatherValue'}, + 'wind_chill_temperature': {'key': 'windChillTemperature', 'type': 'WeatherValue'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherValue'}, + '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.description = kwargs.get('description', None) + self.icon_code = kwargs.get('icon_code', None) + self.has_precipitation = kwargs.get('has_precipitation', None) + self.is_daytime = kwargs.get('is_daytime', 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_description = kwargs.get('uv_index_description', 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.cloud_ceiling = kwargs.get('cloud_ceiling', None) + self.pressure = kwargs.get('pressure', None) + self.pressure_tendency = kwargs.get('pressure_tendency', None) + self.past_twenty_four_hour_temperature_departure = kwargs.get('past_twenty_four_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: Detailed current weather conditions. + :vartype results: list[~azure.maps.weather.models.CurrentConditions] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[CurrentConditions]'}, + } + + def __init__( + self, + **kwargs + ): + super(CurrentConditionsResponse, self).__init__(**kwargs) + self.results = None + + +class DailyForecast(msrest.serialization.Model): + """DailyForecast. + + :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 temperature: Temperature values for the day. + :type temperature: ~azure.maps.weather.models.WeatherValueRange + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherValueRange + :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.WeatherValueRange + :param hours_of_sun: Hours of sun. + :type hours_of_sun: float + :param mean_temperature_deviation: Summary for mean temperature of Heating Degree Day or + Cooling Degree Day information. + :type mean_temperature_deviation: ~azure.maps.weather.models.DegreeDaySummary + :param air_quality: Air quality. + :type air_quality: list[~azure.maps.weather.models.AirAndPollen] + :param daytime_forecast: Day forecast detail. + :type daytime_forecast: ~azure.maps.weather.models.DailyForecastDetail + :param nighttime_forecast: Night forecast detail. + :type nighttime_forecast: ~azure.maps.weather.models.DailyForecastDetail + :param sources: Source(s) of the forecast data. + :type sources: list[str] + """ + + _attribute_map = { + 'date_time': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherValueRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValueRange'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherValueRange'}, + 'hours_of_sun': {'key': 'hoursOfSun', 'type': 'float'}, + 'mean_temperature_deviation': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'air_quality': {'key': 'airAndPollen', 'type': '[AirAndPollen]'}, + 'daytime_forecast': {'key': 'day', 'type': 'DailyForecastDetail'}, + 'nighttime_forecast': {'key': 'night', 'type': 'DailyForecastDetail'}, + 'sources': {'key': 'sources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyForecast, self).__init__(**kwargs) + self.date_time = kwargs.get('date_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.hours_of_sun = kwargs.get('hours_of_sun', None) + self.mean_temperature_deviation = kwargs.get('mean_temperature_deviation', None) + self.air_quality = kwargs.get('air_quality', None) + self.daytime_forecast = kwargs.get('daytime_forecast', None) + self.nighttime_forecast = kwargs.get('nighttime_forecast', None) + self.sources = kwargs.get('sources', None) + + +class DailyForecastDetail(msrest.serialization.Model): + """DailyForecastDetail. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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 is zero, precipitationType is not present in the response. Possible values include: + "Rain", "Snow", "Ice", "Mix". + :type precipitation_type: str or ~azure.maps.weather.models.PrecipitationType + :param precipitation_intensity: Description of the intensity. + :type precipitation_intensity: str + :param short_description: 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_description: 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.WeatherValue + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherValue + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherValue + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherValue + :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_description': {'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': 'WeatherValue'}, + 'rain': {'key': 'rain', 'type': 'WeatherValue'}, + 'snow': {'key': 'snow', 'type': 'WeatherValue'}, + 'ice': {'key': 'ice', 'type': 'WeatherValue'}, + '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(DailyForecastDetail, 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_description = kwargs.get('short_description', 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 DailyForecastResponse(msrest.serialization.Model): + """DailyForecastResponse. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the main conditions for the requested time period. Notice that + summary can cover only part of the time period. + :vartype summary: ~azure.maps.weather.models.DailyForecastSummary + :ivar forecasts: Forecast data for each requested day. + :vartype forecasts: list[~azure.maps.weather.models.DailyForecast] + """ + + _validation = { + 'summary': {'readonly': True}, + 'forecasts': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'DailyForecastSummary'}, + 'forecasts': {'key': 'forecasts', 'type': '[DailyForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyForecastResponse, self).__init__(**kwargs) + self.summary = None + self.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 DailyHistoricalActuals(msrest.serialization.Model): + """DailyHistoricalActuals. + + :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. + :type temperature: ~azure.maps.weather.models.WeatherUnitMaxMinAvg + :param degree_day_summary: Summary of heating or cooling degree day information. Degree days + are measures of how cold or warm a location is. A degree day compares the mean (the average of + the high and low) outdoor temperatures recorded for a location to a standard temperature of 65 + degrees F/ 18 degree C. + :type degree_day_summary: ~azure.maps.weather.models.DegreeDaySummary + :param precipitation: The amount of precipitation (liquid equivalent) that has fallen. + :type precipitation: ~azure.maps.weather.models.WeatherValue + :param snowfall: The amount of snow that has fallen. + :type snowfall: ~azure.maps.weather.models.WeatherValue + :param snow_depth: Snow depth. + :type snow_depth: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitMaxMinAvg'}, + 'degree_day_summary': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherValue'}, + 'snowfall': {'key': 'snowfall', 'type': 'WeatherValue'}, + 'snow_depth': {'key': 'snowDepth', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyHistoricalActuals, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.temperature = kwargs.get('temperature', None) + self.degree_day_summary = kwargs.get('degree_day_summary', None) + self.precipitation = kwargs.get('precipitation', None) + self.snowfall = kwargs.get('snowfall', None) + self.snow_depth = kwargs.get('snow_depth', None) + + +class DailyHistoricalActualsResponse(msrest.serialization.Model): + """DailyHistoricalActualsResponse. + + :param historical_actuals: Historical actuals for each requested day. + :type historical_actuals: list[~azure.maps.weather.models.DailyHistoricalActuals] + """ + + _attribute_map = { + 'historical_actuals': {'key': 'historicalActuals', 'type': '[DailyHistoricalActuals]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyHistoricalActualsResponse, self).__init__(**kwargs) + self.historical_actuals = kwargs.get('historical_actuals', None) + + +class DailyHistoricalNormals(msrest.serialization.Model): + """DailyHistoricalNormals. + + :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. + :type temperature: ~azure.maps.weather.models.WeatherUnitMaxMinAvg + :param degree_day_summary: Summary of heating or cooling degree day information. + :type degree_day_summary: ~azure.maps.weather.models.DegreeDaySummary + :param precipitation: The amount of precipitation (liquid equivalent) that has fallen. + :type precipitation: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitMaxMinAvg'}, + 'degree_day_summary': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyHistoricalNormals, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.temperature = kwargs.get('temperature', None) + self.degree_day_summary = kwargs.get('degree_day_summary', None) + self.precipitation = kwargs.get('precipitation', None) + + +class DailyHistoricalNormalsResponse(msrest.serialization.Model): + """DailyHistoricalNormalsResponse. + + :param historical_normals: Historical normals for each requested day. + :type historical_normals: list[~azure.maps.weather.models.DailyHistoricalNormals] + """ + + _attribute_map = { + 'historical_normals': {'key': 'historicalNormals', 'type': '[DailyHistoricalNormals]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyHistoricalNormalsResponse, self).__init__(**kwargs) + self.historical_normals = kwargs.get('historical_normals', None) + + +class DailyHistoricalRecords(msrest.serialization.Model): + """DailyHistoricalRecords. + + :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 value. + :type temperature: ~azure.maps.weather.models.WeatherUnitYearMaxMinAvg + :param precipitation: Maximum amount of precipitation (liquid equivalent) that has fallen. + :type precipitation: ~azure.maps.weather.models.WeatherUnitYearMax + :param snowfall: Maximum snowfall. + :type snowfall: ~azure.maps.weather.models.WeatherUnitYearMax + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitYearMaxMinAvg'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherUnitYearMax'}, + 'snowfall': {'key': 'snowfall', 'type': 'WeatherUnitYearMax'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyHistoricalRecords, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.temperature = kwargs.get('temperature', None) + self.precipitation = kwargs.get('precipitation', None) + self.snowfall = kwargs.get('snowfall', None) + + +class DailyHistoricalRecordsResponse(msrest.serialization.Model): + """DailyHistoricalRecordsResponse. + + :param historical_records: Historical records for each requested day. + :type historical_records: list[~azure.maps.weather.models.DailyHistoricalRecords] + """ + + _attribute_map = { + 'historical_records': {'key': 'historicalRecords', 'type': '[DailyHistoricalRecords]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyHistoricalRecordsResponse, self).__init__(**kwargs) + self.historical_records = kwargs.get('historical_records', 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_description: Textual description for ``categoryValue`` corresponding to the + level that the index value falls under, for example "Very Good". + :type category_description: 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 is_ascending: Describes the direction of the ``value`` and ``categoryValue``. For + example, when set to ``true``\ , the poorest index value is 0 and the best index value is 10. + When set to ``true``\ , the poorest index value is 10 and the best index value is 0. + :type is_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_description': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'is_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_description = kwargs.get('category_description', None) + self.category_value = kwargs.get('category_value', None) + self.is_ascending = kwargs.get('is_ascending', None) + self.description = kwargs.get('description', None) + + +class DailyIndicesResponse(msrest.serialization.Model): + """This object is returned from a successful Get Daily Indices call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: A list of all daily indices for the queried location. + :vartype results: list[~azure.maps.weather.models.DailyIndex] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[DailyIndex]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyIndicesResponse, self).__init__(**kwargs) + self.results = 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.WeatherValue + :param cooling: Number of degrees that the mean temperature is above 65 degrees F/ 18 degree C. + :type cooling: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'heating': {'key': 'heating', 'type': 'WeatherValue'}, + 'cooling': {'key': 'cooling', 'type': 'WeatherValue'}, + } + + 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 decibel_relative_to_z: A unit that represents forecasted precipitation intensity. + :type decibel_relative_to_z: float + :param short_description: A short phrase describing precipitation condition for the interval. + :type short_description: 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. Possible values include: + "Rain", "Snow", "Ice", "Mix". + :type precipitation_type: str or ~azure.maps.weather.models.PrecipitationType + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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'}, + 'decibel_relative_to_z': {'key': 'dbz', 'type': 'float'}, + 'short_description': {'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.decibel_relative_to_z = kwargs.get('decibel_relative_to_z', None) + self.short_description = kwargs.get('short_description', 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. Possible values include: 0, 1, 2, 3, 4. + :type hazard_index: str or ~azure.maps.weather.models.HazardIndex + :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_description: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_description: str + """ + + _attribute_map = { + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_description': {'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_description = kwargs.get('short_description', None) + + +class HourlyForecast(msrest.serialization.Model): + """HourlyForecast. + + :param date_time: Date and time of the forecast in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. + :type date_time: ~datetime.datetime + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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.WeatherValue + :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.WeatherValue + :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.WeatherValue + :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.WeatherValue + :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.WeatherValue + :param cloud_ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the + height of the base of the lowest clouds. + :type cloud_ceiling: ~azure.maps.weather.models.WeatherValue + :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_description: Phrase associated with the ``uvIndex``. + :type uv_index_description: 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.WeatherValue + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherValue + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherValue + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherValue + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'date_time': {'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': 'WeatherValue'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValue'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherValue'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherValue'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherValue'}, + 'cloud_ceiling': {'key': 'ceiling', 'type': 'WeatherValue'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_description': {'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': 'WeatherValue'}, + 'rain': {'key': 'rain', 'type': 'WeatherValue'}, + 'snow': {'key': 'snow', 'type': 'WeatherValue'}, + 'ice': {'key': 'ice', 'type': 'WeatherValue'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HourlyForecast, self).__init__(**kwargs) + self.date_time = kwargs.get('date_time', 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.cloud_ceiling = kwargs.get('cloud_ceiling', None) + self.uv_index = kwargs.get('uv_index', None) + self.uv_index_description = kwargs.get('uv_index_description', 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar forecasts: Forecast data for each returned hour. + :vartype forecasts: list[~azure.maps.weather.models.HourlyForecast] + """ + + _validation = { + 'forecasts': {'readonly': True}, + } + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[HourlyForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(HourlyForecastResponse, self).__init__(**kwargs) + self.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_description: Short summary phrase. Phrase length is approximately 25 characters. + :type short_description: str + :param brief_description: Brief summary phrase. Phrase length is approximately 60 characters. + :type brief_description: 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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + """ + + _attribute_map = { + 'start_minute': {'key': 'startMinute', 'type': 'int'}, + 'end_minute': {'key': 'endMinute', 'type': 'int'}, + 'total_minutes': {'key': 'totalMinutes', 'type': 'int'}, + 'short_description': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_description': {'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_description = kwargs.get('short_description', None) + self.brief_description = kwargs.get('brief_description', 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Phrase summaries for the entire forecast period. + :vartype summary: ~azure.maps.weather.models.MinuteForecastSummary + :ivar interval_summaries: Summary information for each interval in the forecast. The Summaries + breaks down each potential interval where precipitation starts and stops. + :vartype interval_summaries: list[~azure.maps.weather.models.IntervalSummary] + :ivar intervals: Forecast data for each interval in the forecast. + :vartype intervals: list[~azure.maps.weather.models.ForecastInterval] + """ + + _validation = { + 'summary': {'readonly': True}, + 'interval_summaries': {'readonly': True}, + 'intervals': {'readonly': True}, + } + + _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 = None + self.interval_summaries = None + self.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_description: Short summary phrase for the next 120 minutes. Phrase length is + approximately 25 characters. + :type short_description: str + :param brief_description: Summary phrase for the next 120 minutes. Phrase length is + approximately 60 characters. + :type brief_description: 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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + """ + + _attribute_map = { + 'brief_phrase60': {'key': 'briefPhrase60', 'type': 'str'}, + 'short_description': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_description': {'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_description = kwargs.get('short_description', None) + self.brief_description = kwargs.get('brief_description', None) + self.long_phrase = kwargs.get('long_phrase', None) + self.icon_code = kwargs.get('icon_code', None) + + +class PastHoursTemperature(msrest.serialization.Model): + """Summary of temperature fluctuations over the number of past hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherValue + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherValue'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(PastHoursTemperature, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', 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.WeatherValue + :param past_three_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past three hours. + :type past_three_hours: ~azure.maps.weather.models.WeatherValue + :param past_six_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past six hours. Contains Metric and Imperial Values. + :type past_six_hours: ~azure.maps.weather.models.WeatherValue + :param past_nine_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past nine hours. + :type past_nine_hours: ~azure.maps.weather.models.WeatherValue + :param past_twelve_hours: The amount of precipitation (liquid equivalent) that has fallen in + the past 12 hours. + :type past_twelve_hours: ~azure.maps.weather.models.WeatherValue + :param past_eighteen_hours: The amount of precipitation (liquid equivalent) that has fallen in + the past 18 hours. + :type past_eighteen_hours: ~azure.maps.weather.models.WeatherValue + :param past_twenty_four_hours: The amount of precipitation (liquid equivalent) that has fallen + in the past 24 hours. + :type past_twenty_four_hours: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'past_hour': {'key': 'pastHour', 'type': 'WeatherValue'}, + 'past_three_hours': {'key': 'pastThreeHours', 'type': 'WeatherValue'}, + 'past_six_hours': {'key': 'pastSixHours', 'type': 'WeatherValue'}, + 'past_nine_hours': {'key': 'pastNineHours', 'type': 'WeatherValue'}, + 'past_twelve_hours': {'key': 'pastTwelveHours', 'type': 'WeatherValue'}, + 'past_eighteen_hours': {'key': 'pastEighteenHours', 'type': 'WeatherValue'}, + 'past_twenty_four_hours': {'key': 'pastTwentyFourHours', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(PrecipitationSummary, self).__init__(**kwargs) + self.past_hour = kwargs.get('past_hour', None) + self.past_three_hours = kwargs.get('past_three_hours', None) + self.past_six_hours = kwargs.get('past_six_hours', None) + self.past_nine_hours = kwargs.get('past_nine_hours', None) + self.past_twelve_hours = kwargs.get('past_twelve_hours', None) + self.past_eighteen_hours = kwargs.get('past_eighteen_hours', None) + self.past_twenty_four_hours = kwargs.get('past_twenty_four_hours', None) + + +class PressureTendency(msrest.serialization.Model): + """PressureTendency. + + :param description: Description of the pressure tendency in specified language. + :type description: str + :param code: Pressure tendency code regardless of language. One of F=Falling, S=Steady, + R=Rising. + :type code: str + """ + + _attribute_map = { + 'description': {'key': 'localizedDescription', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PressureTendency, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.code = kwargs.get('code', None) + + +class QuarterDayForecast(msrest.serialization.Model): + """QuarterDayForecast. + + :param date_time: Date of the forecast as example, 2019-10-27T00:00:00. + :type date_time: ~datetime.datetime + :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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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.WeatherValueRange + :param real_feel_temperature: RealFeel™ Temperature values for the quarter. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherValueRange + :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.WeatherValue + :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.WeatherValue + :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 is zero, precipitationType is not present in the response. Possible values include: + "Rain", "Snow", "Ice", "Mix". + :type precipitation_type: str or ~azure.maps.weather.models.PrecipitationType + :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.WeatherValue + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherValue + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherValue + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'date_time': {'key': 'date', 'type': 'iso-8601'}, + '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': 'WeatherValueRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValueRange'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherValue'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherValue'}, + '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': 'WeatherValue'}, + 'rain': {'key': 'rain', 'type': 'WeatherValue'}, + 'snow': {'key': 'snow', 'type': 'WeatherValue'}, + 'ice': {'key': 'ice', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(QuarterDayForecast, self).__init__(**kwargs) + self.date_time = kwargs.get('date_time', 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar forecasts: Forecast data for each quarter in the response. + :vartype forecasts: list[~azure.maps.weather.models.QuarterDayForecast] + """ + + _validation = { + 'forecasts': {'readonly': True}, + } + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[QuarterDayForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuarterDayForecastResponse, self).__init__(**kwargs) + self.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 classification: Classification of the alert. This field is not available for all + countries and therefore not always returned. + :type classification: 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_details: Information about the alert specific to the affected area(s). + :type alert_details: list[~azure.maps.weather.models.AlertDetails] + """ + + _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'}, + 'classification': {'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_details': {'key': 'alertAreas', 'type': '[AlertDetails]'}, + } + + 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.classification = kwargs.get('classification', 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_details = kwargs.get('alert_details', None) + + +class SevereWeatherAlertDescription(msrest.serialization.Model): + """Description of a severe weather alert. + + :param description: 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 description: str + :param status: Description of the alert in English (en-US). + :type status: str + """ + + _attribute_map = { + 'description': {'key': 'localized', 'type': 'str'}, + 'status': {'key': 'english', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SevereWeatherAlertDescription, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.status = kwargs.get('status', None) + + +class SevereWeatherAlertsResponse(msrest.serialization.Model): + """This object is returned from a successful Get Severe Weather Alerts call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: A list of all severe weather alerts for the queried location. + :vartype results: list[~azure.maps.weather.models.SevereWeatherAlert] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[SevereWeatherAlert]'}, + } + + def __init__( + self, + **kwargs + ): + super(SevereWeatherAlertsResponse, self).__init__(**kwargs) + self.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 past_six_hours: Summary of temperature fluctuations over the past 6 hours. + :type past_six_hours: ~azure.maps.weather.models.PastHoursTemperature + :param past_twelve_hours: Summary of temperature fluctuations over the past 12 hours. + :type past_twelve_hours: ~azure.maps.weather.models.PastHoursTemperature + :param past_twenty_four_hours: Summary of temperature fluctuations over the past 24 hours. + :type past_twenty_four_hours: ~azure.maps.weather.models.PastHoursTemperature + """ + + _attribute_map = { + 'past_six_hours': {'key': 'pastSixHours', 'type': 'PastHoursTemperature'}, + 'past_twelve_hours': {'key': 'pastTwelveHours', 'type': 'PastHoursTemperature'}, + 'past_twenty_four_hours': {'key': 'pastTwentyFourHours', 'type': 'PastHoursTemperature'}, + } + + def __init__( + self, + **kwargs + ): + super(TemperatureSummary, self).__init__(**kwargs) + self.past_six_hours = kwargs.get('past_six_hours', None) + self.past_twelve_hours = kwargs.get('past_twelve_hours', None) + self.past_twenty_four_hours = kwargs.get('past_twenty_four_hours', None) + + +class WaypointForecast(msrest.serialization.Model): + """WaypointForecast. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :param short_description: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_description: str + :param is_daytime: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_daytime: 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.WeatherValue + :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_description': {'key': 'shortPhrase', 'type': 'str'}, + 'is_daytime': {'key': 'isDayTime', 'type': 'bool'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherValue'}, + '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(WaypointForecast, self).__init__(**kwargs) + self.icon_code = kwargs.get('icon_code', None) + self.short_description = kwargs.get('short_description', None) + self.is_daytime = kwargs.get('is_daytime', 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 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Short summary of the weather along the route. + :vartype summary: ~azure.maps.weather.models.WeatherAlongRouteSummary + :ivar waypoints: Data for each waypoint returned in the same order as specified in the request. + :vartype waypoints: list[~azure.maps.weather.models.WaypointForecast] + """ + + _validation = { + 'summary': {'readonly': True}, + 'waypoints': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'WeatherAlongRouteSummary'}, + 'waypoints': {'key': 'waypoints', 'type': '[WaypointForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherAlongRouteResponse, self).__init__(**kwargs) + self.summary = None + self.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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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. Possible values include: 0, 1, 2, 3, 4. + :type max_hazard_index: str or ~azure.maps.weather.models.HazardIndex + :param details: Details of the weather hazards affecting the trip. + :type details: list[~azure.maps.weather.models.HazardDetail] + """ + + _attribute_map = { + 'max_hazard_index': {'key': 'maxHazardIndex', 'type': 'int'}, + '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.details = kwargs.get('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. Possible values include: 0, 1, 2, 3, 4. + :type hazard_index: str or ~azure.maps.weather.models.HazardIndex + :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_description: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_description': {'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_description = kwargs.get('short_description', None) + + +class WeatherUnitMaxMinAvg(msrest.serialization.Model): + """Returned temperature values. + + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherValue + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherValue + :param average: Average temperature for the time period. + :type average: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'maximum': {'key': 'maximum', 'type': 'WeatherValue'}, + 'minimum': {'key': 'minimum', 'type': 'WeatherValue'}, + 'average': {'key': 'average', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherUnitMaxMinAvg, self).__init__(**kwargs) + self.maximum = kwargs.get('maximum', None) + self.minimum = kwargs.get('minimum', None) + self.average = kwargs.get('average', None) + + +class WeatherUnitYear(msrest.serialization.Model): + """WeatherUnitYear. + + :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 + :param year: Year the value occurred. + :type year: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + 'year': {'key': 'year', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherUnitYear, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.unit = kwargs.get('unit', None) + self.unit_type = kwargs.get('unit_type', None) + self.year = kwargs.get('year', None) + + +class WeatherUnitYearMax(msrest.serialization.Model): + """Returned temperature values. + + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherUnitYear + """ + + _attribute_map = { + 'maximum': {'key': 'maximum', 'type': 'WeatherUnitYear'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherUnitYearMax, self).__init__(**kwargs) + self.maximum = kwargs.get('maximum', None) + + +class WeatherUnitYearMaxMinAvg(msrest.serialization.Model): + """Returned temperature values. + + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherUnitYear + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherUnitYear + :param average: Average temperature for the time period. + :type average: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'maximum': {'key': 'maximum', 'type': 'WeatherUnitYear'}, + 'minimum': {'key': 'minimum', 'type': 'WeatherUnitYear'}, + 'average': {'key': 'average', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherUnitYearMaxMinAvg, self).__init__(**kwargs) + self.maximum = kwargs.get('maximum', None) + self.minimum = kwargs.get('minimum', None) + self.average = kwargs.get('average', None) + + +class WeatherValue(msrest.serialization.Model): + """Specific value of a given unit related to weather. + + :param value: Rounded value. + :type value: float + :param unit_label: Type of unit for the returned value. + :type unit_label: 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. Possible values include: 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31. + :type unit_type: str or ~azure.maps.weather.models.UnitType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit_label': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherValue, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.unit_label = kwargs.get('unit_label', None) + self.unit_type = kwargs.get('unit_type', None) + + +class WeatherValueRange(msrest.serialization.Model): + """Returned temperature values. + + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherValue + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherValue'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherValue'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherValueRange, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', 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 description: Direction abbreviation in the specified language. + :type description: str + """ + + _attribute_map = { + 'degrees': {'key': 'degrees', 'type': 'int'}, + 'description': {'key': 'localizedDescription', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WindDirection, self).__init__(**kwargs) + self.degrees = kwargs.get('degrees', None) + self.description = kwargs.get('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. Possible values include: 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31. + :type unit_type: str or ~azure.maps.weather.models.UnitType + """ + + _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..5b89c81c7ca3 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_models_py3.py @@ -0,0 +1,2550 @@ +# 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 description: Name of the pollen or pollutant. For example, grass, mold, weed, air + quality, tree and UV index. + :type description: 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 air_quality_type: Only exists for air quality. Examples include ozone and particle + pollution. + :type air_quality_type: str + """ + + _attribute_map = { + 'description': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + 'category': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'air_quality_type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + value: Optional[int] = None, + category: Optional[str] = None, + category_value: Optional[int] = None, + air_quality_type: Optional[str] = None, + **kwargs + ): + super(AirAndPollen, self).__init__(**kwargs) + self.description = description + self.value = value + self.category = category + self.category_value = category_value + self.air_quality_type = air_quality_type + + +class AlertDetails(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 description: Text summarizing the alert in the returned area. + :type description: 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 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 details: str + :param language: 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 language: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'summary', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'latest_status': {'key': 'latestStatus', 'type': 'LatestStatus'}, + 'details': {'key': 'alertDetails', 'type': 'str'}, + 'language': {'key': 'alertDetailsLanguageCode', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + latest_status: Optional["LatestStatus"] = None, + details: Optional[str] = None, + language: Optional[str] = None, + **kwargs + ): + super(AlertDetails, self).__init__(**kwargs) + self.name = name + self.description = description + self.start_time = start_time + self.end_time = end_time + self.latest_status = latest_status + self.details = details + self.language = language + + +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 description: Phrase description of the current weather condition. Displayed in + specified language. + :type description: str + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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_daytime: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_daytime: bool + :param temperature: Temperature being returned. + :type temperature: ~azure.maps.weather.models.WeatherValue + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherValue + :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.WeatherValue + :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.WeatherValue + :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_description: Phrase associated with the ``uvIndex``. + :type uv_index_description: 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.WeatherValue + :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 cloud_ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the + height of the base of the lowest clouds. + :type cloud_ceiling: ~azure.maps.weather.models.WeatherValue + :param pressure: Atmospheric pressure in specified unit. + :type pressure: ~azure.maps.weather.models.WeatherValue + :param pressure_tendency: Atmospheric pressure change. + :type pressure_tendency: ~azure.maps.weather.models.PressureTendency + :param past_twenty_four_hour_temperature_departure: Departure from the temperature observed 24 + hours ago in specified unit. + :type past_twenty_four_hour_temperature_departure: ~azure.maps.weather.models.WeatherValue + :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.WeatherValue + :param wind_chill_temperature: Perceived air temperature on exposed skin due to wind. + :type wind_chill_temperature: ~azure.maps.weather.models.WeatherValue + :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.WeatherValue + :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'}, + 'description': {'key': 'phrase', 'type': 'str'}, + 'icon_code': {'key': 'iconCode', 'type': 'int'}, + 'has_precipitation': {'key': 'hasPrecipitation', 'type': 'bool'}, + 'is_daytime': {'key': 'isDayTime', 'type': 'bool'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherValue'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValue'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherValue'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherValue'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_description': {'key': 'uvIndexPhrase', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherValue'}, + 'obstructions_to_visibility': {'key': 'obstructionsToVisibility', 'type': 'str'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'cloud_ceiling': {'key': 'ceiling', 'type': 'WeatherValue'}, + 'pressure': {'key': 'pressure', 'type': 'WeatherValue'}, + 'pressure_tendency': {'key': 'pressureTendency', 'type': 'PressureTendency'}, + 'past_twenty_four_hour_temperature_departure': {'key': 'pastTwentyFourHourTemperatureDeparture', 'type': 'WeatherValue'}, + 'apparent_temperature': {'key': 'apparentTemperature', 'type': 'WeatherValue'}, + 'wind_chill_temperature': {'key': 'windChillTemperature', 'type': 'WeatherValue'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherValue'}, + 'precipitation_summary': {'key': 'precipitationSummary', 'type': 'PrecipitationSummary'}, + 'temperature_summary': {'key': 'temperatureSummary', 'type': 'TemperatureSummary'}, + } + + def __init__( + self, + *, + date_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + icon_code: Optional[Union[int, "IconCode"]] = None, + has_precipitation: Optional[bool] = None, + is_daytime: Optional[bool] = None, + temperature: Optional["WeatherValue"] = None, + real_feel_temperature: Optional["WeatherValue"] = None, + real_feel_temperature_shade: Optional["WeatherValue"] = None, + relative_humidity: Optional[int] = None, + dew_point: Optional["WeatherValue"] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + uv_index: Optional[int] = None, + uv_index_description: Optional[str] = None, + visibility: Optional["WeatherValue"] = None, + obstructions_to_visibility: Optional[str] = None, + cloud_cover: Optional[int] = None, + cloud_ceiling: Optional["WeatherValue"] = None, + pressure: Optional["WeatherValue"] = None, + pressure_tendency: Optional["PressureTendency"] = None, + past_twenty_four_hour_temperature_departure: Optional["WeatherValue"] = None, + apparent_temperature: Optional["WeatherValue"] = None, + wind_chill_temperature: Optional["WeatherValue"] = None, + wet_bulb_temperature: Optional["WeatherValue"] = None, + precipitation_summary: Optional["PrecipitationSummary"] = None, + temperature_summary: Optional["TemperatureSummary"] = None, + **kwargs + ): + super(CurrentConditions, self).__init__(**kwargs) + self.date_time = date_time + self.description = description + self.icon_code = icon_code + self.has_precipitation = has_precipitation + self.is_daytime = is_daytime + 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_description = uv_index_description + self.visibility = visibility + self.obstructions_to_visibility = obstructions_to_visibility + self.cloud_cover = cloud_cover + self.cloud_ceiling = cloud_ceiling + self.pressure = pressure + self.pressure_tendency = pressure_tendency + self.past_twenty_four_hour_temperature_departure = past_twenty_four_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: Detailed current weather conditions. + :vartype results: list[~azure.maps.weather.models.CurrentConditions] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[CurrentConditions]'}, + } + + def __init__( + self, + **kwargs + ): + super(CurrentConditionsResponse, self).__init__(**kwargs) + self.results = None + + +class DailyForecast(msrest.serialization.Model): + """DailyForecast. + + :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 temperature: Temperature values for the day. + :type temperature: ~azure.maps.weather.models.WeatherValueRange + :param real_feel_temperature: RealFeel™ Temperature being returned. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherValueRange + :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.WeatherValueRange + :param hours_of_sun: Hours of sun. + :type hours_of_sun: float + :param mean_temperature_deviation: Summary for mean temperature of Heating Degree Day or + Cooling Degree Day information. + :type mean_temperature_deviation: ~azure.maps.weather.models.DegreeDaySummary + :param air_quality: Air quality. + :type air_quality: list[~azure.maps.weather.models.AirAndPollen] + :param daytime_forecast: Day forecast detail. + :type daytime_forecast: ~azure.maps.weather.models.DailyForecastDetail + :param nighttime_forecast: Night forecast detail. + :type nighttime_forecast: ~azure.maps.weather.models.DailyForecastDetail + :param sources: Source(s) of the forecast data. + :type sources: list[str] + """ + + _attribute_map = { + 'date_time': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherValueRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValueRange'}, + 'real_feel_temperature_shade': {'key': 'realFeelTemperatureShade', 'type': 'WeatherValueRange'}, + 'hours_of_sun': {'key': 'hoursOfSun', 'type': 'float'}, + 'mean_temperature_deviation': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'air_quality': {'key': 'airAndPollen', 'type': '[AirAndPollen]'}, + 'daytime_forecast': {'key': 'day', 'type': 'DailyForecastDetail'}, + 'nighttime_forecast': {'key': 'night', 'type': 'DailyForecastDetail'}, + 'sources': {'key': 'sources', 'type': '[str]'}, + } + + def __init__( + self, + *, + date_time: Optional[datetime.datetime] = None, + temperature: Optional["WeatherValueRange"] = None, + real_feel_temperature: Optional["WeatherValueRange"] = None, + real_feel_temperature_shade: Optional["WeatherValueRange"] = None, + hours_of_sun: Optional[float] = None, + mean_temperature_deviation: Optional["DegreeDaySummary"] = None, + air_quality: Optional[List["AirAndPollen"]] = None, + daytime_forecast: Optional["DailyForecastDetail"] = None, + nighttime_forecast: Optional["DailyForecastDetail"] = None, + sources: Optional[List[str]] = None, + **kwargs + ): + super(DailyForecast, self).__init__(**kwargs) + self.date_time = date_time + 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.mean_temperature_deviation = mean_temperature_deviation + self.air_quality = air_quality + self.daytime_forecast = daytime_forecast + self.nighttime_forecast = nighttime_forecast + self.sources = sources + + +class DailyForecastDetail(msrest.serialization.Model): + """DailyForecastDetail. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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 is zero, precipitationType is not present in the response. Possible values include: + "Rain", "Snow", "Ice", "Mix". + :type precipitation_type: str or ~azure.maps.weather.models.PrecipitationType + :param precipitation_intensity: Description of the intensity. + :type precipitation_intensity: str + :param short_description: 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_description: 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.WeatherValue + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherValue + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherValue + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherValue + :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_description': {'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': 'WeatherValue'}, + 'rain': {'key': 'rain', 'type': 'WeatherValue'}, + 'snow': {'key': 'snow', 'type': 'WeatherValue'}, + 'ice': {'key': 'ice', 'type': 'WeatherValue'}, + '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[Union[int, "IconCode"]] = None, + icon_phrase: Optional[str] = None, + local_source: Optional["LocalSource"] = None, + has_precipitation: Optional[bool] = None, + precipitation_type: Optional[Union[str, "PrecipitationType"]] = None, + precipitation_intensity: Optional[str] = None, + short_description: 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["WeatherValue"] = None, + rain: Optional["WeatherValue"] = None, + snow: Optional["WeatherValue"] = None, + ice: Optional["WeatherValue"] = 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(DailyForecastDetail, 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_description = short_description + 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 DailyForecastResponse(msrest.serialization.Model): + """DailyForecastResponse. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Summary for the main conditions for the requested time period. Notice that + summary can cover only part of the time period. + :vartype summary: ~azure.maps.weather.models.DailyForecastSummary + :ivar forecasts: Forecast data for each requested day. + :vartype forecasts: list[~azure.maps.weather.models.DailyForecast] + """ + + _validation = { + 'summary': {'readonly': True}, + 'forecasts': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'DailyForecastSummary'}, + 'forecasts': {'key': 'forecasts', 'type': '[DailyForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyForecastResponse, self).__init__(**kwargs) + self.summary = None + self.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, + *, + 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 DailyHistoricalActuals(msrest.serialization.Model): + """DailyHistoricalActuals. + + :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. + :type temperature: ~azure.maps.weather.models.WeatherUnitMaxMinAvg + :param degree_day_summary: Summary of heating or cooling degree day information. Degree days + are measures of how cold or warm a location is. A degree day compares the mean (the average of + the high and low) outdoor temperatures recorded for a location to a standard temperature of 65 + degrees F/ 18 degree C. + :type degree_day_summary: ~azure.maps.weather.models.DegreeDaySummary + :param precipitation: The amount of precipitation (liquid equivalent) that has fallen. + :type precipitation: ~azure.maps.weather.models.WeatherValue + :param snowfall: The amount of snow that has fallen. + :type snowfall: ~azure.maps.weather.models.WeatherValue + :param snow_depth: Snow depth. + :type snow_depth: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitMaxMinAvg'}, + 'degree_day_summary': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherValue'}, + 'snowfall': {'key': 'snowfall', 'type': 'WeatherValue'}, + 'snow_depth': {'key': 'snowDepth', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + date: Optional[datetime.datetime] = None, + temperature: Optional["WeatherUnitMaxMinAvg"] = None, + degree_day_summary: Optional["DegreeDaySummary"] = None, + precipitation: Optional["WeatherValue"] = None, + snowfall: Optional["WeatherValue"] = None, + snow_depth: Optional["WeatherValue"] = None, + **kwargs + ): + super(DailyHistoricalActuals, self).__init__(**kwargs) + self.date = date + self.temperature = temperature + self.degree_day_summary = degree_day_summary + self.precipitation = precipitation + self.snowfall = snowfall + self.snow_depth = snow_depth + + +class DailyHistoricalActualsResponse(msrest.serialization.Model): + """DailyHistoricalActualsResponse. + + :param historical_actuals: Historical actuals for each requested day. + :type historical_actuals: list[~azure.maps.weather.models.DailyHistoricalActuals] + """ + + _attribute_map = { + 'historical_actuals': {'key': 'historicalActuals', 'type': '[DailyHistoricalActuals]'}, + } + + def __init__( + self, + *, + historical_actuals: Optional[List["DailyHistoricalActuals"]] = None, + **kwargs + ): + super(DailyHistoricalActualsResponse, self).__init__(**kwargs) + self.historical_actuals = historical_actuals + + +class DailyHistoricalNormals(msrest.serialization.Model): + """DailyHistoricalNormals. + + :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. + :type temperature: ~azure.maps.weather.models.WeatherUnitMaxMinAvg + :param degree_day_summary: Summary of heating or cooling degree day information. + :type degree_day_summary: ~azure.maps.weather.models.DegreeDaySummary + :param precipitation: The amount of precipitation (liquid equivalent) that has fallen. + :type precipitation: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitMaxMinAvg'}, + 'degree_day_summary': {'key': 'degreeDaySummary', 'type': 'DegreeDaySummary'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + date: Optional[datetime.datetime] = None, + temperature: Optional["WeatherUnitMaxMinAvg"] = None, + degree_day_summary: Optional["DegreeDaySummary"] = None, + precipitation: Optional["WeatherValue"] = None, + **kwargs + ): + super(DailyHistoricalNormals, self).__init__(**kwargs) + self.date = date + self.temperature = temperature + self.degree_day_summary = degree_day_summary + self.precipitation = precipitation + + +class DailyHistoricalNormalsResponse(msrest.serialization.Model): + """DailyHistoricalNormalsResponse. + + :param historical_normals: Historical normals for each requested day. + :type historical_normals: list[~azure.maps.weather.models.DailyHistoricalNormals] + """ + + _attribute_map = { + 'historical_normals': {'key': 'historicalNormals', 'type': '[DailyHistoricalNormals]'}, + } + + def __init__( + self, + *, + historical_normals: Optional[List["DailyHistoricalNormals"]] = None, + **kwargs + ): + super(DailyHistoricalNormalsResponse, self).__init__(**kwargs) + self.historical_normals = historical_normals + + +class DailyHistoricalRecords(msrest.serialization.Model): + """DailyHistoricalRecords. + + :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 value. + :type temperature: ~azure.maps.weather.models.WeatherUnitYearMaxMinAvg + :param precipitation: Maximum amount of precipitation (liquid equivalent) that has fallen. + :type precipitation: ~azure.maps.weather.models.WeatherUnitYearMax + :param snowfall: Maximum snowfall. + :type snowfall: ~azure.maps.weather.models.WeatherUnitYearMax + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'iso-8601'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherUnitYearMaxMinAvg'}, + 'precipitation': {'key': 'precipitation', 'type': 'WeatherUnitYearMax'}, + 'snowfall': {'key': 'snowfall', 'type': 'WeatherUnitYearMax'}, + } + + def __init__( + self, + *, + date: Optional[datetime.datetime] = None, + temperature: Optional["WeatherUnitYearMaxMinAvg"] = None, + precipitation: Optional["WeatherUnitYearMax"] = None, + snowfall: Optional["WeatherUnitYearMax"] = None, + **kwargs + ): + super(DailyHistoricalRecords, self).__init__(**kwargs) + self.date = date + self.temperature = temperature + self.precipitation = precipitation + self.snowfall = snowfall + + +class DailyHistoricalRecordsResponse(msrest.serialization.Model): + """DailyHistoricalRecordsResponse. + + :param historical_records: Historical records for each requested day. + :type historical_records: list[~azure.maps.weather.models.DailyHistoricalRecords] + """ + + _attribute_map = { + 'historical_records': {'key': 'historicalRecords', 'type': '[DailyHistoricalRecords]'}, + } + + def __init__( + self, + *, + historical_records: Optional[List["DailyHistoricalRecords"]] = None, + **kwargs + ): + super(DailyHistoricalRecordsResponse, self).__init__(**kwargs) + self.historical_records = historical_records + + +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_description: Textual description for ``categoryValue`` corresponding to the + level that the index value falls under, for example "Very Good". + :type category_description: 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 is_ascending: Describes the direction of the ``value`` and ``categoryValue``. For + example, when set to ``true``\ , the poorest index value is 0 and the best index value is 10. + When set to ``true``\ , the poorest index value is 10 and the best index value is 0. + :type is_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_description': {'key': 'category', 'type': 'str'}, + 'category_value': {'key': 'categoryValue', 'type': 'int'}, + 'is_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_description: Optional[str] = None, + category_value: Optional[int] = None, + is_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_description = category_description + self.category_value = category_value + self.is_ascending = is_ascending + self.description = description + + +class DailyIndicesResponse(msrest.serialization.Model): + """This object is returned from a successful Get Daily Indices call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: A list of all daily indices for the queried location. + :vartype results: list[~azure.maps.weather.models.DailyIndex] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[DailyIndex]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyIndicesResponse, self).__init__(**kwargs) + self.results = 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.WeatherValue + :param cooling: Number of degrees that the mean temperature is above 65 degrees F/ 18 degree C. + :type cooling: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'heating': {'key': 'heating', 'type': 'WeatherValue'}, + 'cooling': {'key': 'cooling', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + heating: Optional["WeatherValue"] = None, + cooling: Optional["WeatherValue"] = 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 decibel_relative_to_z: A unit that represents forecasted precipitation intensity. + :type decibel_relative_to_z: float + :param short_description: A short phrase describing precipitation condition for the interval. + :type short_description: 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. Possible values include: + "Rain", "Snow", "Ice", "Mix". + :type precipitation_type: str or ~azure.maps.weather.models.PrecipitationType + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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'}, + 'decibel_relative_to_z': {'key': 'dbz', 'type': 'float'}, + 'short_description': {'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, + decibel_relative_to_z: Optional[float] = None, + short_description: Optional[str] = None, + threshold: Optional[str] = None, + color: Optional["ColorValue"] = None, + simplified_color: Optional["ColorValue"] = None, + precipitation_type: Optional[Union[str, "PrecipitationType"]] = None, + icon_code: Optional[Union[int, "IconCode"]] = None, + cloud_cover: Optional[int] = None, + **kwargs + ): + super(ForecastInterval, self).__init__(**kwargs) + self.start_time = start_time + self.minute = minute + self.decibel_relative_to_z = decibel_relative_to_z + self.short_description = short_description + 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. Possible values include: 0, 1, 2, 3, 4. + :type hazard_index: str or ~azure.maps.weather.models.HazardIndex + :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_description: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_description: str + """ + + _attribute_map = { + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_description': {'key': 'shortPhrase', 'type': 'str'}, + } + + def __init__( + self, + *, + hazard_index: Optional[Union[int, "HazardIndex"]] = None, + hazard_code: Optional[str] = None, + short_description: Optional[str] = None, + **kwargs + ): + super(HazardDetail, self).__init__(**kwargs) + self.hazard_index = hazard_index + self.hazard_code = hazard_code + self.short_description = short_description + + +class HourlyForecast(msrest.serialization.Model): + """HourlyForecast. + + :param date_time: Date and time of the forecast in ISO 8601 format, for example, + 2019-10-27T19:39:57-08:00. + :type date_time: ~datetime.datetime + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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.WeatherValue + :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.WeatherValue + :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.WeatherValue + :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.WeatherValue + :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.WeatherValue + :param cloud_ceiling: Cloud ceiling in specified unit. The ceiling is a measurement of the + height of the base of the lowest clouds. + :type cloud_ceiling: ~azure.maps.weather.models.WeatherValue + :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_description: Phrase associated with the ``uvIndex``. + :type uv_index_description: 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.WeatherValue + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherValue + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherValue + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherValue + :param cloud_cover: Percent representing cloud cover. + :type cloud_cover: int + """ + + _attribute_map = { + 'date_time': {'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': 'WeatherValue'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValue'}, + 'wet_bulb_temperature': {'key': 'wetBulbTemperature', 'type': 'WeatherValue'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherValue'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherValue'}, + 'cloud_ceiling': {'key': 'ceiling', 'type': 'WeatherValue'}, + 'uv_index': {'key': 'uvIndex', 'type': 'int'}, + 'uv_index_description': {'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': 'WeatherValue'}, + 'rain': {'key': 'rain', 'type': 'WeatherValue'}, + 'snow': {'key': 'snow', 'type': 'WeatherValue'}, + 'ice': {'key': 'ice', 'type': 'WeatherValue'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + } + + def __init__( + self, + *, + date_time: Optional[datetime.datetime] = None, + icon_code: Optional[Union[int, "IconCode"]] = None, + icon_phrase: Optional[str] = None, + has_precipitation: Optional[bool] = None, + is_daylight: Optional[bool] = None, + temperature: Optional["WeatherValue"] = None, + real_feel_temperature: Optional["WeatherValue"] = None, + wet_bulb_temperature: Optional["WeatherValue"] = None, + dew_point: Optional["WeatherValue"] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + relative_humidity: Optional[int] = None, + visibility: Optional["WeatherValue"] = None, + cloud_ceiling: Optional["WeatherValue"] = None, + uv_index: Optional[int] = None, + uv_index_description: 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["WeatherValue"] = None, + rain: Optional["WeatherValue"] = None, + snow: Optional["WeatherValue"] = None, + ice: Optional["WeatherValue"] = None, + cloud_cover: Optional[int] = None, + **kwargs + ): + super(HourlyForecast, self).__init__(**kwargs) + self.date_time = date_time + 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.cloud_ceiling = cloud_ceiling + self.uv_index = uv_index + self.uv_index_description = uv_index_description + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar forecasts: Forecast data for each returned hour. + :vartype forecasts: list[~azure.maps.weather.models.HourlyForecast] + """ + + _validation = { + 'forecasts': {'readonly': True}, + } + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[HourlyForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(HourlyForecastResponse, self).__init__(**kwargs) + self.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_description: Short summary phrase. Phrase length is approximately 25 characters. + :type short_description: str + :param brief_description: Brief summary phrase. Phrase length is approximately 60 characters. + :type brief_description: 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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + """ + + _attribute_map = { + 'start_minute': {'key': 'startMinute', 'type': 'int'}, + 'end_minute': {'key': 'endMinute', 'type': 'int'}, + 'total_minutes': {'key': 'totalMinutes', 'type': 'int'}, + 'short_description': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_description': {'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_description: Optional[str] = None, + brief_description: Optional[str] = None, + long_phrase: Optional[str] = None, + icon_code: Optional[Union[int, "IconCode"]] = None, + **kwargs + ): + super(IntervalSummary, self).__init__(**kwargs) + self.start_minute = start_minute + self.end_minute = end_minute + self.total_minutes = total_minutes + self.short_description = short_description + self.brief_description = brief_description + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Phrase summaries for the entire forecast period. + :vartype summary: ~azure.maps.weather.models.MinuteForecastSummary + :ivar interval_summaries: Summary information for each interval in the forecast. The Summaries + breaks down each potential interval where precipitation starts and stops. + :vartype interval_summaries: list[~azure.maps.weather.models.IntervalSummary] + :ivar intervals: Forecast data for each interval in the forecast. + :vartype intervals: list[~azure.maps.weather.models.ForecastInterval] + """ + + _validation = { + 'summary': {'readonly': True}, + 'interval_summaries': {'readonly': True}, + 'intervals': {'readonly': True}, + } + + _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 = None + self.interval_summaries = None + self.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_description: Short summary phrase for the next 120 minutes. Phrase length is + approximately 25 characters. + :type short_description: str + :param brief_description: Summary phrase for the next 120 minutes. Phrase length is + approximately 60 characters. + :type brief_description: 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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + """ + + _attribute_map = { + 'brief_phrase60': {'key': 'briefPhrase60', 'type': 'str'}, + 'short_description': {'key': 'shortPhrase', 'type': 'str'}, + 'brief_description': {'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_description: Optional[str] = None, + brief_description: Optional[str] = None, + long_phrase: Optional[str] = None, + icon_code: Optional[Union[int, "IconCode"]] = None, + **kwargs + ): + super(MinuteForecastSummary, self).__init__(**kwargs) + self.brief_phrase60 = brief_phrase60 + self.short_description = short_description + self.brief_description = brief_description + self.long_phrase = long_phrase + self.icon_code = icon_code + + +class PastHoursTemperature(msrest.serialization.Model): + """Summary of temperature fluctuations over the number of past hours. + + :param minimum: minimum. + :type minimum: ~azure.maps.weather.models.WeatherValue + :param maximum: maximum. + :type maximum: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherValue'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + minimum: Optional["WeatherValue"] = None, + maximum: Optional["WeatherValue"] = None, + **kwargs + ): + super(PastHoursTemperature, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + + +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.WeatherValue + :param past_three_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past three hours. + :type past_three_hours: ~azure.maps.weather.models.WeatherValue + :param past_six_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past six hours. Contains Metric and Imperial Values. + :type past_six_hours: ~azure.maps.weather.models.WeatherValue + :param past_nine_hours: The amount of precipitation (liquid equivalent) that has fallen in the + past nine hours. + :type past_nine_hours: ~azure.maps.weather.models.WeatherValue + :param past_twelve_hours: The amount of precipitation (liquid equivalent) that has fallen in + the past 12 hours. + :type past_twelve_hours: ~azure.maps.weather.models.WeatherValue + :param past_eighteen_hours: The amount of precipitation (liquid equivalent) that has fallen in + the past 18 hours. + :type past_eighteen_hours: ~azure.maps.weather.models.WeatherValue + :param past_twenty_four_hours: The amount of precipitation (liquid equivalent) that has fallen + in the past 24 hours. + :type past_twenty_four_hours: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'past_hour': {'key': 'pastHour', 'type': 'WeatherValue'}, + 'past_three_hours': {'key': 'pastThreeHours', 'type': 'WeatherValue'}, + 'past_six_hours': {'key': 'pastSixHours', 'type': 'WeatherValue'}, + 'past_nine_hours': {'key': 'pastNineHours', 'type': 'WeatherValue'}, + 'past_twelve_hours': {'key': 'pastTwelveHours', 'type': 'WeatherValue'}, + 'past_eighteen_hours': {'key': 'pastEighteenHours', 'type': 'WeatherValue'}, + 'past_twenty_four_hours': {'key': 'pastTwentyFourHours', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + past_hour: Optional["WeatherValue"] = None, + past_three_hours: Optional["WeatherValue"] = None, + past_six_hours: Optional["WeatherValue"] = None, + past_nine_hours: Optional["WeatherValue"] = None, + past_twelve_hours: Optional["WeatherValue"] = None, + past_eighteen_hours: Optional["WeatherValue"] = None, + past_twenty_four_hours: Optional["WeatherValue"] = None, + **kwargs + ): + super(PrecipitationSummary, self).__init__(**kwargs) + self.past_hour = past_hour + self.past_three_hours = past_three_hours + self.past_six_hours = past_six_hours + self.past_nine_hours = past_nine_hours + self.past_twelve_hours = past_twelve_hours + self.past_eighteen_hours = past_eighteen_hours + self.past_twenty_four_hours = past_twenty_four_hours + + +class PressureTendency(msrest.serialization.Model): + """PressureTendency. + + :param description: Description of the pressure tendency in specified language. + :type description: str + :param code: Pressure tendency code regardless of language. One of F=Falling, S=Steady, + R=Rising. + :type code: str + """ + + _attribute_map = { + 'description': {'key': 'localizedDescription', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + code: Optional[str] = None, + **kwargs + ): + super(PressureTendency, self).__init__(**kwargs) + self.description = description + self.code = code + + +class QuarterDayForecast(msrest.serialization.Model): + """QuarterDayForecast. + + :param date_time: Date of the forecast as example, 2019-10-27T00:00:00. + :type date_time: ~datetime.datetime + :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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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.WeatherValueRange + :param real_feel_temperature: RealFeel™ Temperature values for the quarter. + :type real_feel_temperature: ~azure.maps.weather.models.WeatherValueRange + :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.WeatherValue + :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.WeatherValue + :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 is zero, precipitationType is not present in the response. Possible values include: + "Rain", "Snow", "Ice", "Mix". + :type precipitation_type: str or ~azure.maps.weather.models.PrecipitationType + :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.WeatherValue + :param rain: Rain. + :type rain: ~azure.maps.weather.models.WeatherValue + :param snow: Snow. + :type snow: ~azure.maps.weather.models.WeatherValue + :param ice: Ice. + :type ice: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'date_time': {'key': 'date', 'type': 'iso-8601'}, + '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': 'WeatherValueRange'}, + 'real_feel_temperature': {'key': 'realFeelTemperature', 'type': 'WeatherValueRange'}, + 'dew_point': {'key': 'dewPoint', 'type': 'WeatherValue'}, + 'relative_humidity': {'key': 'relativeHumidity', 'type': 'int'}, + 'wind': {'key': 'wind', 'type': 'WindDetails'}, + 'wind_gust': {'key': 'windGust', 'type': 'WindDetails'}, + 'visibility': {'key': 'visibility', 'type': 'WeatherValue'}, + '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': 'WeatherValue'}, + 'rain': {'key': 'rain', 'type': 'WeatherValue'}, + 'snow': {'key': 'snow', 'type': 'WeatherValue'}, + 'ice': {'key': 'ice', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + date_time: Optional[datetime.datetime] = None, + effective_date: Optional[datetime.datetime] = None, + quarter: Optional[Union[int, "DayQuarter"]] = None, + icon_code: Optional[Union[int, "IconCode"]] = None, + icon_phrase: Optional[str] = None, + phrase: Optional[str] = None, + temperature: Optional["WeatherValueRange"] = None, + real_feel_temperature: Optional["WeatherValueRange"] = None, + dew_point: Optional["WeatherValue"] = None, + relative_humidity: Optional[int] = None, + wind: Optional["WindDetails"] = None, + wind_gust: Optional["WindDetails"] = None, + visibility: Optional["WeatherValue"] = None, + cloud_cover: Optional[int] = None, + has_precipitation: Optional[bool] = None, + precipitation_type: Optional[Union[str, "PrecipitationType"]] = None, + precipitation_intensity: Optional[str] = None, + precipitation_probability: Optional[int] = None, + thunderstorm_probability: Optional[int] = None, + total_liquid: Optional["WeatherValue"] = None, + rain: Optional["WeatherValue"] = None, + snow: Optional["WeatherValue"] = None, + ice: Optional["WeatherValue"] = None, + **kwargs + ): + super(QuarterDayForecast, self).__init__(**kwargs) + self.date_time = date_time + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar forecasts: Forecast data for each quarter in the response. + :vartype forecasts: list[~azure.maps.weather.models.QuarterDayForecast] + """ + + _validation = { + 'forecasts': {'readonly': True}, + } + + _attribute_map = { + 'forecasts': {'key': 'forecasts', 'type': '[QuarterDayForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuarterDayForecastResponse, self).__init__(**kwargs) + self.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 classification: Classification of the alert. This field is not available for all + countries and therefore not always returned. + :type classification: 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_details: Information about the alert specific to the affected area(s). + :type alert_details: list[~azure.maps.weather.models.AlertDetails] + """ + + _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'}, + 'classification': {'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_details': {'key': 'alertAreas', 'type': '[AlertDetails]'}, + } + + 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, + classification: Optional[str] = None, + level: Optional[str] = None, + source: Optional[str] = None, + source_id: Optional[int] = None, + disclaimer: Optional[str] = None, + alert_details: Optional[List["AlertDetails"]] = 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.classification = classification + self.level = level + self.source = source + self.source_id = source_id + self.disclaimer = disclaimer + self.alert_details = alert_details + + +class SevereWeatherAlertDescription(msrest.serialization.Model): + """Description of a severe weather alert. + + :param description: 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 description: str + :param status: Description of the alert in English (en-US). + :type status: str + """ + + _attribute_map = { + 'description': {'key': 'localized', 'type': 'str'}, + 'status': {'key': 'english', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + status: Optional[str] = None, + **kwargs + ): + super(SevereWeatherAlertDescription, self).__init__(**kwargs) + self.description = description + self.status = status + + +class SevereWeatherAlertsResponse(msrest.serialization.Model): + """This object is returned from a successful Get Severe Weather Alerts call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: A list of all severe weather alerts for the queried location. + :vartype results: list[~azure.maps.weather.models.SevereWeatherAlert] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[SevereWeatherAlert]'}, + } + + def __init__( + self, + **kwargs + ): + super(SevereWeatherAlertsResponse, self).__init__(**kwargs) + self.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, + *, + 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 past_six_hours: Summary of temperature fluctuations over the past 6 hours. + :type past_six_hours: ~azure.maps.weather.models.PastHoursTemperature + :param past_twelve_hours: Summary of temperature fluctuations over the past 12 hours. + :type past_twelve_hours: ~azure.maps.weather.models.PastHoursTemperature + :param past_twenty_four_hours: Summary of temperature fluctuations over the past 24 hours. + :type past_twenty_four_hours: ~azure.maps.weather.models.PastHoursTemperature + """ + + _attribute_map = { + 'past_six_hours': {'key': 'pastSixHours', 'type': 'PastHoursTemperature'}, + 'past_twelve_hours': {'key': 'pastTwelveHours', 'type': 'PastHoursTemperature'}, + 'past_twenty_four_hours': {'key': 'pastTwentyFourHours', 'type': 'PastHoursTemperature'}, + } + + def __init__( + self, + *, + past_six_hours: Optional["PastHoursTemperature"] = None, + past_twelve_hours: Optional["PastHoursTemperature"] = None, + past_twenty_four_hours: Optional["PastHoursTemperature"] = None, + **kwargs + ): + super(TemperatureSummary, self).__init__(**kwargs) + self.past_six_hours = past_six_hours + self.past_twelve_hours = past_twelve_hours + self.past_twenty_four_hours = past_twenty_four_hours + + +class WaypointForecast(msrest.serialization.Model): + """WaypointForecast. + + :param icon_code: Numeric value representing an image that displays the ``iconPhrase``. Please + refer to `Weather Service Concepts `_ for details. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :param short_description: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_description: str + :param is_daytime: Indicates the time of the day. True indicates 'day',', false indicates + 'night. + :type is_daytime: 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.WeatherValue + :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_description': {'key': 'shortPhrase', 'type': 'str'}, + 'is_daytime': {'key': 'isDayTime', 'type': 'bool'}, + 'cloud_cover': {'key': 'cloudCover', 'type': 'int'}, + 'temperature': {'key': 'temperature', 'type': 'WeatherValue'}, + '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[Union[int, "IconCode"]] = None, + short_description: Optional[str] = None, + is_daytime: Optional[bool] = None, + cloud_cover: Optional[int] = None, + temperature: Optional["WeatherValue"] = 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(WaypointForecast, self).__init__(**kwargs) + self.icon_code = icon_code + self.short_description = short_description + self.is_daytime = is_daytime + 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 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar summary: Short summary of the weather along the route. + :vartype summary: ~azure.maps.weather.models.WeatherAlongRouteSummary + :ivar waypoints: Data for each waypoint returned in the same order as specified in the request. + :vartype waypoints: list[~azure.maps.weather.models.WaypointForecast] + """ + + _validation = { + 'summary': {'readonly': True}, + 'waypoints': {'readonly': True}, + } + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'WeatherAlongRouteSummary'}, + 'waypoints': {'key': 'waypoints', 'type': '[WaypointForecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(WeatherAlongRouteResponse, self).__init__(**kwargs) + self.summary = None + self.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. + Possible values include: 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41. + :type icon_code: str or ~azure.maps.weather.models.IconCode + :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[Union[int, "IconCode"]] = 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. Possible values include: 0, 1, 2, 3, 4. + :type max_hazard_index: str or ~azure.maps.weather.models.HazardIndex + :param details: Details of the weather hazards affecting the trip. + :type details: list[~azure.maps.weather.models.HazardDetail] + """ + + _attribute_map = { + 'max_hazard_index': {'key': 'maxHazardIndex', 'type': 'int'}, + 'details': {'key': 'hazardDetails', 'type': '[HazardDetail]'}, + } + + def __init__( + self, + *, + max_hazard_index: Optional[Union[int, "HazardIndex"]] = None, + details: Optional[List["HazardDetail"]] = None, + **kwargs + ): + super(WeatherHazards, self).__init__(**kwargs) + self.max_hazard_index = max_hazard_index + self.details = 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. Possible values include: 0, 1, 2, 3, 4. + :type hazard_index: str or ~azure.maps.weather.models.HazardIndex + :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_description: A displayable short phrase describing the forecasted conditions and + precipitation intensity/type. + :type short_description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'hazard_index': {'key': 'hazardIndex', 'type': 'int'}, + 'hazard_code': {'key': 'hazardCode', 'type': 'str'}, + 'short_description': {'key': 'shortPhrase', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + hazard_index: Optional[Union[int, "HazardIndex"]] = None, + hazard_code: Optional[str] = None, + short_description: Optional[str] = None, + **kwargs + ): + super(WeatherNotification, self).__init__(**kwargs) + self.type = type + self.hazard_index = hazard_index + self.hazard_code = hazard_code + self.short_description = short_description + + +class WeatherUnitMaxMinAvg(msrest.serialization.Model): + """Returned temperature values. + + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherValue + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherValue + :param average: Average temperature for the time period. + :type average: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'maximum': {'key': 'maximum', 'type': 'WeatherValue'}, + 'minimum': {'key': 'minimum', 'type': 'WeatherValue'}, + 'average': {'key': 'average', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + maximum: Optional["WeatherValue"] = None, + minimum: Optional["WeatherValue"] = None, + average: Optional["WeatherValue"] = None, + **kwargs + ): + super(WeatherUnitMaxMinAvg, self).__init__(**kwargs) + self.maximum = maximum + self.minimum = minimum + self.average = average + + +class WeatherUnitYear(msrest.serialization.Model): + """WeatherUnitYear. + + :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 + :param year: Year the value occurred. + :type year: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + 'year': {'key': 'year', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[float] = None, + unit: Optional[str] = None, + unit_type: Optional[int] = None, + year: Optional[int] = None, + **kwargs + ): + super(WeatherUnitYear, self).__init__(**kwargs) + self.value = value + self.unit = unit + self.unit_type = unit_type + self.year = year + + +class WeatherUnitYearMax(msrest.serialization.Model): + """Returned temperature values. + + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherUnitYear + """ + + _attribute_map = { + 'maximum': {'key': 'maximum', 'type': 'WeatherUnitYear'}, + } + + def __init__( + self, + *, + maximum: Optional["WeatherUnitYear"] = None, + **kwargs + ): + super(WeatherUnitYearMax, self).__init__(**kwargs) + self.maximum = maximum + + +class WeatherUnitYearMaxMinAvg(msrest.serialization.Model): + """Returned temperature values. + + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherUnitYear + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherUnitYear + :param average: Average temperature for the time period. + :type average: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'maximum': {'key': 'maximum', 'type': 'WeatherUnitYear'}, + 'minimum': {'key': 'minimum', 'type': 'WeatherUnitYear'}, + 'average': {'key': 'average', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + maximum: Optional["WeatherUnitYear"] = None, + minimum: Optional["WeatherUnitYear"] = None, + average: Optional["WeatherValue"] = None, + **kwargs + ): + super(WeatherUnitYearMaxMinAvg, self).__init__(**kwargs) + self.maximum = maximum + self.minimum = minimum + self.average = average + + +class WeatherValue(msrest.serialization.Model): + """Specific value of a given unit related to weather. + + :param value: Rounded value. + :type value: float + :param unit_label: Type of unit for the returned value. + :type unit_label: 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. Possible values include: 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31. + :type unit_type: str or ~azure.maps.weather.models.UnitType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'float'}, + 'unit_label': {'key': 'unit', 'type': 'str'}, + 'unit_type': {'key': 'unitType', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[float] = None, + unit_label: Optional[str] = None, + unit_type: Optional[Union[int, "UnitType"]] = None, + **kwargs + ): + super(WeatherValue, self).__init__(**kwargs) + self.value = value + self.unit_label = unit_label + self.unit_type = unit_type + + +class WeatherValueRange(msrest.serialization.Model): + """Returned temperature values. + + :param minimum: Minimum temperature for the time period. + :type minimum: ~azure.maps.weather.models.WeatherValue + :param maximum: Maximum temperature for the time period. + :type maximum: ~azure.maps.weather.models.WeatherValue + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'WeatherValue'}, + 'maximum': {'key': 'maximum', 'type': 'WeatherValue'}, + } + + def __init__( + self, + *, + minimum: Optional["WeatherValue"] = None, + maximum: Optional["WeatherValue"] = None, + **kwargs + ): + super(WeatherValueRange, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + + +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 description: Direction abbreviation in the specified language. + :type description: str + """ + + _attribute_map = { + 'degrees': {'key': 'degrees', 'type': 'int'}, + 'description': {'key': 'localizedDescription', 'type': 'str'}, + } + + def __init__( + self, + *, + degrees: Optional[int] = None, + description: Optional[str] = None, + **kwargs + ): + super(WindDirection, self).__init__(**kwargs) + self.degrees = degrees + self.description = 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. Possible values include: 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31. + :type unit_type: str or ~azure.maps.weather.models.UnitType + """ + + _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[Union[int, "UnitType"]] = 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..0dd05b0cb5ca --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/models/_weather_client_enums.py @@ -0,0 +1,241 @@ +# 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. + FIRST_QUARTER = 0 + #: 1:00 pm - 7:00 pm/ 13:00- 19:00. + SECOND_QUARTER = 1 + #: 7:00 pm - 1:00 am/ 19:00 - 01:00. + THIRD_QUARTER = 2 + #: 1:00 am - 7:00 am/ 01:00 - 07:00. + FORTH_QUARTER = 3 + +class HazardIndex(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """A severity/hazard index. + + + * ``0`` - No hazard. + * ``1`` - Be informed, be aware. + * ``2`` - Pay attention, be prepared. + * ``3`` - Take action. + * ``4`` - Life threatening, emergency. + """ + + #: No hazard. + NO_HAZARD = 0 + #: Be informed. + INFORMED = 1 + #: Pay attention. + PAY_ATTENTION = 2 + #: Take action. + TAKE_ACTION = 3 + #: Emergency. + EMERGENCY = 4 + +class IconCode(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """Numeric value representing an image that displays the ``iconPhrase``. Please refer to `Weather + Service Concepts `_ for details. + """ + + #: Sunny. + SUNNY = 1 + #: Mostly Sunny. + MOSTLY_SUNNY = 2 + #: Partly Sunny. + PARTLY_SUNNY = 3 + #: Intermittent Clouds. + INTERMITTENT_CLOUDS = 4 + #: Hazy Sunshine. + HAZY_SUNSHINE = 5 + #: Mostly Cloudy. + MOSTLY_CLOUDY = 6 + #: Cloudy. + CLOUDY = 7 + #: Dreary (Overcast). + DREARY = 8 + #: Fog. + FOG = 11 + #: Showers. + SHOWERS = 12 + #: Mostly Cloudy with Showers. + MOSTLY_CLOUDY_WITH_SHOWERS = 13 + #: Partly Sunny with Showers. + PARTLY_SUNNY_WITH_SHOWERS = 14 + #: Thunderstorms. + THUNDERSTORMS = 15 + #: Mostly Cloudy with Thunderstorms. + MOSTLY_CLOUDY_WITH_THUNDERSTORMS = 16 + #: Partly Sunny with Thunderstorms. + PARTLY_SUNNY_WITH_THUNDERSTORMS = 17 + #: Rain. + RAIN = 18 + #: Flurries. + FLURRIES = 19 + #: Mostly Cloudy with Flurries. + MOSTLY_CLOUDY_WITH_FLURRIES = 20 + #: Partly Sunny with Flurries. + PARTLY_SUNNY_WITH_FLURRIES = 21 + #: Snow. + SNOW = 22 + #: Mostly Cloudy with Snow. + MOSTLY_CLOUDY_WITH_SNOW = 23 + #: Ice. + ICE = 24 + #: Sleet. + SLEET = 25 + #: Freezing Rain. + FREEZING_RAIN = 26 + #: Rain and Snow. + RAIN_AND_SNOW = 29 + #: Hot. + HOT = 30 + #: Cold. + COLD = 31 + #: Windy. + WINDY = 32 + #: Clear. + CLEAR = 33 + #: Mostly Clear. + MOSTLY_CLEAR = 34 + #: Partly Cloudy. + PARTLY_CLOUDY = 35 + #: Hazy Moonlight. + HAZY_MOONLIGHT = 37 + #: Partly Cloudy with Showers. + PARTLY_CLOUDY_WITH_SHOWERS = 39 + #: Partly Cloudy with Thunderstorms. + PARTLY_CLOUDY_WITH_THUNDERSTORMS = 41 + +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 + #: ``alertDetails``\ , ``startTime``\ , ``endTime``\ , or ``class``. + CONTINUE_ENUM = "Continue" + #: "Update" - the alert has been updated since its initial issuance. + UPDATE = "Update" + +class PrecipitationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the type of precipitation ("Rain" "Snow" "Ice" or "Mix"). If dbz is zero, + precipitationType is not present in the response. + """ + + #: Rain. + RAIN = "Rain" + #: Snow. + SNOW = "Snow" + #: Ice. + ICE = "Ice" + #: Mix. + MIX = "Mix" + +class UnitType(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """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. + """ + + #: feet. + FEET = 0 + #: inches. + INCHES = 1 + #: miles. + MILES = 2 + #: millimeter. + MILLIMETER = 3 + #: centimeter. + CENTIMETER = 4 + #: meter. + METER = 5 + #: kilometer. + KILOMETER = 6 + #: kilometersPerHour. + KILOMETERS_PER_HOUR = 7 + #: knots. + KNOTS = 8 + #: milesPerHour. + MILES_PER_HOUR = 9 + #: metersPerSecond. + METERS_PER_SECOND = 10 + #: hectoPascals. + HECTO_PASCALS = 11 + #: inchesOfMercury. + INCHES_OF_MERCURY = 12 + #: kiloPascals. + KILO_PASCALS = 13 + #: millibars. + MILLIBARS = 14 + #: millimetersOfMercury. + MILLIMETERS_OF_MERCURY = 15 + #: poundsPerSquareInch. + POUNDS_PER_SQUARE_INCH = 16 + #: celsius. + CELSIUS = 17 + #: fahrenheit. + FAHRENHEIT = 18 + #: kelvin. + KELVIN = 19 + #: percent. + PERCENT = 20 + #: float. + FLOAT = 21 + #: integer. + INTEGER = 22 + #: MicrogramsPerCubicMeterOfAir. + MICROGRAMS_PER_CUBIC_METER_OF_AIR = 31 + +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..33af3a6d4ce1 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 +from ._weather_operations import WeatherOperations + +__all__ = [ + 'WeatherClientOperationsMixin', + 'WeatherOperations', +] 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..79ed0bdafeae --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_weather_client_operations.py @@ -0,0 +1,846 @@ +# 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 WeatherClientOperationsMixin(object): + + def get_hourly_forecast( + self, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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, + coordinates, # type: List[float] + 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 coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :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("coordinates", coordinates, '[float]', div=',') + 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/operations/_weather_operations.py b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_weather_operations.py new file mode 100644 index 000000000000..77a947e22408 --- /dev/null +++ b/sdk/maps/azure-maps-weather/azure/maps/weather/operations/_weather_operations.py @@ -0,0 +1,310 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WeatherOperations(object): + """WeatherOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.maps.weather.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_daily_historical_actuals( + self, + coordinates, # type: List[float] + start_date, # type: datetime.date + end_date, # type: datetime.date + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.DailyHistoricalActualsResponse" + """**Get Daily Historical Actuals** + + **Applies to**\ : Gen 1 (S0 and S1) and Gen 2 pricing tiers. + + Get Daily Historical Actuals service returns climatology data such as past daily actual + observed temperatures, precipitation, snowfall, snow depth and cooling/heating degree day + information, for the day at a given coordinate location. The data is requested for a specified + date range, up to 31 days in a single API request. Generally, historical data may be available + as far back as the last 5 to 40+ years, depending on the location. + + :param coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :param start_date: Start date in ISO 8601 format, for example, 2019-10-27. The date range + supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not + exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type start_date: ~datetime.date + :param end_date: End date in ISO 8601 format, for example, 2019-10-28. The date range supported + is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a + maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type end_date: ~datetime.date + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyHistoricalActualsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyHistoricalActualsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyHistoricalActualsResponse"] + 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_historical_actuals.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("coordinates", coordinates, '[float]', div=',') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'date') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'date') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, '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('DailyHistoricalActualsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_historical_actuals.metadata = {'url': '/weather/historical/actuals/daily/{format}'} # type: ignore + + def get_daily_historical_records( + self, + coordinates, # type: List[float] + start_date, # type: datetime.date + end_date, # type: datetime.date + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.DailyHistoricalRecordsResponse" + """**Get Daily Historical Records** + + **Applies to**\ : Gen 1 (S0 and S1) and Gen 2 pricing tiers. + + Get Daily Historical Records service returns climatology data such as past daily record + temperatures, precipitation and snowfall at a given coordinate location. Availability of + records data will vary by location. Generally, historical data may be available as far back as + the last 5 to 40+ years, depending on the location. + + :param coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :param start_date: Start date in ISO 8601 format, for example, 2019-10-27. The date range + supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not + exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type start_date: ~datetime.date + :param end_date: End date in ISO 8601 format, for example, 2019-10-28. The date range supported + is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a + maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type end_date: ~datetime.date + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyHistoricalRecordsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyHistoricalRecordsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyHistoricalRecordsResponse"] + 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_historical_records.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("coordinates", coordinates, '[float]', div=',') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'date') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'date') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, '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('DailyHistoricalRecordsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_historical_records.metadata = {'url': '/weather/historical/records/daily/{format}'} # type: ignore + + def get_daily_historical_normals( + self, + coordinates, # type: List[float] + start_date, # type: datetime.date + end_date, # type: datetime.date + format="json", # type: Union[str, "_models.JsonFormat"] + unit=None, # type: Optional[Union[str, "_models.WeatherDataUnit"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.DailyHistoricalNormalsResponse" + """**Get Daily Historical Normals** + + **Applies to**\ : Gen 1 (S0 and S1) and Gen 2 pricing tiers. + + Get Daily Historical Normals service returns climatology data such as past daily normal + temperatures, precipitation and cooling/heating degree day information for the day at a given + coordinate location. Normals are a 30-year average for temperatures and precipitation for a + specific location. As is standard practice in climatology, the 30-year average covers years + 1991-2020, this data will be used for one decade and then will reset in the year 2030. + Generally, historical data may be available as far back as the last 5 to 40+ years, depending + on the location. + + :param coordinates: The applicable query specified as a comma separated string composed by + latitude followed by longitude e.g. "47.641268,-122.125679". + :type coordinates: list[float] + :param start_date: Start date in ISO 8601 format, for example, 2019-10-27. The date range + supported is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not + exceed a maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type start_date: ~datetime.date + :param end_date: End date in ISO 8601 format, for example, 2019-10-28. The date range supported + is 1 to 31 calendar days, so be sure to specify a startDate and endDate that does not exceed a + maximum of 31 days (i.e.: startDate=2012-01-01&endDate=2012-01-31). + :type end_date: ~datetime.date + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DailyHistoricalNormalsResponse, or the result of cls(response) + :rtype: ~azure.maps.weather.models.DailyHistoricalNormalsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DailyHistoricalNormalsResponse"] + 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_historical_normals.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("coordinates", coordinates, '[float]', div=',') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'date') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'date') + if unit is not None: + query_parameters['unit'] = self._serialize.query("unit", unit, '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('DailyHistoricalNormalsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_daily_historical_normals.metadata = {'url': '/weather/historical/normals/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'], + } +)