|
26 | 26 | ListPoliciesRequestOrderBy, |
27 | 27 | ListQuotaRequestOrderBy, |
28 | 28 | ListSSHKeysRequestOrderBy, |
| 29 | + ListScimTokensRequestOrderBy, |
29 | 30 | ListUsersRequestOrderBy, |
30 | 31 | LogAction, |
31 | 32 | LogResourceType, |
|
42 | 43 | CreateJWTRequest, |
43 | 44 | CreatePolicyRequest, |
44 | 45 | CreateSSHKeyRequest, |
| 46 | + CreateScimTokenResponse, |
45 | 47 | CreateUserRequest, |
46 | 48 | CreateUserRequestMember, |
47 | 49 | EncodedJWT, |
|
62 | 64 | ListRulesResponse, |
63 | 65 | ListSSHKeysResponse, |
64 | 66 | ListSamlCertificatesResponse, |
| 67 | + ListScimTokensResponse, |
65 | 68 | ListUsersResponse, |
66 | 69 | Log, |
67 | 70 | MFAOTP, |
|
79 | 82 | SSHKey, |
80 | 83 | Saml, |
81 | 84 | SamlCertificate, |
| 85 | + Scim, |
| 86 | + ScimToken, |
82 | 87 | SetGroupMembersRequest, |
83 | 88 | SetOrganizationAliasRequest, |
84 | 89 | SetRulesRequest, |
|
109 | 114 | unmarshal_SSHKey, |
110 | 115 | unmarshal_SamlCertificate, |
111 | 116 | unmarshal_User, |
| 117 | + unmarshal_CreateScimTokenResponse, |
112 | 118 | unmarshal_EncodedJWT, |
113 | 119 | unmarshal_GetUserConnectionsResponse, |
114 | 120 | unmarshal_InitiateUserConnectionResponse, |
|
124 | 130 | unmarshal_ListRulesResponse, |
125 | 131 | unmarshal_ListSSHKeysResponse, |
126 | 132 | unmarshal_ListSamlCertificatesResponse, |
| 133 | + unmarshal_ListScimTokensResponse, |
127 | 134 | unmarshal_ListUsersResponse, |
128 | 135 | unmarshal_MFAOTP, |
129 | 136 | unmarshal_Organization, |
130 | 137 | unmarshal_OrganizationSecuritySettings, |
131 | 138 | unmarshal_ParseSamlMetadataResponse, |
132 | 139 | unmarshal_Saml, |
| 140 | + unmarshal_Scim, |
133 | 141 | unmarshal_SetRulesResponse, |
134 | 142 | unmarshal_ValidateUserMFAOTPResponse, |
135 | 143 | marshal_AddGroupMemberRequest, |
@@ -3328,3 +3336,181 @@ async def delete_saml_certificate( |
3328 | 3336 | ) |
3329 | 3337 |
|
3330 | 3338 | self._throw_on_error(res) |
| 3339 | + |
| 3340 | + async def enable_organization_scim( |
| 3341 | + self, |
| 3342 | + *, |
| 3343 | + organization_id: Optional[str] = None, |
| 3344 | + ) -> Scim: |
| 3345 | + """ |
| 3346 | + :param organization_id: ID of the Organization. |
| 3347 | + :return: :class:`Scim <Scim>` |
| 3348 | +
|
| 3349 | + Usage: |
| 3350 | + :: |
| 3351 | +
|
| 3352 | + result = await api.enable_organization_scim() |
| 3353 | + """ |
| 3354 | + |
| 3355 | + param_organization_id = validate_path_param( |
| 3356 | + "organization_id", organization_id or self.client.default_organization_id |
| 3357 | + ) |
| 3358 | + |
| 3359 | + res = self._request( |
| 3360 | + "POST", |
| 3361 | + f"/iam/v1alpha1/organizations/{param_organization_id}/scim", |
| 3362 | + body={}, |
| 3363 | + ) |
| 3364 | + |
| 3365 | + self._throw_on_error(res) |
| 3366 | + return unmarshal_Scim(res.json()) |
| 3367 | + |
| 3368 | + async def delete_scim( |
| 3369 | + self, |
| 3370 | + *, |
| 3371 | + scim_id: str, |
| 3372 | + ) -> None: |
| 3373 | + """ |
| 3374 | + :param scim_id: ID of the SCIM configuration. |
| 3375 | +
|
| 3376 | + Usage: |
| 3377 | + :: |
| 3378 | +
|
| 3379 | + result = await api.delete_scim( |
| 3380 | + scim_id="example", |
| 3381 | + ) |
| 3382 | + """ |
| 3383 | + |
| 3384 | + param_scim_id = validate_path_param("scim_id", scim_id) |
| 3385 | + |
| 3386 | + res = self._request( |
| 3387 | + "DELETE", |
| 3388 | + f"/iam/v1alpha1/scim/{param_scim_id}", |
| 3389 | + ) |
| 3390 | + |
| 3391 | + self._throw_on_error(res) |
| 3392 | + |
| 3393 | + async def list_scim_tokens( |
| 3394 | + self, |
| 3395 | + *, |
| 3396 | + scim_id: str, |
| 3397 | + order_by: Optional[ListScimTokensRequestOrderBy] = None, |
| 3398 | + page: Optional[int] = None, |
| 3399 | + page_size: Optional[int] = None, |
| 3400 | + ) -> ListScimTokensResponse: |
| 3401 | + """ |
| 3402 | + :param scim_id: ID of the SCIM configuration. |
| 3403 | + :param order_by: Sort order of SCIM tokens. |
| 3404 | + :param page: Requested page number. Value must be greater or equal to 1. |
| 3405 | + :param page_size: Number of items per page. Value must be between 1 and 100. |
| 3406 | + :return: :class:`ListScimTokensResponse <ListScimTokensResponse>` |
| 3407 | +
|
| 3408 | + Usage: |
| 3409 | + :: |
| 3410 | +
|
| 3411 | + result = await api.list_scim_tokens( |
| 3412 | + scim_id="example", |
| 3413 | + ) |
| 3414 | + """ |
| 3415 | + |
| 3416 | + param_scim_id = validate_path_param("scim_id", scim_id) |
| 3417 | + |
| 3418 | + res = self._request( |
| 3419 | + "GET", |
| 3420 | + f"/iam/v1alpha1/scim/{param_scim_id}/tokens", |
| 3421 | + params={ |
| 3422 | + "order_by": order_by, |
| 3423 | + "page": page, |
| 3424 | + "page_size": page_size or self.client.default_page_size, |
| 3425 | + }, |
| 3426 | + ) |
| 3427 | + |
| 3428 | + self._throw_on_error(res) |
| 3429 | + return unmarshal_ListScimTokensResponse(res.json()) |
| 3430 | + |
| 3431 | + async def list_scim_tokens_all( |
| 3432 | + self, |
| 3433 | + *, |
| 3434 | + scim_id: str, |
| 3435 | + order_by: Optional[ListScimTokensRequestOrderBy] = None, |
| 3436 | + page: Optional[int] = None, |
| 3437 | + page_size: Optional[int] = None, |
| 3438 | + ) -> list[ScimToken]: |
| 3439 | + """ |
| 3440 | + :param scim_id: ID of the SCIM configuration. |
| 3441 | + :param order_by: Sort order of SCIM tokens. |
| 3442 | + :param page: Requested page number. Value must be greater or equal to 1. |
| 3443 | + :param page_size: Number of items per page. Value must be between 1 and 100. |
| 3444 | + :return: :class:`list[ScimToken] <list[ScimToken]>` |
| 3445 | +
|
| 3446 | + Usage: |
| 3447 | + :: |
| 3448 | +
|
| 3449 | + result = await api.list_scim_tokens_all( |
| 3450 | + scim_id="example", |
| 3451 | + ) |
| 3452 | + """ |
| 3453 | + |
| 3454 | + return await fetch_all_pages_async( |
| 3455 | + type=ListScimTokensResponse, |
| 3456 | + key="scim_tokens", |
| 3457 | + fetcher=self.list_scim_tokens, |
| 3458 | + args={ |
| 3459 | + "scim_id": scim_id, |
| 3460 | + "order_by": order_by, |
| 3461 | + "page": page, |
| 3462 | + "page_size": page_size, |
| 3463 | + }, |
| 3464 | + ) |
| 3465 | + |
| 3466 | + async def create_scim_token( |
| 3467 | + self, |
| 3468 | + *, |
| 3469 | + scim_id: str, |
| 3470 | + ) -> CreateScimTokenResponse: |
| 3471 | + """ |
| 3472 | + :param scim_id: ID of the SCIM configuration. |
| 3473 | + :return: :class:`CreateScimTokenResponse <CreateScimTokenResponse>` |
| 3474 | +
|
| 3475 | + Usage: |
| 3476 | + :: |
| 3477 | +
|
| 3478 | + result = await api.create_scim_token( |
| 3479 | + scim_id="example", |
| 3480 | + ) |
| 3481 | + """ |
| 3482 | + |
| 3483 | + param_scim_id = validate_path_param("scim_id", scim_id) |
| 3484 | + |
| 3485 | + res = self._request( |
| 3486 | + "POST", |
| 3487 | + f"/iam/v1alpha1/scim/{param_scim_id}/tokens", |
| 3488 | + ) |
| 3489 | + |
| 3490 | + self._throw_on_error(res) |
| 3491 | + return unmarshal_CreateScimTokenResponse(res.json()) |
| 3492 | + |
| 3493 | + async def delete_scim_token( |
| 3494 | + self, |
| 3495 | + *, |
| 3496 | + token_id: str, |
| 3497 | + ) -> None: |
| 3498 | + """ |
| 3499 | + :param token_id: The SCIM token ID. |
| 3500 | +
|
| 3501 | + Usage: |
| 3502 | + :: |
| 3503 | +
|
| 3504 | + result = await api.delete_scim_token( |
| 3505 | + token_id="example", |
| 3506 | + ) |
| 3507 | + """ |
| 3508 | + |
| 3509 | + param_token_id = validate_path_param("token_id", token_id) |
| 3510 | + |
| 3511 | + res = self._request( |
| 3512 | + "DELETE", |
| 3513 | + f"/iam/v1alpha1/scim-tokens/{param_token_id}", |
| 3514 | + ) |
| 3515 | + |
| 3516 | + self._throw_on_error(res) |
0 commit comments