Debian Codegraph @

src/auth0/management/flows/executions/client.py

raw symbols SCIP
1 # This file was auto-generated by Fern from our API Definition.
2
3 import typing
4
5 from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6 from ...core.pagination import AsyncPager, SyncPager
7 from ...core.request_options import RequestOptions
8 from ...types.flow_execution_summary import FlowExecutionSummary
9 from ...types.get_flow_execution_request_parameters_hydrate_enum import GetFlowExecutionRequestParametersHydrateEnum
10 from ...types.get_flow_execution_response_content import GetFlowExecutionResponseContent
11 from ...types.list_flow_executions_paginated_response_content import ListFlowExecutionsPaginatedResponseContent
12 from .raw_client import AsyncRawExecutionsClient, RawExecutionsClient
13
14
15 class ExecutionsClient:
16 def __init__(self, *, client_wrapper: SyncClientWrapper):
17 self._raw_client = RawExecutionsClient(client_wrapper=client_wrapper)
18
19 @property
20 def with_raw_response(self) -> RawExecutionsClient:
21 """
22 Retrieves a raw implementation of this client that returns raw responses.
23
24 Returns
25 -------
26 RawExecutionsClient
27 """
28 return self._raw_client
29
30 def list(
31 self,
32 flow_id: str,
33 *,
34 from_: typing.Optional[str] = None,
35 take: typing.Optional[int] = 50,
36 request_options: typing.Optional[RequestOptions] = None,
37 ) -> SyncPager[FlowExecutionSummary, ListFlowExecutionsPaginatedResponseContent]:
38 """
39 Parameters
40 ----------
41 flow_id : str
42 Flow id
43
44 from_ : typing.Optional[str]
45 Optional Id from which to start selection.
46
47 take : typing.Optional[int]
48 Number of results per page. Defaults to 50.
49
50 request_options : typing.Optional[RequestOptions]
51 Request-specific configuration.
52
53 Returns
54 -------
55 SyncPager[FlowExecutionSummary, ListFlowExecutionsPaginatedResponseContent]
56 Flow executions successfully retrieved.
57
58 Examples
59 --------
60 from auth0 import Auth0
61
62 client = Auth0(
63 token="YOUR_TOKEN",
64 )
65 response = client.flows.executions.list(
66 flow_id="flow_id",
67 from_="from",
68 take=1,
69 )
70 for item in response:
71 yield item
72 # alternatively, you can paginate page-by-page
73 for page in response.iter_pages():
74 yield page
75 """
76 return self._raw_client.list(flow_id, from_=from_, take=take, request_options=request_options)
77
78 def get(
79 self,
80 flow_id: str,
81 execution_id: str,
82 *,
83 hydrate: typing.Optional[
84 typing.Union[
85 GetFlowExecutionRequestParametersHydrateEnum,
86 typing.Sequence[GetFlowExecutionRequestParametersHydrateEnum],
87 ]
88 ] = None,
89 request_options: typing.Optional[RequestOptions] = None,
90 ) -> GetFlowExecutionResponseContent:
91 """
92 Parameters
93 ----------
94 flow_id : str
95 Flow id
96
97 execution_id : str
98 Flow execution id
99
100 hydrate : typing.Optional[typing.Union[GetFlowExecutionRequestParametersHydrateEnum, typing.Sequence[GetFlowExecutionRequestParametersHydrateEnum]]]
101 Hydration param
102
103 request_options : typing.Optional[RequestOptions]
104 Request-specific configuration.
105
106 Returns
107 -------
108 GetFlowExecutionResponseContent
109 Flow execution successfully retrieved.
110
111 Examples
112 --------
113 from auth0 import Auth0
114
115 client = Auth0(
116 token="YOUR_TOKEN",
117 )
118 client.flows.executions.get(
119 flow_id="flow_id",
120 execution_id="execution_id",
121 hydrate=["debug"],
122 )
123 """
124 _response = self._raw_client.get(flow_id, execution_id, hydrate=hydrate, request_options=request_options)
125 return _response.data
126
127 def delete(
128 self, flow_id: str, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
129 ) -> None:
130 """
131 Parameters
132 ----------
133 flow_id : str
134 Flows id
135
136 execution_id : str
137 Flow execution identifier
138
139 request_options : typing.Optional[RequestOptions]
140 Request-specific configuration.
141
142 Returns
143 -------
144 None
145
146 Examples
147 --------
148 from auth0 import Auth0
149
150 client = Auth0(
151 token="YOUR_TOKEN",
152 )
153 client.flows.executions.delete(
154 flow_id="flow_id",
155 execution_id="execution_id",
156 )
157 """
158 _response = self._raw_client.delete(flow_id, execution_id, request_options=request_options)
159 return _response.data
160
161
162 class AsyncExecutionsClient:
163 def __init__(self, *, client_wrapper: AsyncClientWrapper):
164 self._raw_client = AsyncRawExecutionsClient(client_wrapper=client_wrapper)
165
166 @property
167 def with_raw_response(self) -> AsyncRawExecutionsClient:
168 """
169 Retrieves a raw implementation of this client that returns raw responses.
170
171 Returns
172 -------
173 AsyncRawExecutionsClient
174 """
175 return self._raw_client
176
177 async def list(
178 self,
179 flow_id: str,
180 *,
181 from_: typing.Optional[str] = None,
182 take: typing.Optional[int] = 50,
183 request_options: typing.Optional[RequestOptions] = None,
184 ) -> AsyncPager[FlowExecutionSummary, ListFlowExecutionsPaginatedResponseContent]:
185 """
186 Parameters
187 ----------
188 flow_id : str
189 Flow id
190
191 from_ : typing.Optional[str]
192 Optional Id from which to start selection.
193
194 take : typing.Optional[int]
195 Number of results per page. Defaults to 50.
196
197 request_options : typing.Optional[RequestOptions]
198 Request-specific configuration.
199
200 Returns
201 -------
202 AsyncPager[FlowExecutionSummary, ListFlowExecutionsPaginatedResponseContent]
203 Flow executions successfully retrieved.
204
205 Examples
206 --------
207 import asyncio
208
209 from auth0 import AsyncAuth0
210
211 client = AsyncAuth0(
212 token="YOUR_TOKEN",
213 )
214
215
216 async def main() -> None:
217 response = await client.flows.executions.list(
218 flow_id="flow_id",
219 from_="from",
220 take=1,
221 )
222 async for item in response:
223 yield item
224
225 # alternatively, you can paginate page-by-page
226 async for page in response.iter_pages():
227 yield page
228
229
230 asyncio.run(main())
231 """
232 return await self._raw_client.list(flow_id, from_=from_, take=take, request_options=request_options)
233
234 async def get(
235 self,
236 flow_id: str,
237 execution_id: str,
238 *,
239 hydrate: typing.Optional[
240 typing.Union[
241 GetFlowExecutionRequestParametersHydrateEnum,
242 typing.Sequence[GetFlowExecutionRequestParametersHydrateEnum],
243 ]
244 ] = None,
245 request_options: typing.Optional[RequestOptions] = None,
246 ) -> GetFlowExecutionResponseContent:
247 """
248 Parameters
249 ----------
250 flow_id : str
251 Flow id
252
253 execution_id : str
254 Flow execution id
255
256 hydrate : typing.Optional[typing.Union[GetFlowExecutionRequestParametersHydrateEnum, typing.Sequence[GetFlowExecutionRequestParametersHydrateEnum]]]
257 Hydration param
258
259 request_options : typing.Optional[RequestOptions]
260 Request-specific configuration.
261
262 Returns
263 -------
264 GetFlowExecutionResponseContent
265 Flow execution successfully retrieved.
266
267 Examples
268 --------
269 import asyncio
270
271 from auth0 import AsyncAuth0
272
273 client = AsyncAuth0(
274 token="YOUR_TOKEN",
275 )
276
277
278 async def main() -> None:
279 await client.flows.executions.get(
280 flow_id="flow_id",
281 execution_id="execution_id",
282 hydrate=["debug"],
283 )
284
285
286 asyncio.run(main())
287 """
288 _response = await self._raw_client.get(flow_id, execution_id, hydrate=hydrate, request_options=request_options)
289 return _response.data
290
291 async def delete(
292 self, flow_id: str, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
293 ) -> None:
294 """
295 Parameters
296 ----------
297 flow_id : str
298 Flows id
299
300 execution_id : str
301 Flow execution identifier
302
303 request_options : typing.Optional[RequestOptions]
304 Request-specific configuration.
305
306 Returns
307 -------
308 None
309
310 Examples
311 --------
312 import asyncio
313
314 from auth0 import AsyncAuth0
315
316 client = AsyncAuth0(
317 token="YOUR_TOKEN",
318 )
319
320
321 async def main() -> None:
322 await client.flows.executions.delete(
323 flow_id="flow_id",
324 execution_id="execution_id",
325 )
326
327
328 asyncio.run(main())
329 """
330 _response = await self._raw_client.delete(flow_id, execution_id, request_options=request_options)
331 return _response.data