| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 |
from ...core.request_options import RequestOptions |
| 7 |
from ...types.users_enrollment import UsersEnrollment |
| 8 |
from .raw_client import AsyncRawEnrollmentsClient, RawEnrollmentsClient |
| 9 |
|
| 10 |
|
| 11 |
class EnrollmentsClient: |
| 12 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 13 |
self._raw_client = RawEnrollmentsClient(client_wrapper=client_wrapper) |
| 14 |
|
| 15 |
@property |
| 16 |
def with_raw_response(self) -> RawEnrollmentsClient: |
| 17 |
""" |
| 18 |
Retrieves a raw implementation of this client that returns raw responses. |
| 19 |
|
| 20 |
Returns |
| 21 |
------- |
| 22 |
RawEnrollmentsClient |
| 23 |
""" |
| 24 |
return self._raw_client |
| 25 |
|
| 26 |
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[UsersEnrollment]: |
| 27 |
""" |
| 28 |
Retrieve the first [multi-factor authentication](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors) enrollment that a specific user has confirmed. |
| 29 |
|
| 30 |
Parameters |
| 31 |
---------- |
| 32 |
id : str |
| 33 |
ID of the user to list enrollments for. |
| 34 |
|
| 35 |
request_options : typing.Optional[RequestOptions] |
| 36 |
Request-specific configuration. |
| 37 |
|
| 38 |
Returns |
| 39 |
------- |
| 40 |
typing.List[UsersEnrollment] |
| 41 |
Enrollments successfully retrieved. |
| 42 |
|
| 43 |
Examples |
| 44 |
-------- |
| 45 |
from auth0 import Auth0 |
| 46 |
|
| 47 |
client = Auth0( |
| 48 |
token="YOUR_TOKEN", |
| 49 |
) |
| 50 |
client.users.enrollments.get( |
| 51 |
id="id", |
| 52 |
) |
| 53 |
""" |
| 54 |
_response = self._raw_client.get(id, request_options=request_options) |
| 55 |
return _response.data |
| 56 |
|
| 57 |
|
| 58 |
class AsyncEnrollmentsClient: |
| 59 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 60 |
self._raw_client = AsyncRawEnrollmentsClient(client_wrapper=client_wrapper) |
| 61 |
|
| 62 |
@property |
| 63 |
def with_raw_response(self) -> AsyncRawEnrollmentsClient: |
| 64 |
""" |
| 65 |
Retrieves a raw implementation of this client that returns raw responses. |
| 66 |
|
| 67 |
Returns |
| 68 |
------- |
| 69 |
AsyncRawEnrollmentsClient |
| 70 |
""" |
| 71 |
return self._raw_client |
| 72 |
|
| 73 |
async def get( |
| 74 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 75 |
) -> typing.List[UsersEnrollment]: |
| 76 |
""" |
| 77 |
Retrieve the first [multi-factor authentication](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors) enrollment that a specific user has confirmed. |
| 78 |
|
| 79 |
Parameters |
| 80 |
---------- |
| 81 |
id : str |
| 82 |
ID of the user to list enrollments for. |
| 83 |
|
| 84 |
request_options : typing.Optional[RequestOptions] |
| 85 |
Request-specific configuration. |
| 86 |
|
| 87 |
Returns |
| 88 |
------- |
| 89 |
typing.List[UsersEnrollment] |
| 90 |
Enrollments successfully retrieved. |
| 91 |
|
| 92 |
Examples |
| 93 |
-------- |
| 94 |
import asyncio |
| 95 |
|
| 96 |
from auth0 import AsyncAuth0 |
| 97 |
|
| 98 |
client = AsyncAuth0( |
| 99 |
token="YOUR_TOKEN", |
| 100 |
) |
| 101 |
|
| 102 |
|
| 103 |
async def main() -> None: |
| 104 |
await client.users.enrollments.get( |
| 105 |
id="id", |
| 106 |
) |
| 107 |
|
| 108 |
|
| 109 |
asyncio.run(main()) |
| 110 |
""" |
| 111 |
_response = await self._raw_client.get(id, request_options=request_options) |
| 112 |
return _response.data |