| 1 |
|
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
import typing |
| 6 |
|
| 7 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 8 |
from ...core.pagination import AsyncPager, SyncPager |
| 9 |
from ...core.request_options import RequestOptions |
| 10 |
from ...types.create_directory_provisioning_request_content import CreateDirectoryProvisioningRequestContent |
| 11 |
from ...types.create_directory_provisioning_response_content import CreateDirectoryProvisioningResponseContent |
| 12 |
from ...types.directory_provisioning import DirectoryProvisioning |
| 13 |
from ...types.get_directory_provisioning_default_mapping_response_content import ( |
| 14 |
GetDirectoryProvisioningDefaultMappingResponseContent, |
| 15 |
) |
| 16 |
from ...types.get_directory_provisioning_response_content import GetDirectoryProvisioningResponseContent |
| 17 |
from ...types.list_directory_provisionings_response_content import ListDirectoryProvisioningsResponseContent |
| 18 |
from ...types.list_synchronized_groups_response_content import ListSynchronizedGroupsResponseContent |
| 19 |
from ...types.synchronized_group_payload import SynchronizedGroupPayload |
| 20 |
from ...types.update_directory_provisioning_request_content import UpdateDirectoryProvisioningRequestContent |
| 21 |
from ...types.update_directory_provisioning_response_content import UpdateDirectoryProvisioningResponseContent |
| 22 |
from .raw_client import AsyncRawDirectoryProvisioningClient, RawDirectoryProvisioningClient |
| 23 |
|
| 24 |
if typing.TYPE_CHECKING: |
| 25 |
from .synchronizations.client import AsyncSynchronizationsClient, SynchronizationsClient |
| 26 |
|
| 27 |
OMIT = typing.cast(typing.Any, ...) |
| 28 |
|
| 29 |
|
| 30 |
class DirectoryProvisioningClient: |
| 31 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 32 |
self._raw_client = RawDirectoryProvisioningClient(client_wrapper=client_wrapper) |
| 33 |
self._client_wrapper = client_wrapper |
| 34 |
self._synchronizations: typing.Optional[SynchronizationsClient] = None |
| 35 |
|
| 36 |
@property |
| 37 |
def with_raw_response(self) -> RawDirectoryProvisioningClient: |
| 38 |
""" |
| 39 |
Retrieves a raw implementation of this client that returns raw responses. |
| 40 |
|
| 41 |
Returns |
| 42 |
------- |
| 43 |
RawDirectoryProvisioningClient |
| 44 |
""" |
| 45 |
return self._raw_client |
| 46 |
|
| 47 |
def list( |
| 48 |
self, |
| 49 |
*, |
| 50 |
from_: typing.Optional[str] = None, |
| 51 |
take: typing.Optional[int] = 50, |
| 52 |
request_options: typing.Optional[RequestOptions] = None, |
| 53 |
) -> SyncPager[DirectoryProvisioning, ListDirectoryProvisioningsResponseContent]: |
| 54 |
""" |
| 55 |
Retrieve a list of directory provisioning configurations of a tenant. |
| 56 |
|
| 57 |
Parameters |
| 58 |
---------- |
| 59 |
from_ : typing.Optional[str] |
| 60 |
Optional Id from which to start selection. |
| 61 |
|
| 62 |
take : typing.Optional[int] |
| 63 |
Number of results per page. Defaults to 50. |
| 64 |
|
| 65 |
request_options : typing.Optional[RequestOptions] |
| 66 |
Request-specific configuration. |
| 67 |
|
| 68 |
Returns |
| 69 |
------- |
| 70 |
SyncPager[DirectoryProvisioning, ListDirectoryProvisioningsResponseContent] |
| 71 |
The tenant's directory provisioning configuration. See <strong>Response Schemas</strong> for schema. |
| 72 |
|
| 73 |
Examples |
| 74 |
-------- |
| 75 |
from auth0 import Auth0 |
| 76 |
|
| 77 |
client = Auth0( |
| 78 |
token="YOUR_TOKEN", |
| 79 |
) |
| 80 |
response = client.connections.directory_provisioning.list( |
| 81 |
from_="from", |
| 82 |
take=1, |
| 83 |
) |
| 84 |
for item in response: |
| 85 |
yield item |
| 86 |
# alternatively, you can paginate page-by-page |
| 87 |
for page in response.iter_pages(): |
| 88 |
yield page |
| 89 |
""" |
| 90 |
return self._raw_client.list(from_=from_, take=take, request_options=request_options) |
| 91 |
|
| 92 |
def get( |
| 93 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 94 |
) -> GetDirectoryProvisioningResponseContent: |
| 95 |
""" |
| 96 |
Retrieve the directory provisioning configuration of a connection. |
| 97 |
|
| 98 |
Parameters |
| 99 |
---------- |
| 100 |
id : str |
| 101 |
The id of the connection to retrieve its directory provisioning configuration |
| 102 |
|
| 103 |
request_options : typing.Optional[RequestOptions] |
| 104 |
Request-specific configuration. |
| 105 |
|
| 106 |
Returns |
| 107 |
------- |
| 108 |
GetDirectoryProvisioningResponseContent |
| 109 |
The connection's directory provisioning configuration. See <strong>Response Schemas</strong> for schema. |
| 110 |
|
| 111 |
Examples |
| 112 |
-------- |
| 113 |
from auth0 import Auth0 |
| 114 |
|
| 115 |
client = Auth0( |
| 116 |
token="YOUR_TOKEN", |
| 117 |
) |
| 118 |
client.connections.directory_provisioning.get( |
| 119 |
id="id", |
| 120 |
) |
| 121 |
""" |
| 122 |
_response = self._raw_client.get(id, request_options=request_options) |
| 123 |
return _response.data |
| 124 |
|
| 125 |
def create( |
| 126 |
self, |
| 127 |
id: str, |
| 128 |
*, |
| 129 |
request: typing.Optional[CreateDirectoryProvisioningRequestContent] = None, |
| 130 |
request_options: typing.Optional[RequestOptions] = None, |
| 131 |
) -> CreateDirectoryProvisioningResponseContent: |
| 132 |
""" |
| 133 |
Create a directory provisioning configuration for a connection. |
| 134 |
|
| 135 |
Parameters |
| 136 |
---------- |
| 137 |
id : str |
| 138 |
The id of the connection to create its directory provisioning configuration |
| 139 |
|
| 140 |
request : typing.Optional[CreateDirectoryProvisioningRequestContent] |
| 141 |
|
| 142 |
request_options : typing.Optional[RequestOptions] |
| 143 |
Request-specific configuration. |
| 144 |
|
| 145 |
Returns |
| 146 |
------- |
| 147 |
CreateDirectoryProvisioningResponseContent |
| 148 |
The connection's directory provisioning configuration was created. See <strong>Response Schemas</strong> for schema. |
| 149 |
|
| 150 |
Examples |
| 151 |
-------- |
| 152 |
from auth0 import Auth0, CreateDirectoryProvisioningRequestContent |
| 153 |
|
| 154 |
client = Auth0( |
| 155 |
token="YOUR_TOKEN", |
| 156 |
) |
| 157 |
client.connections.directory_provisioning.create( |
| 158 |
id="id", |
| 159 |
request=CreateDirectoryProvisioningRequestContent(), |
| 160 |
) |
| 161 |
""" |
| 162 |
_response = self._raw_client.create(id, request=request, request_options=request_options) |
| 163 |
return _response.data |
| 164 |
|
| 165 |
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 166 |
""" |
| 167 |
Delete the directory provisioning configuration of a connection. |
| 168 |
|
| 169 |
Parameters |
| 170 |
---------- |
| 171 |
id : str |
| 172 |
The id of the connection to delete its directory provisioning configuration |
| 173 |
|
| 174 |
request_options : typing.Optional[RequestOptions] |
| 175 |
Request-specific configuration. |
| 176 |
|
| 177 |
Returns |
| 178 |
------- |
| 179 |
None |
| 180 |
|
| 181 |
Examples |
| 182 |
-------- |
| 183 |
from auth0 import Auth0 |
| 184 |
|
| 185 |
client = Auth0( |
| 186 |
token="YOUR_TOKEN", |
| 187 |
) |
| 188 |
client.connections.directory_provisioning.delete( |
| 189 |
id="id", |
| 190 |
) |
| 191 |
""" |
| 192 |
_response = self._raw_client.delete(id, request_options=request_options) |
| 193 |
return _response.data |
| 194 |
|
| 195 |
def update( |
| 196 |
self, |
| 197 |
id: str, |
| 198 |
*, |
| 199 |
request: typing.Optional[UpdateDirectoryProvisioningRequestContent] = None, |
| 200 |
request_options: typing.Optional[RequestOptions] = None, |
| 201 |
) -> UpdateDirectoryProvisioningResponseContent: |
| 202 |
""" |
| 203 |
Update the directory provisioning configuration of a connection. |
| 204 |
|
| 205 |
Parameters |
| 206 |
---------- |
| 207 |
id : str |
| 208 |
The id of the connection to create its directory provisioning configuration |
| 209 |
|
| 210 |
request : typing.Optional[UpdateDirectoryProvisioningRequestContent] |
| 211 |
|
| 212 |
request_options : typing.Optional[RequestOptions] |
| 213 |
Request-specific configuration. |
| 214 |
|
| 215 |
Returns |
| 216 |
------- |
| 217 |
UpdateDirectoryProvisioningResponseContent |
| 218 |
The connection's directory provisioning configuration was updated. See <strong>Response Schemas</strong> for schema. |
| 219 |
|
| 220 |
Examples |
| 221 |
-------- |
| 222 |
from auth0 import Auth0, UpdateDirectoryProvisioningRequestContent |
| 223 |
|
| 224 |
client = Auth0( |
| 225 |
token="YOUR_TOKEN", |
| 226 |
) |
| 227 |
client.connections.directory_provisioning.update( |
| 228 |
id="id", |
| 229 |
request=UpdateDirectoryProvisioningRequestContent(), |
| 230 |
) |
| 231 |
""" |
| 232 |
_response = self._raw_client.update(id, request=request, request_options=request_options) |
| 233 |
return _response.data |
| 234 |
|
| 235 |
def get_default_mapping( |
| 236 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 237 |
) -> GetDirectoryProvisioningDefaultMappingResponseContent: |
| 238 |
""" |
| 239 |
Retrieve the directory provisioning default attribute mapping of a connection. |
| 240 |
|
| 241 |
Parameters |
| 242 |
---------- |
| 243 |
id : str |
| 244 |
The id of the connection to retrieve its directory provisioning configuration |
| 245 |
|
| 246 |
request_options : typing.Optional[RequestOptions] |
| 247 |
Request-specific configuration. |
| 248 |
|
| 249 |
Returns |
| 250 |
------- |
| 251 |
GetDirectoryProvisioningDefaultMappingResponseContent |
| 252 |
The connection's directory provisioning default mapping. See <strong>Response Schemas</strong> for schema. |
| 253 |
|
| 254 |
Examples |
| 255 |
-------- |
| 256 |
from auth0 import Auth0 |
| 257 |
|
| 258 |
client = Auth0( |
| 259 |
token="YOUR_TOKEN", |
| 260 |
) |
| 261 |
client.connections.directory_provisioning.get_default_mapping( |
| 262 |
id="id", |
| 263 |
) |
| 264 |
""" |
| 265 |
_response = self._raw_client.get_default_mapping(id, request_options=request_options) |
| 266 |
return _response.data |
| 267 |
|
| 268 |
def list_synchronized_groups( |
| 269 |
self, |
| 270 |
id: str, |
| 271 |
*, |
| 272 |
from_: typing.Optional[str] = None, |
| 273 |
take: typing.Optional[int] = 50, |
| 274 |
request_options: typing.Optional[RequestOptions] = None, |
| 275 |
) -> SyncPager[SynchronizedGroupPayload, ListSynchronizedGroupsResponseContent]: |
| 276 |
""" |
| 277 |
Retrieve the configured synchronized groups for a connection directory provisioning configuration. |
| 278 |
|
| 279 |
Parameters |
| 280 |
---------- |
| 281 |
id : str |
| 282 |
The id of the connection to list synchronized groups for. |
| 283 |
|
| 284 |
from_ : typing.Optional[str] |
| 285 |
Optional Id from which to start selection. |
| 286 |
|
| 287 |
take : typing.Optional[int] |
| 288 |
Number of results per page. Defaults to 50. |
| 289 |
|
| 290 |
request_options : typing.Optional[RequestOptions] |
| 291 |
Request-specific configuration. |
| 292 |
|
| 293 |
Returns |
| 294 |
------- |
| 295 |
SyncPager[SynchronizedGroupPayload, ListSynchronizedGroupsResponseContent] |
| 296 |
The connection's synchronized groups. See <strong>Response Schemas</strong> for schema. |
| 297 |
|
| 298 |
Examples |
| 299 |
-------- |
| 300 |
from auth0 import Auth0 |
| 301 |
|
| 302 |
client = Auth0( |
| 303 |
token="YOUR_TOKEN", |
| 304 |
) |
| 305 |
response = client.connections.directory_provisioning.list_synchronized_groups( |
| 306 |
id="id", |
| 307 |
from_="from", |
| 308 |
take=1, |
| 309 |
) |
| 310 |
for item in response: |
| 311 |
yield item |
| 312 |
# alternatively, you can paginate page-by-page |
| 313 |
for page in response.iter_pages(): |
| 314 |
yield page |
| 315 |
""" |
| 316 |
return self._raw_client.list_synchronized_groups(id, from_=from_, take=take, request_options=request_options) |
| 317 |
|
| 318 |
def set( |
| 319 |
self, |
| 320 |
id: str, |
| 321 |
*, |
| 322 |
groups: typing.Sequence[SynchronizedGroupPayload], |
| 323 |
request_options: typing.Optional[RequestOptions] = None, |
| 324 |
) -> None: |
| 325 |
""" |
| 326 |
Create or replace the selected groups for a connection directory provisioning configuration. |
| 327 |
|
| 328 |
Parameters |
| 329 |
---------- |
| 330 |
id : str |
| 331 |
The id of the connection to create or replace synchronized groups for |
| 332 |
|
| 333 |
groups : typing.Sequence[SynchronizedGroupPayload] |
| 334 |
Array of Google Workspace Directory group objects to synchronize. |
| 335 |
|
| 336 |
request_options : typing.Optional[RequestOptions] |
| 337 |
Request-specific configuration. |
| 338 |
|
| 339 |
Returns |
| 340 |
------- |
| 341 |
None |
| 342 |
|
| 343 |
Examples |
| 344 |
-------- |
| 345 |
from auth0 import Auth0, SynchronizedGroupPayload |
| 346 |
|
| 347 |
client = Auth0( |
| 348 |
token="YOUR_TOKEN", |
| 349 |
) |
| 350 |
client.connections.directory_provisioning.set( |
| 351 |
id="id", |
| 352 |
groups=[ |
| 353 |
SynchronizedGroupPayload( |
| 354 |
id="id", |
| 355 |
) |
| 356 |
], |
| 357 |
) |
| 358 |
""" |
| 359 |
_response = self._raw_client.set(id, groups=groups, request_options=request_options) |
| 360 |
return _response.data |
| 361 |
|
| 362 |
@property |
| 363 |
def synchronizations(self): |
| 364 |
if self._synchronizations is None: |
| 365 |
from .synchronizations.client import SynchronizationsClient |
| 366 |
|
| 367 |
self._synchronizations = SynchronizationsClient(client_wrapper=self._client_wrapper) |
| 368 |
return self._synchronizations |
| 369 |
|
| 370 |
|
| 371 |
class AsyncDirectoryProvisioningClient: |
| 372 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 373 |
self._raw_client = AsyncRawDirectoryProvisioningClient(client_wrapper=client_wrapper) |
| 374 |
self._client_wrapper = client_wrapper |
| 375 |
self._synchronizations: typing.Optional[AsyncSynchronizationsClient] = None |
| 376 |
|
| 377 |
@property |
| 378 |
def with_raw_response(self) -> AsyncRawDirectoryProvisioningClient: |
| 379 |
""" |
| 380 |
Retrieves a raw implementation of this client that returns raw responses. |
| 381 |
|
| 382 |
Returns |
| 383 |
------- |
| 384 |
AsyncRawDirectoryProvisioningClient |
| 385 |
""" |
| 386 |
return self._raw_client |
| 387 |
|
| 388 |
async def list( |
| 389 |
self, |
| 390 |
*, |
| 391 |
from_: typing.Optional[str] = None, |
| 392 |
take: typing.Optional[int] = 50, |
| 393 |
request_options: typing.Optional[RequestOptions] = None, |
| 394 |
) -> AsyncPager[DirectoryProvisioning, ListDirectoryProvisioningsResponseContent]: |
| 395 |
""" |
| 396 |
Retrieve a list of directory provisioning configurations of a tenant. |
| 397 |
|
| 398 |
Parameters |
| 399 |
---------- |
| 400 |
from_ : typing.Optional[str] |
| 401 |
Optional Id from which to start selection. |
| 402 |
|
| 403 |
take : typing.Optional[int] |
| 404 |
Number of results per page. Defaults to 50. |
| 405 |
|
| 406 |
request_options : typing.Optional[RequestOptions] |
| 407 |
Request-specific configuration. |
| 408 |
|
| 409 |
Returns |
| 410 |
------- |
| 411 |
AsyncPager[DirectoryProvisioning, ListDirectoryProvisioningsResponseContent] |
| 412 |
The tenant's directory provisioning configuration. See <strong>Response Schemas</strong> for schema. |
| 413 |
|
| 414 |
Examples |
| 415 |
-------- |
| 416 |
import asyncio |
| 417 |
|
| 418 |
from auth0 import AsyncAuth0 |
| 419 |
|
| 420 |
client = AsyncAuth0( |
| 421 |
token="YOUR_TOKEN", |
| 422 |
) |
| 423 |
|
| 424 |
|
| 425 |
async def main() -> None: |
| 426 |
response = await client.connections.directory_provisioning.list( |
| 427 |
from_="from", |
| 428 |
take=1, |
| 429 |
) |
| 430 |
async for item in response: |
| 431 |
yield item |
| 432 |
|
| 433 |
# alternatively, you can paginate page-by-page |
| 434 |
async for page in response.iter_pages(): |
| 435 |
yield page |
| 436 |
|
| 437 |
|
| 438 |
asyncio.run(main()) |
| 439 |
""" |
| 440 |
return await self._raw_client.list(from_=from_, take=take, request_options=request_options) |
| 441 |
|
| 442 |
async def get( |
| 443 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 444 |
) -> GetDirectoryProvisioningResponseContent: |
| 445 |
""" |
| 446 |
Retrieve the directory provisioning configuration of a connection. |
| 447 |
|
| 448 |
Parameters |
| 449 |
---------- |
| 450 |
id : str |
| 451 |
The id of the connection to retrieve its directory provisioning configuration |
| 452 |
|
| 453 |
request_options : typing.Optional[RequestOptions] |
| 454 |
Request-specific configuration. |
| 455 |
|
| 456 |
Returns |
| 457 |
------- |
| 458 |
GetDirectoryProvisioningResponseContent |
| 459 |
The connection's directory provisioning configuration. See <strong>Response Schemas</strong> for schema. |
| 460 |
|
| 461 |
Examples |
| 462 |
-------- |
| 463 |
import asyncio |
| 464 |
|
| 465 |
from auth0 import AsyncAuth0 |
| 466 |
|
| 467 |
client = AsyncAuth0( |
| 468 |
token="YOUR_TOKEN", |
| 469 |
) |
| 470 |
|
| 471 |
|
| 472 |
async def main() -> None: |
| 473 |
await client.connections.directory_provisioning.get( |
| 474 |
id="id", |
| 475 |
) |
| 476 |
|
| 477 |
|
| 478 |
asyncio.run(main()) |
| 479 |
""" |
| 480 |
_response = await self._raw_client.get(id, request_options=request_options) |
| 481 |
return _response.data |
| 482 |
|
| 483 |
async def create( |
| 484 |
self, |
| 485 |
id: str, |
| 486 |
*, |
| 487 |
request: typing.Optional[CreateDirectoryProvisioningRequestContent] = None, |
| 488 |
request_options: typing.Optional[RequestOptions] = None, |
| 489 |
) -> CreateDirectoryProvisioningResponseContent: |
| 490 |
""" |
| 491 |
Create a directory provisioning configuration for a connection. |
| 492 |
|
| 493 |
Parameters |
| 494 |
---------- |
| 495 |
id : str |
| 496 |
The id of the connection to create its directory provisioning configuration |
| 497 |
|
| 498 |
request : typing.Optional[CreateDirectoryProvisioningRequestContent] |
| 499 |
|
| 500 |
request_options : typing.Optional[RequestOptions] |
| 501 |
Request-specific configuration. |
| 502 |
|
| 503 |
Returns |
| 504 |
------- |
| 505 |
CreateDirectoryProvisioningResponseContent |
| 506 |
The connection's directory provisioning configuration was created. See <strong>Response Schemas</strong> for schema. |
| 507 |
|
| 508 |
Examples |
| 509 |
-------- |
| 510 |
import asyncio |
| 511 |
|
| 512 |
from auth0 import AsyncAuth0, CreateDirectoryProvisioningRequestContent |
| 513 |
|
| 514 |
client = AsyncAuth0( |
| 515 |
token="YOUR_TOKEN", |
| 516 |
) |
| 517 |
|
| 518 |
|
| 519 |
async def main() -> None: |
| 520 |
await client.connections.directory_provisioning.create( |
| 521 |
id="id", |
| 522 |
request=CreateDirectoryProvisioningRequestContent(), |
| 523 |
) |
| 524 |
|
| 525 |
|
| 526 |
asyncio.run(main()) |
| 527 |
""" |
| 528 |
_response = await self._raw_client.create(id, request=request, request_options=request_options) |
| 529 |
return _response.data |
| 530 |
|
| 531 |
async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 532 |
""" |
| 533 |
Delete the directory provisioning configuration of a connection. |
| 534 |
|
| 535 |
Parameters |
| 536 |
---------- |
| 537 |
id : str |
| 538 |
The id of the connection to delete its directory provisioning configuration |
| 539 |
|
| 540 |
request_options : typing.Optional[RequestOptions] |
| 541 |
Request-specific configuration. |
| 542 |
|
| 543 |
Returns |
| 544 |
------- |
| 545 |
None |
| 546 |
|
| 547 |
Examples |
| 548 |
-------- |
| 549 |
import asyncio |
| 550 |
|
| 551 |
from auth0 import AsyncAuth0 |
| 552 |
|
| 553 |
client = AsyncAuth0( |
| 554 |
token="YOUR_TOKEN", |
| 555 |
) |
| 556 |
|
| 557 |
|
| 558 |
async def main() -> None: |
| 559 |
await client.connections.directory_provisioning.delete( |
| 560 |
id="id", |
| 561 |
) |
| 562 |
|
| 563 |
|
| 564 |
asyncio.run(main()) |
| 565 |
""" |
| 566 |
_response = await self._raw_client.delete(id, request_options=request_options) |
| 567 |
return _response.data |
| 568 |
|
| 569 |
async def update( |
| 570 |
self, |
| 571 |
id: str, |
| 572 |
*, |
| 573 |
request: typing.Optional[UpdateDirectoryProvisioningRequestContent] = None, |
| 574 |
request_options: typing.Optional[RequestOptions] = None, |
| 575 |
) -> UpdateDirectoryProvisioningResponseContent: |
| 576 |
""" |
| 577 |
Update the directory provisioning configuration of a connection. |
| 578 |
|
| 579 |
Parameters |
| 580 |
---------- |
| 581 |
id : str |
| 582 |
The id of the connection to create its directory provisioning configuration |
| 583 |
|
| 584 |
request : typing.Optional[UpdateDirectoryProvisioningRequestContent] |
| 585 |
|
| 586 |
request_options : typing.Optional[RequestOptions] |
| 587 |
Request-specific configuration. |
| 588 |
|
| 589 |
Returns |
| 590 |
------- |
| 591 |
UpdateDirectoryProvisioningResponseContent |
| 592 |
The connection's directory provisioning configuration was updated. See <strong>Response Schemas</strong> for schema. |
| 593 |
|
| 594 |
Examples |
| 595 |
-------- |
| 596 |
import asyncio |
| 597 |
|
| 598 |
from auth0 import AsyncAuth0, UpdateDirectoryProvisioningRequestContent |
| 599 |
|
| 600 |
client = AsyncAuth0( |
| 601 |
token="YOUR_TOKEN", |
| 602 |
) |
| 603 |
|
| 604 |
|
| 605 |
async def main() -> None: |
| 606 |
await client.connections.directory_provisioning.update( |
| 607 |
id="id", |
| 608 |
request=UpdateDirectoryProvisioningRequestContent(), |
| 609 |
) |
| 610 |
|
| 611 |
|
| 612 |
asyncio.run(main()) |
| 613 |
""" |
| 614 |
_response = await self._raw_client.update(id, request=request, request_options=request_options) |
| 615 |
return _response.data |
| 616 |
|
| 617 |
async def get_default_mapping( |
| 618 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 619 |
) -> GetDirectoryProvisioningDefaultMappingResponseContent: |
| 620 |
""" |
| 621 |
Retrieve the directory provisioning default attribute mapping of a connection. |
| 622 |
|
| 623 |
Parameters |
| 624 |
---------- |
| 625 |
id : str |
| 626 |
The id of the connection to retrieve its directory provisioning configuration |
| 627 |
|
| 628 |
request_options : typing.Optional[RequestOptions] |
| 629 |
Request-specific configuration. |
| 630 |
|
| 631 |
Returns |
| 632 |
------- |
| 633 |
GetDirectoryProvisioningDefaultMappingResponseContent |
| 634 |
The connection's directory provisioning default mapping. See <strong>Response Schemas</strong> for schema. |
| 635 |
|
| 636 |
Examples |
| 637 |
-------- |
| 638 |
import asyncio |
| 639 |
|
| 640 |
from auth0 import AsyncAuth0 |
| 641 |
|
| 642 |
client = AsyncAuth0( |
| 643 |
token="YOUR_TOKEN", |
| 644 |
) |
| 645 |
|
| 646 |
|
| 647 |
async def main() -> None: |
| 648 |
await client.connections.directory_provisioning.get_default_mapping( |
| 649 |
id="id", |
| 650 |
) |
| 651 |
|
| 652 |
|
| 653 |
asyncio.run(main()) |
| 654 |
""" |
| 655 |
_response = await self._raw_client.get_default_mapping(id, request_options=request_options) |
| 656 |
return _response.data |
| 657 |
|
| 658 |
async def list_synchronized_groups( |
| 659 |
self, |
| 660 |
id: str, |
| 661 |
*, |
| 662 |
from_: typing.Optional[str] = None, |
| 663 |
take: typing.Optional[int] = 50, |
| 664 |
request_options: typing.Optional[RequestOptions] = None, |
| 665 |
) -> AsyncPager[SynchronizedGroupPayload, ListSynchronizedGroupsResponseContent]: |
| 666 |
""" |
| 667 |
Retrieve the configured synchronized groups for a connection directory provisioning configuration. |
| 668 |
|
| 669 |
Parameters |
| 670 |
---------- |
| 671 |
id : str |
| 672 |
The id of the connection to list synchronized groups for. |
| 673 |
|
| 674 |
from_ : typing.Optional[str] |
| 675 |
Optional Id from which to start selection. |
| 676 |
|
| 677 |
take : typing.Optional[int] |
| 678 |
Number of results per page. Defaults to 50. |
| 679 |
|
| 680 |
request_options : typing.Optional[RequestOptions] |
| 681 |
Request-specific configuration. |
| 682 |
|
| 683 |
Returns |
| 684 |
------- |
| 685 |
AsyncPager[SynchronizedGroupPayload, ListSynchronizedGroupsResponseContent] |
| 686 |
The connection's synchronized groups. See <strong>Response Schemas</strong> for schema. |
| 687 |
|
| 688 |
Examples |
| 689 |
-------- |
| 690 |
import asyncio |
| 691 |
|
| 692 |
from auth0 import AsyncAuth0 |
| 693 |
|
| 694 |
client = AsyncAuth0( |
| 695 |
token="YOUR_TOKEN", |
| 696 |
) |
| 697 |
|
| 698 |
|
| 699 |
async def main() -> None: |
| 700 |
response = await client.connections.directory_provisioning.list_synchronized_groups( |
| 701 |
id="id", |
| 702 |
from_="from", |
| 703 |
take=1, |
| 704 |
) |
| 705 |
async for item in response: |
| 706 |
yield item |
| 707 |
|
| 708 |
# alternatively, you can paginate page-by-page |
| 709 |
async for page in response.iter_pages(): |
| 710 |
yield page |
| 711 |
|
| 712 |
|
| 713 |
asyncio.run(main()) |
| 714 |
""" |
| 715 |
return await self._raw_client.list_synchronized_groups( |
| 716 |
id, from_=from_, take=take, request_options=request_options |
| 717 |
) |
| 718 |
|
| 719 |
async def set( |
| 720 |
self, |
| 721 |
id: str, |
| 722 |
*, |
| 723 |
groups: typing.Sequence[SynchronizedGroupPayload], |
| 724 |
request_options: typing.Optional[RequestOptions] = None, |
| 725 |
) -> None: |
| 726 |
""" |
| 727 |
Create or replace the selected groups for a connection directory provisioning configuration. |
| 728 |
|
| 729 |
Parameters |
| 730 |
---------- |
| 731 |
id : str |
| 732 |
The id of the connection to create or replace synchronized groups for |
| 733 |
|
| 734 |
groups : typing.Sequence[SynchronizedGroupPayload] |
| 735 |
Array of Google Workspace Directory group objects to synchronize. |
| 736 |
|
| 737 |
request_options : typing.Optional[RequestOptions] |
| 738 |
Request-specific configuration. |
| 739 |
|
| 740 |
Returns |
| 741 |
------- |
| 742 |
None |
| 743 |
|
| 744 |
Examples |
| 745 |
-------- |
| 746 |
import asyncio |
| 747 |
|
| 748 |
from auth0 import AsyncAuth0, SynchronizedGroupPayload |
| 749 |
|
| 750 |
client = AsyncAuth0( |
| 751 |
token="YOUR_TOKEN", |
| 752 |
) |
| 753 |
|
| 754 |
|
| 755 |
async def main() -> None: |
| 756 |
await client.connections.directory_provisioning.set( |
| 757 |
id="id", |
| 758 |
groups=[ |
| 759 |
SynchronizedGroupPayload( |
| 760 |
id="id", |
| 761 |
) |
| 762 |
], |
| 763 |
) |
| 764 |
|
| 765 |
|
| 766 |
asyncio.run(main()) |
| 767 |
""" |
| 768 |
_response = await self._raw_client.set(id, groups=groups, request_options=request_options) |
| 769 |
return _response.data |
| 770 |
|
| 771 |
@property |
| 772 |
def synchronizations(self): |
| 773 |
if self._synchronizations is None: |
| 774 |
from .synchronizations.client import AsyncSynchronizationsClient |
| 775 |
|
| 776 |
self._synchronizations = AsyncSynchronizationsClient(client_wrapper=self._client_wrapper) |
| 777 |
return self._synchronizations |