Repository navigation
Expand file tree
/
Copy pathclient.py
More file actions
101 lines (77 loc) · 3.27 KB
/
Copy pathclient.py
File metadata and controls
101 lines (77 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This file was auto-generated by Fern from our API Definition.
from __future__ import annotations
import typing
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .raw_client import AsyncRawWebhooksClient, RawWebhooksClient
if typing.TYPE_CHECKING:
from .endpoints.client import AsyncEndpointsClient, EndpointsClient
from .events.client import AsyncEventsClient, EventsClient
from .grants.client import AsyncGrantsClient, GrantsClient
class WebhooksClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._raw_client = RawWebhooksClient(client_wrapper=client_wrapper)
self._client_wrapper = client_wrapper
self._endpoints: typing.Optional[EndpointsClient] = None
self._events: typing.Optional[EventsClient] = None
self._grants: typing.Optional[GrantsClient] = None
@property
def with_raw_response(self) -> RawWebhooksClient:
"""
Retrieves a raw implementation of this client that returns raw responses.
Returns
-------
RawWebhooksClient
"""
return self._raw_client
@property
def endpoints(self):
if self._endpoints is None:
from .endpoints.client import EndpointsClient # noqa: E402
self._endpoints = EndpointsClient(client_wrapper=self._client_wrapper)
return self._endpoints
@property
def events(self):
if self._events is None:
from .events.client import EventsClient # noqa: E402
self._events = EventsClient(client_wrapper=self._client_wrapper)
return self._events
@property
def grants(self):
if self._grants is None:
from .grants.client import GrantsClient # noqa: E402
self._grants = GrantsClient(client_wrapper=self._client_wrapper)
return self._grants
class AsyncWebhooksClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._raw_client = AsyncRawWebhooksClient(client_wrapper=client_wrapper)
self._client_wrapper = client_wrapper
self._endpoints: typing.Optional[AsyncEndpointsClient] = None
self._events: typing.Optional[AsyncEventsClient] = None
self._grants: typing.Optional[AsyncGrantsClient] = None
@property
def with_raw_response(self) -> AsyncRawWebhooksClient:
"""
Retrieves a raw implementation of this client that returns raw responses.
Returns
-------
AsyncRawWebhooksClient
"""
return self._raw_client
@property
def endpoints(self):
if self._endpoints is None:
from .endpoints.client import AsyncEndpointsClient # noqa: E402
self._endpoints = AsyncEndpointsClient(client_wrapper=self._client_wrapper)
return self._endpoints
@property
def events(self):
if self._events is None:
from .events.client import AsyncEventsClient # noqa: E402
self._events = AsyncEventsClient(client_wrapper=self._client_wrapper)
return self._events
@property
def grants(self):
if self._grants is None:
from .grants.client import AsyncGrantsClient # noqa: E402
self._grants = AsyncGrantsClient(client_wrapper=self._client_wrapper)
return self._grants