| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 |
from ...core.request_options import RequestOptions |
| 7 |
from .raw_client import AsyncRawAuthenticatorsClient, RawAuthenticatorsClient |
| 8 |
|
| 9 |
|
| 10 |
class AuthenticatorsClient: |
| 11 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 12 |
self._raw_client = RawAuthenticatorsClient(client_wrapper=client_wrapper) |
| 13 |
|
| 14 |
@property |
| 15 |
def with_raw_response(self) -> RawAuthenticatorsClient: |
| 16 |
""" |
| 17 |
Retrieves a raw implementation of this client that returns raw responses. |
| 18 |
|
| 19 |
Returns |
| 20 |
------- |
| 21 |
RawAuthenticatorsClient |
| 22 |
""" |
| 23 |
return self._raw_client |
| 24 |
|
| 25 |
def delete_all(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 26 |
""" |
| 27 |
Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). |
| 28 |
|
| 29 |
Parameters |
| 30 |
---------- |
| 31 |
id : str |
| 32 |
ID of the user to delete. |
| 33 |
|
| 34 |
request_options : typing.Optional[RequestOptions] |
| 35 |
Request-specific configuration. |
| 36 |
|
| 37 |
Returns |
| 38 |
------- |
| 39 |
None |
| 40 |
|
| 41 |
Examples |
| 42 |
-------- |
| 43 |
from auth0 import Auth0 |
| 44 |
|
| 45 |
client = Auth0( |
| 46 |
token="YOUR_TOKEN", |
| 47 |
) |
| 48 |
client.users.authenticators.delete_all( |
| 49 |
id="id", |
| 50 |
) |
| 51 |
""" |
| 52 |
_response = self._raw_client.delete_all(id, request_options=request_options) |
| 53 |
return _response.data |
| 54 |
|
| 55 |
|
| 56 |
class AsyncAuthenticatorsClient: |
| 57 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 58 |
self._raw_client = AsyncRawAuthenticatorsClient(client_wrapper=client_wrapper) |
| 59 |
|
| 60 |
@property |
| 61 |
def with_raw_response(self) -> AsyncRawAuthenticatorsClient: |
| 62 |
""" |
| 63 |
Retrieves a raw implementation of this client that returns raw responses. |
| 64 |
|
| 65 |
Returns |
| 66 |
------- |
| 67 |
AsyncRawAuthenticatorsClient |
| 68 |
""" |
| 69 |
return self._raw_client |
| 70 |
|
| 71 |
async def delete_all(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 72 |
""" |
| 73 |
Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). |
| 74 |
|
| 75 |
Parameters |
| 76 |
---------- |
| 77 |
id : str |
| 78 |
ID of the user to delete. |
| 79 |
|
| 80 |
request_options : typing.Optional[RequestOptions] |
| 81 |
Request-specific configuration. |
| 82 |
|
| 83 |
Returns |
| 84 |
------- |
| 85 |
None |
| 86 |
|
| 87 |
Examples |
| 88 |
-------- |
| 89 |
import asyncio |
| 90 |
|
| 91 |
from auth0 import AsyncAuth0 |
| 92 |
|
| 93 |
client = AsyncAuth0( |
| 94 |
token="YOUR_TOKEN", |
| 95 |
) |
| 96 |
|
| 97 |
|
| 98 |
async def main() -> None: |
| 99 |
await client.users.authenticators.delete_all( |
| 100 |
id="id", |
| 101 |
) |
| 102 |
|
| 103 |
|
| 104 |
asyncio.run(main()) |
| 105 |
""" |
| 106 |
_response = await self._raw_client.delete_all(id, request_options=request_options) |
| 107 |
return _response.data |