Skip to content

Commit

Permalink
Rename TimezoneClient to MapsTimezoneClient (#36775)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakicar95 authored Aug 6, 2024
1 parent 842376a commit b559f93
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 53 deletions.
38 changes: 19 additions & 19 deletions sdk/maps/azure-maps-timezone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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,
)
```
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__])

Expand Down
4 changes: 2 additions & 2 deletions sdk/maps/azure-maps-timezone/azure/maps/timezone/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -43,7 +43,7 @@ def _authentication_policy(credential):


# pylint: disable=C4748
class TimezoneClient(TimezoneClientGenerated):
class MapsTimezoneClient(TimezoneClientGenerated):
def __init__(
self,
credential: Union[AzureKeyCredential, TokenCredential],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -43,7 +43,7 @@ def _authentication_policy(credential):


# pylint: disable=C4748
class TimezoneClient(TimezoneClientGenerated):
class MapsTimezoneClient(TimezoneClientGenerated):
def __init__(
self,
credential: Union[AzureKeyCredential, AsyncTokenCredential],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions sdk/maps/azure-maps-timezone/samples/get_iana_timezone_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions sdk/maps/azure-maps-timezone/samples/get_iana_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions sdk/maps/azure-maps-timezone/samples/get_timezone_by_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit b559f93

Please sign in to comment.