Debian Codegraph @

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