| 1 |
|
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
import typing |
| 6 |
|
| 7 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 8 |
from .raw_client import AsyncRawPhoneClient, RawPhoneClient |
| 9 |
|
| 10 |
if typing.TYPE_CHECKING: |
| 11 |
from .providers.client import AsyncProvidersClient, ProvidersClient |
| 12 |
from .templates.client import AsyncTemplatesClient, TemplatesClient |
| 13 |
|
| 14 |
|
| 15 |
class PhoneClient: |
| 16 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 17 |
self._raw_client = RawPhoneClient(client_wrapper=client_wrapper) |
| 18 |
self._client_wrapper = client_wrapper |
| 19 |
self._providers: typing.Optional[ProvidersClient] = None |
| 20 |
self._templates: typing.Optional[TemplatesClient] = None |
| 21 |
|
| 22 |
@property |
| 23 |
def with_raw_response(self) -> RawPhoneClient: |
| 24 |
""" |
| 25 |
Retrieves a raw implementation of this client that returns raw responses. |
| 26 |
|
| 27 |
Returns |
| 28 |
------- |
| 29 |
RawPhoneClient |
| 30 |
""" |
| 31 |
return self._raw_client |
| 32 |
|
| 33 |
@property |
| 34 |
def providers(self): |
| 35 |
if self._providers is None: |
| 36 |
from .providers.client import ProvidersClient |
| 37 |
|
| 38 |
self._providers = ProvidersClient(client_wrapper=self._client_wrapper) |
| 39 |
return self._providers |
| 40 |
|
| 41 |
@property |
| 42 |
def templates(self): |
| 43 |
if self._templates is None: |
| 44 |
from .templates.client import TemplatesClient |
| 45 |
|
| 46 |
self._templates = TemplatesClient(client_wrapper=self._client_wrapper) |
| 47 |
return self._templates |
| 48 |
|
| 49 |
|
| 50 |
class AsyncPhoneClient: |
| 51 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 52 |
self._raw_client = AsyncRawPhoneClient(client_wrapper=client_wrapper) |
| 53 |
self._client_wrapper = client_wrapper |
| 54 |
self._providers: typing.Optional[AsyncProvidersClient] = None |
| 55 |
self._templates: typing.Optional[AsyncTemplatesClient] = None |
| 56 |
|
| 57 |
@property |
| 58 |
def with_raw_response(self) -> AsyncRawPhoneClient: |
| 59 |
""" |
| 60 |
Retrieves a raw implementation of this client that returns raw responses. |
| 61 |
|
| 62 |
Returns |
| 63 |
------- |
| 64 |
AsyncRawPhoneClient |
| 65 |
""" |
| 66 |
return self._raw_client |
| 67 |
|
| 68 |
@property |
| 69 |
def providers(self): |
| 70 |
if self._providers is None: |
| 71 |
from .providers.client import AsyncProvidersClient |
| 72 |
|
| 73 |
self._providers = AsyncProvidersClient(client_wrapper=self._client_wrapper) |
| 74 |
return self._providers |
| 75 |
|
| 76 |
@property |
| 77 |
def templates(self): |
| 78 |
if self._templates is None: |
| 79 |
from .templates.client import AsyncTemplatesClient |
| 80 |
|
| 81 |
self._templates = AsyncTemplatesClient(client_wrapper=self._client_wrapper) |
| 82 |
return self._templates |