Debian Codegraph @

src/auth0/management/prompts/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.get_settings_response_content import GetSettingsResponseContent
10 from ..types.universal_login_experience_enum import UniversalLoginExperienceEnum
11 from ..types.update_settings_response_content import UpdateSettingsResponseContent
12 from .raw_client import AsyncRawPromptsClient, RawPromptsClient
13
14 if typing.TYPE_CHECKING:
15 from .custom_text.client import AsyncCustomTextClient, CustomTextClient
16 from .partials.client import AsyncPartialsClient, PartialsClient
17 from .rendering.client import AsyncRenderingClient, RenderingClient
18 # this is used as the default value for optional parameters
19 OMIT = typing.cast(typing.Any, ...)
20
21
22 class PromptsClient:
23 def __init__(self, *, client_wrapper: SyncClientWrapper):
24 self._raw_client = RawPromptsClient(client_wrapper=client_wrapper)
25 self._client_wrapper = client_wrapper
26 self._rendering: typing.Optional[RenderingClient] = None
27 self._custom_text: typing.Optional[CustomTextClient] = None
28 self._partials: typing.Optional[PartialsClient] = None
29
30 @property
31 def with_raw_response(self) -> RawPromptsClient:
32 """
33 Retrieves a raw implementation of this client that returns raw responses.
34
35 Returns
36 -------
37 RawPromptsClient
38 """
39 return self._raw_client
40
41 def get_settings(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetSettingsResponseContent:
42 """
43 Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
44
45 Parameters
46 ----------
47 request_options : typing.Optional[RequestOptions]
48 Request-specific configuration.
49
50 Returns
51 -------
52 GetSettingsResponseContent
53 Prompt settings successfully retrieved.
54
55 Examples
56 --------
57 from auth0 import Auth0
58
59 client = Auth0(
60 token="YOUR_TOKEN",
61 )
62 client.prompts.get_settings()
63 """
64 _response = self._raw_client.get_settings(request_options=request_options)
65 return _response.data
66
67 def update_settings(
68 self,
69 *,
70 universal_login_experience: typing.Optional[UniversalLoginExperienceEnum] = OMIT,
71 identifier_first: typing.Optional[bool] = OMIT,
72 webauthn_platform_first_factor: typing.Optional[bool] = OMIT,
73 request_options: typing.Optional[RequestOptions] = None,
74 ) -> UpdateSettingsResponseContent:
75 """
76 Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
77
78 Parameters
79 ----------
80 universal_login_experience : typing.Optional[UniversalLoginExperienceEnum]
81
82 identifier_first : typing.Optional[bool]
83 Whether identifier first is enabled or not
84
85 webauthn_platform_first_factor : typing.Optional[bool]
86 Use WebAuthn with Device Biometrics as the first authentication factor
87
88 request_options : typing.Optional[RequestOptions]
89 Request-specific configuration.
90
91 Returns
92 -------
93 UpdateSettingsResponseContent
94 Prompts settings successfully updated.
95
96 Examples
97 --------
98 from auth0 import Auth0
99
100 client = Auth0(
101 token="YOUR_TOKEN",
102 )
103 client.prompts.update_settings()
104 """
105 _response = self._raw_client.update_settings(
106 universal_login_experience=universal_login_experience,
107 identifier_first=identifier_first,
108 webauthn_platform_first_factor=webauthn_platform_first_factor,
109 request_options=request_options,
110 )
111 return _response.data
112
113 @property
114 def rendering(self):
115 if self._rendering is None:
116 from .rendering.client import RenderingClient # noqa: E402
117
118 self._rendering = RenderingClient(client_wrapper=self._client_wrapper)
119 return self._rendering
120
121 @property
122 def custom_text(self):
123 if self._custom_text is None:
124 from .custom_text.client import CustomTextClient # noqa: E402
125
126 self._custom_text = CustomTextClient(client_wrapper=self._client_wrapper)
127 return self._custom_text
128
129 @property
130 def partials(self):
131 if self._partials is None:
132 from .partials.client import PartialsClient # noqa: E402
133
134 self._partials = PartialsClient(client_wrapper=self._client_wrapper)
135 return self._partials
136
137
138 class AsyncPromptsClient:
139 def __init__(self, *, client_wrapper: AsyncClientWrapper):
140 self._raw_client = AsyncRawPromptsClient(client_wrapper=client_wrapper)
141 self._client_wrapper = client_wrapper
142 self._rendering: typing.Optional[AsyncRenderingClient] = None
143 self._custom_text: typing.Optional[AsyncCustomTextClient] = None
144 self._partials: typing.Optional[AsyncPartialsClient] = None
145
146 @property
147 def with_raw_response(self) -> AsyncRawPromptsClient:
148 """
149 Retrieves a raw implementation of this client that returns raw responses.
150
151 Returns
152 -------
153 AsyncRawPromptsClient
154 """
155 return self._raw_client
156
157 async def get_settings(
158 self, *, request_options: typing.Optional[RequestOptions] = None
159 ) -> GetSettingsResponseContent:
160 """
161 Retrieve details of the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
162
163 Parameters
164 ----------
165 request_options : typing.Optional[RequestOptions]
166 Request-specific configuration.
167
168 Returns
169 -------
170 GetSettingsResponseContent
171 Prompt settings successfully retrieved.
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.prompts.get_settings()
186
187
188 asyncio.run(main())
189 """
190 _response = await self._raw_client.get_settings(request_options=request_options)
191 return _response.data
192
193 async def update_settings(
194 self,
195 *,
196 universal_login_experience: typing.Optional[UniversalLoginExperienceEnum] = OMIT,
197 identifier_first: typing.Optional[bool] = OMIT,
198 webauthn_platform_first_factor: typing.Optional[bool] = OMIT,
199 request_options: typing.Optional[RequestOptions] = None,
200 ) -> UpdateSettingsResponseContent:
201 """
202 Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
203
204 Parameters
205 ----------
206 universal_login_experience : typing.Optional[UniversalLoginExperienceEnum]
207
208 identifier_first : typing.Optional[bool]
209 Whether identifier first is enabled or not
210
211 webauthn_platform_first_factor : typing.Optional[bool]
212 Use WebAuthn with Device Biometrics as the first authentication factor
213
214 request_options : typing.Optional[RequestOptions]
215 Request-specific configuration.
216
217 Returns
218 -------
219 UpdateSettingsResponseContent
220 Prompts settings successfully updated.
221
222 Examples
223 --------
224 import asyncio
225
226 from auth0 import AsyncAuth0
227
228 client = AsyncAuth0(
229 token="YOUR_TOKEN",
230 )
231
232
233 async def main() -> None:
234 await client.prompts.update_settings()
235
236
237 asyncio.run(main())
238 """
239 _response = await self._raw_client.update_settings(
240 universal_login_experience=universal_login_experience,
241 identifier_first=identifier_first,
242 webauthn_platform_first_factor=webauthn_platform_first_factor,
243 request_options=request_options,
244 )
245 return _response.data
246
247 @property
248 def rendering(self):
249 if self._rendering is None:
250 from .rendering.client import AsyncRenderingClient # noqa: E402
251
252 self._rendering = AsyncRenderingClient(client_wrapper=self._client_wrapper)
253 return self._rendering
254
255 @property
256 def custom_text(self):
257 if self._custom_text is None:
258 from .custom_text.client import AsyncCustomTextClient # noqa: E402
259
260 self._custom_text = AsyncCustomTextClient(client_wrapper=self._client_wrapper)
261 return self._custom_text
262
263 @property
264 def partials(self):
265 if self._partials is None:
266 from .partials.client import AsyncPartialsClient # noqa: E402
267
268 self._partials = AsyncPartialsClient(client_wrapper=self._client_wrapper)
269 return self._partials