Debian Codegraph @

src/auth0/management/actions/triggers/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.request_options import RequestOptions
9 from ...types.list_action_triggers_response_content import ListActionTriggersResponseContent
10 from .raw_client import AsyncRawTriggersClient, RawTriggersClient
11
12 if typing.TYPE_CHECKING:
13 from .bindings.client import AsyncBindingsClient, BindingsClient
14
15
16 class TriggersClient:
17 def __init__(self, *, client_wrapper: SyncClientWrapper):
18 self._raw_client = RawTriggersClient(client_wrapper=client_wrapper)
19 self._client_wrapper = client_wrapper
20 self._bindings: typing.Optional[BindingsClient] = None
21
22 @property
23 def with_raw_response(self) -> RawTriggersClient:
24 """
25 Retrieves a raw implementation of this client that returns raw responses.
26
27 Returns
28 -------
29 RawTriggersClient
30 """
31 return self._raw_client
32
33 def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListActionTriggersResponseContent:
34 """
35 Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound.
36
37 Parameters
38 ----------
39 request_options : typing.Optional[RequestOptions]
40 Request-specific configuration.
41
42 Returns
43 -------
44 ListActionTriggersResponseContent
45 The triggers were retrieved.
46
47 Examples
48 --------
49 from auth0 import Auth0
50
51 client = Auth0(
52 token="YOUR_TOKEN",
53 )
54 client.actions.triggers.list()
55 """
56 _response = self._raw_client.list(request_options=request_options)
57 return _response.data
58
59 @property
60 def bindings(self):
61 if self._bindings is None:
62 from .bindings.client import BindingsClient # noqa: E402
63
64 self._bindings = BindingsClient(client_wrapper=self._client_wrapper)
65 return self._bindings
66
67
68 class AsyncTriggersClient:
69 def __init__(self, *, client_wrapper: AsyncClientWrapper):
70 self._raw_client = AsyncRawTriggersClient(client_wrapper=client_wrapper)
71 self._client_wrapper = client_wrapper
72 self._bindings: typing.Optional[AsyncBindingsClient] = None
73
74 @property
75 def with_raw_response(self) -> AsyncRawTriggersClient:
76 """
77 Retrieves a raw implementation of this client that returns raw responses.
78
79 Returns
80 -------
81 AsyncRawTriggersClient
82 """
83 return self._raw_client
84
85 async def list(
86 self, *, request_options: typing.Optional[RequestOptions] = None
87 ) -> ListActionTriggersResponseContent:
88 """
89 Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound.
90
91 Parameters
92 ----------
93 request_options : typing.Optional[RequestOptions]
94 Request-specific configuration.
95
96 Returns
97 -------
98 ListActionTriggersResponseContent
99 The triggers were retrieved.
100
101 Examples
102 --------
103 import asyncio
104
105 from auth0 import AsyncAuth0
106
107 client = AsyncAuth0(
108 token="YOUR_TOKEN",
109 )
110
111
112 async def main() -> None:
113 await client.actions.triggers.list()
114
115
116 asyncio.run(main())
117 """
118 _response = await self._raw_client.list(request_options=request_options)
119 return _response.data
120
121 @property
122 def bindings(self):
123 if self._bindings is None:
124 from .bindings.client import AsyncBindingsClient # noqa: E402
125
126 self._bindings = AsyncBindingsClient(client_wrapper=self._client_wrapper)
127 return self._bindings