Debian Codegraph @

src/auth0/management/actions/client.py

raw symbols SCIP
1 # This file was auto-generated by Fern from our API Definition.
2
3 from __future__ import annotations
4
5 import typing
6
7 from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8 from ..core.pagination import AsyncPager, SyncPager
9 from ..core.request_options import RequestOptions
10 from ..types.action import Action
11 from ..types.action_module_reference import ActionModuleReference
12 from ..types.action_secret_request import ActionSecretRequest
13 from ..types.action_trigger import ActionTrigger
14 from ..types.action_trigger_type_enum import ActionTriggerTypeEnum
15 from ..types.action_version_dependency import ActionVersionDependency
16 from ..types.create_action_response_content import CreateActionResponseContent
17 from ..types.deploy_action_response_content import DeployActionResponseContent
18 from ..types.get_action_response_content import GetActionResponseContent
19 from ..types.list_actions_paginated_response_content import ListActionsPaginatedResponseContent
20 from ..types.test_action_payload import TestActionPayload
21 from ..types.test_action_response_content import TestActionResponseContent
22 from ..types.update_action_response_content import UpdateActionResponseContent
23 from .raw_client import AsyncRawActionsClient, RawActionsClient
24
25 if typing.TYPE_CHECKING:
26 from .executions.client import AsyncExecutionsClient, ExecutionsClient
27 from .modules.client import AsyncModulesClient, ModulesClient
28 from .triggers.client import AsyncTriggersClient, TriggersClient
29 from .versions.client import AsyncVersionsClient, VersionsClient
30 # this is used as the default value for optional parameters
31 OMIT = typing.cast(typing.Any, ...)
32
33
34 class ActionsClient:
35 def __init__(self, *, client_wrapper: SyncClientWrapper):
36 self._raw_client = RawActionsClient(client_wrapper=client_wrapper)
37 self._client_wrapper = client_wrapper
38 self._versions: typing.Optional[VersionsClient] = None
39 self._executions: typing.Optional[ExecutionsClient] = None
40 self._modules: typing.Optional[ModulesClient] = None
41 self._triggers: typing.Optional[TriggersClient] = None
42
43 @property
44 def with_raw_response(self) -> RawActionsClient:
45 """
46 Retrieves a raw implementation of this client that returns raw responses.
47
48 Returns
49 -------
50 RawActionsClient
51 """
52 return self._raw_client
53
54 def list(
55 self,
56 *,
57 trigger_id: typing.Optional[ActionTriggerTypeEnum] = None,
58 action_name: typing.Optional[str] = None,
59 deployed: typing.Optional[bool] = None,
60 page: typing.Optional[int] = 0,
61 per_page: typing.Optional[int] = 50,
62 installed: typing.Optional[bool] = None,
63 request_options: typing.Optional[RequestOptions] = None,
64 ) -> SyncPager[Action, ListActionsPaginatedResponseContent]:
65 """
66 Retrieve all actions.
67
68 Parameters
69 ----------
70 trigger_id : typing.Optional[ActionTriggerTypeEnum]
71 An actions extensibility point.
72
73 action_name : typing.Optional[str]
74 The name of the action to retrieve.
75
76 deployed : typing.Optional[bool]
77 Optional filter to only retrieve actions that are deployed.
78
79 page : typing.Optional[int]
80 Use this field to request a specific page of the list results.
81
82 per_page : typing.Optional[int]
83 The maximum number of results to be returned by the server in single response. 20 by default
84
85 installed : typing.Optional[bool]
86 Optional. When true, return only installed actions. When false, return only custom actions. Returns all actions by default.
87
88 request_options : typing.Optional[RequestOptions]
89 Request-specific configuration.
90
91 Returns
92 -------
93 SyncPager[Action, ListActionsPaginatedResponseContent]
94 The actions were retrieved.
95
96 Examples
97 --------
98 from auth0 import Auth0
99
100 client = Auth0(
101 token="YOUR_TOKEN",
102 )
103 response = client.actions.list(
104 trigger_id="post-login",
105 action_name="actionName",
106 deployed=True,
107 page=1,
108 per_page=1,
109 installed=True,
110 )
111 for item in response:
112 yield item
113 # alternatively, you can paginate page-by-page
114 for page in response.iter_pages():
115 yield page
116 """
117 return self._raw_client.list(
118 trigger_id=trigger_id,
119 action_name=action_name,
120 deployed=deployed,
121 page=page,
122 per_page=per_page,
123 installed=installed,
124 request_options=request_options,
125 )
126
127 def create(
128 self,
129 *,
130 name: str,
131 supported_triggers: typing.Sequence[ActionTrigger],
132 code: typing.Optional[str] = OMIT,
133 dependencies: typing.Optional[typing.Sequence[ActionVersionDependency]] = OMIT,
134 runtime: typing.Optional[str] = OMIT,
135 secrets: typing.Optional[typing.Sequence[ActionSecretRequest]] = OMIT,
136 modules: typing.Optional[typing.Sequence[ActionModuleReference]] = OMIT,
137 deploy: typing.Optional[bool] = OMIT,
138 request_options: typing.Optional[RequestOptions] = None,
139 ) -> CreateActionResponseContent:
140 """
141 Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow.
142
143 Parameters
144 ----------
145 name : str
146 The name of an action.
147
148 supported_triggers : typing.Sequence[ActionTrigger]
149 The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.
150
151 code : typing.Optional[str]
152 The source code of the action.
153
154 dependencies : typing.Optional[typing.Sequence[ActionVersionDependency]]
155 The list of third party npm modules, and their versions, that this action depends on.
156
157 runtime : typing.Optional[str]
158 The Node runtime. For example: `node22`, defaults to `node22`
159
160 secrets : typing.Optional[typing.Sequence[ActionSecretRequest]]
161 The list of secrets that are included in an action or a version of an action.
162
163 modules : typing.Optional[typing.Sequence[ActionModuleReference]]
164 The list of action modules and their versions used by this action.
165
166 deploy : typing.Optional[bool]
167 True if the action should be deployed after creation.
168
169 request_options : typing.Optional[RequestOptions]
170 Request-specific configuration.
171
172 Returns
173 -------
174 CreateActionResponseContent
175 Action successfully created.
176
177 Examples
178 --------
179 from auth0 import ActionTrigger, Auth0
180
181 client = Auth0(
182 token="YOUR_TOKEN",
183 )
184 client.actions.create(
185 name="name",
186 supported_triggers=[
187 ActionTrigger(
188 id="post-login",
189 )
190 ],
191 )
192 """
193 _response = self._raw_client.create(
194 name=name,
195 supported_triggers=supported_triggers,
196 code=code,
197 dependencies=dependencies,
198 runtime=runtime,
199 secrets=secrets,
200 modules=modules,
201 deploy=deploy,
202 request_options=request_options,
203 )
204 return _response.data
205
206 def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetActionResponseContent:
207 """
208 Retrieve an action by its ID.
209
210 Parameters
211 ----------
212 id : str
213 The ID of the action to retrieve.
214
215 request_options : typing.Optional[RequestOptions]
216 Request-specific configuration.
217
218 Returns
219 -------
220 GetActionResponseContent
221 The action was retrieved.
222
223 Examples
224 --------
225 from auth0 import Auth0
226
227 client = Auth0(
228 token="YOUR_TOKEN",
229 )
230 client.actions.get(
231 id="id",
232 )
233 """
234 _response = self._raw_client.get(id, request_options=request_options)
235 return _response.data
236
237 def delete(
238 self, id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
239 ) -> None:
240 """
241 Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted.
242
243 Parameters
244 ----------
245 id : str
246 The ID of the action to delete.
247
248 force : typing.Optional[bool]
249 Force action deletion detaching bindings
250
251 request_options : typing.Optional[RequestOptions]
252 Request-specific configuration.
253
254 Returns
255 -------
256 None
257
258 Examples
259 --------
260 from auth0 import Auth0
261
262 client = Auth0(
263 token="YOUR_TOKEN",
264 )
265 client.actions.delete(
266 id="id",
267 force=True,
268 )
269 """
270 _response = self._raw_client.delete(id, force=force, request_options=request_options)
271 return _response.data
272
273 def update(
274 self,
275 id: str,
276 *,
277 name: typing.Optional[str] = OMIT,
278 supported_triggers: typing.Optional[typing.Sequence[ActionTrigger]] = OMIT,
279 code: typing.Optional[str] = OMIT,
280 dependencies: typing.Optional[typing.Sequence[ActionVersionDependency]] = OMIT,
281 runtime: typing.Optional[str] = OMIT,
282 secrets: typing.Optional[typing.Sequence[ActionSecretRequest]] = OMIT,
283 modules: typing.Optional[typing.Sequence[ActionModuleReference]] = OMIT,
284 request_options: typing.Optional[RequestOptions] = None,
285 ) -> UpdateActionResponseContent:
286 """
287 Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed.
288
289 Parameters
290 ----------
291 id : str
292 The id of the action to update.
293
294 name : typing.Optional[str]
295 The name of an action.
296
297 supported_triggers : typing.Optional[typing.Sequence[ActionTrigger]]
298 The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.
299
300 code : typing.Optional[str]
301 The source code of the action.
302
303 dependencies : typing.Optional[typing.Sequence[ActionVersionDependency]]
304 The list of third party npm modules, and their versions, that this action depends on.
305
306 runtime : typing.Optional[str]
307 The Node runtime. For example: `node22`, defaults to `node22`
308
309 secrets : typing.Optional[typing.Sequence[ActionSecretRequest]]
310 The list of secrets that are included in an action or a version of an action.
311
312 modules : typing.Optional[typing.Sequence[ActionModuleReference]]
313 The list of action modules and their versions used by this action.
314
315 request_options : typing.Optional[RequestOptions]
316 Request-specific configuration.
317
318 Returns
319 -------
320 UpdateActionResponseContent
321 Action successfully updated.
322
323 Examples
324 --------
325 from auth0 import Auth0
326
327 client = Auth0(
328 token="YOUR_TOKEN",
329 )
330 client.actions.update(
331 id="id",
332 )
333 """
334 _response = self._raw_client.update(
335 id,
336 name=name,
337 supported_triggers=supported_triggers,
338 code=code,
339 dependencies=dependencies,
340 runtime=runtime,
341 secrets=secrets,
342 modules=modules,
343 request_options=request_options,
344 )
345 return _response.data
346
347 def deploy(
348 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
349 ) -> DeployActionResponseContent:
350 """
351 Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow.
352
353 Parameters
354 ----------
355 id : str
356 The ID of an action.
357
358 request_options : typing.Optional[RequestOptions]
359 Request-specific configuration.
360
361 Returns
362 -------
363 DeployActionResponseContent
364 Request to create action version was accepted.
365
366 Examples
367 --------
368 from auth0 import Auth0
369
370 client = Auth0(
371 token="YOUR_TOKEN",
372 )
373 client.actions.deploy(
374 id="id",
375 )
376 """
377 _response = self._raw_client.deploy(id, request_options=request_options)
378 return _response.data
379
380 def test(
381 self, id: str, *, payload: TestActionPayload, request_options: typing.Optional[RequestOptions] = None
382 ) -> TestActionResponseContent:
383 """
384 Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected.
385
386 Parameters
387 ----------
388 id : str
389 The id of the action to test.
390
391 payload : TestActionPayload
392
393 request_options : typing.Optional[RequestOptions]
394 Request-specific configuration.
395
396 Returns
397 -------
398 TestActionResponseContent
399 Test action version successfully created.
400
401 Examples
402 --------
403 from auth0 import Auth0
404
405 client = Auth0(
406 token="YOUR_TOKEN",
407 )
408 client.actions.test(
409 id="id",
410 payload={"key": "value"},
411 )
412 """
413 _response = self._raw_client.test(id, payload=payload, request_options=request_options)
414 return _response.data
415
416 @property
417 def versions(self):
418 if self._versions is None:
419 from .versions.client import VersionsClient # noqa: E402
420
421 self._versions = VersionsClient(client_wrapper=self._client_wrapper)
422 return self._versions
423
424 @property
425 def executions(self):
426 if self._executions is None:
427 from .executions.client import ExecutionsClient # noqa: E402
428
429 self._executions = ExecutionsClient(client_wrapper=self._client_wrapper)
430 return self._executions
431
432 @property
433 def modules(self):
434 if self._modules is None:
435 from .modules.client import ModulesClient # noqa: E402
436
437 self._modules = ModulesClient(client_wrapper=self._client_wrapper)
438 return self._modules
439
440 @property
441 def triggers(self):
442 if self._triggers is None:
443 from .triggers.client import TriggersClient # noqa: E402
444
445 self._triggers = TriggersClient(client_wrapper=self._client_wrapper)
446 return self._triggers
447
448
449 class AsyncActionsClient:
450 def __init__(self, *, client_wrapper: AsyncClientWrapper):
451 self._raw_client = AsyncRawActionsClient(client_wrapper=client_wrapper)
452 self._client_wrapper = client_wrapper
453 self._versions: typing.Optional[AsyncVersionsClient] = None
454 self._executions: typing.Optional[AsyncExecutionsClient] = None
455 self._modules: typing.Optional[AsyncModulesClient] = None
456 self._triggers: typing.Optional[AsyncTriggersClient] = None
457
458 @property
459 def with_raw_response(self) -> AsyncRawActionsClient:
460 """
461 Retrieves a raw implementation of this client that returns raw responses.
462
463 Returns
464 -------
465 AsyncRawActionsClient
466 """
467 return self._raw_client
468
469 async def list(
470 self,
471 *,
472 trigger_id: typing.Optional[ActionTriggerTypeEnum] = None,
473 action_name: typing.Optional[str] = None,
474 deployed: typing.Optional[bool] = None,
475 page: typing.Optional[int] = 0,
476 per_page: typing.Optional[int] = 50,
477 installed: typing.Optional[bool] = None,
478 request_options: typing.Optional[RequestOptions] = None,
479 ) -> AsyncPager[Action, ListActionsPaginatedResponseContent]:
480 """
481 Retrieve all actions.
482
483 Parameters
484 ----------
485 trigger_id : typing.Optional[ActionTriggerTypeEnum]
486 An actions extensibility point.
487
488 action_name : typing.Optional[str]
489 The name of the action to retrieve.
490
491 deployed : typing.Optional[bool]
492 Optional filter to only retrieve actions that are deployed.
493
494 page : typing.Optional[int]
495 Use this field to request a specific page of the list results.
496
497 per_page : typing.Optional[int]
498 The maximum number of results to be returned by the server in single response. 20 by default
499
500 installed : typing.Optional[bool]
501 Optional. When true, return only installed actions. When false, return only custom actions. Returns all actions by default.
502
503 request_options : typing.Optional[RequestOptions]
504 Request-specific configuration.
505
506 Returns
507 -------
508 AsyncPager[Action, ListActionsPaginatedResponseContent]
509 The actions were retrieved.
510
511 Examples
512 --------
513 import asyncio
514
515 from auth0 import AsyncAuth0
516
517 client = AsyncAuth0(
518 token="YOUR_TOKEN",
519 )
520
521
522 async def main() -> None:
523 response = await client.actions.list(
524 trigger_id="post-login",
525 action_name="actionName",
526 deployed=True,
527 page=1,
528 per_page=1,
529 installed=True,
530 )
531 async for item in response:
532 yield item
533
534 # alternatively, you can paginate page-by-page
535 async for page in response.iter_pages():
536 yield page
537
538
539 asyncio.run(main())
540 """
541 return await self._raw_client.list(
542 trigger_id=trigger_id,
543 action_name=action_name,
544 deployed=deployed,
545 page=page,
546 per_page=per_page,
547 installed=installed,
548 request_options=request_options,
549 )
550
551 async def create(
552 self,
553 *,
554 name: str,
555 supported_triggers: typing.Sequence[ActionTrigger],
556 code: typing.Optional[str] = OMIT,
557 dependencies: typing.Optional[typing.Sequence[ActionVersionDependency]] = OMIT,
558 runtime: typing.Optional[str] = OMIT,
559 secrets: typing.Optional[typing.Sequence[ActionSecretRequest]] = OMIT,
560 modules: typing.Optional[typing.Sequence[ActionModuleReference]] = OMIT,
561 deploy: typing.Optional[bool] = OMIT,
562 request_options: typing.Optional[RequestOptions] = None,
563 ) -> CreateActionResponseContent:
564 """
565 Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow.
566
567 Parameters
568 ----------
569 name : str
570 The name of an action.
571
572 supported_triggers : typing.Sequence[ActionTrigger]
573 The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.
574
575 code : typing.Optional[str]
576 The source code of the action.
577
578 dependencies : typing.Optional[typing.Sequence[ActionVersionDependency]]
579 The list of third party npm modules, and their versions, that this action depends on.
580
581 runtime : typing.Optional[str]
582 The Node runtime. For example: `node22`, defaults to `node22`
583
584 secrets : typing.Optional[typing.Sequence[ActionSecretRequest]]
585 The list of secrets that are included in an action or a version of an action.
586
587 modules : typing.Optional[typing.Sequence[ActionModuleReference]]
588 The list of action modules and their versions used by this action.
589
590 deploy : typing.Optional[bool]
591 True if the action should be deployed after creation.
592
593 request_options : typing.Optional[RequestOptions]
594 Request-specific configuration.
595
596 Returns
597 -------
598 CreateActionResponseContent
599 Action successfully created.
600
601 Examples
602 --------
603 import asyncio
604
605 from auth0 import ActionTrigger, AsyncAuth0
606
607 client = AsyncAuth0(
608 token="YOUR_TOKEN",
609 )
610
611
612 async def main() -> None:
613 await client.actions.create(
614 name="name",
615 supported_triggers=[
616 ActionTrigger(
617 id="post-login",
618 )
619 ],
620 )
621
622
623 asyncio.run(main())
624 """
625 _response = await self._raw_client.create(
626 name=name,
627 supported_triggers=supported_triggers,
628 code=code,
629 dependencies=dependencies,
630 runtime=runtime,
631 secrets=secrets,
632 modules=modules,
633 deploy=deploy,
634 request_options=request_options,
635 )
636 return _response.data
637
638 async def get(
639 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
640 ) -> GetActionResponseContent:
641 """
642 Retrieve an action by its ID.
643
644 Parameters
645 ----------
646 id : str
647 The ID of the action to retrieve.
648
649 request_options : typing.Optional[RequestOptions]
650 Request-specific configuration.
651
652 Returns
653 -------
654 GetActionResponseContent
655 The action was retrieved.
656
657 Examples
658 --------
659 import asyncio
660
661 from auth0 import AsyncAuth0
662
663 client = AsyncAuth0(
664 token="YOUR_TOKEN",
665 )
666
667
668 async def main() -> None:
669 await client.actions.get(
670 id="id",
671 )
672
673
674 asyncio.run(main())
675 """
676 _response = await self._raw_client.get(id, request_options=request_options)
677 return _response.data
678
679 async def delete(
680 self, id: str, *, force: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
681 ) -> None:
682 """
683 Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted.
684
685 Parameters
686 ----------
687 id : str
688 The ID of the action to delete.
689
690 force : typing.Optional[bool]
691 Force action deletion detaching bindings
692
693 request_options : typing.Optional[RequestOptions]
694 Request-specific configuration.
695
696 Returns
697 -------
698 None
699
700 Examples
701 --------
702 import asyncio
703
704 from auth0 import AsyncAuth0
705
706 client = AsyncAuth0(
707 token="YOUR_TOKEN",
708 )
709
710
711 async def main() -> None:
712 await client.actions.delete(
713 id="id",
714 force=True,
715 )
716
717
718 asyncio.run(main())
719 """
720 _response = await self._raw_client.delete(id, force=force, request_options=request_options)
721 return _response.data
722
723 async def update(
724 self,
725 id: str,
726 *,
727 name: typing.Optional[str] = OMIT,
728 supported_triggers: typing.Optional[typing.Sequence[ActionTrigger]] = OMIT,
729 code: typing.Optional[str] = OMIT,
730 dependencies: typing.Optional[typing.Sequence[ActionVersionDependency]] = OMIT,
731 runtime: typing.Optional[str] = OMIT,
732 secrets: typing.Optional[typing.Sequence[ActionSecretRequest]] = OMIT,
733 modules: typing.Optional[typing.Sequence[ActionModuleReference]] = OMIT,
734 request_options: typing.Optional[RequestOptions] = None,
735 ) -> UpdateActionResponseContent:
736 """
737 Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed.
738
739 Parameters
740 ----------
741 id : str
742 The id of the action to update.
743
744 name : typing.Optional[str]
745 The name of an action.
746
747 supported_triggers : typing.Optional[typing.Sequence[ActionTrigger]]
748 The list of triggers that this action supports. At this time, an action can only target a single trigger at a time.
749
750 code : typing.Optional[str]
751 The source code of the action.
752
753 dependencies : typing.Optional[typing.Sequence[ActionVersionDependency]]
754 The list of third party npm modules, and their versions, that this action depends on.
755
756 runtime : typing.Optional[str]
757 The Node runtime. For example: `node22`, defaults to `node22`
758
759 secrets : typing.Optional[typing.Sequence[ActionSecretRequest]]
760 The list of secrets that are included in an action or a version of an action.
761
762 modules : typing.Optional[typing.Sequence[ActionModuleReference]]
763 The list of action modules and their versions used by this action.
764
765 request_options : typing.Optional[RequestOptions]
766 Request-specific configuration.
767
768 Returns
769 -------
770 UpdateActionResponseContent
771 Action successfully updated.
772
773 Examples
774 --------
775 import asyncio
776
777 from auth0 import AsyncAuth0
778
779 client = AsyncAuth0(
780 token="YOUR_TOKEN",
781 )
782
783
784 async def main() -> None:
785 await client.actions.update(
786 id="id",
787 )
788
789
790 asyncio.run(main())
791 """
792 _response = await self._raw_client.update(
793 id,
794 name=name,
795 supported_triggers=supported_triggers,
796 code=code,
797 dependencies=dependencies,
798 runtime=runtime,
799 secrets=secrets,
800 modules=modules,
801 request_options=request_options,
802 )
803 return _response.data
804
805 async def deploy(
806 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
807 ) -> DeployActionResponseContent:
808 """
809 Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow.
810
811 Parameters
812 ----------
813 id : str
814 The ID of an action.
815
816 request_options : typing.Optional[RequestOptions]
817 Request-specific configuration.
818
819 Returns
820 -------
821 DeployActionResponseContent
822 Request to create action version was accepted.
823
824 Examples
825 --------
826 import asyncio
827
828 from auth0 import AsyncAuth0
829
830 client = AsyncAuth0(
831 token="YOUR_TOKEN",
832 )
833
834
835 async def main() -> None:
836 await client.actions.deploy(
837 id="id",
838 )
839
840
841 asyncio.run(main())
842 """
843 _response = await self._raw_client.deploy(id, request_options=request_options)
844 return _response.data
845
846 async def test(
847 self, id: str, *, payload: TestActionPayload, request_options: typing.Optional[RequestOptions] = None
848 ) -> TestActionResponseContent:
849 """
850 Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected.
851
852 Parameters
853 ----------
854 id : str
855 The id of the action to test.
856
857 payload : TestActionPayload
858
859 request_options : typing.Optional[RequestOptions]
860 Request-specific configuration.
861
862 Returns
863 -------
864 TestActionResponseContent
865 Test action version successfully created.
866
867 Examples
868 --------
869 import asyncio
870
871 from auth0 import AsyncAuth0
872
873 client = AsyncAuth0(
874 token="YOUR_TOKEN",
875 )
876
877
878 async def main() -> None:
879 await client.actions.test(
880 id="id",
881 payload={"key": "value"},
882 )
883
884
885 asyncio.run(main())
886 """
887 _response = await self._raw_client.test(id, payload=payload, request_options=request_options)
888 return _response.data
889
890 @property
891 def versions(self):
892 if self._versions is None:
893 from .versions.client import AsyncVersionsClient # noqa: E402
894
895 self._versions = AsyncVersionsClient(client_wrapper=self._client_wrapper)
896 return self._versions
897
898 @property
899 def executions(self):
900 if self._executions is None:
901 from .executions.client import AsyncExecutionsClient # noqa: E402
902
903 self._executions = AsyncExecutionsClient(client_wrapper=self._client_wrapper)
904 return self._executions
905
906 @property
907 def modules(self):
908 if self._modules is None:
909 from .modules.client import AsyncModulesClient # noqa: E402
910
911 self._modules = AsyncModulesClient(client_wrapper=self._client_wrapper)
912 return self._modules
913
914 @property
915 def triggers(self):
916 if self._triggers is None:
917 from .triggers.client import AsyncTriggersClient # noqa: E402
918
919 self._triggers = AsyncTriggersClient(client_wrapper=self._client_wrapper)
920 return self._triggers