| 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 AsyncRawKeysClient, RawKeysClient |
| 9 |
|
| 10 |
if typing.TYPE_CHECKING: |
| 11 |
from .custom_signing.client import AsyncCustomSigningClient, CustomSigningClient |
| 12 |
from .encryption.client import AsyncEncryptionClient, EncryptionClient |
| 13 |
from .signing.client import AsyncSigningClient, SigningClient |
| 14 |
|
| 15 |
|
| 16 |
class KeysClient: |
| 17 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 18 |
self._raw_client = RawKeysClient(client_wrapper=client_wrapper) |
| 19 |
self._client_wrapper = client_wrapper |
| 20 |
self._custom_signing: typing.Optional[CustomSigningClient] = None |
| 21 |
self._encryption: typing.Optional[EncryptionClient] = None |
| 22 |
self._signing: typing.Optional[SigningClient] = None |
| 23 |
|
| 24 |
@property |
| 25 |
def with_raw_response(self) -> RawKeysClient: |
| 26 |
""" |
| 27 |
Retrieves a raw implementation of this client that returns raw responses. |
| 28 |
|
| 29 |
Returns |
| 30 |
------- |
| 31 |
RawKeysClient |
| 32 |
""" |
| 33 |
return self._raw_client |
| 34 |
|
| 35 |
@property |
| 36 |
def custom_signing(self): |
| 37 |
if self._custom_signing is None: |
| 38 |
from .custom_signing.client import CustomSigningClient |
| 39 |
|
| 40 |
self._custom_signing = CustomSigningClient(client_wrapper=self._client_wrapper) |
| 41 |
return self._custom_signing |
| 42 |
|
| 43 |
@property |
| 44 |
def encryption(self): |
| 45 |
if self._encryption is None: |
| 46 |
from .encryption.client import EncryptionClient |
| 47 |
|
| 48 |
self._encryption = EncryptionClient(client_wrapper=self._client_wrapper) |
| 49 |
return self._encryption |
| 50 |
|
| 51 |
@property |
| 52 |
def signing(self): |
| 53 |
if self._signing is None: |
| 54 |
from .signing.client import SigningClient |
| 55 |
|
| 56 |
self._signing = SigningClient(client_wrapper=self._client_wrapper) |
| 57 |
return self._signing |
| 58 |
|
| 59 |
|
| 60 |
class AsyncKeysClient: |
| 61 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 62 |
self._raw_client = AsyncRawKeysClient(client_wrapper=client_wrapper) |
| 63 |
self._client_wrapper = client_wrapper |
| 64 |
self._custom_signing: typing.Optional[AsyncCustomSigningClient] = None |
| 65 |
self._encryption: typing.Optional[AsyncEncryptionClient] = None |
| 66 |
self._signing: typing.Optional[AsyncSigningClient] = None |
| 67 |
|
| 68 |
@property |
| 69 |
def with_raw_response(self) -> AsyncRawKeysClient: |
| 70 |
""" |
| 71 |
Retrieves a raw implementation of this client that returns raw responses. |
| 72 |
|
| 73 |
Returns |
| 74 |
------- |
| 75 |
AsyncRawKeysClient |
| 76 |
""" |
| 77 |
return self._raw_client |
| 78 |
|
| 79 |
@property |
| 80 |
def custom_signing(self): |
| 81 |
if self._custom_signing is None: |
| 82 |
from .custom_signing.client import AsyncCustomSigningClient |
| 83 |
|
| 84 |
self._custom_signing = AsyncCustomSigningClient(client_wrapper=self._client_wrapper) |
| 85 |
return self._custom_signing |
| 86 |
|
| 87 |
@property |
| 88 |
def encryption(self): |
| 89 |
if self._encryption is None: |
| 90 |
from .encryption.client import AsyncEncryptionClient |
| 91 |
|
| 92 |
self._encryption = AsyncEncryptionClient(client_wrapper=self._client_wrapper) |
| 93 |
return self._encryption |
| 94 |
|
| 95 |
@property |
| 96 |
def signing(self): |
| 97 |
if self._signing is None: |
| 98 |
from .signing.client import AsyncSigningClient |
| 99 |
|
| 100 |
self._signing = AsyncSigningClient(client_wrapper=self._client_wrapper) |
| 101 |
return self._signing |