Debian Codegraph @

src/auth0/management/supplemental_signals/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.get_supplemental_signals_response_content import GetSupplementalSignalsResponseContent
8 from ..types.patch_supplemental_signals_response_content import PatchSupplementalSignalsResponseContent
9 from .raw_client import AsyncRawSupplementalSignalsClient, RawSupplementalSignalsClient
10
11 # this is used as the default value for optional parameters
12 OMIT = typing.cast(typing.Any, ...)
13
14
15 class SupplementalSignalsClient:
16 def __init__(self, *, client_wrapper: SyncClientWrapper):
17 self._raw_client = RawSupplementalSignalsClient(client_wrapper=client_wrapper)
18
19 @property
20 def with_raw_response(self) -> RawSupplementalSignalsClient:
21 """
22 Retrieves a raw implementation of this client that returns raw responses.
23
24 Returns
25 -------
26 RawSupplementalSignalsClient
27 """
28 return self._raw_client
29
30 def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetSupplementalSignalsResponseContent:
31 """
32 Get the supplemental signals configuration for a tenant.
33
34 Parameters
35 ----------
36 request_options : typing.Optional[RequestOptions]
37 Request-specific configuration.
38
39 Returns
40 -------
41 GetSupplementalSignalsResponseContent
42 Supplemental Signals configuration successfully retrieved.
43
44 Examples
45 --------
46 from auth0 import Auth0
47
48 client = Auth0(
49 token="YOUR_TOKEN",
50 )
51 client.supplemental_signals.get()
52 """
53 _response = self._raw_client.get(request_options=request_options)
54 return _response.data
55
56 def patch(
57 self, *, akamai_enabled: bool, request_options: typing.Optional[RequestOptions] = None
58 ) -> PatchSupplementalSignalsResponseContent:
59 """
60 Update the supplemental signals configuration for a tenant.
61
62 Parameters
63 ----------
64 akamai_enabled : bool
65 Indicates if incoming Akamai Headers should be processed
66
67 request_options : typing.Optional[RequestOptions]
68 Request-specific configuration.
69
70 Returns
71 -------
72 PatchSupplementalSignalsResponseContent
73 Supplemental Signals configuration successfully updated.
74
75 Examples
76 --------
77 from auth0 import Auth0
78
79 client = Auth0(
80 token="YOUR_TOKEN",
81 )
82 client.supplemental_signals.patch(
83 akamai_enabled=True,
84 )
85 """
86 _response = self._raw_client.patch(akamai_enabled=akamai_enabled, request_options=request_options)
87 return _response.data
88
89
90 class AsyncSupplementalSignalsClient:
91 def __init__(self, *, client_wrapper: AsyncClientWrapper):
92 self._raw_client = AsyncRawSupplementalSignalsClient(client_wrapper=client_wrapper)
93
94 @property
95 def with_raw_response(self) -> AsyncRawSupplementalSignalsClient:
96 """
97 Retrieves a raw implementation of this client that returns raw responses.
98
99 Returns
100 -------
101 AsyncRawSupplementalSignalsClient
102 """
103 return self._raw_client
104
105 async def get(
106 self, *, request_options: typing.Optional[RequestOptions] = None
107 ) -> GetSupplementalSignalsResponseContent:
108 """
109 Get the supplemental signals configuration for a tenant.
110
111 Parameters
112 ----------
113 request_options : typing.Optional[RequestOptions]
114 Request-specific configuration.
115
116 Returns
117 -------
118 GetSupplementalSignalsResponseContent
119 Supplemental Signals configuration successfully retrieved.
120
121 Examples
122 --------
123 import asyncio
124
125 from auth0 import AsyncAuth0
126
127 client = AsyncAuth0(
128 token="YOUR_TOKEN",
129 )
130
131
132 async def main() -> None:
133 await client.supplemental_signals.get()
134
135
136 asyncio.run(main())
137 """
138 _response = await self._raw_client.get(request_options=request_options)
139 return _response.data
140
141 async def patch(
142 self, *, akamai_enabled: bool, request_options: typing.Optional[RequestOptions] = None
143 ) -> PatchSupplementalSignalsResponseContent:
144 """
145 Update the supplemental signals configuration for a tenant.
146
147 Parameters
148 ----------
149 akamai_enabled : bool
150 Indicates if incoming Akamai Headers should be processed
151
152 request_options : typing.Optional[RequestOptions]
153 Request-specific configuration.
154
155 Returns
156 -------
157 PatchSupplementalSignalsResponseContent
158 Supplemental Signals configuration successfully updated.
159
160 Examples
161 --------
162 import asyncio
163
164 from auth0 import AsyncAuth0
165
166 client = AsyncAuth0(
167 token="YOUR_TOKEN",
168 )
169
170
171 async def main() -> None:
172 await client.supplemental_signals.patch(
173 akamai_enabled=True,
174 )
175
176
177 asyncio.run(main())
178 """
179 _response = await self._raw_client.patch(akamai_enabled=akamai_enabled, request_options=request_options)
180 return _response.data