azure.maps.timezone.aio package

class azure.maps.timezone.aio.MapsTimeZoneClient(credential: AzureKeyCredential | AzureSasCredential | AsyncTokenCredential, client_id: str | None = None, *, endpoint: str = 'https://atlas.microsoft.com', **kwargs: Any)[source]
async close() None
async convert_windows_timezone_to_iana(format: str = 'json', *, windows_timezone_id: str, windows_territory_code: str | None = None, **kwargs: Any) List[MutableMapping[str, Any]]

Use to get the IANA ID.

The Get Windows to IANA Time Zone API is an HTTP GET request that returns a corresponding Internet Assigned Numbers Authority (IANA) ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be returned for a single Windows ID. It is possible to narrow these results by adding an optional territory parameter.

Parameters:

format (str) – Desired format of the response. Only json format is supported. “json” Default value is “json”.

Keyword Arguments:
  • windows_timezone_id (str) – The Windows time zone ID. Required.

  • windows_territory_code (str) – Windows Time Zone territory code. Default value is None.

Returns:

list of JSON object

Return type:

list[JSON]

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == [
    {
        "AliasOf": "str",
        "HasZone1970Location": bool,
        "Id": "str",
        "IsAlias": bool
    }
]
async get_iana_timezone_ids(format: str = 'json', **kwargs: Any) List[MutableMapping[str, Any]]

Use to get the list of IANA time zone IDs.

The Get IANA Time Zones API is an HTTP GET request that returns a full list of Internet Assigned Numbers Authority (IANA) time zone IDs. Updates to the IANA service are reflected in the system within one day.

Parameters:

format (str) – Desired format of the response. Only json format is supported. “json” Default value is “json”.

Returns:

list of JSON object

Return type:

list[JSON]

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == [
    {
        "AliasOf": "str",
        "HasZone1970Location": bool,
        "Id": "str",
        "IsAlias": bool
    }
]
async get_iana_version(format: str = 'json', **kwargs: Any) MutableMapping[str, Any]

Use to get the current IANA version number.

The Get Time Zone IANA Version API is an HTTP GET request that returns the current Internet Assigned Numbers Authority (IANA) version number as Metadata.

Parameters:

format (str) – Desired format of the response. Only json format is supported. “json” Default value is “json”.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "Version": "str"
}
async get_timezone(*, timezone_id: str | None = None, coordinates: List[float] | None = None, accept_language: str | None = None, options: str | None = None, time_stamp: datetime | None = None, dst_from: datetime | None = None, dst_lasting_years: int | None = None, **kwargs: Any) MutableMapping[str, Any][source]

Unified method to get timezone information by either timezone_id or coordinates. Only one of coordinate or timezone_id will be considered. If timezone_id is provided, coordinate will be ignored.

Keyword Arguments:
  • timezone_id (str) – The IANA time zone ID.

  • coordinates (list[float]) – Coordinates of the point for which time zone information is requested. This parameter is a list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly, coordinates are passed in as a single string containing coordinates, separated by commas.

  • accept_language (str) – Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in “EN”. Please refer to Supported Languages for details. Default value is None.

  • options (str) – Options available for types of information returned in the result. Known values are: “none”, “zoneInfo”, “transitions”, and “all”. Default value is None.

  • time_stamp (datetime) – Reference time, if omitted, the API will use the machine time serving the request. Default value is None.

  • dst_from (datetime) – The start date from which daylight savings time (DST) transitions are requested, only applies when “options” = all or “options” = transitions. Default value is None.

  • dst_lasting_years (int) – The number of years from “transitionsFrom” for which DST transitions are requested, only applies when “options” = all or “options” = transitions. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

async get_timezone_by_coordinates(format: str = 'json', *, coordinates: List[float], accept_language: str | None = None, options: str | None = None, time_stamp: datetime | None = None, dst_from: datetime | None = None, dst_lasting_years: int | None = None, **kwargs: Any) MutableMapping[str, Any]

Use to get the current, historical, and future time zone information for the specified latitude-longitude pair.

The Get Timezone By Coordinates API is an HTTP GET request that returns current, historical, and future time zone information for a specified latitude-longitude pair. In addition, the API provides sunset and sunrise times for a given location.

Parameters:

format (str) – Desired format of the response. Only json format is supported. “json” Default value is “json”.

Keyword Arguments:
  • coordinates (list[float]) – Coordinates of the point for which time zone information is requested. This parameter is a list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly, coordinates are passed in as a single string containing coordinates, separated by commas. Required.

  • accept_language (str) –

    Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in “EN”. Please refer to Supported Languages for details. Default value is None.

  • options (str) – Alternatively, use alias “o”. Options available for types of information returned in the result. Known values are: “none”, “zoneInfo”, “transitions”, and “all”. Default value is None.

  • time_stamp (datetime) – Alternatively, use alias “stamp”, or “s”. Reference time, if omitted, the API will use the machine time serving the request. Default value is None.

  • dst_from (datetime) – Alternatively, use alias “tf”. The start date from which daylight savings time (DST) transitions are requested, only applies when “options” = all or “options” = transitions. Default value is None.

  • dst_lasting_years (int) – Alternatively, use alias “ty”. The number of years from “transitionsFrom” for which DST transitions are requested, only applies when “options” = all or “options” = transitions. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "ReferenceUtcTimestamp": "2020-02-20 00:00:00",
    "TimeZones": [
        {
            "Aliases": [
                "str"
            ],
            "Countries": [
                {
                    "Code": "str",
                    "Name": "str"
                }
            ],
            "Id": "str",
            "Names": {
                "Daylight": "str",
                "Generic": "str",
                "ISO6391LanguageCode": "str",
                "Standard": "str"
            },
            "ReferenceTime": {
                "DaylightSavings": "str",
                "PosixTz": "str",
                "PosixTzValidYear": 0,
                "StandardOffset": "str",
                "Sunrise": "2020-02-20 00:00:00",
                "Sunset": "2020-02-20 00:00:00",
                "Tag": "str",
                "WallTime": "str"
            },
            "RepresentativePoint": {
                "Latitude": 0.0,
                "Longitude": 0.0
            },
            "TimeTransitions": [
                {
                    "DaylightSavings": "str",
                    "StandardOffset": "str",
                    "Tag": "str",
                    "UtcEnd": "2020-02-20 00:00:00",
                    "UtcStart": "2020-02-20 00:00:00"
                }
            ]
        }
    ],
    "Version": "str"
}
async get_timezone_by_id(format: str = 'json', *, timezone_id: str, accept_language: str | None = None, options: str | None = None, time_stamp: datetime | None = None, dst_from: datetime | None = None, dst_lasting_years: int | None = None, **kwargs: Any) MutableMapping[str, Any]

Use to get the current, historical, and future time zone information for the specified IANA time zone ID.

The Get Timezone By ID API is an HTTP GET request that returns current, historical, and future time zone information for the specified IANA time zone ID.

Parameters:

format (str) – Desired format of the response. Only json format is supported. “json” Default value is “json”.

Keyword Arguments:
  • timezone_id (str) – The IANA time zone ID. Required.

  • accept_language (str) –

    Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in “EN”. Please refer to Supported Languages for details. Default value is None.

  • options (str) – Alternatively, use alias “o”. Options available for types of information returned in the result. Known values are: “none”, “zoneInfo”, “transitions”, and “all”. Default value is None.

  • time_stamp (datetime) – Alternatively, use alias “stamp”, or “s”. Reference time, if omitted, the API will use the machine time serving the request. Default value is None.

  • dst_from (datetime) – Alternatively, use alias “tf”. The start date from which daylight savings time (DST) transitions are requested, only applies when “options” = all or “options” = transitions. Default value is None.

  • dst_lasting_years (int) – Alternatively, use alias “ty”. The number of years from “transitionsFrom” for which DST transitions are requested, only applies when “options” = all or “options” = transitions. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "ReferenceUtcTimestamp": "2020-02-20 00:00:00",
    "TimeZones": [
        {
            "Aliases": [
                "str"
            ],
            "Countries": [
                {
                    "Code": "str",
                    "Name": "str"
                }
            ],
            "Id": "str",
            "Names": {
                "Daylight": "str",
                "Generic": "str",
                "ISO6391LanguageCode": "str",
                "Standard": "str"
            },
            "ReferenceTime": {
                "DaylightSavings": "str",
                "PosixTz": "str",
                "PosixTzValidYear": 0,
                "StandardOffset": "str",
                "Sunrise": "2020-02-20 00:00:00",
                "Sunset": "2020-02-20 00:00:00",
                "Tag": "str",
                "WallTime": "str"
            },
            "RepresentativePoint": {
                "Latitude": 0.0,
                "Longitude": 0.0
            },
            "TimeTransitions": [
                {
                    "DaylightSavings": "str",
                    "StandardOffset": "str",
                    "Tag": "str",
                    "UtcEnd": "2020-02-20 00:00:00",
                    "UtcStart": "2020-02-20 00:00:00"
                }
            ]
        }
    ],
    "Version": "str"
}
async get_windows_timezone_ids(format: str = 'json', **kwargs: Any) List[MutableMapping[str, Any]]

Use to get the list of Windows Time Zone IDs.

The Get Windows Time Zones API is an HTTP GET request that returns a full list of Windows Time Zone IDs.

Parameters:

format (str) – Desired format of the response. Only json format is supported. “json” Default value is “json”.

Returns:

list of JSON object

Return type:

list[JSON]

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == [
    {
        "IanaIds": [
            "str"
        ],
        "Territory": "str",
        "WindowsId": "str"
    }
]
send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) Awaitable[AsyncHttpResponse]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client.send_request(request)
<AsyncHttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

Parameters:

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments:

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns:

The response of your network call. Does not do error handling on your response.

Return type:

AsyncHttpResponse

Subpackages