| 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 AsyncRawUsersClient, RawUsersClient |
| 8 |
|
| 9 |
|
| 10 |
class UsersClient: |
| 11 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 12 |
self._raw_client = RawUsersClient(client_wrapper=client_wrapper) |
| 13 |
|
| 14 |
@property |
| 15 |
def with_raw_response(self) -> RawUsersClient: |
| 16 |
""" |
| 17 |
Retrieves a raw implementation of this client that returns raw responses. |
| 18 |
|
| 19 |
Returns |
| 20 |
------- |
| 21 |
RawUsersClient |
| 22 |
""" |
| 23 |
return self._raw_client |
| 24 |
|
| 25 |
def delete_by_email(self, id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 26 |
""" |
| 27 |
Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. |
| 28 |
|
| 29 |
Parameters |
| 30 |
---------- |
| 31 |
id : str |
| 32 |
The id of the connection (currently only database connections are supported) |
| 33 |
|
| 34 |
email : str |
| 35 |
The email of the user to delete |
| 36 |
|
| 37 |
request_options : typing.Optional[RequestOptions] |
| 38 |
Request-specific configuration. |
| 39 |
|
| 40 |
Returns |
| 41 |
------- |
| 42 |
None |
| 43 |
|
| 44 |
Examples |
| 45 |
-------- |
| 46 |
from auth0 import Auth0 |
| 47 |
|
| 48 |
client = Auth0( |
| 49 |
token="YOUR_TOKEN", |
| 50 |
) |
| 51 |
client.connections.users.delete_by_email( |
| 52 |
id="id", |
| 53 |
email="email", |
| 54 |
) |
| 55 |
""" |
| 56 |
_response = self._raw_client.delete_by_email(id, email=email, request_options=request_options) |
| 57 |
return _response.data |
| 58 |
|
| 59 |
|
| 60 |
class AsyncUsersClient: |
| 61 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 62 |
self._raw_client = AsyncRawUsersClient(client_wrapper=client_wrapper) |
| 63 |
|
| 64 |
@property |
| 65 |
def with_raw_response(self) -> AsyncRawUsersClient: |
| 66 |
""" |
| 67 |
Retrieves a raw implementation of this client that returns raw responses. |
| 68 |
|
| 69 |
Returns |
| 70 |
------- |
| 71 |
AsyncRawUsersClient |
| 72 |
""" |
| 73 |
return self._raw_client |
| 74 |
|
| 75 |
async def delete_by_email( |
| 76 |
self, id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None |
| 77 |
) -> None: |
| 78 |
""" |
| 79 |
Deletes a specified connection user by its email (you cannot delete all users from specific connection). Currently, only Database Connections are supported. |
| 80 |
|
| 81 |
Parameters |
| 82 |
---------- |
| 83 |
id : str |
| 84 |
The id of the connection (currently only database connections are supported) |
| 85 |
|
| 86 |
email : str |
| 87 |
The email of the user to delete |
| 88 |
|
| 89 |
request_options : typing.Optional[RequestOptions] |
| 90 |
Request-specific configuration. |
| 91 |
|
| 92 |
Returns |
| 93 |
------- |
| 94 |
None |
| 95 |
|
| 96 |
Examples |
| 97 |
-------- |
| 98 |
import asyncio |
| 99 |
|
| 100 |
from auth0 import AsyncAuth0 |
| 101 |
|
| 102 |
client = AsyncAuth0( |
| 103 |
token="YOUR_TOKEN", |
| 104 |
) |
| 105 |
|
| 106 |
|
| 107 |
async def main() -> None: |
| 108 |
await client.connections.users.delete_by_email( |
| 109 |
id="id", |
| 110 |
email="email", |
| 111 |
) |
| 112 |
|
| 113 |
|
| 114 |
asyncio.run(main()) |
| 115 |
""" |
| 116 |
_response = await self._raw_client.delete_by_email(id, email=email, request_options=request_options) |
| 117 |
return _response.data |