| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 |
from .....core.request_options import RequestOptions |
| 7 |
from .....types.get_guardian_factor_duo_settings_response_content import GetGuardianFactorDuoSettingsResponseContent |
| 8 |
from .....types.set_guardian_factor_duo_settings_response_content import SetGuardianFactorDuoSettingsResponseContent |
| 9 |
from .....types.update_guardian_factor_duo_settings_response_content import ( |
| 10 |
UpdateGuardianFactorDuoSettingsResponseContent, |
| 11 |
) |
| 12 |
from .raw_client import AsyncRawSettingsClient, RawSettingsClient |
| 13 |
|
| 14 |
|
| 15 |
OMIT = typing.cast(typing.Any, ...) |
| 16 |
|
| 17 |
|
| 18 |
class SettingsClient: |
| 19 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 20 |
self._raw_client = RawSettingsClient(client_wrapper=client_wrapper) |
| 21 |
|
| 22 |
@property |
| 23 |
def with_raw_response(self) -> RawSettingsClient: |
| 24 |
""" |
| 25 |
Retrieves a raw implementation of this client that returns raw responses. |
| 26 |
|
| 27 |
Returns |
| 28 |
------- |
| 29 |
RawSettingsClient |
| 30 |
""" |
| 31 |
return self._raw_client |
| 32 |
|
| 33 |
def get( |
| 34 |
self, *, request_options: typing.Optional[RequestOptions] = None |
| 35 |
) -> GetGuardianFactorDuoSettingsResponseContent: |
| 36 |
""" |
| 37 |
Retrieves the DUO account and factor configuration. |
| 38 |
|
| 39 |
Parameters |
| 40 |
---------- |
| 41 |
request_options : typing.Optional[RequestOptions] |
| 42 |
Request-specific configuration. |
| 43 |
|
| 44 |
Returns |
| 45 |
------- |
| 46 |
GetGuardianFactorDuoSettingsResponseContent |
| 47 |
DUO settings successfully retrieved. |
| 48 |
|
| 49 |
Examples |
| 50 |
-------- |
| 51 |
from auth0 import Auth0 |
| 52 |
|
| 53 |
client = Auth0( |
| 54 |
token="YOUR_TOKEN", |
| 55 |
) |
| 56 |
client.guardian.factors.duo.settings.get() |
| 57 |
""" |
| 58 |
_response = self._raw_client.get(request_options=request_options) |
| 59 |
return _response.data |
| 60 |
|
| 61 |
def set( |
| 62 |
self, |
| 63 |
*, |
| 64 |
ikey: typing.Optional[str] = OMIT, |
| 65 |
skey: typing.Optional[str] = OMIT, |
| 66 |
host: typing.Optional[str] = OMIT, |
| 67 |
request_options: typing.Optional[RequestOptions] = None, |
| 68 |
) -> SetGuardianFactorDuoSettingsResponseContent: |
| 69 |
""" |
| 70 |
Set the DUO account configuration and other properties specific to this factor. |
| 71 |
|
| 72 |
Parameters |
| 73 |
---------- |
| 74 |
ikey : typing.Optional[str] |
| 75 |
|
| 76 |
skey : typing.Optional[str] |
| 77 |
|
| 78 |
host : typing.Optional[str] |
| 79 |
|
| 80 |
request_options : typing.Optional[RequestOptions] |
| 81 |
Request-specific configuration. |
| 82 |
|
| 83 |
Returns |
| 84 |
------- |
| 85 |
SetGuardianFactorDuoSettingsResponseContent |
| 86 |
DUO settings successfully updated. |
| 87 |
|
| 88 |
Examples |
| 89 |
-------- |
| 90 |
from auth0 import Auth0 |
| 91 |
|
| 92 |
client = Auth0( |
| 93 |
token="YOUR_TOKEN", |
| 94 |
) |
| 95 |
client.guardian.factors.duo.settings.set() |
| 96 |
""" |
| 97 |
_response = self._raw_client.set(ikey=ikey, skey=skey, host=host, request_options=request_options) |
| 98 |
return _response.data |
| 99 |
|
| 100 |
def update( |
| 101 |
self, |
| 102 |
*, |
| 103 |
ikey: typing.Optional[str] = OMIT, |
| 104 |
skey: typing.Optional[str] = OMIT, |
| 105 |
host: typing.Optional[str] = OMIT, |
| 106 |
request_options: typing.Optional[RequestOptions] = None, |
| 107 |
) -> UpdateGuardianFactorDuoSettingsResponseContent: |
| 108 |
""" |
| 109 |
Parameters |
| 110 |
---------- |
| 111 |
ikey : typing.Optional[str] |
| 112 |
|
| 113 |
skey : typing.Optional[str] |
| 114 |
|
| 115 |
host : typing.Optional[str] |
| 116 |
|
| 117 |
request_options : typing.Optional[RequestOptions] |
| 118 |
Request-specific configuration. |
| 119 |
|
| 120 |
Returns |
| 121 |
------- |
| 122 |
UpdateGuardianFactorDuoSettingsResponseContent |
| 123 |
DUO settings successfully updated. |
| 124 |
|
| 125 |
Examples |
| 126 |
-------- |
| 127 |
from auth0 import Auth0 |
| 128 |
|
| 129 |
client = Auth0( |
| 130 |
token="YOUR_TOKEN", |
| 131 |
) |
| 132 |
client.guardian.factors.duo.settings.update() |
| 133 |
""" |
| 134 |
_response = self._raw_client.update(ikey=ikey, skey=skey, host=host, request_options=request_options) |
| 135 |
return _response.data |
| 136 |
|
| 137 |
|
| 138 |
class AsyncSettingsClient: |
| 139 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 140 |
self._raw_client = AsyncRawSettingsClient(client_wrapper=client_wrapper) |
| 141 |
|
| 142 |
@property |
| 143 |
def with_raw_response(self) -> AsyncRawSettingsClient: |
| 144 |
""" |
| 145 |
Retrieves a raw implementation of this client that returns raw responses. |
| 146 |
|
| 147 |
Returns |
| 148 |
------- |
| 149 |
AsyncRawSettingsClient |
| 150 |
""" |
| 151 |
return self._raw_client |
| 152 |
|
| 153 |
async def get( |
| 154 |
self, *, request_options: typing.Optional[RequestOptions] = None |
| 155 |
) -> GetGuardianFactorDuoSettingsResponseContent: |
| 156 |
""" |
| 157 |
Retrieves the DUO account and factor configuration. |
| 158 |
|
| 159 |
Parameters |
| 160 |
---------- |
| 161 |
request_options : typing.Optional[RequestOptions] |
| 162 |
Request-specific configuration. |
| 163 |
|
| 164 |
Returns |
| 165 |
------- |
| 166 |
GetGuardianFactorDuoSettingsResponseContent |
| 167 |
DUO settings successfully retrieved. |
| 168 |
|
| 169 |
Examples |
| 170 |
-------- |
| 171 |
import asyncio |
| 172 |
|
| 173 |
from auth0 import AsyncAuth0 |
| 174 |
|
| 175 |
client = AsyncAuth0( |
| 176 |
token="YOUR_TOKEN", |
| 177 |
) |
| 178 |
|
| 179 |
|
| 180 |
async def main() -> None: |
| 181 |
await client.guardian.factors.duo.settings.get() |
| 182 |
|
| 183 |
|
| 184 |
asyncio.run(main()) |
| 185 |
""" |
| 186 |
_response = await self._raw_client.get(request_options=request_options) |
| 187 |
return _response.data |
| 188 |
|
| 189 |
async def set( |
| 190 |
self, |
| 191 |
*, |
| 192 |
ikey: typing.Optional[str] = OMIT, |
| 193 |
skey: typing.Optional[str] = OMIT, |
| 194 |
host: typing.Optional[str] = OMIT, |
| 195 |
request_options: typing.Optional[RequestOptions] = None, |
| 196 |
) -> SetGuardianFactorDuoSettingsResponseContent: |
| 197 |
""" |
| 198 |
Set the DUO account configuration and other properties specific to this factor. |
| 199 |
|
| 200 |
Parameters |
| 201 |
---------- |
| 202 |
ikey : typing.Optional[str] |
| 203 |
|
| 204 |
skey : typing.Optional[str] |
| 205 |
|
| 206 |
host : typing.Optional[str] |
| 207 |
|
| 208 |
request_options : typing.Optional[RequestOptions] |
| 209 |
Request-specific configuration. |
| 210 |
|
| 211 |
Returns |
| 212 |
------- |
| 213 |
SetGuardianFactorDuoSettingsResponseContent |
| 214 |
DUO settings successfully updated. |
| 215 |
|
| 216 |
Examples |
| 217 |
-------- |
| 218 |
import asyncio |
| 219 |
|
| 220 |
from auth0 import AsyncAuth0 |
| 221 |
|
| 222 |
client = AsyncAuth0( |
| 223 |
token="YOUR_TOKEN", |
| 224 |
) |
| 225 |
|
| 226 |
|
| 227 |
async def main() -> None: |
| 228 |
await client.guardian.factors.duo.settings.set() |
| 229 |
|
| 230 |
|
| 231 |
asyncio.run(main()) |
| 232 |
""" |
| 233 |
_response = await self._raw_client.set(ikey=ikey, skey=skey, host=host, request_options=request_options) |
| 234 |
return _response.data |
| 235 |
|
| 236 |
async def update( |
| 237 |
self, |
| 238 |
*, |
| 239 |
ikey: typing.Optional[str] = OMIT, |
| 240 |
skey: typing.Optional[str] = OMIT, |
| 241 |
host: typing.Optional[str] = OMIT, |
| 242 |
request_options: typing.Optional[RequestOptions] = None, |
| 243 |
) -> UpdateGuardianFactorDuoSettingsResponseContent: |
| 244 |
""" |
| 245 |
Parameters |
| 246 |
---------- |
| 247 |
ikey : typing.Optional[str] |
| 248 |
|
| 249 |
skey : typing.Optional[str] |
| 250 |
|
| 251 |
host : typing.Optional[str] |
| 252 |
|
| 253 |
request_options : typing.Optional[RequestOptions] |
| 254 |
Request-specific configuration. |
| 255 |
|
| 256 |
Returns |
| 257 |
------- |
| 258 |
UpdateGuardianFactorDuoSettingsResponseContent |
| 259 |
DUO settings successfully updated. |
| 260 |
|
| 261 |
Examples |
| 262 |
-------- |
| 263 |
import asyncio |
| 264 |
|
| 265 |
from auth0 import AsyncAuth0 |
| 266 |
|
| 267 |
client = AsyncAuth0( |
| 268 |
token="YOUR_TOKEN", |
| 269 |
) |
| 270 |
|
| 271 |
|
| 272 |
async def main() -> None: |
| 273 |
await client.guardian.factors.duo.settings.update() |
| 274 |
|
| 275 |
|
| 276 |
asyncio.run(main()) |
| 277 |
""" |
| 278 |
_response = await self._raw_client.update(ikey=ikey, skey=skey, host=host, request_options=request_options) |
| 279 |
return _response.data |