Debian Codegraph @

src/auth0/management/prompts/rendering/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.acul_configs import AculConfigs
9 from ...types.acul_context_configuration import AculContextConfiguration
10 from ...types.acul_filters import AculFilters
11 from ...types.acul_head_tag import AculHeadTag
12 from ...types.acul_rendering_mode_enum import AculRenderingModeEnum
13 from ...types.bulk_update_acul_response_content import BulkUpdateAculResponseContent
14 from ...types.get_acul_response_content import GetAculResponseContent
15 from ...types.list_aculs_offset_paginated_response_content import ListAculsOffsetPaginatedResponseContent
16 from ...types.list_aculs_response_content_item import ListAculsResponseContentItem
17 from ...types.prompt_group_name_enum import PromptGroupNameEnum
18 from ...types.screen_group_name_enum import ScreenGroupNameEnum
19 from ...types.update_acul_response_content import UpdateAculResponseContent
20 from .raw_client import AsyncRawRenderingClient, RawRenderingClient
21
22 # this is used as the default value for optional parameters
23 OMIT = typing.cast(typing.Any, ...)
24
25
26 class RenderingClient:
27 def __init__(self, *, client_wrapper: SyncClientWrapper):
28 self._raw_client = RawRenderingClient(client_wrapper=client_wrapper)
29
30 @property
31 def with_raw_response(self) -> RawRenderingClient:
32 """
33 Retrieves a raw implementation of this client that returns raw responses.
34
35 Returns
36 -------
37 RawRenderingClient
38 """
39 return self._raw_client
40
41 def list(
42 self,
43 *,
44 fields: typing.Optional[str] = None,
45 include_fields: typing.Optional[bool] = None,
46 page: typing.Optional[int] = 0,
47 per_page: typing.Optional[int] = 50,
48 include_totals: typing.Optional[bool] = True,
49 prompt: typing.Optional[str] = None,
50 screen: typing.Optional[str] = None,
51 rendering_mode: typing.Optional[AculRenderingModeEnum] = None,
52 request_options: typing.Optional[RequestOptions] = None,
53 ) -> SyncPager[ListAculsResponseContentItem, ListAculsOffsetPaginatedResponseContent]:
54 """
55 Get render setting configurations for all screens.
56
57 Parameters
58 ----------
59 fields : typing.Optional[str]
60 Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
61
62 include_fields : typing.Optional[bool]
63 Whether specified fields are to be included (default: true) or excluded (false).
64
65 page : typing.Optional[int]
66 Page index of the results to return. First page is 0.
67
68 per_page : typing.Optional[int]
69 Number of results per page. Maximum value is 100, default value is 50.
70
71 include_totals : typing.Optional[bool]
72 Return results inside an object that contains the total configuration count (true) or as a direct array of results (false, default).
73
74 prompt : typing.Optional[str]
75 Name of the prompt to filter by
76
77 screen : typing.Optional[str]
78 Name of the screen to filter by
79
80 rendering_mode : typing.Optional[AculRenderingModeEnum]
81 Rendering mode to filter by
82
83 request_options : typing.Optional[RequestOptions]
84 Request-specific configuration.
85
86 Returns
87 -------
88 SyncPager[ListAculsResponseContentItem, ListAculsOffsetPaginatedResponseContent]
89 ACUL settings successfully retrieved.
90
91 Examples
92 --------
93 from auth0 import Auth0
94
95 client = Auth0(
96 token="YOUR_TOKEN",
97 )
98 response = client.prompts.rendering.list(
99 fields="fields",
100 include_fields=True,
101 page=1,
102 per_page=1,
103 include_totals=True,
104 prompt="prompt",
105 screen="screen",
106 rendering_mode="advanced",
107 )
108 for item in response:
109 yield item
110 # alternatively, you can paginate page-by-page
111 for page in response.iter_pages():
112 yield page
113 """
114 return self._raw_client.list(
115 fields=fields,
116 include_fields=include_fields,
117 page=page,
118 per_page=per_page,
119 include_totals=include_totals,
120 prompt=prompt,
121 screen=screen,
122 rendering_mode=rendering_mode,
123 request_options=request_options,
124 )
125
126 def bulk_update(
127 self, *, configs: AculConfigs, request_options: typing.Optional[RequestOptions] = None
128 ) -> BulkUpdateAculResponseContent:
129 """
130 Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
131
132 Parameters
133 ----------
134 configs : AculConfigs
135
136 request_options : typing.Optional[RequestOptions]
137 Request-specific configuration.
138
139 Returns
140 -------
141 BulkUpdateAculResponseContent
142 ACUL settings successfully updated.
143
144 Examples
145 --------
146 from auth0 import AculConfigsItem, Auth0
147
148 client = Auth0(
149 token="YOUR_TOKEN",
150 )
151 client.prompts.rendering.bulk_update(
152 configs=[
153 AculConfigsItem(
154 prompt="login",
155 screen="login",
156 )
157 ],
158 )
159 """
160 _response = self._raw_client.bulk_update(configs=configs, request_options=request_options)
161 return _response.data
162
163 def get(
164 self,
165 prompt: PromptGroupNameEnum,
166 screen: ScreenGroupNameEnum,
167 *,
168 request_options: typing.Optional[RequestOptions] = None,
169 ) -> GetAculResponseContent:
170 """
171 Get render settings for a screen.
172
173 Parameters
174 ----------
175 prompt : PromptGroupNameEnum
176 Name of the prompt
177
178 screen : ScreenGroupNameEnum
179 Name of the screen
180
181 request_options : typing.Optional[RequestOptions]
182 Request-specific configuration.
183
184 Returns
185 -------
186 GetAculResponseContent
187 ACUL settings successfully retrieved.
188
189 Examples
190 --------
191 from auth0 import Auth0
192
193 client = Auth0(
194 token="YOUR_TOKEN",
195 )
196 client.prompts.rendering.get(
197 prompt="login",
198 screen="login",
199 )
200 """
201 _response = self._raw_client.get(prompt, screen, request_options=request_options)
202 return _response.data
203
204 def update(
205 self,
206 prompt: PromptGroupNameEnum,
207 screen: ScreenGroupNameEnum,
208 *,
209 rendering_mode: typing.Optional[AculRenderingModeEnum] = OMIT,
210 context_configuration: typing.Optional[AculContextConfiguration] = OMIT,
211 default_head_tags_disabled: typing.Optional[bool] = OMIT,
212 use_page_template: typing.Optional[bool] = OMIT,
213 head_tags: typing.Optional[typing.Sequence[AculHeadTag]] = OMIT,
214 filters: typing.Optional[AculFilters] = OMIT,
215 request_options: typing.Optional[RequestOptions] = None,
216 ) -> UpdateAculResponseContent:
217 """
218 Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
219
220 Parameters
221 ----------
222 prompt : PromptGroupNameEnum
223 Name of the prompt
224
225 screen : ScreenGroupNameEnum
226 Name of the screen
227
228 rendering_mode : typing.Optional[AculRenderingModeEnum]
229 Rendering mode
230
231 context_configuration : typing.Optional[AculContextConfiguration]
232
233 default_head_tags_disabled : typing.Optional[bool]
234 Override Universal Login default head tags
235
236 use_page_template : typing.Optional[bool]
237 Use page template with ACUL
238
239 head_tags : typing.Optional[typing.Sequence[AculHeadTag]]
240 An array of head tags
241
242 filters : typing.Optional[AculFilters]
243
244 request_options : typing.Optional[RequestOptions]
245 Request-specific configuration.
246
247 Returns
248 -------
249 UpdateAculResponseContent
250 ACUL settings successfully updated.
251
252 Examples
253 --------
254 from auth0 import Auth0
255
256 client = Auth0(
257 token="YOUR_TOKEN",
258 )
259 client.prompts.rendering.update(
260 prompt="login",
261 screen="login",
262 )
263 """
264 _response = self._raw_client.update(
265 prompt,
266 screen,
267 rendering_mode=rendering_mode,
268 context_configuration=context_configuration,
269 default_head_tags_disabled=default_head_tags_disabled,
270 use_page_template=use_page_template,
271 head_tags=head_tags,
272 filters=filters,
273 request_options=request_options,
274 )
275 return _response.data
276
277
278 class AsyncRenderingClient:
279 def __init__(self, *, client_wrapper: AsyncClientWrapper):
280 self._raw_client = AsyncRawRenderingClient(client_wrapper=client_wrapper)
281
282 @property
283 def with_raw_response(self) -> AsyncRawRenderingClient:
284 """
285 Retrieves a raw implementation of this client that returns raw responses.
286
287 Returns
288 -------
289 AsyncRawRenderingClient
290 """
291 return self._raw_client
292
293 async def list(
294 self,
295 *,
296 fields: typing.Optional[str] = None,
297 include_fields: typing.Optional[bool] = None,
298 page: typing.Optional[int] = 0,
299 per_page: typing.Optional[int] = 50,
300 include_totals: typing.Optional[bool] = True,
301 prompt: typing.Optional[str] = None,
302 screen: typing.Optional[str] = None,
303 rendering_mode: typing.Optional[AculRenderingModeEnum] = None,
304 request_options: typing.Optional[RequestOptions] = None,
305 ) -> AsyncPager[ListAculsResponseContentItem, ListAculsOffsetPaginatedResponseContent]:
306 """
307 Get render setting configurations for all screens.
308
309 Parameters
310 ----------
311 fields : typing.Optional[str]
312 Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
313
314 include_fields : typing.Optional[bool]
315 Whether specified fields are to be included (default: true) or excluded (false).
316
317 page : typing.Optional[int]
318 Page index of the results to return. First page is 0.
319
320 per_page : typing.Optional[int]
321 Number of results per page. Maximum value is 100, default value is 50.
322
323 include_totals : typing.Optional[bool]
324 Return results inside an object that contains the total configuration count (true) or as a direct array of results (false, default).
325
326 prompt : typing.Optional[str]
327 Name of the prompt to filter by
328
329 screen : typing.Optional[str]
330 Name of the screen to filter by
331
332 rendering_mode : typing.Optional[AculRenderingModeEnum]
333 Rendering mode to filter by
334
335 request_options : typing.Optional[RequestOptions]
336 Request-specific configuration.
337
338 Returns
339 -------
340 AsyncPager[ListAculsResponseContentItem, ListAculsOffsetPaginatedResponseContent]
341 ACUL settings successfully retrieved.
342
343 Examples
344 --------
345 import asyncio
346
347 from auth0 import AsyncAuth0
348
349 client = AsyncAuth0(
350 token="YOUR_TOKEN",
351 )
352
353
354 async def main() -> None:
355 response = await client.prompts.rendering.list(
356 fields="fields",
357 include_fields=True,
358 page=1,
359 per_page=1,
360 include_totals=True,
361 prompt="prompt",
362 screen="screen",
363 rendering_mode="advanced",
364 )
365 async for item in response:
366 yield item
367
368 # alternatively, you can paginate page-by-page
369 async for page in response.iter_pages():
370 yield page
371
372
373 asyncio.run(main())
374 """
375 return await self._raw_client.list(
376 fields=fields,
377 include_fields=include_fields,
378 page=page,
379 per_page=per_page,
380 include_totals=include_totals,
381 prompt=prompt,
382 screen=screen,
383 rendering_mode=rendering_mode,
384 request_options=request_options,
385 )
386
387 async def bulk_update(
388 self, *, configs: AculConfigs, request_options: typing.Optional[RequestOptions] = None
389 ) -> BulkUpdateAculResponseContent:
390 """
391 Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
392
393 Parameters
394 ----------
395 configs : AculConfigs
396
397 request_options : typing.Optional[RequestOptions]
398 Request-specific configuration.
399
400 Returns
401 -------
402 BulkUpdateAculResponseContent
403 ACUL settings successfully updated.
404
405 Examples
406 --------
407 import asyncio
408
409 from auth0 import AculConfigsItem, AsyncAuth0
410
411 client = AsyncAuth0(
412 token="YOUR_TOKEN",
413 )
414
415
416 async def main() -> None:
417 await client.prompts.rendering.bulk_update(
418 configs=[
419 AculConfigsItem(
420 prompt="login",
421 screen="login",
422 )
423 ],
424 )
425
426
427 asyncio.run(main())
428 """
429 _response = await self._raw_client.bulk_update(configs=configs, request_options=request_options)
430 return _response.data
431
432 async def get(
433 self,
434 prompt: PromptGroupNameEnum,
435 screen: ScreenGroupNameEnum,
436 *,
437 request_options: typing.Optional[RequestOptions] = None,
438 ) -> GetAculResponseContent:
439 """
440 Get render settings for a screen.
441
442 Parameters
443 ----------
444 prompt : PromptGroupNameEnum
445 Name of the prompt
446
447 screen : ScreenGroupNameEnum
448 Name of the screen
449
450 request_options : typing.Optional[RequestOptions]
451 Request-specific configuration.
452
453 Returns
454 -------
455 GetAculResponseContent
456 ACUL settings successfully retrieved.
457
458 Examples
459 --------
460 import asyncio
461
462 from auth0 import AsyncAuth0
463
464 client = AsyncAuth0(
465 token="YOUR_TOKEN",
466 )
467
468
469 async def main() -> None:
470 await client.prompts.rendering.get(
471 prompt="login",
472 screen="login",
473 )
474
475
476 asyncio.run(main())
477 """
478 _response = await self._raw_client.get(prompt, screen, request_options=request_options)
479 return _response.data
480
481 async def update(
482 self,
483 prompt: PromptGroupNameEnum,
484 screen: ScreenGroupNameEnum,
485 *,
486 rendering_mode: typing.Optional[AculRenderingModeEnum] = OMIT,
487 context_configuration: typing.Optional[AculContextConfiguration] = OMIT,
488 default_head_tags_disabled: typing.Optional[bool] = OMIT,
489 use_page_template: typing.Optional[bool] = OMIT,
490 head_tags: typing.Optional[typing.Sequence[AculHeadTag]] = OMIT,
491 filters: typing.Optional[AculFilters] = OMIT,
492 request_options: typing.Optional[RequestOptions] = None,
493 ) -> UpdateAculResponseContent:
494 """
495 Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
496
497 Parameters
498 ----------
499 prompt : PromptGroupNameEnum
500 Name of the prompt
501
502 screen : ScreenGroupNameEnum
503 Name of the screen
504
505 rendering_mode : typing.Optional[AculRenderingModeEnum]
506 Rendering mode
507
508 context_configuration : typing.Optional[AculContextConfiguration]
509
510 default_head_tags_disabled : typing.Optional[bool]
511 Override Universal Login default head tags
512
513 use_page_template : typing.Optional[bool]
514 Use page template with ACUL
515
516 head_tags : typing.Optional[typing.Sequence[AculHeadTag]]
517 An array of head tags
518
519 filters : typing.Optional[AculFilters]
520
521 request_options : typing.Optional[RequestOptions]
522 Request-specific configuration.
523
524 Returns
525 -------
526 UpdateAculResponseContent
527 ACUL settings successfully updated.
528
529 Examples
530 --------
531 import asyncio
532
533 from auth0 import AsyncAuth0
534
535 client = AsyncAuth0(
536 token="YOUR_TOKEN",
537 )
538
539
540 async def main() -> None:
541 await client.prompts.rendering.update(
542 prompt="login",
543 screen="login",
544 )
545
546
547 asyncio.run(main())
548 """
549 _response = await self._raw_client.update(
550 prompt,
551 screen,
552 rendering_mode=rendering_mode,
553 context_configuration=context_configuration,
554 default_head_tags_disabled=default_head_tags_disabled,
555 use_page_template=use_page_template,
556 head_tags=head_tags,
557 filters=filters,
558 request_options=request_options,
559 )
560 return _response.data