diff --git a/sdk/maps/azure-maps-timezone/README.md b/sdk/maps/azure-maps-timezone/README.md index 21ef015ce286..63b82ca609bc 100644 --- a/sdk/maps/azure-maps-timezone/README.md +++ b/sdk/maps/azure-maps-timezone/README.md @@ -31,7 +31,7 @@ Install the Azure Maps Service Timezone SDK. pip install azure-maps-timezone ``` -### Create and Authenticate the TimezoneClient +### Create and Authenticate the MapsTimezoneClient To create a client object to access the Azure Maps Timezone API, you will need a **credential** object. Azure Maps Timezone client also support two ways to authenticate. @@ -45,11 +45,11 @@ Then pass an `AZURE_SUBSCRIPTION_KEY` as the `credential` parameter into an inst import os from azure.core.credentials import AzureKeyCredential -from azure.maps.timezone import TimezoneClient +from azure.maps.timezone import MapsTimezoneClient credential = AzureKeyCredential(os.environ.get("AZURE_SUBSCRIPTION_KEY")) -timezone_client = TimezoneClient( +timezone_client = MapsTimezoneClient( credential=credential, ) ``` @@ -74,11 +74,11 @@ You will also need to specify the Azure Maps resource you intend to use by speci ```python import os -from azure.maps.timezone import TimezoneClient +from azure.maps.timezone import MapsTimezoneClient from azure.identity import DefaultAzureCredential credential = DefaultAzureCredential() -timezone_client = TimezoneClient(credential=credential) +timezone_client = MapsTimezoneClient(credential=credential) ``` ## Key concepts @@ -87,8 +87,8 @@ The Azure Maps Timezone client library for Python allows you to interact with ea ### Sync Clients -`TimezoneClient` is the primary client for developers using the Azure Maps Timezone client library for Python. -Once you initialized a `TimezoneClient` class, you can explore the methods on this client object to understand the different features of the Azure Maps Timezone service that you can access. +`MapsTimezoneClient` is the primary client for developers using the Azure Maps Timezone client library for Python. +Once you initialized a `MapsTimezoneClient` class, you can explore the methods on this client object to understand the different features of the Azure Maps Timezone service that you can access. ### Async Clients @@ -121,9 +121,9 @@ subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY", "your subscription key") def get_timezone_by_id(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_timezone_by_id(timezone_id="sr-Latn-RS") print(result) @@ -149,9 +149,9 @@ subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY", "your subscription key") def get_timezone_by_coordinates(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_timezone_by_coordinates(coordinates=[25.0338053, 121.5640089]) print(result) @@ -177,9 +177,9 @@ subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY", "your subscription key") def get_iana_version(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_iana_version() print(result) @@ -205,9 +205,9 @@ subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY", "your subscription key") def get_iana_timezone_ids(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_iana_timezone_ids() print(result) @@ -233,9 +233,9 @@ subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY", "your subscription key") def get_windows_timezone_ids(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_windows_timezone_ids() print(result) @@ -260,9 +260,9 @@ subscription_key = os.getenv("AZURE_SUBSCRIPTION_KEY", "your subscription key") def convert_windows_timezone_to_iana(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.convert_windows_timezone_to_iana(windows_timezone_id="Pacific Standard Time") print(result) diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/__init__.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/__init__.py index 4c26036bca77..ec4b704bbba4 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/__init__.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/__init__.py @@ -14,7 +14,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "TimezoneClient", + "MapsTimezoneClient", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py index def3fd729e95..68c65a317b78 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py @@ -13,7 +13,7 @@ from azure.core.pipeline.policies import AzureKeyCredentialPolicy from ._client import TimezoneClient as TimezoneClientGenerated -__all__: List[str] = ["TimezoneClient"] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ["MapsTimezoneClient"] def patch_sdk(): @@ -43,7 +43,7 @@ def _authentication_policy(credential): # pylint: disable=C4748 -class TimezoneClient(TimezoneClientGenerated): +class MapsTimezoneClient(TimezoneClientGenerated): def __init__( self, credential: Union[AzureKeyCredential, TokenCredential], diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/__init__.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/__init__.py index 4c26036bca77..ec4b704bbba4 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/__init__.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/__init__.py @@ -14,7 +14,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "TimezoneClient", + "MapsTimezoneClient", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py index c8252f3bd9d9..d6b9db84d2a9 100644 --- a/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py +++ b/sdk/maps/azure-maps-timezone/azure/maps/timezone/aio/_patch.py @@ -14,7 +14,7 @@ from azure.core.pipeline.policies import AzureKeyCredentialPolicy from ._client import TimezoneClient as TimezoneClientGenerated -__all__: List[str] = ["TimezoneClient"] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ["MapsTimezoneClient"] def patch_sdk(): @@ -43,7 +43,7 @@ def _authentication_policy(credential): # pylint: disable=C4748 -class TimezoneClient(TimezoneClientGenerated): +class MapsTimezoneClient(TimezoneClientGenerated): def __init__( self, credential: Union[AzureKeyCredential, AsyncTokenCredential], diff --git a/sdk/maps/azure-maps-timezone/samples/async_samples/convert_windows_timezone_to_iana_async.py b/sdk/maps/azure-maps-timezone/samples/async_samples/convert_windows_timezone_to_iana_async.py index ebe57b34bc8f..450a95b9f60d 100644 --- a/sdk/maps/azure-maps-timezone/samples/async_samples/convert_windows_timezone_to_iana_async.py +++ b/sdk/maps/azure-maps-timezone/samples/async_samples/convert_windows_timezone_to_iana_async.py @@ -25,9 +25,9 @@ async def convert_windows_timezone_to_iana_async(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone.aio import TimezoneClient + from azure.maps.timezone.aio import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: async with timezone_client: result = await timezone_client.convert_windows_timezone_to_iana(windows_timezone_id="Pacific Standard Time") diff --git a/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_timezone_ids_async.py b/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_timezone_ids_async.py index f473efbda232..7ed8c43d98d1 100644 --- a/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_timezone_ids_async.py +++ b/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_timezone_ids_async.py @@ -25,9 +25,9 @@ async def get_iana_timezone_ids_async(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone.aio import TimezoneClient + from azure.maps.timezone.aio import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: async with timezone_client: result = await timezone_client.get_iana_timezone_ids() diff --git a/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_version_async.py b/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_version_async.py index d0a8705bbddf..6741ceee5e3e 100644 --- a/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_version_async.py +++ b/sdk/maps/azure-maps-timezone/samples/async_samples/get_iana_version_async.py @@ -25,9 +25,9 @@ async def get_iana_version_async(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone.aio import TimezoneClient + from azure.maps.timezone.aio import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: async with timezone_client: result = await timezone_client.get_iana_version() diff --git a/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_coordinates_async.py b/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_coordinates_async.py index 9b90cfe28e89..7773ae47b167 100644 --- a/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_coordinates_async.py +++ b/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_coordinates_async.py @@ -25,9 +25,9 @@ async def get_timezone_by_coordinates_async(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone.aio import TimezoneClient + from azure.maps.timezone.aio import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: async with timezone_client: result = await timezone_client.get_timezone_by_coordinates(coordinates=[25.0338053, 121.5640089]) diff --git a/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_id_async.py b/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_id_async.py index 28679939225b..89d4f4543b58 100644 --- a/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_id_async.py +++ b/sdk/maps/azure-maps-timezone/samples/async_samples/get_timezone_by_id_async.py @@ -25,9 +25,9 @@ async def get_timezone_by_id_async(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone.aio import TimezoneClient + from azure.maps.timezone.aio import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: async with timezone_client: result = await timezone_client.get_timezone_by_id(timezone_id="sr-Latn-RS") diff --git a/sdk/maps/azure-maps-timezone/samples/async_samples/get_windows_timezone_ids_async.py b/sdk/maps/azure-maps-timezone/samples/async_samples/get_windows_timezone_ids_async.py index adf9187ca396..0bd9d04adca1 100644 --- a/sdk/maps/azure-maps-timezone/samples/async_samples/get_windows_timezone_ids_async.py +++ b/sdk/maps/azure-maps-timezone/samples/async_samples/get_windows_timezone_ids_async.py @@ -25,9 +25,9 @@ async def get_windows_timezone_ids_async(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone.aio import TimezoneClient + from azure.maps.timezone.aio import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: async with timezone_client: result = await timezone_client.get_windows_timezone_ids() diff --git a/sdk/maps/azure-maps-timezone/samples/convert_windows_timezone_to_iana.py b/sdk/maps/azure-maps-timezone/samples/convert_windows_timezone_to_iana.py index 9c1fa832a201..11f7e6d78d8a 100644 --- a/sdk/maps/azure-maps-timezone/samples/convert_windows_timezone_to_iana.py +++ b/sdk/maps/azure-maps-timezone/samples/convert_windows_timezone_to_iana.py @@ -24,9 +24,9 @@ def convert_windows_timezone_to_iana(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.convert_windows_timezone_to_iana(windows_timezone_id="Pacific Standard Time") print(result) diff --git a/sdk/maps/azure-maps-timezone/samples/get_iana_timezone_ids.py b/sdk/maps/azure-maps-timezone/samples/get_iana_timezone_ids.py index c56213eb1e14..bb17ae51404c 100644 --- a/sdk/maps/azure-maps-timezone/samples/get_iana_timezone_ids.py +++ b/sdk/maps/azure-maps-timezone/samples/get_iana_timezone_ids.py @@ -24,9 +24,9 @@ def get_iana_timezone_ids(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_iana_timezone_ids() print(result) diff --git a/sdk/maps/azure-maps-timezone/samples/get_iana_version.py b/sdk/maps/azure-maps-timezone/samples/get_iana_version.py index 4a3d73ba8326..09deb25f6bba 100644 --- a/sdk/maps/azure-maps-timezone/samples/get_iana_version.py +++ b/sdk/maps/azure-maps-timezone/samples/get_iana_version.py @@ -24,9 +24,9 @@ def get_iana_version(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_iana_version() print(result) diff --git a/sdk/maps/azure-maps-timezone/samples/get_timezone_by_coordinates.py b/sdk/maps/azure-maps-timezone/samples/get_timezone_by_coordinates.py index e42d654fd721..66f7aad65cab 100644 --- a/sdk/maps/azure-maps-timezone/samples/get_timezone_by_coordinates.py +++ b/sdk/maps/azure-maps-timezone/samples/get_timezone_by_coordinates.py @@ -24,9 +24,9 @@ def get_timezone_by_coordinates(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_timezone_by_coordinates(coordinates=[25.0338053, 121.5640089]) print(result) diff --git a/sdk/maps/azure-maps-timezone/samples/get_timezone_by_id.py b/sdk/maps/azure-maps-timezone/samples/get_timezone_by_id.py index f50b432c988c..2e463dbee15a 100644 --- a/sdk/maps/azure-maps-timezone/samples/get_timezone_by_id.py +++ b/sdk/maps/azure-maps-timezone/samples/get_timezone_by_id.py @@ -24,9 +24,9 @@ def get_timezone_by_id(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_timezone_by_id(timezone_id="sr-Latn-RS") print(result) diff --git a/sdk/maps/azure-maps-timezone/samples/get_windows_timezone_ids.py b/sdk/maps/azure-maps-timezone/samples/get_windows_timezone_ids.py index da69d8bb2cf6..cb4198f18d82 100644 --- a/sdk/maps/azure-maps-timezone/samples/get_windows_timezone_ids.py +++ b/sdk/maps/azure-maps-timezone/samples/get_windows_timezone_ids.py @@ -24,9 +24,9 @@ def get_windows_timezone_ids(): from azure.core.credentials import AzureKeyCredential - from azure.maps.timezone import TimezoneClient + from azure.maps.timezone import MapsTimezoneClient - timezone_client = TimezoneClient(credential=AzureKeyCredential(subscription_key)) + timezone_client = MapsTimezoneClient(credential=AzureKeyCredential(subscription_key)) try: result = timezone_client.get_windows_timezone_ids() print(result) diff --git a/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client.py b/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client.py index 61359c36dd05..d3512b63f40f 100644 --- a/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client.py +++ b/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client.py @@ -6,7 +6,7 @@ import os from azure.core.credentials import AzureKeyCredential -from azure.maps.timezone import TimezoneClient +from azure.maps.timezone import MapsTimezoneClient from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy, is_live from timezone_preparer import MapsTimezonePreparer @@ -15,7 +15,7 @@ # cSpell:disable class TestMapsTimezoneClient(AzureRecordedTestCase): def setup_method(self, method): - self.client = TimezoneClient( + self.client = MapsTimezoneClient( credential=AzureKeyCredential(os.getenv("AZURE_SUBSCRIPTION_KEY", "AzureSubscriptionKey")) ) assert self.client is not None diff --git a/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client_async.py b/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client_async.py index e6a3adb06222..eedaa048121a 100644 --- a/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client_async.py +++ b/sdk/maps/azure-maps-timezone/tests/test_maps_timezone_client_async.py @@ -6,7 +6,7 @@ import os from azure.core.credentials import AzureKeyCredential -from azure.maps.timezone.aio import TimezoneClient +from azure.maps.timezone.aio import MapsTimezoneClient from devtools_testutils import AzureRecordedTestCase, is_live from devtools_testutils.aio import recorded_by_proxy_async @@ -16,7 +16,7 @@ # cSpell:disable class TestMapsTimezoneClient(AzureRecordedTestCase): def setup_method(self, method): - self.client = TimezoneClient( + self.client = MapsTimezoneClient( credential=AzureKeyCredential(os.getenv("AZURE_SUBSCRIPTION_KEY", "AzureSubscriptionKey")) ) assert self.client is not None