| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 |
from ...core.request_options import RequestOptions |
| 7 |
from ...types.create_export_users_fields import CreateExportUsersFields |
| 8 |
from ...types.create_export_users_response_content import CreateExportUsersResponseContent |
| 9 |
from ...types.job_file_format_enum import JobFileFormatEnum |
| 10 |
from .raw_client import AsyncRawUsersExportsClient, RawUsersExportsClient |
| 11 |
|
| 12 |
|
| 13 |
OMIT = typing.cast(typing.Any, ...) |
| 14 |
|
| 15 |
|
| 16 |
class UsersExportsClient: |
| 17 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 18 |
self._raw_client = RawUsersExportsClient(client_wrapper=client_wrapper) |
| 19 |
|
| 20 |
@property |
| 21 |
def with_raw_response(self) -> RawUsersExportsClient: |
| 22 |
""" |
| 23 |
Retrieves a raw implementation of this client that returns raw responses. |
| 24 |
|
| 25 |
Returns |
| 26 |
------- |
| 27 |
RawUsersExportsClient |
| 28 |
""" |
| 29 |
return self._raw_client |
| 30 |
|
| 31 |
def create( |
| 32 |
self, |
| 33 |
*, |
| 34 |
connection_id: typing.Optional[str] = OMIT, |
| 35 |
format: typing.Optional[JobFileFormatEnum] = OMIT, |
| 36 |
limit: typing.Optional[int] = OMIT, |
| 37 |
fields: typing.Optional[typing.Sequence[CreateExportUsersFields]] = OMIT, |
| 38 |
request_options: typing.Optional[RequestOptions] = None, |
| 39 |
) -> CreateExportUsersResponseContent: |
| 40 |
""" |
| 41 |
Export all users to a file via a long-running job. |
| 42 |
|
| 43 |
Parameters |
| 44 |
---------- |
| 45 |
connection_id : typing.Optional[str] |
| 46 |
connection_id of the connection from which users will be exported. |
| 47 |
|
| 48 |
format : typing.Optional[JobFileFormatEnum] |
| 49 |
|
| 50 |
limit : typing.Optional[int] |
| 51 |
Limit the number of records. |
| 52 |
|
| 53 |
fields : typing.Optional[typing.Sequence[CreateExportUsersFields]] |
| 54 |
List of fields to be included in the CSV. Defaults to a predefined set of fields. |
| 55 |
|
| 56 |
request_options : typing.Optional[RequestOptions] |
| 57 |
Request-specific configuration. |
| 58 |
|
| 59 |
Returns |
| 60 |
------- |
| 61 |
CreateExportUsersResponseContent |
| 62 |
Job created successfully. |
| 63 |
|
| 64 |
Examples |
| 65 |
-------- |
| 66 |
from auth0 import Auth0 |
| 67 |
|
| 68 |
client = Auth0( |
| 69 |
token="YOUR_TOKEN", |
| 70 |
) |
| 71 |
client.jobs.users_exports.create() |
| 72 |
""" |
| 73 |
_response = self._raw_client.create( |
| 74 |
connection_id=connection_id, format=format, limit=limit, fields=fields, request_options=request_options |
| 75 |
) |
| 76 |
return _response.data |
| 77 |
|
| 78 |
|
| 79 |
class AsyncUsersExportsClient: |
| 80 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 81 |
self._raw_client = AsyncRawUsersExportsClient(client_wrapper=client_wrapper) |
| 82 |
|
| 83 |
@property |
| 84 |
def with_raw_response(self) -> AsyncRawUsersExportsClient: |
| 85 |
""" |
| 86 |
Retrieves a raw implementation of this client that returns raw responses. |
| 87 |
|
| 88 |
Returns |
| 89 |
------- |
| 90 |
AsyncRawUsersExportsClient |
| 91 |
""" |
| 92 |
return self._raw_client |
| 93 |
|
| 94 |
async def create( |
| 95 |
self, |
| 96 |
*, |
| 97 |
connection_id: typing.Optional[str] = OMIT, |
| 98 |
format: typing.Optional[JobFileFormatEnum] = OMIT, |
| 99 |
limit: typing.Optional[int] = OMIT, |
| 100 |
fields: typing.Optional[typing.Sequence[CreateExportUsersFields]] = OMIT, |
| 101 |
request_options: typing.Optional[RequestOptions] = None, |
| 102 |
) -> CreateExportUsersResponseContent: |
| 103 |
""" |
| 104 |
Export all users to a file via a long-running job. |
| 105 |
|
| 106 |
Parameters |
| 107 |
---------- |
| 108 |
connection_id : typing.Optional[str] |
| 109 |
connection_id of the connection from which users will be exported. |
| 110 |
|
| 111 |
format : typing.Optional[JobFileFormatEnum] |
| 112 |
|
| 113 |
limit : typing.Optional[int] |
| 114 |
Limit the number of records. |
| 115 |
|
| 116 |
fields : typing.Optional[typing.Sequence[CreateExportUsersFields]] |
| 117 |
List of fields to be included in the CSV. Defaults to a predefined set of fields. |
| 118 |
|
| 119 |
request_options : typing.Optional[RequestOptions] |
| 120 |
Request-specific configuration. |
| 121 |
|
| 122 |
Returns |
| 123 |
------- |
| 124 |
CreateExportUsersResponseContent |
| 125 |
Job created successfully. |
| 126 |
|
| 127 |
Examples |
| 128 |
-------- |
| 129 |
import asyncio |
| 130 |
|
| 131 |
from auth0 import AsyncAuth0 |
| 132 |
|
| 133 |
client = AsyncAuth0( |
| 134 |
token="YOUR_TOKEN", |
| 135 |
) |
| 136 |
|
| 137 |
|
| 138 |
async def main() -> None: |
| 139 |
await client.jobs.users_exports.create() |
| 140 |
|
| 141 |
|
| 142 |
asyncio.run(main()) |
| 143 |
""" |
| 144 |
_response = await self._raw_client.create( |
| 145 |
connection_id=connection_id, format=format, limit=limit, fields=fields, request_options=request_options |
| 146 |
) |
| 147 |
return _response.data |