Debian Codegraph @

src/auth0/management/branding/themes/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.request_options import RequestOptions
7 from ...types.branding_theme_borders import BrandingThemeBorders
8 from ...types.branding_theme_colors import BrandingThemeColors
9 from ...types.branding_theme_fonts import BrandingThemeFonts
10 from ...types.branding_theme_identifiers import BrandingThemeIdentifiers
11 from ...types.branding_theme_page_background import BrandingThemePageBackground
12 from ...types.branding_theme_widget import BrandingThemeWidget
13 from ...types.create_branding_theme_response_content import CreateBrandingThemeResponseContent
14 from ...types.get_branding_default_theme_response_content import GetBrandingDefaultThemeResponseContent
15 from ...types.get_branding_theme_response_content import GetBrandingThemeResponseContent
16 from ...types.update_branding_theme_response_content import UpdateBrandingThemeResponseContent
17 from .raw_client import AsyncRawThemesClient, RawThemesClient
18
19 # this is used as the default value for optional parameters
20 OMIT = typing.cast(typing.Any, ...)
21
22
23 class ThemesClient:
24 def __init__(self, *, client_wrapper: SyncClientWrapper):
25 self._raw_client = RawThemesClient(client_wrapper=client_wrapper)
26
27 @property
28 def with_raw_response(self) -> RawThemesClient:
29 """
30 Retrieves a raw implementation of this client that returns raw responses.
31
32 Returns
33 -------
34 RawThemesClient
35 """
36 return self._raw_client
37
38 def create(
39 self,
40 *,
41 borders: BrandingThemeBorders,
42 colors: BrandingThemeColors,
43 fonts: BrandingThemeFonts,
44 page_background: BrandingThemePageBackground,
45 widget: BrandingThemeWidget,
46 display_name: typing.Optional[str] = OMIT,
47 identifiers: typing.Optional[BrandingThemeIdentifiers] = OMIT,
48 request_options: typing.Optional[RequestOptions] = None,
49 ) -> CreateBrandingThemeResponseContent:
50 """
51 Create branding theme.
52
53 Parameters
54 ----------
55 borders : BrandingThemeBorders
56
57 colors : BrandingThemeColors
58
59 fonts : BrandingThemeFonts
60
61 page_background : BrandingThemePageBackground
62
63 widget : BrandingThemeWidget
64
65 display_name : typing.Optional[str]
66 Display Name
67
68 identifiers : typing.Optional[BrandingThemeIdentifiers]
69
70 request_options : typing.Optional[RequestOptions]
71 Request-specific configuration.
72
73 Returns
74 -------
75 CreateBrandingThemeResponseContent
76 Branding settings successfully updated.
77
78 Examples
79 --------
80 from auth0 import (
81 Auth0,
82 BrandingThemeBorders,
83 BrandingThemeColors,
84 BrandingThemeFontBodyText,
85 BrandingThemeFontButtonsText,
86 BrandingThemeFontInputLabels,
87 BrandingThemeFontLinks,
88 BrandingThemeFonts,
89 BrandingThemeFontSubtitle,
90 BrandingThemeFontTitle,
91 BrandingThemePageBackground,
92 BrandingThemeWidget,
93 )
94
95 client = Auth0(
96 token="YOUR_TOKEN",
97 )
98 client.branding.themes.create(
99 borders=BrandingThemeBorders(
100 button_border_radius=1.1,
101 button_border_weight=1.1,
102 buttons_style="pill",
103 input_border_radius=1.1,
104 input_border_weight=1.1,
105 inputs_style="pill",
106 show_widget_shadow=True,
107 widget_border_weight=1.1,
108 widget_corner_radius=1.1,
109 ),
110 colors=BrandingThemeColors(
111 body_text="body_text",
112 error="error",
113 header="header",
114 icons="icons",
115 input_background="input_background",
116 input_border="input_border",
117 input_filled_text="input_filled_text",
118 input_labels_placeholders="input_labels_placeholders",
119 links_focused_components="links_focused_components",
120 primary_button="primary_button",
121 primary_button_label="primary_button_label",
122 secondary_button_border="secondary_button_border",
123 secondary_button_label="secondary_button_label",
124 success="success",
125 widget_background="widget_background",
126 widget_border="widget_border",
127 ),
128 fonts=BrandingThemeFonts(
129 body_text=BrandingThemeFontBodyText(
130 bold=True,
131 size=1.1,
132 ),
133 buttons_text=BrandingThemeFontButtonsText(
134 bold=True,
135 size=1.1,
136 ),
137 font_url="font_url",
138 input_labels=BrandingThemeFontInputLabels(
139 bold=True,
140 size=1.1,
141 ),
142 links=BrandingThemeFontLinks(
143 bold=True,
144 size=1.1,
145 ),
146 links_style="normal",
147 reference_text_size=1.1,
148 subtitle=BrandingThemeFontSubtitle(
149 bold=True,
150 size=1.1,
151 ),
152 title=BrandingThemeFontTitle(
153 bold=True,
154 size=1.1,
155 ),
156 ),
157 page_background=BrandingThemePageBackground(
158 background_color="background_color",
159 background_image_url="background_image_url",
160 page_layout="center",
161 ),
162 widget=BrandingThemeWidget(
163 header_text_alignment="center",
164 logo_height=1.1,
165 logo_position="center",
166 logo_url="logo_url",
167 social_buttons_layout="bottom",
168 ),
169 )
170 """
171 _response = self._raw_client.create(
172 borders=borders,
173 colors=colors,
174 fonts=fonts,
175 page_background=page_background,
176 widget=widget,
177 display_name=display_name,
178 identifiers=identifiers,
179 request_options=request_options,
180 )
181 return _response.data
182
183 def get_default(
184 self, *, request_options: typing.Optional[RequestOptions] = None
185 ) -> GetBrandingDefaultThemeResponseContent:
186 """
187 Retrieve default branding theme.
188
189 Parameters
190 ----------
191 request_options : typing.Optional[RequestOptions]
192 Request-specific configuration.
193
194 Returns
195 -------
196 GetBrandingDefaultThemeResponseContent
197 Branding theme successfully retrieved.
198
199 Examples
200 --------
201 from auth0 import Auth0
202
203 client = Auth0(
204 token="YOUR_TOKEN",
205 )
206 client.branding.themes.get_default()
207 """
208 _response = self._raw_client.get_default(request_options=request_options)
209 return _response.data
210
211 def get(
212 self, theme_id: str, *, request_options: typing.Optional[RequestOptions] = None
213 ) -> GetBrandingThemeResponseContent:
214 """
215 Retrieve branding theme.
216
217 Parameters
218 ----------
219 theme_id : str
220 The ID of the theme
221
222 request_options : typing.Optional[RequestOptions]
223 Request-specific configuration.
224
225 Returns
226 -------
227 GetBrandingThemeResponseContent
228 Branding theme successfully retrieved.
229
230 Examples
231 --------
232 from auth0 import Auth0
233
234 client = Auth0(
235 token="YOUR_TOKEN",
236 )
237 client.branding.themes.get(
238 theme_id="themeId",
239 )
240 """
241 _response = self._raw_client.get(theme_id, request_options=request_options)
242 return _response.data
243
244 def delete(self, theme_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
245 """
246 Delete branding theme.
247
248 Parameters
249 ----------
250 theme_id : str
251 The ID of the theme
252
253 request_options : typing.Optional[RequestOptions]
254 Request-specific configuration.
255
256 Returns
257 -------
258 None
259
260 Examples
261 --------
262 from auth0 import Auth0
263
264 client = Auth0(
265 token="YOUR_TOKEN",
266 )
267 client.branding.themes.delete(
268 theme_id="themeId",
269 )
270 """
271 _response = self._raw_client.delete(theme_id, request_options=request_options)
272 return _response.data
273
274 def update(
275 self,
276 theme_id: str,
277 *,
278 borders: BrandingThemeBorders,
279 colors: BrandingThemeColors,
280 fonts: BrandingThemeFonts,
281 page_background: BrandingThemePageBackground,
282 widget: BrandingThemeWidget,
283 display_name: typing.Optional[str] = OMIT,
284 identifiers: typing.Optional[BrandingThemeIdentifiers] = OMIT,
285 request_options: typing.Optional[RequestOptions] = None,
286 ) -> UpdateBrandingThemeResponseContent:
287 """
288 Update branding theme.
289
290 Parameters
291 ----------
292 theme_id : str
293 The ID of the theme
294
295 borders : BrandingThemeBorders
296
297 colors : BrandingThemeColors
298
299 fonts : BrandingThemeFonts
300
301 page_background : BrandingThemePageBackground
302
303 widget : BrandingThemeWidget
304
305 display_name : typing.Optional[str]
306 Display Name
307
308 identifiers : typing.Optional[BrandingThemeIdentifiers]
309
310 request_options : typing.Optional[RequestOptions]
311 Request-specific configuration.
312
313 Returns
314 -------
315 UpdateBrandingThemeResponseContent
316 Branding settings successfully updated.
317
318 Examples
319 --------
320 from auth0 import (
321 Auth0,
322 BrandingThemeBorders,
323 BrandingThemeColors,
324 BrandingThemeFontBodyText,
325 BrandingThemeFontButtonsText,
326 BrandingThemeFontInputLabels,
327 BrandingThemeFontLinks,
328 BrandingThemeFonts,
329 BrandingThemeFontSubtitle,
330 BrandingThemeFontTitle,
331 BrandingThemePageBackground,
332 BrandingThemeWidget,
333 )
334
335 client = Auth0(
336 token="YOUR_TOKEN",
337 )
338 client.branding.themes.update(
339 theme_id="themeId",
340 borders=BrandingThemeBorders(
341 button_border_radius=1.1,
342 button_border_weight=1.1,
343 buttons_style="pill",
344 input_border_radius=1.1,
345 input_border_weight=1.1,
346 inputs_style="pill",
347 show_widget_shadow=True,
348 widget_border_weight=1.1,
349 widget_corner_radius=1.1,
350 ),
351 colors=BrandingThemeColors(
352 body_text="body_text",
353 error="error",
354 header="header",
355 icons="icons",
356 input_background="input_background",
357 input_border="input_border",
358 input_filled_text="input_filled_text",
359 input_labels_placeholders="input_labels_placeholders",
360 links_focused_components="links_focused_components",
361 primary_button="primary_button",
362 primary_button_label="primary_button_label",
363 secondary_button_border="secondary_button_border",
364 secondary_button_label="secondary_button_label",
365 success="success",
366 widget_background="widget_background",
367 widget_border="widget_border",
368 ),
369 fonts=BrandingThemeFonts(
370 body_text=BrandingThemeFontBodyText(
371 bold=True,
372 size=1.1,
373 ),
374 buttons_text=BrandingThemeFontButtonsText(
375 bold=True,
376 size=1.1,
377 ),
378 font_url="font_url",
379 input_labels=BrandingThemeFontInputLabels(
380 bold=True,
381 size=1.1,
382 ),
383 links=BrandingThemeFontLinks(
384 bold=True,
385 size=1.1,
386 ),
387 links_style="normal",
388 reference_text_size=1.1,
389 subtitle=BrandingThemeFontSubtitle(
390 bold=True,
391 size=1.1,
392 ),
393 title=BrandingThemeFontTitle(
394 bold=True,
395 size=1.1,
396 ),
397 ),
398 page_background=BrandingThemePageBackground(
399 background_color="background_color",
400 background_image_url="background_image_url",
401 page_layout="center",
402 ),
403 widget=BrandingThemeWidget(
404 header_text_alignment="center",
405 logo_height=1.1,
406 logo_position="center",
407 logo_url="logo_url",
408 social_buttons_layout="bottom",
409 ),
410 )
411 """
412 _response = self._raw_client.update(
413 theme_id,
414 borders=borders,
415 colors=colors,
416 fonts=fonts,
417 page_background=page_background,
418 widget=widget,
419 display_name=display_name,
420 identifiers=identifiers,
421 request_options=request_options,
422 )
423 return _response.data
424
425
426 class AsyncThemesClient:
427 def __init__(self, *, client_wrapper: AsyncClientWrapper):
428 self._raw_client = AsyncRawThemesClient(client_wrapper=client_wrapper)
429
430 @property
431 def with_raw_response(self) -> AsyncRawThemesClient:
432 """
433 Retrieves a raw implementation of this client that returns raw responses.
434
435 Returns
436 -------
437 AsyncRawThemesClient
438 """
439 return self._raw_client
440
441 async def create(
442 self,
443 *,
444 borders: BrandingThemeBorders,
445 colors: BrandingThemeColors,
446 fonts: BrandingThemeFonts,
447 page_background: BrandingThemePageBackground,
448 widget: BrandingThemeWidget,
449 display_name: typing.Optional[str] = OMIT,
450 identifiers: typing.Optional[BrandingThemeIdentifiers] = OMIT,
451 request_options: typing.Optional[RequestOptions] = None,
452 ) -> CreateBrandingThemeResponseContent:
453 """
454 Create branding theme.
455
456 Parameters
457 ----------
458 borders : BrandingThemeBorders
459
460 colors : BrandingThemeColors
461
462 fonts : BrandingThemeFonts
463
464 page_background : BrandingThemePageBackground
465
466 widget : BrandingThemeWidget
467
468 display_name : typing.Optional[str]
469 Display Name
470
471 identifiers : typing.Optional[BrandingThemeIdentifiers]
472
473 request_options : typing.Optional[RequestOptions]
474 Request-specific configuration.
475
476 Returns
477 -------
478 CreateBrandingThemeResponseContent
479 Branding settings successfully updated.
480
481 Examples
482 --------
483 import asyncio
484
485 from auth0 import (
486 AsyncAuth0,
487 BrandingThemeBorders,
488 BrandingThemeColors,
489 BrandingThemeFontBodyText,
490 BrandingThemeFontButtonsText,
491 BrandingThemeFontInputLabels,
492 BrandingThemeFontLinks,
493 BrandingThemeFonts,
494 BrandingThemeFontSubtitle,
495 BrandingThemeFontTitle,
496 BrandingThemePageBackground,
497 BrandingThemeWidget,
498 )
499
500 client = AsyncAuth0(
501 token="YOUR_TOKEN",
502 )
503
504
505 async def main() -> None:
506 await client.branding.themes.create(
507 borders=BrandingThemeBorders(
508 button_border_radius=1.1,
509 button_border_weight=1.1,
510 buttons_style="pill",
511 input_border_radius=1.1,
512 input_border_weight=1.1,
513 inputs_style="pill",
514 show_widget_shadow=True,
515 widget_border_weight=1.1,
516 widget_corner_radius=1.1,
517 ),
518 colors=BrandingThemeColors(
519 body_text="body_text",
520 error="error",
521 header="header",
522 icons="icons",
523 input_background="input_background",
524 input_border="input_border",
525 input_filled_text="input_filled_text",
526 input_labels_placeholders="input_labels_placeholders",
527 links_focused_components="links_focused_components",
528 primary_button="primary_button",
529 primary_button_label="primary_button_label",
530 secondary_button_border="secondary_button_border",
531 secondary_button_label="secondary_button_label",
532 success="success",
533 widget_background="widget_background",
534 widget_border="widget_border",
535 ),
536 fonts=BrandingThemeFonts(
537 body_text=BrandingThemeFontBodyText(
538 bold=True,
539 size=1.1,
540 ),
541 buttons_text=BrandingThemeFontButtonsText(
542 bold=True,
543 size=1.1,
544 ),
545 font_url="font_url",
546 input_labels=BrandingThemeFontInputLabels(
547 bold=True,
548 size=1.1,
549 ),
550 links=BrandingThemeFontLinks(
551 bold=True,
552 size=1.1,
553 ),
554 links_style="normal",
555 reference_text_size=1.1,
556 subtitle=BrandingThemeFontSubtitle(
557 bold=True,
558 size=1.1,
559 ),
560 title=BrandingThemeFontTitle(
561 bold=True,
562 size=1.1,
563 ),
564 ),
565 page_background=BrandingThemePageBackground(
566 background_color="background_color",
567 background_image_url="background_image_url",
568 page_layout="center",
569 ),
570 widget=BrandingThemeWidget(
571 header_text_alignment="center",
572 logo_height=1.1,
573 logo_position="center",
574 logo_url="logo_url",
575 social_buttons_layout="bottom",
576 ),
577 )
578
579
580 asyncio.run(main())
581 """
582 _response = await self._raw_client.create(
583 borders=borders,
584 colors=colors,
585 fonts=fonts,
586 page_background=page_background,
587 widget=widget,
588 display_name=display_name,
589 identifiers=identifiers,
590 request_options=request_options,
591 )
592 return _response.data
593
594 async def get_default(
595 self, *, request_options: typing.Optional[RequestOptions] = None
596 ) -> GetBrandingDefaultThemeResponseContent:
597 """
598 Retrieve default branding theme.
599
600 Parameters
601 ----------
602 request_options : typing.Optional[RequestOptions]
603 Request-specific configuration.
604
605 Returns
606 -------
607 GetBrandingDefaultThemeResponseContent
608 Branding theme successfully retrieved.
609
610 Examples
611 --------
612 import asyncio
613
614 from auth0 import AsyncAuth0
615
616 client = AsyncAuth0(
617 token="YOUR_TOKEN",
618 )
619
620
621 async def main() -> None:
622 await client.branding.themes.get_default()
623
624
625 asyncio.run(main())
626 """
627 _response = await self._raw_client.get_default(request_options=request_options)
628 return _response.data
629
630 async def get(
631 self, theme_id: str, *, request_options: typing.Optional[RequestOptions] = None
632 ) -> GetBrandingThemeResponseContent:
633 """
634 Retrieve branding theme.
635
636 Parameters
637 ----------
638 theme_id : str
639 The ID of the theme
640
641 request_options : typing.Optional[RequestOptions]
642 Request-specific configuration.
643
644 Returns
645 -------
646 GetBrandingThemeResponseContent
647 Branding theme successfully retrieved.
648
649 Examples
650 --------
651 import asyncio
652
653 from auth0 import AsyncAuth0
654
655 client = AsyncAuth0(
656 token="YOUR_TOKEN",
657 )
658
659
660 async def main() -> None:
661 await client.branding.themes.get(
662 theme_id="themeId",
663 )
664
665
666 asyncio.run(main())
667 """
668 _response = await self._raw_client.get(theme_id, request_options=request_options)
669 return _response.data
670
671 async def delete(self, theme_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
672 """
673 Delete branding theme.
674
675 Parameters
676 ----------
677 theme_id : str
678 The ID of the theme
679
680 request_options : typing.Optional[RequestOptions]
681 Request-specific configuration.
682
683 Returns
684 -------
685 None
686
687 Examples
688 --------
689 import asyncio
690
691 from auth0 import AsyncAuth0
692
693 client = AsyncAuth0(
694 token="YOUR_TOKEN",
695 )
696
697
698 async def main() -> None:
699 await client.branding.themes.delete(
700 theme_id="themeId",
701 )
702
703
704 asyncio.run(main())
705 """
706 _response = await self._raw_client.delete(theme_id, request_options=request_options)
707 return _response.data
708
709 async def update(
710 self,
711 theme_id: str,
712 *,
713 borders: BrandingThemeBorders,
714 colors: BrandingThemeColors,
715 fonts: BrandingThemeFonts,
716 page_background: BrandingThemePageBackground,
717 widget: BrandingThemeWidget,
718 display_name: typing.Optional[str] = OMIT,
719 identifiers: typing.Optional[BrandingThemeIdentifiers] = OMIT,
720 request_options: typing.Optional[RequestOptions] = None,
721 ) -> UpdateBrandingThemeResponseContent:
722 """
723 Update branding theme.
724
725 Parameters
726 ----------
727 theme_id : str
728 The ID of the theme
729
730 borders : BrandingThemeBorders
731
732 colors : BrandingThemeColors
733
734 fonts : BrandingThemeFonts
735
736 page_background : BrandingThemePageBackground
737
738 widget : BrandingThemeWidget
739
740 display_name : typing.Optional[str]
741 Display Name
742
743 identifiers : typing.Optional[BrandingThemeIdentifiers]
744
745 request_options : typing.Optional[RequestOptions]
746 Request-specific configuration.
747
748 Returns
749 -------
750 UpdateBrandingThemeResponseContent
751 Branding settings successfully updated.
752
753 Examples
754 --------
755 import asyncio
756
757 from auth0 import (
758 AsyncAuth0,
759 BrandingThemeBorders,
760 BrandingThemeColors,
761 BrandingThemeFontBodyText,
762 BrandingThemeFontButtonsText,
763 BrandingThemeFontInputLabels,
764 BrandingThemeFontLinks,
765 BrandingThemeFonts,
766 BrandingThemeFontSubtitle,
767 BrandingThemeFontTitle,
768 BrandingThemePageBackground,
769 BrandingThemeWidget,
770 )
771
772 client = AsyncAuth0(
773 token="YOUR_TOKEN",
774 )
775
776
777 async def main() -> None:
778 await client.branding.themes.update(
779 theme_id="themeId",
780 borders=BrandingThemeBorders(
781 button_border_radius=1.1,
782 button_border_weight=1.1,
783 buttons_style="pill",
784 input_border_radius=1.1,
785 input_border_weight=1.1,
786 inputs_style="pill",
787 show_widget_shadow=True,
788 widget_border_weight=1.1,
789 widget_corner_radius=1.1,
790 ),
791 colors=BrandingThemeColors(
792 body_text="body_text",
793 error="error",
794 header="header",
795 icons="icons",
796 input_background="input_background",
797 input_border="input_border",
798 input_filled_text="input_filled_text",
799 input_labels_placeholders="input_labels_placeholders",
800 links_focused_components="links_focused_components",
801 primary_button="primary_button",
802 primary_button_label="primary_button_label",
803 secondary_button_border="secondary_button_border",
804 secondary_button_label="secondary_button_label",
805 success="success",
806 widget_background="widget_background",
807 widget_border="widget_border",
808 ),
809 fonts=BrandingThemeFonts(
810 body_text=BrandingThemeFontBodyText(
811 bold=True,
812 size=1.1,
813 ),
814 buttons_text=BrandingThemeFontButtonsText(
815 bold=True,
816 size=1.1,
817 ),
818 font_url="font_url",
819 input_labels=BrandingThemeFontInputLabels(
820 bold=True,
821 size=1.1,
822 ),
823 links=BrandingThemeFontLinks(
824 bold=True,
825 size=1.1,
826 ),
827 links_style="normal",
828 reference_text_size=1.1,
829 subtitle=BrandingThemeFontSubtitle(
830 bold=True,
831 size=1.1,
832 ),
833 title=BrandingThemeFontTitle(
834 bold=True,
835 size=1.1,
836 ),
837 ),
838 page_background=BrandingThemePageBackground(
839 background_color="background_color",
840 background_image_url="background_image_url",
841 page_layout="center",
842 ),
843 widget=BrandingThemeWidget(
844 header_text_alignment="center",
845 logo_height=1.1,
846 logo_position="center",
847 logo_url="logo_url",
848 social_buttons_layout="bottom",
849 ),
850 )
851
852
853 asyncio.run(main())
854 """
855 _response = await self._raw_client.update(
856 theme_id,
857 borders=borders,
858 colors=colors,
859 fonts=fonts,
860 page_background=page_background,
861 widget=widget,
862 display_name=display_name,
863 identifiers=identifiers,
864 request_options=request_options,
865 )
866 return _response.data