Debian Codegraph @

src/auth0/management/event_streams/redeliveries/client.py

raw symbols SCIP
1 # This file was auto-generated by Fern from our API Definition.
2
3 import datetime as dt
4 import typing
5
6 from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7 from ...core.request_options import RequestOptions
8 from ...types.create_event_stream_redelivery_response_content import CreateEventStreamRedeliveryResponseContent
9 from ...types.event_stream_delivery_status_enum import EventStreamDeliveryStatusEnum
10 from ...types.event_stream_event_type_enum import EventStreamEventTypeEnum
11 from .raw_client import AsyncRawRedeliveriesClient, RawRedeliveriesClient
12
13 # this is used as the default value for optional parameters
14 OMIT = typing.cast(typing.Any, ...)
15
16
17 class RedeliveriesClient:
18 def __init__(self, *, client_wrapper: SyncClientWrapper):
19 self._raw_client = RawRedeliveriesClient(client_wrapper=client_wrapper)
20
21 @property
22 def with_raw_response(self) -> RawRedeliveriesClient:
23 """
24 Retrieves a raw implementation of this client that returns raw responses.
25
26 Returns
27 -------
28 RawRedeliveriesClient
29 """
30 return self._raw_client
31
32 def create(
33 self,
34 id: str,
35 *,
36 date_from: typing.Optional[dt.datetime] = OMIT,
37 date_to: typing.Optional[dt.datetime] = OMIT,
38 statuses: typing.Optional[typing.Sequence[EventStreamDeliveryStatusEnum]] = OMIT,
39 event_types: typing.Optional[typing.Sequence[EventStreamEventTypeEnum]] = OMIT,
40 request_options: typing.Optional[RequestOptions] = None,
41 ) -> CreateEventStreamRedeliveryResponseContent:
42 """
43 Parameters
44 ----------
45 id : str
46 Unique identifier for the event stream.
47
48 date_from : typing.Optional[dt.datetime]
49 An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision.
50
51 date_to : typing.Optional[dt.datetime]
52 An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision.
53
54 statuses : typing.Optional[typing.Sequence[EventStreamDeliveryStatusEnum]]
55 Filter by status
56
57 event_types : typing.Optional[typing.Sequence[EventStreamEventTypeEnum]]
58 Filter by event type
59
60 request_options : typing.Optional[RequestOptions]
61 Request-specific configuration.
62
63 Returns
64 -------
65 CreateEventStreamRedeliveryResponseContent
66 Redelivery request accepted.
67
68 Examples
69 --------
70 from auth0 import Auth0
71
72 client = Auth0(
73 token="YOUR_TOKEN",
74 )
75 client.event_streams.redeliveries.create(
76 id="id",
77 )
78 """
79 _response = self._raw_client.create(
80 id,
81 date_from=date_from,
82 date_to=date_to,
83 statuses=statuses,
84 event_types=event_types,
85 request_options=request_options,
86 )
87 return _response.data
88
89 def create_by_id(self, id: str, event_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
90 """
91 Parameters
92 ----------
93 id : str
94 Unique identifier for the event stream.
95
96 event_id : str
97 Unique identifier for the event
98
99 request_options : typing.Optional[RequestOptions]
100 Request-specific configuration.
101
102 Returns
103 -------
104 None
105
106 Examples
107 --------
108 from auth0 import Auth0
109
110 client = Auth0(
111 token="YOUR_TOKEN",
112 )
113 client.event_streams.redeliveries.create_by_id(
114 id="id",
115 event_id="event_id",
116 )
117 """
118 _response = self._raw_client.create_by_id(id, event_id, request_options=request_options)
119 return _response.data
120
121
122 class AsyncRedeliveriesClient:
123 def __init__(self, *, client_wrapper: AsyncClientWrapper):
124 self._raw_client = AsyncRawRedeliveriesClient(client_wrapper=client_wrapper)
125
126 @property
127 def with_raw_response(self) -> AsyncRawRedeliveriesClient:
128 """
129 Retrieves a raw implementation of this client that returns raw responses.
130
131 Returns
132 -------
133 AsyncRawRedeliveriesClient
134 """
135 return self._raw_client
136
137 async def create(
138 self,
139 id: str,
140 *,
141 date_from: typing.Optional[dt.datetime] = OMIT,
142 date_to: typing.Optional[dt.datetime] = OMIT,
143 statuses: typing.Optional[typing.Sequence[EventStreamDeliveryStatusEnum]] = OMIT,
144 event_types: typing.Optional[typing.Sequence[EventStreamEventTypeEnum]] = OMIT,
145 request_options: typing.Optional[RequestOptions] = None,
146 ) -> CreateEventStreamRedeliveryResponseContent:
147 """
148 Parameters
149 ----------
150 id : str
151 Unique identifier for the event stream.
152
153 date_from : typing.Optional[dt.datetime]
154 An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision.
155
156 date_to : typing.Optional[dt.datetime]
157 An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision.
158
159 statuses : typing.Optional[typing.Sequence[EventStreamDeliveryStatusEnum]]
160 Filter by status
161
162 event_types : typing.Optional[typing.Sequence[EventStreamEventTypeEnum]]
163 Filter by event type
164
165 request_options : typing.Optional[RequestOptions]
166 Request-specific configuration.
167
168 Returns
169 -------
170 CreateEventStreamRedeliveryResponseContent
171 Redelivery request accepted.
172
173 Examples
174 --------
175 import asyncio
176
177 from auth0 import AsyncAuth0
178
179 client = AsyncAuth0(
180 token="YOUR_TOKEN",
181 )
182
183
184 async def main() -> None:
185 await client.event_streams.redeliveries.create(
186 id="id",
187 )
188
189
190 asyncio.run(main())
191 """
192 _response = await self._raw_client.create(
193 id,
194 date_from=date_from,
195 date_to=date_to,
196 statuses=statuses,
197 event_types=event_types,
198 request_options=request_options,
199 )
200 return _response.data
201
202 async def create_by_id(
203 self, id: str, event_id: str, *, request_options: typing.Optional[RequestOptions] = None
204 ) -> None:
205 """
206 Parameters
207 ----------
208 id : str
209 Unique identifier for the event stream.
210
211 event_id : str
212 Unique identifier for the event
213
214 request_options : typing.Optional[RequestOptions]
215 Request-specific configuration.
216
217 Returns
218 -------
219 None
220
221 Examples
222 --------
223 import asyncio
224
225 from auth0 import AsyncAuth0
226
227 client = AsyncAuth0(
228 token="YOUR_TOKEN",
229 )
230
231
232 async def main() -> None:
233 await client.event_streams.redeliveries.create_by_id(
234 id="id",
235 event_id="event_id",
236 )
237
238
239 asyncio.run(main())
240 """
241 _response = await self._raw_client.create_by_id(id, event_id, request_options=request_options)
242 return _response.data