| 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 AsyncRawAnomalyClient, RawAnomalyClient |
| 9 |
|
| 10 |
if typing.TYPE_CHECKING: |
| 11 |
from .blocks.client import AsyncBlocksClient, BlocksClient |
| 12 |
|
| 13 |
|
| 14 |
class AnomalyClient: |
| 15 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 16 |
self._raw_client = RawAnomalyClient(client_wrapper=client_wrapper) |
| 17 |
self._client_wrapper = client_wrapper |
| 18 |
self._blocks: typing.Optional[BlocksClient] = None |
| 19 |
|
| 20 |
@property |
| 21 |
def with_raw_response(self) -> RawAnomalyClient: |
| 22 |
""" |
| 23 |
Retrieves a raw implementation of this client that returns raw responses. |
| 24 |
|
| 25 |
Returns |
| 26 |
------- |
| 27 |
RawAnomalyClient |
| 28 |
""" |
| 29 |
return self._raw_client |
| 30 |
|
| 31 |
@property |
| 32 |
def blocks(self): |
| 33 |
if self._blocks is None: |
| 34 |
from .blocks.client import BlocksClient |
| 35 |
|
| 36 |
self._blocks = BlocksClient(client_wrapper=self._client_wrapper) |
| 37 |
return self._blocks |
| 38 |
|
| 39 |
|
| 40 |
class AsyncAnomalyClient: |
| 41 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 42 |
self._raw_client = AsyncRawAnomalyClient(client_wrapper=client_wrapper) |
| 43 |
self._client_wrapper = client_wrapper |
| 44 |
self._blocks: typing.Optional[AsyncBlocksClient] = None |
| 45 |
|
| 46 |
@property |
| 47 |
def with_raw_response(self) -> AsyncRawAnomalyClient: |
| 48 |
""" |
| 49 |
Retrieves a raw implementation of this client that returns raw responses. |
| 50 |
|
| 51 |
Returns |
| 52 |
------- |
| 53 |
AsyncRawAnomalyClient |
| 54 |
""" |
| 55 |
return self._raw_client |
| 56 |
|
| 57 |
@property |
| 58 |
def blocks(self): |
| 59 |
if self._blocks is None: |
| 60 |
from .blocks.client import AsyncBlocksClient |
| 61 |
|
| 62 |
self._blocks = AsyncBlocksClient(client_wrapper=self._client_wrapper) |
| 63 |
return self._blocks |