From 393b11d667b347322fa22994a64968e5bf53ff75 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 04:54:34 +0000 Subject: [PATCH 1/5] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 5.12.10 --- .fern/replay.lock | 839 ---- reference.md | 3379 ++++++++++------- src/auth0/management/__init__.py | 80 +- src/auth0/management/actions/client.py | 4 +- src/auth0/management/actions/raw_client.py | 4 +- .../management/actions/versions/raw_client.py | 6 - .../branding/phone/templates/raw_client.py | 6 - .../management/branding/templates/client.py | 64 +- .../branding/templates/raw_client.py | 70 +- src/auth0/management/client.py | 19 + src/auth0/management/connections/client.py | 72 +- .../management/connections/clients/client.py | 8 +- .../connections/clients/raw_client.py | 14 +- .../directory_provisioning/raw_client.py | 12 - .../management/connections/keys/raw_client.py | 12 - .../management/connections/raw_client.py | 72 +- .../connections/scim_configuration/client.py | 16 +- .../scim_configuration/raw_client.py | 22 +- .../scim_configuration/tokens/client.py | 8 +- .../scim_configuration/tokens/raw_client.py | 8 +- src/auth0/management/core/client_wrapper.py | 22 +- src/auth0/management/custom_domains/client.py | 62 +- .../management/custom_domains/raw_client.py | 62 +- .../management/event_streams/raw_client.py | 6 - .../flows/vault/connections/raw_client.py | 6 - src/auth0/management/groups/__init__.py | 6 +- src/auth0/management/groups/client.py | 19 + src/auth0/management/groups/roles/__init__.py | 4 + src/auth0/management/groups/roles/client.py | 314 ++ .../management/groups/roles/raw_client.py | 637 ++++ .../management/guardian/enrollments/client.py | 14 +- .../guardian/enrollments/raw_client.py | 14 +- .../factors/push_notification/client.py | 12 +- .../factors/push_notification/raw_client.py | 12 +- .../management/guardian/policies/client.py | 44 +- .../guardian/policies/raw_client.py | 50 +- src/auth0/management/hooks/client.py | 8 +- src/auth0/management/hooks/raw_client.py | 8 +- .../management/hooks/secrets/raw_client.py | 18 - .../jobs/verification_email/client.py | 4 +- .../jobs/verification_email/raw_client.py | 4 +- .../management/log_streams/raw_client.py | 6 - src/auth0/management/logs/client.py | 74 +- src/auth0/management/logs/raw_client.py | 74 +- .../prompts/custom_text/raw_client.py | 6 - .../management/prompts/partials/raw_client.py | 6 - .../management/prompts/rendering/client.py | 8 +- .../prompts/rendering/raw_client.py | 8 +- .../rate_limit_policies/__init__.py | 4 + .../management/rate_limit_policies/client.py | 534 +++ .../rate_limit_policies/raw_client.py | 1076 ++++++ src/auth0/management/roles/client.py | 24 +- .../management/roles/permissions/client.py | 8 +- .../roles/permissions/raw_client.py | 8 +- src/auth0/management/roles/raw_client.py | 24 +- src/auth0/management/roles/users/client.py | 48 +- .../management/roles/users/raw_client.py | 48 +- src/auth0/management/rules/client.py | 16 +- src/auth0/management/rules/raw_client.py | 16 +- .../custom_text/raw_client.py | 6 - src/auth0/management/types/__init__.py | 78 + .../client_external_metadata_type_enum.py | 2 +- .../types/connection_properties_options.py | 2 + ...eate_rate_limit_policy_response_content.py | 44 + .../types/create_user_response_content.py | 2 + .../get_rate_limit_policy_response_content.py | 44 + .../types/get_user_response_content.py | 2 + .../list_group_roles_response_content.py | 24 + ...mit_policies_paginated_response_content.py | 24 + src/auth0/management/types/oauth_scope.py | 7 + ...it_policy_configuration_request_content.py | 19 + ...cy_configuration_request_content_action.py | 35 + ...iguration_request_content_action_action.py | 5 + ...olicy_configuration_request_content_one.py | 30 + ...onfiguration_request_content_one_action.py | 5 + ...licy_configuration_request_content_zero.py | 25 + ...nfiguration_request_content_zero_action.py | 5 + .../management/types/rate_limit_policy.py | 44 + .../types/rate_limit_policy_configuration.py | 11 + .../rate_limit_policy_configuration_action.py | 33 + ...imit_policy_configuration_action_action.py | 5 + .../rate_limit_policy_configuration_one.py | 28 + ...e_limit_policy_configuration_one_action.py | 5 + .../rate_limit_policy_configuration_zero.py | 23 + ..._limit_policy_configuration_zero_action.py | 5 + .../types/rate_limit_policy_consumer_enum.py | 5 + .../types/rate_limit_policy_resource_enum.py | 5 + .../types/update_connection_options.py | 2 + ...date_rate_limit_policy_response_content.py | 44 + .../types/update_user_response_content.py | 2 + .../management/types/user_response_schema.py | 2 + .../user_attribute_profiles/client.py | 4 +- .../user_attribute_profiles/raw_client.py | 4 +- .../authentication_methods/raw_client.py | 6 - .../management/users/authenticators/client.py | 4 +- .../users/authenticators/raw_client.py | 4 +- src/auth0/management/users/client.py | 254 +- .../management/users/enrollments/client.py | 4 +- .../users/enrollments/raw_client.py | 4 +- .../management/users/identities/client.py | 102 +- .../management/users/identities/raw_client.py | 102 +- .../management/users/multifactor/client.py | 8 +- .../users/multifactor/raw_client.py | 8 +- .../management/users/organizations/client.py | 4 +- .../users/organizations/raw_client.py | 4 +- src/auth0/management/users/raw_client.py | 254 +- src/auth0/management/users/roles/client.py | 16 +- .../management/users/roles/raw_client.py | 16 +- tests/wire/test_groups_roles.py | 35 + tests/wire/test_rateLimitPolicies.py | 77 + wiremock/wiremock-mappings.json | 316 +- 111 files changed, 6622 insertions(+), 3206 deletions(-) create mode 100644 src/auth0/management/groups/roles/__init__.py create mode 100644 src/auth0/management/groups/roles/client.py create mode 100644 src/auth0/management/groups/roles/raw_client.py create mode 100644 src/auth0/management/rate_limit_policies/__init__.py create mode 100644 src/auth0/management/rate_limit_policies/client.py create mode 100644 src/auth0/management/rate_limit_policies/raw_client.py create mode 100644 src/auth0/management/types/create_rate_limit_policy_response_content.py create mode 100644 src/auth0/management/types/get_rate_limit_policy_response_content.py create mode 100644 src/auth0/management/types/list_group_roles_response_content.py create mode 100644 src/auth0/management/types/list_rate_limit_policies_paginated_response_content.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action_action.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one_action.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero.py create mode 100644 src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero_action.py create mode 100644 src/auth0/management/types/rate_limit_policy.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration_action.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration_action_action.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration_one.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration_one_action.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration_zero.py create mode 100644 src/auth0/management/types/rate_limit_policy_configuration_zero_action.py create mode 100644 src/auth0/management/types/rate_limit_policy_consumer_enum.py create mode 100644 src/auth0/management/types/rate_limit_policy_resource_enum.py create mode 100644 src/auth0/management/types/update_rate_limit_policy_response_content.py create mode 100644 tests/wire/test_groups_roles.py create mode 100644 tests/wire/test_rateLimitPolicies.py diff --git a/.fern/replay.lock b/.fern/replay.lock index eb9e8fea..6a8f72b7 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -8358,842 +8358,3 @@ patches: "users", "verifiable_credentials", ] - - id: patch-f182694f - content_hash: sha256:5b0050902cba2aa5b86585d4eabba3987354307a1721cf12a9a94422ee371470 - original_commit: f182694f50720cacb568ff5c7a1894b0dd972373 - original_message: "fix: Add top-level `py.typed` marker to resolve IDE import errors (#829)" - original_author: Snehil Kishore - base_generation: 812b8ca16fc2740001f9839ce5c88f85fed87c6e - files: - - src/auth0/py.typed - patch_content: |+ - From f182694f50720cacb568ff5c7a1894b0dd972373 Mon Sep 17 00:00:00 2001 - From: Snehil Kishore - Date: Mon, 4 May 2026 15:36:32 +0530 - Subject: [PATCH] fix: Add top-level `py.typed` marker to resolve IDE import - errors (#829) - - ## Changes - - - Adds a `py.typed` marker at the root package level - (`src/auth0/py.typed`). - - The marker previously only existed under `src/auth0/management/`, - causing IDEs like PyCharm to fall back to outdated [typeshed - stubs](https://github.com/python/typeshed/pull/14697) and report - unresolved imports for `ManagementClient`, `ApiError`, and other - classes. A root-level marker signals IDEs to use the package's own - inline types instead. - - Closes #824 - Related: #804, #793 - --- - .fernignore | 3 ++- - src/auth0/py.typed | 0 - 2 files changed, 2 insertions(+), 1 deletion(-) - create mode 100644 src/auth0/py.typed - - diff --git a/.fernignore b/.fernignore - index f0e9481..9c29793 100644 - --- a/.fernignore - +++ b/.fernignore - @@ -16,8 +16,9 @@ CHANGELOG.md - src/auth0/authentication/ - tests/authentication/ - - -# Root auth0 __init__.py - +# Root auth0 __init__.py and py.typed marker - src/auth0/__init__.py - +src/auth0/py.typed - - # Telemetry customization (Auth0 format with dynamic versioning) - src/auth0/management/core/client_wrapper.py - diff --git a/src/auth0/py.typed b/src/auth0/py.typed - new file mode 100644 - index 0000000..e69de29 - -- - 2.52.0 - - theirs_snapshot: - src/auth0/py.typed: "" - user_owned: true - - id: patch-1026b4d8 - content_hash: sha256:d1944b0fa60d6251e0f6411e9ea7255795874b63e979590195c9c52cb9e48c77 - original_commit: 1026b4d84790f1037f99df904ddf58d68f944224 - original_message: Release 5.4.0 (#838) - original_author: Snehil Kishore - base_generation: 812b8ca16fc2740001f9839ce5c88f85fed87c6e - files: - - .version - - CHANGELOG.md - - pyproject.toml - patch_content: |+ - From 1026b4d84790f1037f99df904ddf58d68f944224 Mon Sep 17 00:00:00 2001 - From: Snehil Kishore - Date: Mon, 4 May 2026 16:34:45 +0530 - Subject: [PATCH] Release 5.4.0 (#838) - - **Added** - - chore: Add events module, async token support, and connection retry - resilience [\#835](https://github.com/auth0/auth0-python/pull/835) - ([fern-api[bot]](https://github.com/apps/fern-api)) - - **Changed** - - [fern-replay] Initialize Replay for SDK customizations - [\#833](https://github.com/auth0/auth0-python/pull/833) - ([fern-api[bot]](https://github.com/apps/fern-api), - [developerkunal](https://github.com/developerkunal)) - - **Fixed** - - fix: Add top-level `py.typed` marker to resolve IDE import errors - [\#829](https://github.com/auth0/auth0-python/pull/829) - ([kishore7snehil](https://github.com/kishore7snehil)) - --- - .version | 2 +- - CHANGELOG.md | 12 ++++++++++++ - pyproject.toml | 2 +- - 3 files changed, 14 insertions(+), 2 deletions(-) - - diff --git a/.version b/.version - index e230c83..1e20ec3 100644 - --- a/.version - +++ b/.version - @@ -1 +1 @@ - -5.3.0 - \ No newline at end of file - +5.4.0 - \ No newline at end of file - diff --git a/CHANGELOG.md b/CHANGELOG.md - index 061116a..025b731 100644 - --- a/CHANGELOG.md - +++ b/CHANGELOG.md - @@ -1,5 +1,17 @@ - # Change Log - - +## [5.4.0](https://github.com/auth0/auth0-python/tree/5.4.0) (2026-05-04) - +[Full Changelog](https://github.com/auth0/auth0-python/compare/5.3.0...5.4.0) - + - +**Added** - +- chore: Add events module, async token support, and connection retry resilience [\#835](https://github.com/auth0/auth0-python/pull/835) ([fern-api[bot]](https://github.com/apps/fern-api)) - + - +**Changed** - +- [fern-replay] Initialize Replay for SDK customizations [\#833](https://github.com/auth0/auth0-python/pull/833) ([fern-api[bot]](https://github.com/apps/fern-api), [developerkunal](https://github.com/developerkunal)) - + - +**Fixed** - +- fix: Add top-level `py.typed` marker to resolve IDE import errors [\#829](https://github.com/auth0/auth0-python/pull/829) ([kishore7snehil](https://github.com/kishore7snehil)) - + - ## [5.3.0](https://github.com/auth0/auth0-python/tree/5.3.0) (2026-04-09) - [Full Changelog](https://github.com/auth0/auth0-python/compare/5.2.0...5.3.0) - - diff --git a/pyproject.toml b/pyproject.toml - index eabea62..c96a12b 100644 - --- a/pyproject.toml - +++ b/pyproject.toml - @@ -3,7 +3,7 @@ name = "auth0-python" - - [tool.poetry] - name = "auth0-python" - -version = "5.3.0" - +version = "5.4.0" - description = "Auth0 Python SDK - Management and Authentication APIs" - readme = "README.md" - authors = ["Auth0 "] - -- - 2.52.0 - - theirs_snapshot: - .version: 5.4.0 - CHANGELOG.md: | - # Change Log - - ## [5.4.0](https://github.com/auth0/auth0-python/tree/5.4.0) (2026-05-04) - [Full Changelog](https://github.com/auth0/auth0-python/compare/5.3.0...5.4.0) - - **Added** - - chore: Add events module, async token support, and connection retry resilience [\#835](https://github.com/auth0/auth0-python/pull/835) ([fern-api[bot]](https://github.com/apps/fern-api)) - - **Changed** - - [fern-replay] Initialize Replay for SDK customizations [\#833](https://github.com/auth0/auth0-python/pull/833) ([fern-api[bot]](https://github.com/apps/fern-api), [developerkunal](https://github.com/developerkunal)) - - **Fixed** - - fix: Add top-level `py.typed` marker to resolve IDE import errors [\#829](https://github.com/auth0/auth0-python/pull/829) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [5.3.0](https://github.com/auth0/auth0-python/tree/5.3.0) (2026-04-09) - [Full Changelog](https://github.com/auth0/auth0-python/compare/5.2.0...5.3.0) - - **Added** - - feat: Add CIMD support, organization connections, group deletion, refresh token listing; remove AOL/Flickr/Yammer providers [\#816](https://github.com/auth0/auth0-python/pull/816) ([fern-api[bot]](https://github.com/apps/fern-api)) - - feat:Add `Auth0-Custom-Domain` header support for Multiple Custom Domains (MCD) [\#799](https://github.com/auth0/auth0-python/pull/799) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [5.2.0](https://github.com/auth0/auth0-python/tree/5.2.0) (2026-03-30) - [Full Changelog](https://github.com/auth0/auth0-python/compare/5.1.0...5.2.0) - - **⚠️ Breaking: Python 3.8 support dropped** - - Python 3.8 reached end-of-life in October 2024. This release requires **Python >=3.9.2**. Users on Python 3.8 should remain on v5.1.0 until they upgrade their Python version. [\#808](https://github.com/auth0/auth0-python/pull/808) ([kishore7snehil](https://github.com/kishore7snehil)) - - **Added** - - feat: Add default domain endpoints, connection key provisioning, tenant SCIM listing; remove MiiCard/Renren providers [\#801](https://github.com/auth0/auth0-python/pull/801) ([fern-api[bot]](https://github.com/apps/fern-api)) - - feat: Add client_info support for custom telemetry in Authentication and Management clients [\#802](https://github.com/auth0/auth0-python/pull/802) ([kishore7snehil](https://github.com/kishore7snehil)) - - feat: Add SDK logging infrastructure with configurable log levels and header redaction [\#785](https://github.com/auth0/auth0-python/pull/785) ([fern-api[bot]](https://github.com/apps/fern-api)) - - **Fixed** - - fix: Pagination page advancement incorrectly skipping pages [\#785](https://github.com/auth0/auth0-python/pull/785) ([fern-api[bot]](https://github.com/apps/fern-api)) - - **Changed** - - chore: Update ruff, aiohttp, cryptography, urllib3, codecov-action; replace Snyk with SCA scan [\#808](https://github.com/auth0/auth0-python/pull/808) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [5.1.0](https://github.com/auth0/auth0-python/tree/5.1.0) (2026-02-11) - [Full Changelog](https://github.com/auth0/auth0-python/compare/5.0.0...5.1.0) - - **Fixed** - - fix: Remove placeholder defaults from optional parameters + additional updates [\#778](https://github.com/auth0/auth0-python/pull/778) ([fern-api[bot]](https://github.com/apps/fern-api)) - - ## [5.0.0](https://github.com/auth0/auth0-python/tree/5.0.0) (2026-02-04) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.13.0...5.0.0) - - 📢 This is the official v5.0.0 release with significant improvements and breaking changes. - - **Breaking Changes** - - - **Complete rewrite of Management API client** - Generated from Auth0's OpenAPI specifications using [Fern](https://buildwithfern.com) - - **Python 3.7 support dropped** - Minimum required version is now Python 3.8 - - **Management API client restructured** - Methods organized into modular sub-clients for better discoverability - - **Method signatures changed** - Consistent and predictable naming conventions across all endpoints - - **Response types changed** - Strongly-typed Pydantic models replace generic dictionaries - - **Import paths changed** - `from auth0.management.core.api_error import ApiError` instead of `from auth0.exceptions import Auth0Error` - - **Pagination defaults changed** - `include_totals=True` is now the default for list operations - - **Client initialization simplified** - `ManagementClient` takes `domain` instead of full `base_url` - - **Added** - - - First-class async support with `AsyncAuth0` and `AsyncManagementClient` - - Automatic token management with client credentials in `ManagementClient` - - Built-in pagination support with `include_totals=True` by default - - Type-safe request/response objects using Pydantic models - - Better IntelliSense and code completion support - - Comprehensive API reference documentation - - Migration guide for upgrading from v4.x - - **Changed** - - - Management API client fully regenerated using Fern - - Package structure reorganized with hierarchical sub-clients - - Error handling updated to use `ApiError` base class - - Documentation updated with v5 examples - - **Note** - - - Authentication API remains **fully backward compatible** - no changes required - - See [v5_MIGRATION_GUIDE.md](https://github.com/auth0/auth0-python/blob/master/v5_MIGRATION_GUIDE.md) for detailed upgrade instructions - - - ## [4.13.0](https://github.com/auth0/auth0-python/tree/4.13.0) (2025-09-17) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.12.0...4.13.0) - - **Added** - - fix(backchannel): expose headers on `slow_down` errors (HTTP 429s) [\#744](https://github.com/auth0/auth0-python/pull/744) ([pmalouin](https://github.com/pmalouin)) - - ## [4.12.0](https://github.com/auth0/auth0-python/tree/4.12.0) (2025-09-15) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.11.0...4.12.0) - - **Added** - - Updates for CIBA with email [\#720](https://github.com/auth0/auth0-python/pull/720) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.11.0](https://github.com/auth0/auth0-python/tree/4.11.0) (2025-09-11) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.10.0...4.11.0) - - **Added** - - feat: Support For Network ACL Endpoints [\#706](https://github.com/auth0/auth0-python/pull/706) ([kishore7snehil](https://github.com/kishore7snehil)) - - **Fixed** - - chore: fix workflow syntax errors and update dependencies [\#724](https://github.com/auth0/auth0-python/pull/724) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [4.10.0](https://github.com/auth0/auth0-python/tree/4.10.0) (2025-06-05) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.9.0...4.10.0) - - **Added** - - chore: merge community PRs – bugfixes, features, and dependency upgrades [\#696](https://github.com/auth0/auth0-python/pull/696) ([kishore7snehil](https://github.com/kishore7snehil)) - - **Fixed** - - fix: handle `authorization_details` in back_channel_login [\#695](https://github.com/auth0/auth0-python/pull/695) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [4.9.0](https://github.com/auth0/auth0-python/tree/4.9.0) (2025-04-01) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.8.1...4.9.0) - - **Added** - - feat: Federated Connections Support [\#682](https://github.com/auth0/auth0-python/pull/682) ([kishore7snehil](https://github.com/kishore7snehil)) - - Adding Support For CIBA with RAR [\#679](https://github.com/auth0/auth0-python/pull/679) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [4.8.1](https://github.com/auth0/auth0-python/tree/4.8.1) (2025-02-24) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.8.0...4.8.1) - - **Fixed** - - Fix: Unauthorized Access Error For PAR [\#671](https://github.com/auth0/auth0-python/pull/671) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [4.8.0](https://github.com/auth0/auth0-python/tree/4.8.0) (2025-01-29) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.7.2...4.8.0) - - **Added** - - Adding Support For RAR and JAR Requests [\#659](https://github.com/auth0/auth0-python/pull/659) ([kishore7snehil](https://github.com/kishore7snehil)) - - Adding Support For Back Channel Login [\#643](https://github.com/auth0/auth0-python/pull/643) ([kishore7snehil](https://github.com/kishore7snehil)) - - **Fixed** - - Consolidated Community PRs and Dependency Upgrades [\#660](https://github.com/auth0/auth0-python/pull/660) ([kishore7snehil](https://github.com/kishore7snehil)) - - [fix typo in docstring](https://github.com/auth0/auth0-python/pull/637) ([@CarlosEduR ](https://github.com/CarlosEduR)) - - [Added support for "include_totals" to all_organization_member_roles](https://github.com/auth0/auth0-python/pull/635) ([@jpayton-cx](https://github.com/jpayton-cx)) - - [Fixed Version Table](https://github.com/auth0/auth0-python/pull/633) ([@sanchez](https://github.com/sanchez)) - - [Remove upper bounds on all python dependency versions](https://github.com/auth0/auth0-python/pull/628) ([@ngfeldman](https://github.com/ngfeldman)) - - [Adding secrets to Codecov Action Upload](https://github.com/auth0/auth0-python/pull/624) ([@developerkunal](https://github.com/developerkunal)) - - Updating Dependancies And Workflow Action Versions [\#653](https://github.com/auth0/auth0-python/pull/653) ([kishore7snehil](https://github.com/kishore7snehil)) - - Fixing the Github Workflow Issues [\#644](https://github.com/auth0/auth0-python/pull/644) ([kishore7snehil](https://github.com/kishore7snehil)) - - ## [4.7.2](https://github.com/auth0/auth0-python/tree/4.7.2) (2024-09-10) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.7.1...4.7.2) - - **Security** - - Update cryptography requirements.txt [\#630](https://github.com/auth0/auth0-python/pull/630) ([duedares-rvj](https://github.com/duedares-rvj)) - - ## [4.7.1](https://github.com/auth0/auth0-python/tree/4.7.1) (2024-02-26) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.7.0...4.7.1) - - **Security** - - Update cryptography requirements.txt [\#597](https://github.com/auth0/auth0-python/pull/597) ([skjensen](https://github.com/skjensen)) - - ## [4.7.0](https://github.com/auth0/auth0-python/tree/4.7.0) (2023-12-05) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.6.1...4.7.0) - - **⚠️ BREAKING CHANGES** - - Add python 3.12 support, drop 3.7 [\#562](https://github.com/auth0/auth0-python/pull/562) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - **Added** - - [SDK-4138] Add support for Pushed Authorization Requests (PAR) [\#560](https://github.com/auth0/auth0-python/pull/560) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.6.1](https://github.com/auth0/auth0-python/tree/4.6.1) (2023-11-29) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.6.0...4.6.1) - - **Fixed** - - Fix rest_async and async tests [\#556](https://github.com/auth0/auth0-python/pull/556) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - fix type hint for link_user_account [\#552](https://github.com/auth0/auth0-python/pull/552) ([tzzh](https://github.com/tzzh)) - - ## [4.6.0](https://github.com/auth0/auth0-python/tree/4.6.0) (2023-11-09) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.5.0...4.6.0) - - **Added** - - [SDK-4544] Add orgs in client credentials support [\#549](https://github.com/auth0/auth0-python/pull/549) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Authentication API, the Database classs, Add the organization param to the change_password method [\#539](https://github.com/auth0/auth0-python/pull/539) ([shchotse](https://github.com/shchotse)) - - Retry all methods on 429 [\#518](https://github.com/auth0/auth0-python/pull/518) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.5.0](https://github.com/auth0/auth0-python/tree/4.5.0) (2023-10-20) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.4.2...4.5.0) - - **Added** - - [SDK-4656] Add fields to all_organization_members [\#537](https://github.com/auth0/auth0-python/pull/537) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.4.2](https://github.com/auth0/auth0-python/tree/4.4.2) (2023-08-31) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.4.1...4.4.2) - - **Fixed** - - Fix python dependency version [\#522](https://github.com/auth0/auth0-python/pull/522) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Revert publishing types [\#521](https://github.com/auth0/auth0-python/pull/521) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.4.1](https://github.com/auth0/auth0-python/tree/4.4.1) (2023-08-21) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.4.0...4.4.1) - - **Fixed** - - Fix for async types [\#515](https://github.com/auth0/auth0-python/pull/515) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.4.0](https://github.com/auth0/auth0-python/tree/4.4.0) (2023-07-25) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.3.0...4.4.0) - - **Added** - - [SDK-4394] Add organization name validation [\#507](https://github.com/auth0/auth0-python/pull/507) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Add type hints to `management` [\#497](https://github.com/auth0/auth0-python/pull/497) ([Viicos](https://github.com/Viicos)) - - **Fixed** - - Fix asyncify for users client where token is not required [\#506](https://github.com/auth0/auth0-python/pull/506) ([cgearing](https://github.com/cgearing)) - - ## [4.3.0](https://github.com/auth0/auth0-python/tree/4.3.0) (2023-06-26) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.2.0...4.3.0) - - **Added** - - Add forwardedFor option to password grant login [\#501](https://github.com/auth0/auth0-python/pull/501) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Add connections.all name parameter [\#500](https://github.com/auth0/auth0-python/pull/500) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Add type hints to base and `authentication` [\#472](https://github.com/auth0/auth0-python/pull/472) ([Viicos](https://github.com/Viicos)) - - **Fixed** - - Fix async auth client [\#499](https://github.com/auth0/auth0-python/pull/499) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Fix update_template_universal_login [\#495](https://github.com/auth0/auth0-python/pull/495) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.2.0](https://github.com/auth0/auth0-python/tree/4.2.0) (2023-05-02) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.1.1...4.2.0) - - **Added** - - Add cache_ttl param to AsymmetricSignatureVerifier [\#490](https://github.com/auth0/auth0-python/pull/490) ([matei-radu](https://github.com/matei-radu)) - - ## [4.1.1](https://github.com/auth0/auth0-python/tree/4.1.1) (2023-04-13) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.1.0...4.1.1) - - **Fixed** - - Make pw realm params optional [\#484](https://github.com/auth0/auth0-python/pull/484) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Fix intellisense on Auth0 class [\#486](https://github.com/auth0/auth0-python/pull/486) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [4.1.0](https://github.com/auth0/auth0-python/tree/4.1.0) (2023-03-14) - [Full Changelog](https://github.com/auth0/auth0-python/compare/4.0.0...4.1.0) - - **Added** - - Add branding theme endpoints [\#477](https://github.com/auth0/auth0-python/pull/477) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - [SDK-4011] Add API2 Factor Management Endpoints [\#476](https://github.com/auth0/auth0-python/pull/476) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Use declarative setup with `pyproject.toml` [\#474](https://github.com/auth0/auth0-python/pull/474) ([Viicos](https://github.com/Viicos)) - - ## [4.0.0](https://github.com/auth0/auth0-python/tree/4.0.0) (2023-01-19) - [Full Changelog](https://github.com/auth0/auth0-python/compare/3.24.1...4.0.0) - - **Added** - - Add support for private_key_jwt [\#456](https://github.com/auth0/auth0-python/pull/456) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Add support for managing client credentials [\#459](https://github.com/auth0/auth0-python/pull/459) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - **Security** - - Update pyjwt [\#460](https://github.com/auth0/auth0-python/pull/460) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - **Changed** - - Publish Python Support Schedule [\#454](https://github.com/auth0/auth0-python/pull/454) ([evansims](https://github.com/evansims)) - - **⚠️ BREAKING CHANGES** - - Remove deprecated methods [\#461](https://github.com/auth0/auth0-python/pull/461) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Remove v3 folder [\#462](https://github.com/auth0/auth0-python/pull/462) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - See the [V4_MIGRATION_GUIDE](https://github.com/auth0/auth0-python/blob/master/V4_MIGRATION_GUIDE.md) for more info. - - ## [3.24.1](https://github.com/auth0/auth0-python/tree/3.24.1) (2023-01-19) - [Full Changelog](https://github.com/auth0/auth0-python/compare/3.24.0...3.24.1) - - **Fixed** - - Remove unnecessary type param from update_template_universal_login [\#463](https://github.com/auth0/auth0-python/pull/463) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [3.24.0](https://github.com/auth0/auth0-python/tree/3.24.0) (2022-10-17) - [Full Changelog](https://github.com/auth0/auth0-python/compare/3.23.1...3.24.0) - - **Added** - - [SDK-3714] Async token verifier [\#445](https://github.com/auth0/auth0-python/pull/445) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Add AsyncAuth0 to share a session among many services [\#443](https://github.com/auth0/auth0-python/pull/443) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - **Fixed** - - Bugfix 414 missing import [\#442](https://github.com/auth0/auth0-python/pull/442) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - ## [3.23.1](https://github.com/auth0/auth0-python/tree/3.23.1) (2022-06-10) - [Full Changelog](https://github.com/auth0/auth0-python/compare/3.23.0...3.23.1) - - **Fixed** - - Pass rest_options through Auth0 constructor [\#354](https://github.com/auth0/auth0-python/pull/354) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - - 3.23.0 - ------------------ - - **Added** - - Asyncio Support [\#312](https://github.com/auth0/auth0-python/pull/312) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - Add `/api/v2/branding` endpoints support [\#313](https://github.com/auth0/auth0-python/pull/313) ([evansims](https://github.com/evansims)) - - 3.22.0 - ------------------ - - **Added** - - [SDK-3174] Add `DELETE` method for `/api/v2/users/{id}/authenticators` endpoint [\#301](https://github.com/auth0/auth0-python/pull/301) ([akmjenkins](https://github.com/akmjenkins)) - - [SDK-3175] Return token claims in TokenVerifier.verify() [\#273](https://github.com/auth0/auth0-python/pull/273) ([bisguzar](https://github.com/bisguzar)) - - **Fixed** - - [SDK-3173] Default to 'None' for `deployed` on GET /api/v2/actions/actions endpoint [\#309](https://github.com/auth0/auth0-python/pull/309) ([evansims](https://github.com/evansims)) - - 3.21.0 - ------------------ - - **Added** - - Add pagination to device credentials [\#300](https://github.com/auth0/auth0-python/pull/300) ([fionnulak](https://github.com/fionnulak)) - - 3.20.0 - ------------------ - - **Added** - - Add attack protection endpoints [\#303](https://github.com/auth0/auth0-python/pull/303) ([adamjmcgrath](https://github.com/adamjmcgrath)) - - 3.19.0 - ------------------ - - **Added** - - Add actions to Auth0 class [\#293](https://github.com/auth0/auth0-python/pull/293) ([jrzerr](https://github.com/jrzerr)) - - Added support for prompts API [\#291](https://github.com/auth0/auth0-python/pull/291) ([lorinkoz](https://github.com/lorinkoz)) - - **Changed** - - Remove references to ID token in generic token classes [\#295](https://github.com/auth0/auth0-python/pull/295) ([lbalmaceda](https://github.com/lbalmaceda)) - - **Fixed** - - Use assertNotEqual instead of assertNotEquals for Python 3.11 compatibility. [\#294](https://github.com/auth0/auth0-python/pull/294) ([tirkarthi](https://github.com/tirkarthi)) - - 3.18.0 - ------------------ - - **Added** - - [SDK-2720] Add support for actions APIs [\#289](https://github.com/auth0/auth0-python/pull/289) ([jimmyjames](https://github.com/jimmyjames)) - - 3.17.0 - ------------------ - - **Added** - - Make the CI fail when the docs syntax is invalid [\#287](https://github.com/auth0/auth0-python/pull/287) ([lbalmaceda](https://github.com/lbalmaceda)) - - [SDK-2687] Implement automatic rate-limit handling [\#285](https://github.com/auth0/auth0-python/pull/285) ([evansims](https://github.com/evansims)) - - Use Sphinx to generate API docs [\#281](https://github.com/auth0/auth0-python/pull/281) ([lbalmaceda](https://github.com/lbalmaceda)) - - Add Passwordless Login function [\#279](https://github.com/auth0/auth0-python/pull/279) ([lbalmaceda](https://github.com/lbalmaceda)) - - [SDK 2665] Update endpoint methods to support 'from' and 'take' checkpoint pagination parameters, where appropriate [\#278](https://github.com/auth0/auth0-python/pull/278) ([evansims](https://github.com/evansims)) - - **Deprecated** - - Deprecate /oauth/ro for passwordless [\#280](https://github.com/auth0/auth0-python/pull/280) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.16.2 - ------------------ - - **Fixed** - - Re-Route Job Results endpoint [\#275](https://github.com/auth0/auth0-python/pull/275) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.16.1 - ------------------ - - **Fixed** - - Remove requirements.txt file [\#270](https://github.com/auth0/auth0-python/pull/270) ([lbalmaceda](https://github.com/lbalmaceda)) - - Repair Organisation get by name URL. [\#269](https://github.com/auth0/auth0-python/pull/269) ([queenvictoria](https://github.com/queenvictoria)) - - 3.16.0 - ------------------ - - **Added** - - Add access token validation guidance for organizations [\#262](https://github.com/auth0/auth0-python/pull/262) ([lbalmaceda](https://github.com/lbalmaceda)) - - Add support for Organization MGMT API endpoints [SDK-2439] [\#261](https://github.com/auth0/auth0-python/pull/261) ([lbalmaceda](https://github.com/lbalmaceda)) - - Add scope to refresh_token [\#256](https://github.com/auth0/auth0-python/pull/256) ([criles25](https://github.com/criles25)) - - Allow configuration of outgoing request protocol [\#254](https://github.com/auth0/auth0-python/pull/254) ([garry-jeromson](https://github.com/garry-jeromson)) - - 3.15.0 - ------------------ - - **Added** - - Add support for organizations feature [\#258](https://github.com/auth0/auth0-python/pull/258) ([jimmyjames](https://github.com/jimmyjames)) - - 3.14.0 - ------------------ - - **Added** - - Adds a new user method invalidate_remembered_browsers [\#248](https://github.com/auth0/auth0-python/pull/248) ([kpurdon](https://github.com/kpurdon)) - - 3.13.0 - ------------------ - - **Added** - - Add support for Log Streams API [\#236](https://github.com/auth0/auth0-python/pull/236) ([lbalmaceda](https://github.com/lbalmaceda)) - - **Fixed** - - Fix imports on the management/__init__.py file [\#235](https://github.com/auth0/auth0-python/pull/235) ([matthewarmand](https://github.com/matthewarmand)) - - 3.12.0 - ------------------ - - **Added** - - Add missing user profile properties to the signup endpoint [\#231](https://github.com/auth0/auth0-python/pull/231) ([lbalmaceda](https://github.com/lbalmaceda)) - - Add Hooks management API [\#227](https://github.com/auth0/auth0-python/pull/227) ([guillp](https://github.com/guillp)) - - Add missing external_id property to the import users job [\#222](https://github.com/auth0/auth0-python/pull/222) ([lbalmaceda](https://github.com/lbalmaceda)) - - **Changed** - - Remove iat claim value check [\#223](https://github.com/auth0/auth0-python/pull/223) ([lbalmaceda](https://github.com/lbalmaceda)) - - **Fixed** - - Skip sending optional parameters on POST request when unspecified [\#230](https://github.com/auth0/auth0-python/pull/230) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.11.0 - ------------------ - - **Added** - - Add send_completion_email to users import job [\#220](https://github.com/auth0/auth0-python/pull/220) ([lbalmaceda](https://github.com/lbalmaceda)) - - Expose the time at which the Rate Limit will reset [\#219](https://github.com/auth0/auth0-python/pull/219) ([lbalmaceda](https://github.com/lbalmaceda)) - - **Removed** - - Add deprecation note for DELETE /users (all users) [\#217](https://github.com/auth0/auth0-python/pull/217) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.10.0 - ------------------ - - **Security** - - Improved OIDC compliance [\#213](https://github.com/auth0/auth0-python/pull/213) ([lbalmaceda](https://github.com/lbalmaceda)) - - **Added** - - Add connect/read timeout option [\#215](https://github.com/auth0/auth0-python/pull/215) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.9.2 - ------------------ - - **Fixed** - - Accept client_secret as passwordless/start param [\#211](https://github.com/auth0/auth0-python/pull/211) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.9.1 - ------------------ - - **Changed** - - Update minimum "requests" version to 2.14.0 [\#204](https://github.com/auth0/auth0-python/pull/204) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.9.0 - ------------------ - - **Added** - - Add Roles and Permissions endpoints [\#202](https://github.com/auth0/auth0-python/pull/202) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.8.1 - ------------------ - - July 18, 2019: This release included an unintentionally breaking change affecting those users that were manually parsing the response from GET requests. e.g. /userinfo or /authorize. The `AuthenticationBase#get` method was incorrectly parsing the request result into a String. - - From this release on, making a GET request returns a Dictionary instead. - - **Breaking Change** - - Fix request creation when headers are the default [\#198](https://github.com/auth0/auth0-python/pull/198) ([lbalmaceda](https://github.com/lbalmaceda)). - - - 3.8.0 - ------------------ - - **Fixed** - - rules_config.unset fix [\#195](https://github.com/auth0/auth0-python/pull/195) ([jhunken](https://github.com/jhunken)) - - **Security** - - Update requests dependency to latest version [\#196](https://github.com/auth0/auth0-python/pull/196) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.7.2 - ------------------ - - **Fixed** - - Fix HTTP method used for rotating Client secret [\#191](https://github.com/auth0/auth0-python/pull/191) ([lbalmaceda](https://github.com/lbalmaceda)) - - 3.7.1 - ------------------ - - **Fixed** - - Update telemetry format [\#187](https://github.com/auth0/auth0-python/pull/187) ([lbalmaceda](https://github.com/lbalmaceda)) - - - 3.7.0 - ------------------ - - **Changed** - - Remove default value for search_engine [\#185](https://github.com/auth0/auth0-python/pull/185) ([lbalmaceda](https://github.com/lbalmaceda)) - - - 3.6.1 - ------------------ - - **Fixed** - - Fixed Management API Grants class instantiation [\#179](https://github.com/auth0/auth0-python/pull/179) ([beck3905](https://github.com/beck3905)) - - - 3.6.0 - ------------------ - - **Added** - - Add grants, custom domains, rules_configs to API [\#177](https://github.com/auth0/auth0-python/pull/177) ([sagnew-dg](https://github.com/sagnew-dg)) - - - 3.5.0 - ------------------ - - **Added** - - Add Revoke Refresh Token endpoint [\#170](https://github.com/auth0/auth0-python/pull/170) ([lbalmaceda](https://github.com/lbalmaceda)) - - Add /dbconnections/signup with username and metadata [\#169](https://github.com/auth0/auth0-python/pull/169) ([lbalmaceda](https://github.com/lbalmaceda)) - - - 3.4.0 - ------------------ - - **Added** - - Add `client_id` param to ClientGrants.all [\#159](https://github.com/auth0/auth0-python/pull/159) ([danishprakash](https://github.com/danishprakash)) - - Add telemetry headers to AuthenticationBase [\#152](https://github.com/auth0/auth0-python/pull/152) ([crgk](https://github.com/crgk)) - - Add pre-commit pypgrade hook and update supported versions [\#124](https://github.com/auth0/auth0-python/pull/124) ([hugovk](https://github.com/hugovk)) - - Implemented delete_user_by_email and test for connections [\#122](https://github.com/auth0/auth0-python/pull/122) ([runz0rd](https://github.com/runz0rd)) - - Adds user export job creation. [\#112](https://github.com/auth0/auth0-python/pull/112) ([dmark](https://github.com/dmark)) - - **Changed** - - String Formatting Updated [\#141](https://github.com/auth0/auth0-python/pull/141) ([vkmrishad](https://github.com/vkmrishad)) - - Uses Python built-in modules to retrieve Python and auth0-python version number [\#125](https://github.com/auth0/auth0-python/pull/125) ([edawine](https://github.com/edawine)) - - **Fixed** - - Stop lower-casing email on user search [\#167](https://github.com/auth0/auth0-python/pull/167) ([helmus](https://github.com/helmus)) - - Always include Content-Type header in management requests [\#158](https://github.com/auth0/auth0-python/pull/158) ([crgk](https://github.com/crgk)) - - - 3.3.0 - ------------------ - - **Added** - - Add pagination to Clients and Connections - - Add pagination to Client Grants, Resource Servers and Rules - - Add Email-Templates Management API endpoints - - **Fixed** - - Replace default mutable arguments with None - - Fix JSON error message handling for Management API - - - 3.2.2 - ------------------ - - **Fixed** - - Upload the correct package contents to Pypi. - - - 3.2.0 - ------------------ - - **Added** - - Raise Auth0Error for bad status code [\#98](https://github.com/auth0/auth0-python/pull/98) ([beck3905](https://github.com/beck3905)) - - **Fixed** - - Correctly throw an exception when handing a text response [\#92](https://github.com/auth0/auth0-python/pull/92) ([benbc](https://github.com/benbc)) - - Instantiate UserBlocks for consistency [\#90](https://github.com/auth0/auth0-python/pull/90) ([mattdodge](https://github.com/mattdodge)) - - 3.1.4 - ------------------ - - Authentication API - - Improve handling of inconsistent API error responses. - - 3.1.3 - ------------------ - - Management API - - Added `upsert` parameter to `import_users` job. - - 3.1.2 - ------------------ - - Authentication API - - Added `refresh_token` method to get_token - - 3.1.0 - ------------------ - - Authentication API - - Added Logout Functionality - - 3.0.0 - ------------------ - - Authentication API - - Added Support for API Authorization. `oauth/token` endpoint - - Client Credentials Grant - - Authorization Code Grant - - Authorization Code PKCE Grant - - Resource Owner Password Realm Grant - - Added Support for API Authorization. `authorize` endpoint - - Authorization Code Grant - - Management API v2 - - Added Support for Guardian - - Added Support to retrieve Logs - - Added Support to manage Resource Servers - - Added Support to manage Client Grants - - Added Support to manage User blocks - pyproject.toml: | - [project] - name = "auth0-python" - - [tool.poetry] - name = "auth0-python" - version = "5.4.0" - description = "Auth0 Python SDK - Management and Authentication APIs" - readme = "README.md" - authors = ["Auth0 "] - license = "MIT" - keywords = ["auth0", "authentication", "authorization", "oauth", "openid"] - - classifiers = [ - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: OS Independent", - "Operating System :: POSIX", - "Operating System :: MacOS", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed" - ] - packages = [ - { include = "auth0", from = "src"} - ] - - [tool.poetry.urls] - Repository = 'https://github.com/auth0/auth0-python' - Homepage = 'https://auth0.com' - - [tool.poetry.dependencies] - python = ">=3.9.2,<4.0" - httpx = ">=0.21.2" - pydantic = ">= 1.9.2" - pydantic-core = ">=2.18.2" - typing_extensions = ">= 4.0.0" - # Authentication API dependencies - aiohttp = ">=3.11.18" - cryptography = ">=44.0.0" - pyjwt = ">=2.8.0" - requests = ">=2.32.3" - urllib3 = ">=2.3.0" - - [tool.poetry.group.dev.dependencies] - mypy = "==1.13.0" - pytest = "^7.4.0" - pytest-asyncio = "^0.23.5" - pytest-xdist = "^3.6.1" - python-dateutil = "^2.9.0" - types-python-dateutil = "^2.9.0.20240316" - types-requests = "^2.31.0" - ruff = "==0.15.8" - # Authentication API test dependencies - aioresponses = "^0.7.8" - mock = "^5.1.0" - pytest-aiohttp = "^1.0.4" - pytest-cov = "^4.1.0" - responses = ">=0.23.3" - - [tool.pytest.ini_options] - asyncio_mode = "auto" - - [tool.mypy] - plugins = ["pydantic.mypy"] - # Exclude Authentication API, not built for mypy - exclude = ["src/auth0/authentication/"] - - [tool.ruff] - line-length = 120 - - [tool.ruff.lint] - select = [ - "E", # pycodestyle errors - "F", # pyflakes - "I", # isort - ] - ignore = [ - "E402", # Module level import not at top of file - "E501", # Line too long - "E711", # Comparison to `None` should be `cond is not None` - "E712", # Avoid equality comparisons to `True`; use `if ...:` checks - "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks - "E722", # Do not use bare `except` - "E731", # Do not assign a `lambda` expression, use a `def` - "F821", # Undefined name - "F841" # Local variable ... is assigned to but never used - ] - - [tool.ruff.lint.isort] - section-order = ["future", "standard-library", "third-party", "first-party"] - - [build-system] - requires = ["poetry-core"] - build-backend = "poetry.core.masonry.api" - user_owned: true diff --git a/reference.md b/reference.md index fb6bfb5a..cc537eb3 100644 --- a/reference.md +++ b/reference.md @@ -419,7 +419,7 @@ client.actions.delete(
-Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. +Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed.
@@ -3648,25 +3648,23 @@ client.connection_profiles.update(
-Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. +Retrieves detailed list of all [connections](https://auth0.com/docs/authenticate/identity-providers) that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ +- Offset pagination +- Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 connections. -

Checkpoint Pagination

+**Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
-Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +- `from`: Optional id from which to start selection. +- `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + +**Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining.
@@ -3786,9 +3784,9 @@ client.connections.list(
-Creates a new connection according to the JSON object received in body. +Creates a new connection according to the JSON object received in `body`. -Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. +**Note:** If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.
@@ -3942,7 +3940,7 @@ client.connections.create(
-Retrieve details for a specified connection along with options that can be used for identity provider configuration. +Retrieve details for a specified [connection](https://auth0.com/docs/authenticate/identity-providers) along with options that can be used for identity provider configuration.
@@ -4033,9 +4031,9 @@ client.connections.get(
-Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. +Removes a specific [connection](https://auth0.com/docs/authenticate/identity-providers) from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. -Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name. +**Note:** If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent [create connection](https://auth0.com/docs/api/management/v2/connections/post-connections) requests, if they use an identical connection name.
@@ -4108,9 +4106,9 @@ client.connections.delete(
-Update details for a specific connection, including option properties for identity provider configuration. +Update details for a specific [connection](https://auth0.com/docs/authenticate/identity-providers), including option properties for identity provider configuration. -Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. +**Note**: If you use the `options` parameter, the entire `options` object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.
@@ -4255,7 +4253,7 @@ client.connections.update(
-Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message +Retrieves the status of an ad/ldap connection referenced by its `ID`. `200 OK` http status code response is returned when the connection is online, otherwise a `404` status code is returned along with an error message
@@ -4329,7 +4327,7 @@ client.connections.check_status(
-Retrieve details on custom domains. +Retrieve details on [custom domains](https://auth0.com/docs/custom-domains).
@@ -4439,7 +4437,6 @@ Optional attributes that can be updated: - custom_client_ip_header - tls_policy - TLS Policies: - recommended - for modern usage this includes TLS 1.2 only @@ -4853,23 +4850,31 @@ These are the attributes that can be updated: - custom_client_ip_header - tls_policy -
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to +**Updating CUSTOM_CLIENT_IP_HEADER for a custom domain** + +To update the `custom_client_ip_header` for a domain, the body to send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+```json +{ "custom_client_ip_header": "cf-connecting-ip" } +``` +**Updating TLS_POLICY for a custom domain** + +To update the `tls_policy` for a domain, the body to send should be: + +```json +{ "tls_policy": "recommended" } +``` TLS Policies: - recommended - for modern usage this includes TLS 1.2 only - Some considerations: - The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. -- The compatible TLS policy is no longer supported. +- The `compatible` TLS policy is no longer supported. @@ -5049,12 +5054,12 @@ client.custom_domains.test( Run the verification process on a custom domain. -Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. +Note: Check the `status` field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. -For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. +For `self_managed_certs`, when the custom domain is verified for the first time, the response will also include the `cname_api_key` which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. -Learn more about verifying custom domains that use Auth0 Managed certificates. -Learn more about verifying custom domains that use Self Managed certificates. +[Learn more](https://auth0.com/docs/custom-domains#step-2-verify-ownership) about verifying custom domains that use Auth0 Managed certificates. +[Learn more](https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership) about verifying custom domains that use Self Managed certificates. @@ -7841,7 +7846,7 @@ client.groups.delete(
-Retrieve all hooks. Accepts a list of fields to include or exclude in the result. +Retrieve all [hooks](https://auth0.com/docs/hooks). Accepts a list of fields to include or exclude in the result.
@@ -8066,7 +8071,7 @@ client.hooks.create(
-Retrieve a hook by its ID. Accepts a list of fields to include in the result. +Retrieve [a hook](https://auth0.com/docs/hooks) by its ID. Accepts a list of fields to include in the result.
@@ -9302,33 +9307,30 @@ client.log_streams.update( Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). -Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). +Set custom search criteria using the `q` parameter, or search from a specific log ID (_"search from checkpoint"_). -For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. +For more information on all possible event types, their respective acronyms, and descriptions, see [Log Event Type Codes](https://auth0.com/docs/logs/log-event-type-codes). -
To set custom search criteria, use the following parameters:
+**To set custom search criteria, use the following parameters:** -
    -
  • q: Search Criteria using Query String Syntax
  • -
  • page: Page index of the results to return. First page is 0.
  • -
  • per_page: Number of results per page.
  • -
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • -
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • -
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • -
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • -
+- **q:** Search Criteria using [Query String Syntax](https://auth0.com/docs/logs/log-search-query-syntax) +- **page:** Page index of the results to return. First page is 0. +- **per_page:** Number of results per page. +- **sort:** Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1` +- **fields:** Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields. +- **include_fields:** Whether specified fields are to be included (true) or excluded (false). +- **include_totals:** Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). **Deprecated:** this field is deprecated and should be removed from use. See [Search Engine V3 Breaking Changes](https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination) -For more information on the list of fields that can be used in fields and sort, see Searchable Fields. +For more information on the list of fields that can be used in `fields` and `sort`, see [Searchable Fields](https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields). -Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. +Auth0 [limits the number of logs](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations) you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the [get logs by checkpoint method](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint). -
To search from a checkpoint log ID, use the following parameters:
-
    -
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • -
  • take: Number of entries to retrieve when using the from parameter.
  • -
+**To search from a checkpoint log ID, use the following parameters:** -Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. +- **from:** Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the `take` parameter. If you use `from` at the same time as `q`, `from` takes precedence and `q` is ignored. +- **take:** Number of entries to retrieve when using the `from` parameter. + +**Important:** When fetching logs from a checkpoint log ID, any parameter other than `from` and `take` will be ignored, and date ordering is not guaranteed. @@ -10784,25 +10786,11 @@ client.prompts.update_settings() -## RefreshTokens -
client.refresh_tokens.list(...) -> GetRefreshTokensPaginatedResponseContent -
-
- -#### 📝 Description - +## RateLimitPolicies +
client.rate_limit_policies.list(...) -> ListRateLimitPoliciesPaginatedResponseContent
-
-
- -Retrieve a paginated list of refresh tokens for a specific user, with optional filtering by client ID. Results are sorted by credential_id ascending. -
-
-
-
- #### 🔌 Usage
@@ -10820,13 +10808,12 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.refresh_tokens.list( - user_id="user_id", - client_id="client_id", - from_="from", +client.rate_limit_policies.list( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", take=1, - fields="fields", - include_fields=True, + from_="from", ) ``` @@ -10843,7 +10830,7 @@ client.refresh_tokens.list(
-**user_id:** `str` — ID of the user whose refresh tokens to retrieve. Required. +**resource:** `typing.Optional[RateLimitPolicyResourceEnum]` — The API protected by the Rate Limit Policy.
@@ -10851,7 +10838,7 @@ client.refresh_tokens.list(
-**client_id:** `typing.Optional[str]` — Filter results by client ID. Only valid when user_id is provided. +**consumer:** `typing.Optional[RateLimitPolicyConsumerEnum]` — The consumer to which the rate limit policy applies.
@@ -10859,7 +10846,7 @@ client.refresh_tokens.list(
-**from:** `typing.Optional[str]` — An opaque cursor from which to start the selection (exclusive). Expires after 24 hours. Obtained from the next property of a previous response. +**consumer_selector:** `typing.Optional[str]` — Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted.
@@ -10875,15 +10862,7 @@ client.refresh_tokens.list(
-**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. - -
-
- -
-
- -**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false). +**from:** `typing.Optional[str]` — Cursor for pagination.
@@ -10903,24 +10882,10 @@ client.refresh_tokens.list(
-
client.refresh_tokens.revoke(...) -
-
- -#### 📝 Description - +
client.rate_limit_policies.create(...) -> CreateRateLimitPolicyResponseContent
-
-
- -Revoke refresh tokens in bulk by ID list, user, user+client, or client. -
-
-
-
- #### 🔌 Usage
@@ -10930,7 +10895,7 @@ Revoke refresh tokens in bulk by ID list, user, user+client, or client.
```python -from auth0.management import Auth0 +from auth0.management import Auth0, RateLimitPolicyConfigurationZero from auth0.management.environment import Auth0Environment client = Auth0( @@ -10938,7 +10903,14 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.refresh_tokens.revoke() +client.rate_limit_policies.create( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + configuration=RateLimitPolicyConfigurationZero( + action="allow", + ), +) ```
@@ -10954,7 +10926,7 @@ client.refresh_tokens.revoke()
-**ids:** `typing.Optional[typing.List[str]]` — Array of refresh token IDs to revoke. Limited to 100 at a time. +**resource:** `RateLimitPolicyResourceEnum`
@@ -10962,7 +10934,7 @@ client.refresh_tokens.revoke()
-**user_id:** `typing.Optional[str]` — Revoke all refresh tokens for this user. +**consumer:** `RateLimitPolicyConsumerEnum`
@@ -10970,7 +10942,7 @@ client.refresh_tokens.revoke()
-**client_id:** `typing.Optional[str]` — Revoke all refresh tokens for this client. +**consumer_selector:** `str` — Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted.
@@ -10978,7 +10950,7 @@ client.refresh_tokens.revoke()
-**audience:** `typing.Optional[str]` — Resource server identifier (audience) to scope the revocation. Must be used with both `user_id` and `client_id`. +**configuration:** `RateLimitPolicyConfiguration`
@@ -10998,24 +10970,10 @@ client.refresh_tokens.revoke()
-
client.refresh_tokens.get(...) -> GetRefreshTokenResponseContent +
client.rate_limit_policies.get(...) -> GetRateLimitPolicyResponseContent
-#### 📝 Description - -
-
- -
-
- -Retrieve refresh token information. -
-
-
-
- #### 🔌 Usage
@@ -11033,7 +10991,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.refresh_tokens.get( +client.rate_limit_policies.get( id="id", ) @@ -11051,7 +11009,7 @@ client.refresh_tokens.get(
-**id:** `str` — ID refresh token to retrieve +**id:** `str` — Unique identifier for the Rate Limit Policy.
@@ -11071,24 +11029,10 @@ client.refresh_tokens.get(
-
client.refresh_tokens.delete(...) +
client.rate_limit_policies.delete(...)
-#### 📝 Description - -
-
- -
-
- -Delete a refresh token by its ID. -
-
-
-
- #### 🔌 Usage
@@ -11106,7 +11050,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.refresh_tokens.delete( +client.rate_limit_policies.delete( id="id", ) @@ -11124,7 +11068,7 @@ client.refresh_tokens.delete(
-**id:** `str` — ID of the refresh token to delete. +**id:** `str` — Unique identifier for the Rate Limit Policy.
@@ -11144,24 +11088,10 @@ client.refresh_tokens.delete(
-
client.refresh_tokens.update(...) -> UpdateRefreshTokenResponseContent -
-
- -#### 📝 Description - +
client.rate_limit_policies.update(...) -> UpdateRateLimitPolicyResponseContent
-
-
- -Update a refresh token by its ID. -
-
-
-
- #### 🔌 Usage
@@ -11171,7 +11101,7 @@ Update a refresh token by its ID.
```python -from auth0.management import Auth0 +from auth0.management import Auth0, PatchRateLimitPolicyConfigurationRequestContentZero from auth0.management.environment import Auth0Environment client = Auth0( @@ -11179,8 +11109,11 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.refresh_tokens.update( +client.rate_limit_policies.update( id="id", + configuration=PatchRateLimitPolicyConfigurationRequestContentZero( + action="allow", + ), ) ``` @@ -11197,7 +11130,7 @@ client.refresh_tokens.update(
-**id:** `str` — ID of the refresh token to update. +**id:** `str` — Unique identifier for the Rate Limit Policy.
@@ -11205,7 +11138,7 @@ client.refresh_tokens.update(
-**refresh_token_metadata:** `typing.Optional[RefreshTokenMetadata]` — Metadata associated with the refresh token. Pass null or {} to remove all metadata. +**configuration:** `PatchRateLimitPolicyConfigurationRequestContent`
@@ -11225,8 +11158,8 @@ client.refresh_tokens.update(
-## ResourceServers -
client.resource_servers.list(...) -> ListResourceServerOffsetPaginatedResponseContent +## RefreshTokens +
client.refresh_tokens.list(...) -> GetRefreshTokensPaginatedResponseContent
@@ -11238,7 +11171,7 @@ client.refresh_tokens.update(
-Retrieve details of all APIs associated with your tenant. +Retrieve a paginated list of refresh tokens for a specific user, with optional filtering by client ID. Results are sorted by credential_id ascending.
@@ -11261,13 +11194,12 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.resource_servers.list( - identifiers=[ - "identifiers" - ], - page=1, - per_page=1, - include_totals=True, +client.refresh_tokens.list( + user_id="user_id", + client_id="client_id", + from_="from", + take=1, + fields="fields", include_fields=True, ) @@ -11285,7 +11217,7 @@ client.resource_servers.list(
-**identifiers:** `typing.Optional[typing.Union[typing.Optional[str], typing.Sequence[typing.Optional[str]]]]` — An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../resource-servers?identifiers=id1&identifiers=id2 +**user_id:** `str` — ID of the user whose refresh tokens to retrieve. Required.
@@ -11293,7 +11225,7 @@ client.resource_servers.list(
-**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. +**client_id:** `typing.Optional[str]` — Filter results by client ID. Only valid when user_id is provided.
@@ -11301,7 +11233,7 @@ client.resource_servers.list(
-**per_page:** `typing.Optional[int]` — Number of results per page. +**from:** `typing.Optional[str]` — An opaque cursor from which to start the selection (exclusive). Expires after 24 hours. Obtained from the next property of a previous response.
@@ -11309,7 +11241,15 @@ client.resource_servers.list(
-**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
@@ -11337,7 +11277,7 @@ client.resource_servers.list(
-
client.resource_servers.create(...) -> CreateResourceServerResponseContent +
client.refresh_tokens.revoke(...)
@@ -11349,7 +11289,7 @@ client.resource_servers.list(
-Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read APIs. +Revoke refresh tokens in bulk by ID list, user, user+client, or client.
@@ -11372,9 +11312,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.resource_servers.create( - identifier="identifier", -) +client.refresh_tokens.revoke() ```
@@ -11390,7 +11328,7 @@ client.resource_servers.create(
-**identifier:** `str` — Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. +**ids:** `typing.Optional[typing.List[str]]` — Array of refresh token IDs to revoke. Limited to 100 at a time.
@@ -11398,7 +11336,7 @@ client.resource_servers.create(
-**name:** `typing.Optional[str]` — Friendly name for this resource server. Can not contain `<` or `>` characters. +**user_id:** `typing.Optional[str]` — Revoke all refresh tokens for this user.
@@ -11406,7 +11344,7 @@ client.resource_servers.create(
-**scopes:** `typing.Optional[typing.List[ResourceServerScope]]` — List of permissions (scopes) that this API uses. +**client_id:** `typing.Optional[str]` — Revoke all refresh tokens for this client.
@@ -11414,7 +11352,7 @@ client.resource_servers.create(
-**signing_alg:** `typing.Optional[SigningAlgorithmEnum]` +**audience:** `typing.Optional[str]` — Resource server identifier (audience) to scope the revocation. Must be used with both `user_id` and `client_id`.
@@ -11422,111 +11360,72 @@ client.resource_servers.create(
-**signing_secret:** `typing.Optional[str]` — Secret used to sign tokens when using symmetric algorithms (HS256). +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**allow_offline_access:** `typing.Optional[bool]` — Whether refresh tokens can be issued for this API (true) or not (false). -
-
-
-**allow_online_access:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued for this API (true) or not (false). -
+
+
client.refresh_tokens.get(...) -> GetRefreshTokenResponseContent
-**allow_online_access_with_ephemeral_sessions:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). - -
-
+#### 📝 Description
-**token_lifetime:** `typing.Optional[int]` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. - -
-
-
-**token_dialect:** `typing.Optional[ResourceServerTokenDialectSchemaEnum]` - +Retrieve refresh token information.
- -
-
- -**skip_consent_for_verifiable_first_party_clients:** `typing.Optional[bool]` — Whether to skip user consent for applications flagged as first party (true) or not (false). -
-
-
- -**enforce_policies:** `typing.Optional[bool]` — Whether to enforce authorization policies (true) or to ignore them (false). - -
-
+#### 🔌 Usage
-**token_encryption:** `typing.Optional[ResourceServerTokenEncryption]` - -
-
-
-**consent_policy:** `typing.Optional[ResourceServerConsentPolicyEnum]` - -
-
+```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment -
-
+client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) -**authorization_details:** `typing.Optional[typing.List[typing.Any]]` - +client.refresh_tokens.get( + id="id", +) + +```
- -
-
- -**proof_of_possession:** `typing.Optional[ResourceServerProofOfPossession]` -
+#### ⚙️ Parameters +
-**subject_type_authorization:** `typing.Optional[ResourceServerSubjectTypeAuthorization]` - -
-
-
-**authorization_policy:** `typing.Optional[ResourceServerAuthorizationPolicy]` +**id:** `str` — ID refresh token to retrieve
@@ -11546,7 +11445,7 @@ client.resource_servers.create(
-
client.resource_servers.get(...) -> GetResourceServerResponseContent +
client.refresh_tokens.delete(...)
@@ -11558,7 +11457,7 @@ client.resource_servers.create(
-Retrieve API details with the given ID. +Delete a refresh token by its ID.
@@ -11581,9 +11480,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.resource_servers.get( +client.refresh_tokens.delete( id="id", - include_fields=True, ) ``` @@ -11600,15 +11498,7 @@ client.resource_servers.get(
-**id:** `str` — ID or audience of the resource server to retrieve. - -
-
- -
-
- -**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false). +**id:** `str` — ID of the refresh token to delete.
@@ -11628,7 +11518,7 @@ client.resource_servers.get(
-
client.resource_servers.delete(...) +
client.refresh_tokens.update(...) -> UpdateRefreshTokenResponseContent
@@ -11640,7 +11530,7 @@ client.resource_servers.get(
-Delete an existing API by ID. For more information, read API Settings. +Update a refresh token by its ID.
@@ -11663,7 +11553,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.resource_servers.delete( +client.refresh_tokens.update( id="id", ) @@ -11681,7 +11571,15 @@ client.resource_servers.delete(
-**id:** `str` — ID or the audience of the resource server to delete. +**id:** `str` — ID of the refresh token to update. + +
+
+ +
+
+ +**refresh_token_metadata:** `typing.Optional[RefreshTokenMetadata]` — Metadata associated with the refresh token. Pass null or {} to remove all metadata.
@@ -11701,7 +11599,8 @@ client.resource_servers.delete(
-
client.resource_servers.update(...) -> UpdateResourceServerResponseContent +## ResourceServers +
client.resource_servers.list(...) -> ListResourceServerOffsetPaginatedResponseContent
@@ -11713,7 +11612,7 @@ client.resource_servers.delete(
-Change an existing API setting by resource server ID. For more information, read API Settings. +Retrieve details of all APIs associated with your tenant.
@@ -11736,8 +11635,14 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.resource_servers.update( - id="id", +client.resource_servers.list( + identifiers=[ + "identifiers" + ], + page=1, + per_page=1, + include_totals=True, + include_fields=True, ) ``` @@ -11754,7 +11659,7 @@ client.resource_servers.update(
-**id:** `str` — ID or audience of the resource server to update. +**identifiers:** `typing.Optional[typing.Union[typing.Optional[str], typing.Sequence[typing.Optional[str]]]]` — An optional filter on the resource server identifier. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../resource-servers?identifiers=id1&identifiers=id2
@@ -11762,7 +11667,7 @@ client.resource_servers.update(
-**name:** `typing.Optional[str]` — Friendly name for this resource server. Can not contain `<` or `>` characters. +**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0.
@@ -11770,7 +11675,7 @@ client.resource_servers.update(
-**scopes:** `typing.Optional[typing.List[ResourceServerScope]]` — List of permissions (scopes) that this API uses. +**per_page:** `typing.Optional[int]` — Number of results per page.
@@ -11778,7 +11683,7 @@ client.resource_servers.update(
-**signing_alg:** `typing.Optional[SigningAlgorithmEnum]` +**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -11786,7 +11691,7 @@ client.resource_servers.update(
-**signing_secret:** `typing.Optional[str]` — Secret used to sign tokens when using symmetric algorithms (HS256). +**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false).
@@ -11794,71 +11699,72 @@ client.resource_servers.update(
-**skip_consent_for_verifiable_first_party_clients:** `typing.Optional[bool]` — Whether to skip user consent for applications flagged as first party (true) or not (false). +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**allow_offline_access:** `typing.Optional[bool]` — Whether refresh tokens can be issued for this API (true) or not (false). -
+
+
client.resource_servers.create(...) -> CreateResourceServerResponseContent
-**allow_online_access:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued for this API (true) or not (false). - -
-
+#### 📝 Description
-**allow_online_access_with_ephemeral_sessions:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). - -
-
-
-**token_lifetime:** `typing.Optional[int]` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. - +Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0. For more information, read APIs. +
+
+#### 🔌 Usage +
-**token_dialect:** `typing.Optional[ResourceServerTokenDialectSchemaEnum]` - -
-
-
-**enforce_policies:** `typing.Optional[bool]` — Whether authorization policies are enforced (true) or not enforced (false). - +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.resource_servers.create( + identifier="identifier", +) + +```
+ + + +#### ⚙️ Parameters
-**token_encryption:** `typing.Optional[ResourceServerTokenEncryption]` - -
-
-
-**consent_policy:** `typing.Optional[ResourceServerConsentPolicyEnum]` +**identifier:** `str` — Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.
@@ -11866,7 +11772,7 @@ client.resource_servers.update(
-**authorization_details:** `typing.Optional[typing.List[typing.Any]]` +**name:** `typing.Optional[str]` — Friendly name for this resource server. Can not contain `<` or `>` characters.
@@ -11874,7 +11780,7 @@ client.resource_servers.update(
-**proof_of_possession:** `typing.Optional[ResourceServerProofOfPossession]` +**scopes:** `typing.Optional[typing.List[ResourceServerScope]]` — List of permissions (scopes) that this API uses.
@@ -11882,7 +11788,7 @@ client.resource_servers.update(
-**subject_type_authorization:** `typing.Optional[ResourceServerSubjectTypeAuthorization]` +**signing_alg:** `typing.Optional[SigningAlgorithmEnum]`
@@ -11890,7 +11796,7 @@ client.resource_servers.update(
-**authorization_policy:** `typing.Optional[ResourceServerAuthorizationPolicy]` +**signing_secret:** `typing.Optional[str]` — Secret used to sign tokens when using symmetric algorithms (HS256).
@@ -11898,78 +11804,31 @@ client.resource_servers.update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**allow_offline_access:** `typing.Optional[bool]` — Whether refresh tokens can be issued for this API (true) or not (false).
- - - - - - -
-## Roles -
client.roles.list(...) -> ListRolesOffsetPaginatedResponseContent
-#### 📝 Description - -
-
- -
-
- -Retrieve detailed list of user roles created in your tenant. - -Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. -
-
+**allow_online_access:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued for this API (true) or not (false). +
-#### 🔌 Usage - -
-
-
-```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.roles.list( - per_page=1, - page=1, - include_totals=True, - name_filter="name_filter", -) - -``` -
-
+**allow_online_access_with_ephemeral_sessions:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). +
-#### ⚙️ Parameters - -
-
-
-**per_page:** `typing.Optional[int]` — Number of results per page. Defaults to 50. +**token_lifetime:** `typing.Optional[int]` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint.
@@ -11977,7 +11836,7 @@ client.roles.list(
-**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. +**token_dialect:** `typing.Optional[ResourceServerTokenDialectSchemaEnum]`
@@ -11985,7 +11844,7 @@ client.roles.list(
-**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**skip_consent_for_verifiable_first_party_clients:** `typing.Optional[bool]` — Whether to skip user consent for applications flagged as first party (true) or not (false).
@@ -11993,7 +11852,7 @@ client.roles.list(
-**name_filter:** `typing.Optional[str]` — Optional filter on name (case-insensitive). +**enforce_policies:** `typing.Optional[bool]` — Whether to enforce authorization policies (true) or to ignore them (false).
@@ -12001,74 +11860,39 @@ client.roles.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**token_encryption:** `typing.Optional[ResourceServerTokenEncryption]`
-
-
- - -
-
-
-
client.roles.create(...) -> CreateRoleResponseContent
-#### 📝 Description - -
-
+**consent_policy:** `typing.Optional[ResourceServerConsentPolicyEnum]` + +
+
-Create a user role for Role-Based Access Control. - -Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. -
-
+**authorization_details:** `typing.Optional[typing.List[typing.Any]]` +
-#### 🔌 Usage - -
-
-
-```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.roles.create( - name="name", -) - -``` -
-
+**proof_of_possession:** `typing.Optional[ResourceServerProofOfPossession]` +
-#### ⚙️ Parameters - -
-
-
-**name:** `str` — Name of the role. +**subject_type_authorization:** `typing.Optional[ResourceServerSubjectTypeAuthorization]`
@@ -12076,7 +11900,7 @@ client.roles.create(
-**description:** `typing.Optional[str]` — Description of the role. +**authorization_policy:** `typing.Optional[ResourceServerAuthorizationPolicy]`
@@ -12096,7 +11920,7 @@ client.roles.create(
-
client.roles.get(...) -> GetRoleResponseContent +
client.resource_servers.get(...) -> GetResourceServerResponseContent
@@ -12108,7 +11932,7 @@ client.roles.create(
-Retrieve details about a specific user role specified by ID. +Retrieve API details with the given ID.
@@ -12131,8 +11955,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.roles.get( +client.resource_servers.get( id="id", + include_fields=True, ) ``` @@ -12149,7 +11974,15 @@ client.roles.get(
-**id:** `str` — ID of the role to retrieve. +**id:** `str` — ID or audience of the resource server to retrieve. + +
+
+ +
+
+ +**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false).
@@ -12169,7 +12002,7 @@ client.roles.get(
-
client.roles.delete(...) +
client.resource_servers.delete(...)
@@ -12181,7 +12014,7 @@ client.roles.get(
-Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. +Delete an existing API by ID. For more information, read API Settings.
@@ -12204,7 +12037,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.roles.delete( +client.resource_servers.delete( id="id", ) @@ -12222,7 +12055,7 @@ client.roles.delete(
-**id:** `str` — ID of the role to delete. +**id:** `str` — ID or the audience of the resource server to delete.
@@ -12242,7 +12075,7 @@ client.roles.delete(
-
client.roles.update(...) -> UpdateRoleResponseContent +
client.resource_servers.update(...) -> UpdateResourceServerResponseContent
@@ -12254,7 +12087,7 @@ client.roles.delete(
-Modify the details of a specific user role specified by ID. +Change an existing API setting by resource server ID. For more information, read API Settings.
@@ -12277,7 +12110,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.roles.update( +client.resource_servers.update( id="id", ) @@ -12295,7 +12128,7 @@ client.roles.update(
-**id:** `str` — ID of the role to update. +**id:** `str` — ID or audience of the resource server to update.
@@ -12303,7 +12136,7 @@ client.roles.update(
-**name:** `typing.Optional[str]` — Name of this role. +**name:** `typing.Optional[str]` — Friendly name for this resource server. Can not contain `<` or `>` characters.
@@ -12311,7 +12144,7 @@ client.roles.update(
-**description:** `typing.Optional[str]` — Description of this role. +**scopes:** `typing.Optional[typing.List[ResourceServerScope]]` — List of permissions (scopes) that this API uses.
@@ -12319,78 +12152,79 @@ client.roles.update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**signing_alg:** `typing.Optional[SigningAlgorithmEnum]`
- -
+
+
+**signing_secret:** `typing.Optional[str]` — Secret used to sign tokens when using symmetric algorithms (HS256). +
-
-## Rules -
client.rules.list(...) -> ListRulesOffsetPaginatedResponseContent
-#### 📝 Description +**skip_consent_for_verifiable_first_party_clients:** `typing.Optional[bool]` — Whether to skip user consent for applications flagged as first party (true) or not (false). + +
+
+**allow_offline_access:** `typing.Optional[bool]` — Whether refresh tokens can be issued for this API (true) or not (false). + +
+
+
-Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. -
-
+**allow_online_access:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued for this API (true) or not (false). + -#### 🔌 Usage -
+**allow_online_access_with_ephemeral_sessions:** `typing.Optional[bool]` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). + +
+
+
-```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.rules.list( - page=1, - per_page=1, - include_totals=True, - enabled=True, - fields="fields", - include_fields=True, -) - -``` +**token_lifetime:** `typing.Optional[int]` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. +
+ +
+
+ +**token_dialect:** `typing.Optional[ResourceServerTokenDialectSchemaEnum]` +
-#### ⚙️ Parameters -
+**enforce_policies:** `typing.Optional[bool]` — Whether authorization policies are enforced (true) or not enforced (false). + +
+
+
-**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. +**token_encryption:** `typing.Optional[ResourceServerTokenEncryption]`
@@ -12398,7 +12232,7 @@ client.rules.list(
-**per_page:** `typing.Optional[int]` — Number of results per page. +**consent_policy:** `typing.Optional[ResourceServerConsentPolicyEnum]`
@@ -12406,7 +12240,7 @@ client.rules.list(
-**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**authorization_details:** `typing.Optional[typing.List[typing.Any]]`
@@ -12414,7 +12248,7 @@ client.rules.list(
-**enabled:** `typing.Optional[bool]` — Optional filter on whether a rule is enabled (true) or disabled (false). +**proof_of_possession:** `typing.Optional[ResourceServerProofOfPossession]`
@@ -12422,7 +12256,7 @@ client.rules.list(
-**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. +**subject_type_authorization:** `typing.Optional[ResourceServerSubjectTypeAuthorization]`
@@ -12430,7 +12264,7 @@ client.rules.list(
-**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false). +**authorization_policy:** `typing.Optional[ResourceServerAuthorizationPolicy]`
@@ -12450,7 +12284,8 @@ client.rules.list(
-
client.rules.create(...) -> CreateRuleResponseContent +## Roles +
client.roles.list(...) -> ListRolesOffsetPaginatedResponseContent
@@ -12462,9 +12297,9 @@ client.rules.list(
-Create a new rule. +Retrieve detailed list of user roles created in your tenant. -Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. +**Note**: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.
@@ -12487,9 +12322,11 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.rules.create( - name="name", - script="script", +client.roles.list( + per_page=1, + page=1, + include_totals=True, + name_filter="name_filter", ) ``` @@ -12506,7 +12343,7 @@ client.rules.create(
-**name:** `str` — Name of this rule. +**per_page:** `typing.Optional[int]` — Number of results per page. Defaults to 50.
@@ -12514,7 +12351,7 @@ client.rules.create(
-**script:** `str` — Code to be executed when this rule runs. +**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0.
@@ -12522,7 +12359,7 @@ client.rules.create(
-**order:** `typing.Optional[float]` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. +**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -12530,7 +12367,7 @@ client.rules.create(
-**enabled:** `typing.Optional[bool]` — Whether the rule is enabled (true), or disabled (false). +**name_filter:** `typing.Optional[str]` — Optional filter on name (case-insensitive).
@@ -12550,7 +12387,7 @@ client.rules.create(
-
client.rules.get(...) -> GetRuleResponseContent +
client.roles.create(...) -> CreateRoleResponseContent
@@ -12562,7 +12399,9 @@ client.rules.create(
-Retrieve rule details. Accepts a list of fields to include or exclude in the result. +Create a user role for [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). + +**Note**: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.
@@ -12585,10 +12424,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.rules.get( - id="id", - fields="fields", - include_fields=True, +client.roles.create( + name="name", ) ``` @@ -12605,15 +12442,7 @@ client.rules.get(
-**id:** `str` — ID of the rule to retrieve. - -
-
- -
-
- -**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. +**name:** `str` — Name of the role.
@@ -12621,7 +12450,7 @@ client.rules.get(
-**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false). +**description:** `typing.Optional[str]` — Description of the role.
@@ -12641,7 +12470,7 @@ client.rules.get(
-
client.rules.delete(...) +
client.roles.get(...) -> GetRoleResponseContent
@@ -12653,7 +12482,7 @@ client.rules.get(
-Delete a rule. +Retrieve details about a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID.
@@ -12676,7 +12505,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.rules.delete( +client.roles.get( id="id", ) @@ -12694,7 +12523,7 @@ client.rules.delete(
-**id:** `str` — ID of the rule to delete. +**id:** `str` — ID of the role to retrieve.
@@ -12714,7 +12543,7 @@ client.rules.delete(
-
client.rules.update(...) -> UpdateRuleResponseContent +
client.roles.delete(...)
@@ -12726,7 +12555,7 @@ client.rules.delete(
-Update an existing rule. +Delete a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone.
@@ -12749,7 +12578,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.rules.update( +client.roles.delete( id="id", ) @@ -12767,39 +12596,7 @@ client.rules.update(
-**id:** `str` — ID of the rule to retrieve. - -
-
- -
-
- -**script:** `typing.Optional[str]` — Code to be executed when this rule runs. - -
-
- -
-
- -**name:** `typing.Optional[str]` — Name of this rule. - -
-
- -
-
- -**order:** `typing.Optional[float]` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first. - -
-
- -
-
- -**enabled:** `typing.Optional[bool]` — Whether the rule is enabled (true), or disabled (false). +**id:** `str` — ID of the role to delete.
@@ -12819,8 +12616,7 @@ client.rules.update(
-## RulesConfigs -
client.rules_configs.list() -> typing.List[RulesConfig] +
client.roles.update(...) -> UpdateRoleResponseContent
@@ -12832,9 +12628,7 @@ client.rules.update(
-Retrieve rules config variable keys. - - Note: For security, config variable values cannot be retrieved outside rule execution. +Modify the details of a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID.
@@ -12857,7 +12651,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.rules_configs.list() +client.roles.update( + id="id", +) ``` @@ -12873,73 +12669,15 @@ client.rules_configs.list()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**id:** `str` — ID of the role to update.
- -
- - - - -
- -
client.rules_configs.set(...) -> SetRulesConfigResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Sets a rules config variable. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.rules_configs.set( - key="key", - value="value", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
-**key:** `str` — Key of the rules config variable to set (max length: 127 characters). +**name:** `typing.Optional[str]` — Name of this role.
@@ -12947,7 +12685,7 @@ client.rules_configs.set(
-**value:** `str` — Value for a rules config variable. +**description:** `typing.Optional[str]` — Description of this role.
@@ -12967,7 +12705,8 @@ client.rules_configs.set(
-
client.rules_configs.delete(...) +## Rules +
client.rules.list(...) -> ListRulesOffsetPaginatedResponseContent
@@ -12979,7 +12718,7 @@ client.rules_configs.set(
-Delete a rules config variable identified by its key. +Retrieve a filtered list of [rules](https://auth0.com/docs/rules). Accepts a list of fields to include or exclude.
@@ -13002,8 +12741,13 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.rules_configs.delete( - key="key", +client.rules.list( + page=1, + per_page=1, + include_totals=True, + enabled=True, + fields="fields", + include_fields=True, ) ``` @@ -13020,7 +12764,7 @@ client.rules_configs.delete(
-**key:** `str` — Key of the rules config variable to delete. +**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0.
@@ -13028,75 +12772,23 @@ client.rules_configs.delete(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**per_page:** `typing.Optional[int]` — Number of results per page.
- -
- - - - -
- -## SelfServiceProfiles -
client.self_service_profiles.list(...) -> ListSelfServiceProfilesPaginatedResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves self-service profiles. -
-
-
-
- -#### 🔌 Usage
-
-
- -```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.self_service_profiles.list( - page=1, - per_page=1, - include_totals=True, -) - -``` -
-
+**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +
-#### ⚙️ Parameters -
-
-
- -**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. +**enabled:** `typing.Optional[bool]` — Optional filter on whether a rule is enabled (true) or disabled (false).
@@ -13104,7 +12796,7 @@ client.self_service_profiles.list(
-**per_page:** `typing.Optional[int]` — Number of results per page. Defaults to 50. +**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.
@@ -13112,7 +12804,7 @@ client.self_service_profiles.list(
-**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false).
@@ -13132,7 +12824,7 @@ client.self_service_profiles.list(
-
client.self_service_profiles.create(...) -> CreateSelfServiceProfileResponseContent +
client.rules.create(...) -> CreateRuleResponseContent
@@ -13144,7 +12836,9 @@ client.self_service_profiles.list(
-Creates a self-service profile. +Create a [new rule](https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api). + +Note: Changing a rule's stage of execution from the default `login_success` can change the rule's function signature to have user omitted.
@@ -13167,8 +12861,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.self_service_profiles.create( +client.rules.create( name="name", + script="script", ) ``` @@ -13185,23 +12880,7 @@ client.self_service_profiles.create(
-**name:** `str` — The name of the self-service Profile. - -
-
- -
-
- -**description:** `typing.Optional[str]` — The description of the self-service Profile. - -
-
- -
-
- -**branding:** `typing.Optional[SelfServiceProfileBrandingProperties]` +**name:** `str` — Name of this rule.
@@ -13209,7 +12888,7 @@ client.self_service_profiles.create(
-**allowed_strategies:** `typing.Optional[typing.List[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service Enterprise Configuration flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `auth0-samlp`, `okta-samlp`, `keycloak-samlp`, `pingfederate`] +**script:** `str` — Code to be executed when this rule runs.
@@ -13217,7 +12896,7 @@ client.self_service_profiles.create(
-**user_attributes:** `typing.Optional[typing.List[SelfServiceProfileUserAttribute]]` — List of attributes to be mapped that will be shown to the user during the Self-Service Enterprise Configuration flow. +**order:** `typing.Optional[float]` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first.
@@ -13225,7 +12904,7 @@ client.self_service_profiles.create(
-**user_attribute_profile_id:** `typing.Optional[str]` — ID of the user-attribute-profile to associate with this self-service profile. +**enabled:** `typing.Optional[bool]` — Whether the rule is enabled (true), or disabled (false).
@@ -13245,7 +12924,7 @@ client.self_service_profiles.create(
-
client.self_service_profiles.get(...) -> GetSelfServiceProfileResponseContent +
client.rules.get(...) -> GetRuleResponseContent
@@ -13257,7 +12936,7 @@ client.self_service_profiles.create(
-Retrieves a self-service profile by Id. +Retrieve [rule](https://auth0.com/docs/rules) details. Accepts a list of fields to include or exclude in the result.
@@ -13280,8 +12959,10 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.self_service_profiles.get( +client.rules.get( id="id", + fields="fields", + include_fields=True, ) ``` @@ -13298,7 +12979,23 @@ client.self_service_profiles.get(
-**id:** `str` — The id of the self-service profile to retrieve +**id:** `str` — ID of the rule to retrieve. + +
+
+ +
+
+ +**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false).
@@ -13318,7 +13015,7 @@ client.self_service_profiles.get(
-
client.self_service_profiles.delete(...) +
client.rules.delete(...)
@@ -13330,7 +13027,7 @@ client.self_service_profiles.get(
-Deletes a self-service profile by Id. +Delete a rule.
@@ -13353,7 +13050,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.self_service_profiles.delete( +client.rules.delete( id="id", ) @@ -13371,7 +13068,7 @@ client.self_service_profiles.delete(
-**id:** `str` — The id of the self-service profile to delete +**id:** `str` — ID of the rule to delete.
@@ -13391,7 +13088,7 @@ client.self_service_profiles.delete(
-
client.self_service_profiles.update(...) -> UpdateSelfServiceProfileResponseContent +
client.rules.update(...) -> UpdateRuleResponseContent
@@ -13403,7 +13100,7 @@ client.self_service_profiles.delete(
-Updates a self-service profile. +Update an existing rule.
@@ -13426,7 +13123,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.self_service_profiles.update( +client.rules.update( id="id", ) @@ -13444,23 +13141,7 @@ client.self_service_profiles.update(
-**id:** `str` — The id of the self-service profile to update - -
-
- -
-
- -**name:** `typing.Optional[str]` — The name of the self-service Profile. - -
-
- -
-
- -**description:** `typing.Optional[SelfServiceProfileDescription]` +**id:** `str` — ID of the rule to retrieve.
@@ -13468,7 +13149,7 @@ client.self_service_profiles.update(
-**branding:** `typing.Optional[SelfServiceProfileBranding]` +**script:** `typing.Optional[str]` — Code to be executed when this rule runs.
@@ -13476,7 +13157,7 @@ client.self_service_profiles.update(
-**allowed_strategies:** `typing.Optional[typing.List[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service Enterprise Configuration flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `auth0-samlp`, `okta-samlp`, `keycloak-samlp`, `pingfederate`] +**name:** `typing.Optional[str]` — Name of this rule.
@@ -13484,7 +13165,7 @@ client.self_service_profiles.update(
-**user_attributes:** `typing.Optional[SelfServiceProfileUserAttributes]` +**order:** `typing.Optional[float]` — Order that this rule should execute in relative to other rules. Lower-valued rules execute first.
@@ -13492,7 +13173,7 @@ client.self_service_profiles.update(
-**user_attribute_profile_id:** `typing.Optional[str]` — ID of the user-attribute-profile to associate with this self-service profile. +**enabled:** `typing.Optional[bool]` — Whether the rule is enabled (true), or disabled (false).
@@ -13512,8 +13193,8 @@ client.self_service_profiles.update(
-## Sessions -
client.sessions.get(...) -> GetSessionResponseContent +## RulesConfigs +
client.rules_configs.list() -> typing.List[RulesConfig]
@@ -13525,7 +13206,9 @@ client.self_service_profiles.update(
-Retrieve session information. +Retrieve rules config variable keys. + + Note: For security, config variable values cannot be retrieved outside rule execution.
@@ -13548,9 +13231,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.sessions.get( - id="id", -) +client.rules_configs.list() ``` @@ -13566,14 +13247,6 @@ client.sessions.get(
-**id:** `str` — ID of session to retrieve - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -13586,7 +13259,7 @@ client.sessions.get(
-
client.sessions.delete(...) +
client.rules_configs.set(...) -> SetRulesConfigResponseContent
@@ -13598,7 +13271,7 @@ client.sessions.get(
-Delete a session by ID. +Sets a rules config variable.
@@ -13621,8 +13294,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.sessions.delete( - id="id", +client.rules_configs.set( + key="key", + value="value", ) ``` @@ -13639,7 +13313,15 @@ client.sessions.delete(
-**id:** `str` — ID of the session to delete. +**key:** `str` — Key of the rules config variable to set (max length: 127 characters). + +
+
+ +
+
+ +**value:** `str` — Value for a rules config variable.
@@ -13659,7 +13341,7 @@ client.sessions.delete(
-
client.sessions.update(...) -> UpdateSessionResponseContent +
client.rules_configs.delete(...)
@@ -13671,7 +13353,7 @@ client.sessions.delete(
-Update session information. +Delete a rules config variable identified by its key.
@@ -13694,8 +13376,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.sessions.update( - id="id", +client.rules_configs.delete( + key="key", ) ``` @@ -13712,15 +13394,7 @@ client.sessions.update(
-**id:** `str` — ID of the session to update. - -
-
- -
-
- -**session_metadata:** `typing.Optional[SessionMetadata]` — Metadata associated with the session. Pass null or {} to remove all session_metadata. +**key:** `str` — Key of the rules config variable to delete.
@@ -13740,7 +13414,8 @@ client.sessions.update(
-
client.sessions.revoke(...) +## SelfServiceProfiles +
client.self_service_profiles.list(...) -> ListSelfServiceProfilesPaginatedResponseContent
@@ -13752,7 +13427,7 @@ client.sessions.update(
-Revokes a session by ID and all associated refresh tokens. +Retrieves self-service profiles.
@@ -13775,8 +13450,10 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.sessions.revoke( - id="id", +client.self_service_profiles.list( + page=1, + per_page=1, + include_totals=True, ) ``` @@ -13793,7 +13470,23 @@ client.sessions.revoke(
-**id:** `str` — ID of the session to revoke. +**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**per_page:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
@@ -13813,8 +13506,7 @@ client.sessions.revoke(
-## Stats -
client.stats.get_active_users_count() -> GetActiveUsersCountStatsResponseContent +
client.self_service_profiles.create(...) -> CreateSelfServiceProfileResponseContent
@@ -13826,7 +13518,7 @@ client.sessions.revoke(
-Retrieve the number of active users that logged in during the last 30 days. +Creates a self-service profile.
@@ -13849,7 +13541,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.stats.get_active_users_count() +client.self_service_profiles.create( + name="name", +) ``` @@ -13865,73 +13559,39 @@ client.stats.get_active_users_count()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**name:** `str` — The name of the self-service Profile.
- -
- - - -
- -
client.stats.get_daily(...) -> typing.List[DailyStats]
-#### 📝 Description - -
-
+**description:** `typing.Optional[str]` — The description of the self-service Profile. + +
+
-Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range. -
-
+**branding:** `typing.Optional[SelfServiceProfileBrandingProperties]` +
-#### 🔌 Usage -
-
-
- -```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.stats.get_daily( - from_="from", - to="to", -) - -``` -
-
+**allowed_strategies:** `typing.Optional[typing.List[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service Enterprise Configuration flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `auth0-samlp`, `okta-samlp`, `keycloak-samlp`, `pingfederate`] +
-#### ⚙️ Parameters - -
-
-
-**from:** `typing.Optional[str]` — Optional first day of the date range (inclusive) in YYYYMMDD format. +**user_attributes:** `typing.Optional[typing.List[SelfServiceProfileUserAttribute]]` — List of attributes to be mapped that will be shown to the user during the Self-Service Enterprise Configuration flow.
@@ -13939,7 +13599,7 @@ client.stats.get_daily(
-**to:** `typing.Optional[str]` — Optional last day of the date range (inclusive) in YYYYMMDD format. +**user_attribute_profile_id:** `typing.Optional[str]` — ID of the user-attribute-profile to associate with this self-service profile.
@@ -13959,8 +13619,7 @@ client.stats.get_daily(
-## SupplementalSignals -
client.supplemental_signals.get() -> GetSupplementalSignalsResponseContent +
client.self_service_profiles.get(...) -> GetSelfServiceProfileResponseContent
@@ -13972,7 +13631,7 @@ client.stats.get_daily(
-Get the supplemental signals configuration for a tenant. +Retrieves a self-service profile by Id.
@@ -13995,7 +13654,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.supplemental_signals.get() +client.self_service_profiles.get( + id="id", +) ``` @@ -14011,6 +13672,14 @@ client.supplemental_signals.get()
+**id:** `str` — The id of the self-service profile to retrieve + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -14023,7 +13692,7 @@ client.supplemental_signals.get()
-
client.supplemental_signals.patch(...) -> PatchSupplementalSignalsResponseContent +
client.self_service_profiles.delete(...)
@@ -14035,7 +13704,7 @@ client.supplemental_signals.get()
-Update the supplemental signals configuration for a tenant. +Deletes a self-service profile by Id.
@@ -14058,8 +13727,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.supplemental_signals.patch( - akamai_enabled=True, +client.self_service_profiles.delete( + id="id", ) ``` @@ -14076,7 +13745,7 @@ client.supplemental_signals.patch(
-**akamai_enabled:** `bool` — Indicates if incoming Akamai Headers should be processed +**id:** `str` — The id of the self-service profile to delete
@@ -14096,8 +13765,7 @@ client.supplemental_signals.patch(
-## Tickets -
client.tickets.verify_email(...) -> VerifyEmailTicketResponseContent +
client.self_service_profiles.update(...) -> UpdateSelfServiceProfileResponseContent
@@ -14109,7 +13777,7 @@ client.supplemental_signals.patch(
-Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address. +Updates a self-service profile.
@@ -14132,8 +13800,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.tickets.verify_email( - user_id="user_id", +client.self_service_profiles.update( + id="id", ) ``` @@ -14150,7 +13818,7 @@ client.tickets.verify_email(
-**user_id:** `str` — user_id of for whom the ticket should be created. +**id:** `str` — The id of the self-service profile to update
@@ -14158,7 +13826,7 @@ client.tickets.verify_email(
-**result_url:** `typing.Optional[str]` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. +**name:** `typing.Optional[str]` — The name of the self-service Profile.
@@ -14166,7 +13834,7 @@ client.tickets.verify_email(
-**client_id:** `typing.Optional[str]` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. +**description:** `typing.Optional[SelfServiceProfileDescription]`
@@ -14174,7 +13842,7 @@ client.tickets.verify_email(
-**organization_id:** `typing.Optional[str]` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. +**branding:** `typing.Optional[SelfServiceProfileBranding]`
@@ -14182,7 +13850,7 @@ client.tickets.verify_email(
-**ttl_sec:** `typing.Optional[int]` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). +**allowed_strategies:** `typing.Optional[typing.List[SelfServiceProfileAllowedStrategyEnum]]` — List of IdP strategies that will be shown to users during the Self-Service Enterprise Configuration flow. Possible values: [`oidc`, `samlp`, `waad`, `google-apps`, `adfs`, `okta`, `auth0-samlp`, `okta-samlp`, `keycloak-samlp`, `pingfederate`]
@@ -14190,7 +13858,7 @@ client.tickets.verify_email(
-**include_email_in_redirect:** `typing.Optional[bool]` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). +**user_attributes:** `typing.Optional[SelfServiceProfileUserAttributes]`
@@ -14198,7 +13866,7 @@ client.tickets.verify_email(
-**identity:** `typing.Optional[Identity]` +**user_attribute_profile_id:** `typing.Optional[str]` — ID of the user-attribute-profile to associate with this self-service profile.
@@ -14218,7 +13886,8 @@ client.tickets.verify_email(
-
client.tickets.change_password(...) -> ChangePasswordTicketResponseContent +## Sessions +
client.sessions.get(...) -> GetSessionResponseContent
@@ -14230,9 +13899,7 @@ client.tickets.verify_email(
-Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. - -Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity. +Retrieve session information.
@@ -14255,7 +13922,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.tickets.change_password() +client.sessions.get( + id="id", +) ``` @@ -14271,79 +13940,7 @@ client.tickets.change_password()
-**result_url:** `typing.Optional[str]` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using organization_id. May be specified together with client_id when the tenant has a custom password reset page enabled and a password-reset-post-challenge Action bound. - -
-
- -
-
- -**user_id:** `typing.Optional[str]` — user_id of for whom the ticket should be created. - -
-
- -
-
- -**client_id:** `typing.Optional[str]` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. - -
-
- -
-
- -**organization_id:** `typing.Optional[str]` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. - -
-
- -
-
- -**connection_id:** `typing.Optional[str]` — ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id. - -
-
- -
-
- -**email:** `typing.Optional[str]` — Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id. - -
-
- -
-
- -**ttl_sec:** `typing.Optional[int]` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). - -
-
- -
-
- -**mark_email_as_verified:** `typing.Optional[bool]` — Whether to set the email_verified attribute to true (true) or whether it should not be updated (false). - -
-
- -
-
- -**include_email_in_redirect:** `typing.Optional[bool]` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). - -
-
- -
-
- -**identity:** `typing.Optional[ChangePasswordTicketIdentity]` +**id:** `str` — ID of session to retrieve
@@ -14363,8 +13960,7 @@ client.tickets.change_password()
-## TokenExchangeProfiles -
client.token_exchange_profiles.list(...) -> ListTokenExchangeProfileResponseContent +
client.sessions.delete(...)
@@ -14376,17 +13972,7 @@ client.tickets.change_password()
-Retrieve a list of all Token Exchange Profiles available in your tenant. - -By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details. - -This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- -Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +Delete a session by ID.
@@ -14409,9 +13995,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.token_exchange_profiles.list( - from_="from", - take=1, +client.sessions.delete( + id="id", ) ``` @@ -14428,15 +14013,7 @@ client.token_exchange_profiles.list(
-**from:** `typing.Optional[str]` — Optional Id from which to start selection. - -
-
- -
-
- -**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. +**id:** `str` — ID of the session to delete.
@@ -14456,7 +14033,7 @@ client.token_exchange_profiles.list(
-
client.token_exchange_profiles.create(...) -> CreateTokenExchangeProfileResponseContent +
client.sessions.update(...) -> UpdateSessionResponseContent
@@ -14468,9 +14045,7 @@ client.token_exchange_profiles.list(
-Create a new Token Exchange Profile within your tenant. - -By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details. +Update session information.
@@ -14493,11 +14068,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.token_exchange_profiles.create( - name="name", - subject_token_type="subject_token_type", - action_id="action_id", - type="custom_authentication", +client.sessions.update( + id="id", ) ``` @@ -14514,23 +14086,7 @@ client.token_exchange_profiles.create(
-**name:** `str` — Friendly name of this profile. - -
-
- -
-
- -**subject_token_type:** `str` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. - -
-
- -
-
- -**action_id:** `str` — The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. +**id:** `str` — ID of the session to update.
@@ -14538,7 +14094,7 @@ client.token_exchange_profiles.create(
-**type:** `TokenExchangeProfileTypeEnum` +**session_metadata:** `typing.Optional[SessionMetadata]` — Metadata associated with the session. Pass null or {} to remove all session_metadata.
@@ -14558,7 +14114,7 @@ client.token_exchange_profiles.create(
-
client.token_exchange_profiles.get(...) -> GetTokenExchangeProfileResponseContent +
client.sessions.revoke(...)
@@ -14570,9 +14126,7 @@ client.token_exchange_profiles.create(
-Retrieve details about a single Token Exchange Profile specified by ID. - -By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details. +Revokes a session by ID and all associated refresh tokens.
@@ -14595,7 +14149,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.token_exchange_profiles.get( +client.sessions.revoke( id="id", ) @@ -14613,7 +14167,7 @@ client.token_exchange_profiles.get(
-**id:** `str` — ID of the Token Exchange Profile to retrieve. +**id:** `str` — ID of the session to revoke.
@@ -14633,7 +14187,8 @@ client.token_exchange_profiles.get(
-
client.token_exchange_profiles.delete(...) +## Stats +
client.stats.get_active_users_count() -> GetActiveUsersCountStatsResponseContent
@@ -14645,10 +14200,7 @@ client.token_exchange_profiles.get(
-Delete a Token Exchange Profile within your tenant. - -By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details. - +Retrieve the number of active users that logged in during the last 30 days.
@@ -14671,9 +14223,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.token_exchange_profiles.delete( - id="id", -) +client.stats.get_active_users_count() ``` @@ -14689,14 +14239,6 @@ client.token_exchange_profiles.delete(
-**id:** `str` — ID of the Token Exchange Profile to delete. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -14709,7 +14251,7 @@ client.token_exchange_profiles.delete(
-
client.token_exchange_profiles.update(...) +
client.stats.get_daily(...) -> typing.List[DailyStats]
@@ -14721,10 +14263,7 @@ client.token_exchange_profiles.delete(
-Update a Token Exchange Profile within your tenant. - -By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details. - +Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range.
@@ -14747,8 +14286,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.token_exchange_profiles.update( - id="id", +client.stats.get_daily( + from_="from", + to="to", ) ``` @@ -14765,15 +14305,7 @@ client.token_exchange_profiles.update(
-**id:** `str` — ID of the Token Exchange Profile to update. - -
-
- -
-
- -**name:** `typing.Optional[str]` — Friendly name of this profile. +**from:** `typing.Optional[str]` — Optional first day of the date range (inclusive) in YYYYMMDD format.
@@ -14781,7 +14313,7 @@ client.token_exchange_profiles.update(
-**subject_token_type:** `typing.Optional[str]` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. +**to:** `typing.Optional[str]` — Optional last day of the date range (inclusive) in YYYYMMDD format.
@@ -14801,8 +14333,8 @@ client.token_exchange_profiles.update(
-## UserAttributeProfiles -
client.user_attribute_profiles.list(...) -> ListUserAttributeProfilesPaginatedResponseContent +## SupplementalSignals +
client.supplemental_signals.get() -> GetSupplementalSignalsResponseContent
@@ -14814,7 +14346,7 @@ client.token_exchange_profiles.update(
-Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination. +Get the supplemental signals configuration for a tenant.
@@ -14837,10 +14369,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_attribute_profiles.list( - from_="from", - take=1, -) +client.supplemental_signals.get() ``` @@ -14856,22 +14385,6 @@ client.user_attribute_profiles.list(
-**from:** `typing.Optional[str]` — Optional Id from which to start selection. - -
-
- -
-
- -**take:** `typing.Optional[int]` — Number of results per page. Defaults to 5. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -14884,7 +14397,7 @@ client.user_attribute_profiles.list(
-
client.user_attribute_profiles.create(...) -> CreateUserAttributeProfileResponseContent +
client.supplemental_signals.patch(...) -> PatchSupplementalSignalsResponseContent
@@ -14896,7 +14409,7 @@ client.user_attribute_profiles.list(
-Create a User Attribute Profile +Update the supplemental signals configuration for a tenant.
@@ -14911,7 +14424,7 @@ Create a User Attribute Profile
```python -from auth0.management import Auth0, UserAttributeProfileUserAttributeAdditionalProperties +from auth0.management import Auth0 from auth0.management.environment import Auth0Environment client = Auth0( @@ -14919,16 +14432,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_attribute_profiles.create( - name="name", - user_attributes={ - "key": UserAttributeProfileUserAttributeAdditionalProperties( - description="description", - label="label", - profile_required=True, - auth_0_mapping="auth0_mapping", - ) - }, +client.supplemental_signals.patch( + akamai_enabled=True, ) ``` @@ -14945,23 +14450,7 @@ client.user_attribute_profiles.create(
-**name:** `UserAttributeProfileName` - -
-
- -
-
- -**user_attributes:** `UserAttributeProfileUserAttributes` - -
-
- -
-
- -**user_id:** `typing.Optional[UserAttributeProfileUserId]` +**akamai_enabled:** `bool` — Indicates if incoming Akamai Headers should be processed
@@ -14981,7 +14470,8 @@ client.user_attribute_profiles.create(
-
client.user_attribute_profiles.list_templates() -> ListUserAttributeProfileTemplateResponseContent +## Tickets +
client.tickets.verify_email(...) -> VerifyEmailTicketResponseContent
@@ -14993,7 +14483,7 @@ client.user_attribute_profiles.create(
-Retrieve a list of User Attribute Profile Templates. +Create an email verification ticket for a given user. An email verification ticket is a generated URL that the user can consume to verify their email address.
@@ -15016,7 +14506,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_attribute_profiles.list_templates() +client.tickets.verify_email( + user_id="user_id", +) ``` @@ -15032,72 +14524,55 @@ client.user_attribute_profiles.list_templates()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**user_id:** `str` — user_id of for whom the ticket should be created.
- -
+
+
+**result_url:** `typing.Optional[str]` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using client_id or organization_id. +
-
-
client.user_attribute_profiles.get_template(...) -> GetUserAttributeProfileTemplateResponseContent
-#### 📝 Description - -
-
+**client_id:** `typing.Optional[str]` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. + +
+
-Retrieve a User Attribute Profile Template. -
-
+**organization_id:** `typing.Optional[str]` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. +
-#### 🔌 Usage - -
-
-
-```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.user_attribute_profiles.get_template( - id="id", -) - -``` -
-
+**ttl_sec:** `typing.Optional[int]` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). +
-#### ⚙️ Parameters -
+**include_email_in_redirect:** `typing.Optional[bool]` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + +
+
+
-**id:** `str` — ID of the user-attribute-profile-template to retrieve. +**identity:** `typing.Optional[Identity]`
@@ -15117,7 +14592,7 @@ client.user_attribute_profiles.get_template(
-
client.user_attribute_profiles.get(...) -> GetUserAttributeProfileResponseContent +
client.tickets.change_password(...) -> ChangePasswordTicketResponseContent
@@ -15129,7 +14604,9 @@ client.user_attribute_profiles.get_template(
-Retrieve details about a single User Attribute Profile specified by ID. +Create a password change ticket for a given user. A password change ticket is a generated URL that the user can consume to start a reset password flow. + +Note: This endpoint does not verify the given user’s identity. If you call this endpoint within your application, you must design your application to verify the user’s identity.
@@ -15152,9 +14629,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_attribute_profiles.get( - id="id", -) +client.tickets.change_password() ``` @@ -15170,7 +14645,7 @@ client.user_attribute_profiles.get(
-**id:** `str` — ID of the user-attribute-profile to retrieve. +**result_url:** `typing.Optional[str]` — URL the user will be redirected to in the classic Universal Login experience once the ticket is used. Cannot be specified when using organization_id. May be specified together with client_id when the tenant has a custom password reset page enabled and a password-reset-post-challenge Action bound.
@@ -15178,72 +14653,71 @@ client.user_attribute_profiles.get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**user_id:** `typing.Optional[str]` — user_id of for whom the ticket should be created.
- -
+
+
+**client_id:** `typing.Optional[str]` — ID of the client (application). If provided for tenants using the New Universal Login experience, the email template and UI displays application details, and the user is prompted to redirect to the application's default login route after the ticket is used. client_id is required to use the Password Reset Post Challenge trigger. +
-
-
client.user_attribute_profiles.delete(...)
-#### 📝 Description +**organization_id:** `typing.Optional[str]` — (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + +
+
+**connection_id:** `typing.Optional[str]` — ID of the connection. If provided, allows the user to be specified using email instead of user_id. If you set this value, you must also send the email parameter. You cannot send user_id when specifying a connection_id. + +
+
+
-Delete a single User Attribute Profile specified by ID. -
-
+**email:** `typing.Optional[str]` — Email address of the user for whom the tickets should be created. Requires the connection_id parameter. Cannot be specified when using user_id. + -#### 🔌 Usage -
+**ttl_sec:** `typing.Optional[int]` — Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + +
+
+
-```python -from auth0.management import Auth0 -from auth0.management.environment import Auth0Environment - -client = Auth0( - token="", - environment=Auth0Environment.DEFAULT, -) - -client.user_attribute_profiles.delete( - id="id", -) - -``` -
-
+**mark_email_as_verified:** `typing.Optional[bool]` — Whether to set the email_verified attribute to true (true) or whether it should not be updated (false). + -#### ⚙️ Parameters -
+**include_email_in_redirect:** `typing.Optional[bool]` — Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + +
+
+
-**id:** `str` — ID of the user-attribute-profile to delete. +**identity:** `typing.Optional[ChangePasswordTicketIdentity]`
@@ -15263,7 +14737,8 @@ client.user_attribute_profiles.delete(
-
client.user_attribute_profiles.update(...) -> UpdateUserAttributeProfileResponseContent +## TokenExchangeProfiles +
client.token_exchange_profiles.list(...) -> ListTokenExchangeProfileResponseContent
@@ -15275,7 +14750,17 @@ client.user_attribute_profiles.delete(
-Update the details of a specific User attribute profile, such as name, user_id and user_attributes. +Retrieve a list of all Token Exchange Profiles available in your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details. + +This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters: +
    +
  • from: Optional id from which to start selection.
  • +
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • +
+ +Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.
@@ -15298,8 +14783,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_attribute_profiles.update( - id="id", +client.token_exchange_profiles.list( + from_="from", + take=1, ) ``` @@ -15316,23 +14802,7 @@ client.user_attribute_profiles.update(
-**id:** `str` — ID of the user attribute profile to update. - -
-
- -
-
- -**name:** `typing.Optional[UserAttributeProfileName]` - -
-
- -
-
- -**user_id:** `typing.Optional[UserAttributeProfilePatchUserId]` +**from:** `typing.Optional[str]` — Optional Id from which to start selection.
@@ -15340,7 +14810,7 @@ client.user_attribute_profiles.update(
-**user_attributes:** `typing.Optional[UserAttributeProfileUserAttributes]` +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50.
@@ -15360,8 +14830,7 @@ client.user_attribute_profiles.update(
-## UserBlocks -
client.user_blocks.list_by_identifier(...) -> ListUserBlocksByIdentifierResponseContent +
client.token_exchange_profiles.create(...) -> CreateTokenExchangeProfileResponseContent
@@ -15373,7 +14842,9 @@ client.user_attribute_profiles.update(
-Retrieve details of all Brute-force Protection blocks for a user with the given identifier (username, phone number, or email). +Create a new Token Exchange Profile within your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details.
@@ -15396,9 +14867,11 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_blocks.list_by_identifier( - identifier="identifier", - consider_brute_force_enablement=True, +client.token_exchange_profiles.create( + name="name", + subject_token_type="subject_token_type", + action_id="action_id", + type="custom_authentication", ) ``` @@ -15415,7 +14888,7 @@ client.user_blocks.list_by_identifier(
-**identifier:** `str` — Should be any of a username, phone number, or email. +**name:** `str` — Friendly name of this profile.
@@ -15423,12 +14896,23 @@ client.user_blocks.list_by_identifier(
-**consider_brute_force_enablement:** `typing.Optional[bool]` +**subject_token_type:** `str` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI. + +
+
+
+
- If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. - If true and Brute Force Protection is disabled, will return an empty list. - +**action_id:** `str` — The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger. + +
+
+ +
+
+ +**type:** `TokenExchangeProfileTypeEnum`
@@ -15448,7 +14932,7 @@ client.user_blocks.list_by_identifier(
-
client.user_blocks.delete_by_identifier(...) +
client.token_exchange_profiles.get(...) -> GetTokenExchangeProfileResponseContent
@@ -15460,9 +14944,9 @@ client.user_blocks.list_by_identifier(
-Remove all Brute-force Protection blocks for the user with the given identifier (username, phone number, or email). +Retrieve details about a single Token Exchange Profile specified by ID. -Note: This endpoint does not unblock users that were blocked by a tenant administrator. +By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details.
@@ -15485,8 +14969,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_blocks.delete_by_identifier( - identifier="identifier", +client.token_exchange_profiles.get( + id="id", ) ``` @@ -15503,7 +14987,7 @@ client.user_blocks.delete_by_identifier(
-**identifier:** `str` — Should be any of a username, phone number, or email. +**id:** `str` — ID of the Token Exchange Profile to retrieve.
@@ -15523,7 +15007,7 @@ client.user_blocks.delete_by_identifier(
-
client.user_blocks.list(...) -> ListUserBlocksResponseContent +
client.token_exchange_profiles.delete(...)
@@ -15535,7 +15019,10 @@ client.user_blocks.delete_by_identifier(
-Retrieve details of all Brute-force Protection blocks for the user with the given ID. +Delete a Token Exchange Profile within your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details. +
@@ -15558,9 +15045,8 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_blocks.list( +client.token_exchange_profiles.delete( id="id", - consider_brute_force_enablement=True, ) ``` @@ -15577,20 +15063,7 @@ client.user_blocks.list(
-**id:** `str` — user_id of the user blocks to retrieve. - -
-
- -
-
- -**consider_brute_force_enablement:** `typing.Optional[bool]` - - - If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. - If true and Brute Force Protection is disabled, will return an empty list. - +**id:** `str` — ID of the Token Exchange Profile to delete.
@@ -15610,7 +15083,7 @@ client.user_blocks.list(
-
client.user_blocks.delete(...) +
client.token_exchange_profiles.update(...)
@@ -15622,9 +15095,10 @@ client.user_blocks.list(
-Remove all Brute-force Protection blocks for the user with the given ID. +Update a Token Exchange Profile within your tenant. + +By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details. -Note: This endpoint does not unblock users that were blocked by a tenant administrator.
@@ -15647,7 +15121,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.user_blocks.delete( +client.token_exchange_profiles.update( id="id", ) @@ -15665,7 +15139,23 @@ client.user_blocks.delete(
-**id:** `str` — The user_id of the user to update. +**id:** `str` — ID of the Token Exchange Profile to update. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — Friendly name of this profile. + +
+
+ +
+
+ +**subject_token_type:** `typing.Optional[str]` — Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.
@@ -15685,8 +15175,8 @@ client.user_blocks.delete(
-## Users -
client.users.list(...) -> ListUsersOffsetPaginatedResponseContent +## UserAttributeProfiles +
client.user_attribute_profiles.list(...) -> ListUserAttributeProfilesPaginatedResponseContent
@@ -15698,20 +15188,7 @@ client.user_blocks.delete(
-Retrieve details of users. It is possible to: - -- Specify a search criteria for users -- Sort the users to be returned -- Select the fields to be returned -- Specify the number of users to retrieve per page and the page index - -The q query parameter can be used to get users that match the specified criteria using query string syntax. - -Learn more about searching for users. - -Read about best practices when working with the API endpoints for retrieving users. - -Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. +Retrieve a list of User Attribute Profiles. This endpoint supports Checkpoint pagination.
@@ -15734,17 +15211,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.users.list( - page=1, - per_page=1, - include_totals=True, - sort="sort", - connection="connection", - fields="fields", - include_fields=True, - q="q", - search_engine="v1", - primary_order=True, +client.user_attribute_profiles.list( + from_="from", + take=1, ) ``` @@ -15761,7 +15230,7 @@ client.users.list(
-**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. +**from:** `typing.Optional[str]` — Optional Id from which to start selection.
@@ -15769,7 +15238,7 @@ client.users.list(
-**per_page:** `typing.Optional[int]` — Number of results per page. +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 5.
@@ -15777,31 +15246,80 @@ client.users.list(
-**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.user_attribute_profiles.create(...) -> CreateUserAttributeProfileResponseContent
-**sort:** `typing.Optional[str]` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1 - +#### 📝 Description + +
+
+ +
+
+ +Create a User Attribute Profile. +
+
+#### 🔌 Usage +
-**connection:** `typing.Optional[str]` — Connection filter. Only applies when using search_engine=v1. To filter by connection with search_engine=v2|v3, use q=identities.connection:"connection_name" - +
+
+ +```python +from auth0.management import Auth0, UserAttributeProfileUserAttributeAdditionalProperties +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_attribute_profiles.create( + name="name", + user_attributes={ + "key": UserAttributeProfileUserAttributeAdditionalProperties( + description="description", + label="label", + profile_required=True, + auth_0_mapping="auth0_mapping", + ) + }, +) + +```
+
+
+ +#### ⚙️ Parameters
-**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. +
+
+ +**name:** `UserAttributeProfileName`
@@ -15809,7 +15327,7 @@ client.users.list(
-**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false). +**user_attributes:** `UserAttributeProfileUserAttributes`
@@ -15817,7 +15335,7 @@ client.users.list(
-**q:** `typing.Optional[str]` — Query in Lucene query string syntax. Some query types cannot be used on metadata fields, for details see Searchable Fields. +**user_id:** `typing.Optional[UserAttributeProfileUserId]`
@@ -15825,19 +15343,66 @@ client.users.list(
-**search_engine:** `typing.Optional[SearchEngineVersionsEnum]` — The version of the search engine +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ +
+
+
+ +
client.user_attribute_profiles.list_templates() -> ListUserAttributeProfileTemplateResponseContent
-**primary_order:** `typing.Optional[bool]` — If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required. - +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of User Attribute Profile Templates. +
+
+#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_attribute_profiles.list_templates() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+
@@ -15853,7 +15418,7 @@ client.users.list(
-
client.users.create(...) -> CreateUserResponseContent +
client.user_attribute_profiles.get_template(...) -> GetUserAttributeProfileTemplateResponseContent
@@ -15865,9 +15430,822 @@ client.users.list(
-Create a new user for a given database or passwordless connection. - -Note: connection is required but other parameters such as email and password are dependent upon the type of connection. +Retrieve a User Attribute Profile Template. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_attribute_profiles.get_template( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user-attribute-profile-template to retrieve. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +
client.user_attribute_profiles.get(...) -> GetUserAttributeProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single User Attribute Profile specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_attribute_profiles.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user-attribute-profile to retrieve. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_attribute_profiles.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a single User Attribute Profile specified by ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_attribute_profiles.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user-attribute-profile to delete. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_attribute_profiles.update(...) -> UpdateUserAttributeProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the details of a specific User attribute profile, such as name, user_id and user_attributes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_attribute_profiles.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user attribute profile to update. + +
+
+ +
+
+ +**name:** `typing.Optional[UserAttributeProfileName]` + +
+
+ +
+
+ +**user_id:** `typing.Optional[UserAttributeProfilePatchUserId]` + +
+
+ +
+
+ +**user_attributes:** `typing.Optional[UserAttributeProfileUserAttributes]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## UserBlocks +
client.user_blocks.list_by_identifier(...) -> ListUserBlocksByIdentifierResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all Brute-force Protection blocks for a user with the given identifier (username, phone number, or email). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_blocks.list_by_identifier( + identifier="identifier", + consider_brute_force_enablement=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**identifier:** `str` — Should be any of a username, phone number, or email. + +
+
+ +
+
+ +**consider_brute_force_enablement:** `typing.Optional[bool]` + + + If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + If true and Brute Force Protection is disabled, will return an empty list. + + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_blocks.delete_by_identifier(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all Brute-force Protection blocks for the user with the given identifier (username, phone number, or email). + +Note: This endpoint does not unblock users that were blocked by a tenant administrator. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_blocks.delete_by_identifier( + identifier="identifier", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**identifier:** `str` — Should be any of a username, phone number, or email. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_blocks.list(...) -> ListUserBlocksResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of all Brute-force Protection blocks for the user with the given ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_blocks.list( + id="id", + consider_brute_force_enablement=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — user_id of the user blocks to retrieve. + +
+
+ +
+
+ +**consider_brute_force_enablement:** `typing.Optional[bool]` + + + If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses. + If true and Brute Force Protection is disabled, will return an empty list. + + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_blocks.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all Brute-force Protection blocks for the user with the given ID. + +Note: This endpoint does not unblock users that were blocked by a tenant administrator. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.user_blocks.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The user_id of the user to update. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Users +
client.users.list(...) -> ListUsersOffsetPaginatedResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details of users. It is possible to: + +- Specify a search criteria for users +- Sort the users to be returned +- Select the fields to be returned +- Specify the number of users to retrieve per page and the page index + + + +The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax) + +[Learn more about searching for users.](https://auth0.com/docs/users/search/v3) + +Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users. + + + +Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.users.list( + page=1, + per_page=1, + include_totals=True, + sort="sort", + connection="connection", + fields="fields", + include_fields=True, + q="q", + search_engine="v1", + primary_order=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**per_page:** `typing.Optional[int]` — Number of results per page. + +
+
+ +
+
+ +**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**sort:** `typing.Optional[str]` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1 + +
+
+ +
+
+ +**connection:** `typing.Optional[str]` — Connection filter. Only applies when using search_engine=v1. To filter by connection with search_engine=v2|v3, use q=identities.connection:"connection_name" + +
+
+ +
+
+ +**fields:** `typing.Optional[str]` — Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. + +
+
+ +
+
+ +**include_fields:** `typing.Optional[bool]` — Whether specified fields are to be included (true) or excluded (false). + +
+
+ +
+
+ +**q:** `typing.Optional[str]` — Query in Lucene query string syntax. Some query types cannot be used on metadata fields, for details see Searchable Fields. + +
+
+ +
+
+ +**search_engine:** `typing.Optional[SearchEngineVersionsEnum]` — The version of the search engine + +
+
+ +
+
+ +**primary_order:** `typing.Optional[bool]` — If true (default), results are returned in a deterministic order. If false, results may be returned in a non-deterministic order, which can enhance performance for complex queries targeting a small number of users. Set to false only when consistent ordering and pagination is not required. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users.create(...) -> CreateUserResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new user for a given [database](https://auth0.com/docs/connections/database) or [passwordless](https://auth0.com/docs/connections/passwordless) connection. + +Note: `connection` is required but other parameters such as `email` and `password` are dependent upon the type of connection.
@@ -16163,7 +16541,7 @@ client.users.list_users_by_email(
-Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. +Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint).
@@ -16254,7 +16632,7 @@ client.users.get(
-Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. +Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see [Delete Users](https://auth0.com/docs/manage-users/user-accounts/delete-users).
@@ -16331,64 +16709,84 @@ Update a user. These are the attributes that can be updated at the root level: -
    -
  • app_metadata
  • -
  • blocked
  • -
  • email
  • -
  • email_verified
  • -
  • family_name
  • -
  • given_name
  • -
  • name
  • -
  • nickname
  • -
  • password
  • -
  • phone_number
  • -
  • phone_verified
  • -
  • picture
  • -
  • username
  • -
  • user_metadata
  • -
  • verify_email
  • -
+- app_metadata +- blocked +- email +- email_verified +- family_name +- given_name +- name +- nickname +- password +- phone_number +- phone_verified +- picture +- username +- user_metadata +- verify_email Some considerations: -
    -
  • The properties of the new object will replace the old ones.
  • -
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • -
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • -
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • -
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • -
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • -
  • Supported attributes can be unset by supplying null as the value.
  • -
-
Updating a field (non-metadata property)
+- The properties of the new object will replace the old ones. +- The metadata fields are an exception to this rule (`user_metadata` and `app_metadata`). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level. +- If you are updating `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of a secondary identity, you need to specify the `connection` property too. +- If you are updating `email` or `phone_number` you can specify, optionally, the `client_id` property. +- Updating `email_verified` is not supported for enterprise and passwordless sms connections. +- Updating the `blocked` to `false` does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state. +- Supported attributes can be unset by supplying `null` as the value. + +**Updating a field (non-metadata property)** + To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+```json +{ "email_verified": true } +``` -To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+**Updating a user metadata root property** -The modified object ends up with the following user_metadata property:
{
+Let's assume that our test user has the following `user_metadata`:
+
+```json
+{ "user_metadata" : { "profileCode": 1479 } }
+```
+
+To add the field `addresses` the body to send should be:
+
+```json
+{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+```
+
+The modified object ends up with the following `user_metadata` property:
+
+```json
+{
   "user_metadata": {
     "profileCode": 1479,
     "addresses": { "work_address": "100 Industrial Way" }
   }
-}
+} +``` + +**Updating an inner user metadata property** + +If there's existing user metadata to which we want to add `"home_address": "742 Evergreen Terrace"` (using the `addresses` property) we should send the whole `addresses` object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
+```json
+{
   "user_metadata": {
     "addresses": {
       "work_address": "100 Industrial Way",
       "home_address": "742 Evergreen Terrace"
     }
   }
-}
+} +``` -The modified object ends up with the following user_metadata property: -
{
+The modified object ends up with the following `user_metadata` property:
+
+```json
+{
   "user_metadata": {
     "profileCode": 1479,
     "addresses": {
@@ -16396,7 +16794,8 @@ The modified object ends up with the following user_metadata proper
       "home_address": "742 Evergreen Terrace"
     }
   }
-}
+} +```
@@ -16613,7 +17012,7 @@ client.users.update(
-Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. +Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate.
@@ -19281,28 +19680,28 @@ client.branding.templates.get_universal_login() Update the Universal Login branding template. -

When content-type header is set to application/json:

-
+When `content-type` header is set to `application/json`:
+
+```json
 {
-  "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+  "template": "{% assign resolved_dir = dir | default: \"auto\" %}{%- auth0:head -%}{%- auth0:widget -%}"
 }
-
+``` + +When `content-type` header is set to `text/html`: -

- When content-type header is set to text/html: -

-
-<!DOCTYPE html>
+```html
+
 {% assign resolved_dir = dir | default: "auto" %}
-<html lang="{{locale}}" dir="{{resolved_dir}}">
-  <head>
+
+  
     {%- auth0:head -%}
-  </head>
-  <body class="_widget-auto-layout">
+  
+  
     {%- auth0:widget -%}
-  </body>
-</html>
-
+ + +``` @@ -22415,7 +22814,7 @@ client.connections.scim_configuration.list(
-Retrieves a scim configuration by its connectionId. +Retrieves a scim configuration by its `connectionId`.
@@ -22570,7 +22969,7 @@ client.connections.scim_configuration.create(
-Deletes a scim configuration by its connectionId. +Deletes a scim configuration by its `connectionId`.
@@ -22643,7 +23042,7 @@ client.connections.scim_configuration.delete(
-Update a scim configuration by its connectionId. +Update a scim configuration by its `connectionId`.
@@ -22736,7 +23135,7 @@ client.connections.scim_configuration.update(
-Retrieves a scim configuration's default mapping by its connectionId. +Retrieves a scim configuration's default mapping by its `connectionId`.
@@ -22810,9 +23209,9 @@ client.connections.scim_configuration.get_default_mapping(
-Retrieve all clients that have the specified connection enabled. +Retrieve all clients that have the specified [connection](https://auth0.com/docs/authenticate/identity-providers) enabled. -Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. +**Note**: The first time you call this endpoint, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no further results are remaining.
@@ -23372,7 +23771,7 @@ client.connections.directory_provisioning.synchronizations.create(
-Retrieves all scim tokens by its connection id. +Retrieves all scim tokens by its connection `id`.
@@ -23534,7 +23933,7 @@ client.connections.scim_configuration.tokens.create(
-Deletes a scim token by its connection id and tokenId. +Deletes a scim token by its connection `id` and `tokenId`.
@@ -25052,6 +25451,266 @@ client.groups.members.get( + + +
+ +## Groups Roles +
client.groups.roles.list(...) -> ListGroupRolesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the roles assigned to a group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.groups.roles.list( + id="id", + from_="from", + take=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — Unique identifier for the group (service-generated). + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.groups.roles.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more roles to a specified group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.groups.roles.create( + id="id", + roles=[ + "roles" + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — Unique identifier for the group (service-generated). + +
+
+ +
+
+ +**roles:** `typing.List[str]` — Array of role IDs to assign to the group. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.groups.roles.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Unassign one or more roles from a specified group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.groups.roles.delete( + id="id", + roles=[ + "roles" + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — Unique identifier for the group (service-generated). + +
+
+ +
+
+ +**roles:** `typing.List[str]` — Array of role IDs to remove from the group. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -25069,10 +25728,7 @@ client.groups.members.get(
-Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. -Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- -Note: Users cannot enroll in Email as a factor through custom enrollment tickets. +Create a [multi-factor authentication (MFA) enrollment ticket](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets), and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
@@ -25258,7 +25914,7 @@ client.guardian.enrollments.get(
-Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. +Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review [Reset User Multi-Factor Authentication and Recovery Codes](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa).
@@ -25478,15 +26134,14 @@ client.guardian.factors.set(
-Retrieve the multi-factor authentication (MFA) policies configured for your tenant. +Retrieve the [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) configured for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
-Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +- `all-applications` policy prompts with MFA for all logins. +- `confidence-score` policy prompts with MFA only for low confidence logins. + +**Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details.
@@ -25549,15 +26204,14 @@ client.guardian.policies.list()
-Set multi-factor authentication (MFA) policies for your tenant. +Set [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
-Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +- `all-applications` policy prompts with MFA for all logins. +- `confidence-score` policy prompts with MFA only for low confidence logins. + +**Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details.
@@ -26718,7 +27372,7 @@ client.guardian.factors.push_notification.update_fcmv_1_provider()
-Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. +Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review [Configure Push Notifications for MFA](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa).
@@ -26781,7 +27435,7 @@ client.guardian.factors.push_notification.get_sns_provider()
-Configure the AWS SNS push notification provider configuration (subscription required). +Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required).
@@ -26884,7 +27538,7 @@ client.guardian.factors.push_notification.set_sns_provider()
-Configure the AWS SNS push notification provider configuration (subscription required). +Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required).
@@ -27800,7 +28454,7 @@ client.guardian.factors.duo.settings.update()
-Retrieve a hook's secrets by the ID of the hook. +Retrieve a hook's secrets by the ID of the hook.
@@ -27873,7 +28527,7 @@ client.hooks.secrets.get(
-Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. +Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets.
@@ -27957,7 +28611,7 @@ client.hooks.secrets.create(
-Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. +Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete.
@@ -28041,7 +28695,7 @@ client.hooks.secrets.delete(
-Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. +Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret.
@@ -28329,7 +28983,7 @@ client.jobs.users_imports.create(
-Send an email to the specified user that asks them to click a link to verify their email address. +Send an email to the specified user that asks them to click a link to [verify their email address](https://auth0.com/docs/email/custom#verification-email). Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent.
@@ -32402,7 +33056,7 @@ client.prompts.rendering.list(
-Learn more about configuring render settings for advanced customization. +Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
@@ -32562,7 +33216,7 @@ client.prompts.rendering.get(
-Learn more about configuring render settings for advanced customization. +Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
@@ -33401,7 +34055,7 @@ client.roles.permissions.list(
-Add one or more permissions to a specified user role. +Add one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) to a specified user role.
@@ -33488,7 +34142,7 @@ client.roles.permissions.add(
-Remove one or more permissions from a specified user role. +Remove one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) from a specified user role.
@@ -33576,25 +34230,23 @@ client.roles.permissions.delete(
-Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. +Retrieve list of users associated with a specific role. For Dashboard instructions, review [View Users Assigned to Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles). This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ +- Offset pagination +- Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. -

Checkpoint Pagination

+**Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
-Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. +- `from`: Optional id from which to start selection. +- `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + +**Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining.
@@ -33685,9 +34337,9 @@ client.roles.users.list(
-Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. +Assign one or more users to an existing user role. To learn more, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). -Note: New roles cannot be created through this action. +**Note**: New roles cannot be created through this action.
@@ -35345,7 +35997,7 @@ client.users.authentication_methods.update(
-Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. +Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api).
@@ -35511,7 +36163,7 @@ client.users.connected_accounts.list(
-Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. +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.
@@ -35841,30 +36493,31 @@ Link two user accounts together forming a primary and secondary relationship. On Note: There are two ways of invoking the endpoint: -
    -
  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: -
    -      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -      Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
    -      {
    -        "link_with": "SECONDARY_ACCOUNT_JWT"
    -      }
    -    
    - In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. -
  • -
  • With a token generated by the API V2 containing the update:users scope: -
    -    POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -    Authorization: "Bearer YOUR_API_V2_TOKEN"
    -    {
    -      "provider": "SECONDARY_ACCOUNT_PROVIDER",
    -      "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
    -      "user_id": "SECONDARY_ACCOUNT_USER_ID"
    -    }
    -    
    - In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. -
  • -
+- With the authenticated primary account's JWT in the Authorization header, which has the `update:current_user_identities` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + { + "link_with": "SECONDARY_ACCOUNT_JWT" + } + ``` + + In this case, only the `link_with` param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + +- With a token generated by the API V2 containing the `update:users` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer YOUR_API_V2_TOKEN" + { + "provider": "SECONDARY_ACCOUNT_PROVIDER", + "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + "user_id": "SECONDARY_ACCOUNT_USER_ID" + } + ``` + + In this case you need to send `provider` and `user_id` in the body. Optionally you can also send the `connection_id` param which is suitable for identifying a particular database connection for the 'auth0' provider.
@@ -35971,7 +36624,7 @@ client.users.identities.link( Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. -Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. +Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review [Unlink User Accounts](https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts). @@ -36179,7 +36832,7 @@ client.users.logs.list(
-Invalidate all remembered browsers across all authentication factors for a user. +Invalidate all remembered browsers across all [authentication factors](https://auth0.com/docs/multifactor-authentication) for a user.
@@ -36252,7 +36905,7 @@ client.users.multifactor.invalidate_remember_browser(
-Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. +Remove a [multifactor](https://auth0.com/docs/multifactor-authentication) authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider.
@@ -36335,7 +36988,7 @@ client.users.multifactor.delete_provider(
-Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. +Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations).
@@ -36807,7 +37460,7 @@ client.users.risk_assessments.clear( Retrieve detailed list of all user roles currently assigned to a user. -Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. +**Note**: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: [Get user roles assigned to an Organization member](https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles). @@ -36907,9 +37560,9 @@ client.users.roles.list(
-Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. +Assign one or more existing user roles to a user. For more information, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). -Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. +**Note**: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: [Assign user roles to an Organization member](https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles).
@@ -36995,7 +37648,7 @@ client.users.roles.assign( Remove one or more specified user roles assigned to a user. -Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. +**Note**: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: [Delete user roles from an Organization member](https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles). diff --git a/src/auth0/management/__init__.py b/src/auth0/management/__init__.py index 4fd6bafa..71b8e8cc 100644 --- a/src/auth0/management/__init__.py +++ b/src/auth0/management/__init__.py @@ -998,6 +998,7 @@ CreatePhoneTemplateResponseContent, CreatePhoneTemplateTestNotificationResponseContent, CreatePublicKeyDeviceCredentialResponseContent, + CreateRateLimitPolicyResponseContent, CreateResourceServerResponseContent, CreateRoleResponseContent, CreateRuleResponseContent, @@ -2107,6 +2108,7 @@ GetOrganizationResponseContent, GetPartialsResponseContent, GetPhoneTemplateResponseContent, + GetRateLimitPolicyResponseContent, GetRefreshTokenResponseContent, GetRefreshTokensPaginatedResponseContent, GetResourceServerResponseContent, @@ -2186,6 +2188,7 @@ ListFlowsRequestParametersHydrateEnum, ListFlowsVaultConnectionsOffsetPaginatedResponseContent, ListFormsOffsetPaginatedResponseContent, + ListGroupRolesResponseContent, ListGroupsPaginatedResponseContent, ListGuardianPoliciesResponseContent, ListHooksOffsetPaginatedResponseContent, @@ -2200,6 +2203,7 @@ ListOrganizationMembersPaginatedResponseContent, ListOrganizationsPaginatedResponseContent, ListPhoneTemplatesResponseContent, + ListRateLimitPoliciesPaginatedResponseContent, ListRefreshTokensPaginatedResponseContent, ListResourceServerOffsetPaginatedResponseContent, ListRolePermissionsOffsetPaginatedResponseContent, @@ -2321,6 +2325,13 @@ PasswordMaxLengthExceededPolicyEnum, PasswordSequentialCharactersPolicyEnum, PatchClientCredentialResponseContent, + PatchRateLimitPolicyConfigurationRequestContent, + PatchRateLimitPolicyConfigurationRequestContentAction, + PatchRateLimitPolicyConfigurationRequestContentActionAction, + PatchRateLimitPolicyConfigurationRequestContentOne, + PatchRateLimitPolicyConfigurationRequestContentOneAction, + PatchRateLimitPolicyConfigurationRequestContentZero, + PatchRateLimitPolicyConfigurationRequestContentZeroAction, PatchSupplementalSignalsResponseContent, PermissionRequestPayload, PermissionsResponsePayload, @@ -2347,6 +2358,16 @@ PublicKeyCredential, PublicKeyCredentialAlgorithmEnum, PublicKeyCredentialTypeEnum, + RateLimitPolicy, + RateLimitPolicyConfiguration, + RateLimitPolicyConfigurationAction, + RateLimitPolicyConfigurationActionAction, + RateLimitPolicyConfigurationOne, + RateLimitPolicyConfigurationOneAction, + RateLimitPolicyConfigurationZero, + RateLimitPolicyConfigurationZeroAction, + RateLimitPolicyConsumerEnum, + RateLimitPolicyResourceEnum, RefreshTokenDate, RefreshTokenDateObject, RefreshTokenDevice, @@ -2609,6 +2630,7 @@ UpdateOrganizationDiscoveryDomainResponseContent, UpdateOrganizationResponseContent, UpdatePhoneTemplateResponseContent, + UpdateRateLimitPolicyResponseContent, UpdateRefreshTokenResponseContent, UpdateResourceServerResponseContent, UpdateRiskAssessmentsSettingsNewDeviceResponseContent, @@ -2719,6 +2741,7 @@ network_acls, organizations, prompts, + rate_limit_policies, refresh_tokens, resource_servers, risk_assessments, @@ -2743,8 +2766,6 @@ from .environment import Auth0Environment from .event_streams import EventStreamsCreateRequest from .version import __version__ - from .management_client import AsyncManagementClient, CustomDomainHeader, ManagementClient - from .token_provider import AsyncTokenProvider, TokenProvider _dynamic_imports: typing.Dict[str, str] = { "Action": ".types", "ActionBase": ".types", @@ -2805,8 +2826,6 @@ "AssociateOrganizationClientGrantResponseContent": ".types", "AsyncApprovalNotificationsChannelsEnum": ".types", "AsyncAuth0": ".client", - "AsyncManagementClient": ".management_client", - "AsyncTokenProvider": ".token_provider", "AttackProtectionCaptchaArkoseResponseContent": ".types", "AttackProtectionCaptchaAuthChallengeRequest": ".types", "AttackProtectionCaptchaAuthChallengeResponseContent": ".types", @@ -3745,6 +3764,7 @@ "CreatePhoneTemplateResponseContent": ".types", "CreatePhoneTemplateTestNotificationResponseContent": ".types", "CreatePublicKeyDeviceCredentialResponseContent": ".types", + "CreateRateLimitPolicyResponseContent": ".types", "CreateResourceServerResponseContent": ".types", "CreateRoleResponseContent": ".types", "CreateRuleResponseContent": ".types", @@ -3765,7 +3785,6 @@ "CredentialDeviceTypeEnum": ".types", "CredentialId": ".types", "CustomDomain": ".types", - "CustomDomainHeader": ".management_client", "CustomDomainCustomClientIpHeader": ".types", "CustomDomainCustomClientIpHeaderEnum": ".types", "CustomDomainProvisioningTypeEnum": ".types", @@ -4859,6 +4878,7 @@ "GetOrganizationResponseContent": ".types", "GetPartialsResponseContent": ".types", "GetPhoneTemplateResponseContent": ".types", + "GetRateLimitPolicyResponseContent": ".types", "GetRefreshTokenResponseContent": ".types", "GetRefreshTokensPaginatedResponseContent": ".types", "GetResourceServerResponseContent": ".types", @@ -4940,6 +4960,7 @@ "ListFlowsRequestParametersHydrateEnum": ".types", "ListFlowsVaultConnectionsOffsetPaginatedResponseContent": ".types", "ListFormsOffsetPaginatedResponseContent": ".types", + "ListGroupRolesResponseContent": ".types", "ListGroupsPaginatedResponseContent": ".types", "ListGuardianPoliciesResponseContent": ".types", "ListHooksOffsetPaginatedResponseContent": ".types", @@ -4954,6 +4975,7 @@ "ListOrganizationMembersPaginatedResponseContent": ".types", "ListOrganizationsPaginatedResponseContent": ".types", "ListPhoneTemplatesResponseContent": ".types", + "ListRateLimitPoliciesPaginatedResponseContent": ".types", "ListRefreshTokensPaginatedResponseContent": ".types", "ListResourceServerOffsetPaginatedResponseContent": ".types", "ListRolePermissionsOffsetPaginatedResponseContent": ".types", @@ -5025,7 +5047,6 @@ "LogStreamSumoEnum": ".types", "LogStreamSumoResponseSchema": ".types", "LogStreamSumoSink": ".types", - "ManagementClient": ".management_client", "MdlPresentationProperties": ".types", "MdlPresentationRequest": ".types", "MdlPresentationRequestProperties": ".types", @@ -5077,6 +5098,13 @@ "PasswordMaxLengthExceededPolicyEnum": ".types", "PasswordSequentialCharactersPolicyEnum": ".types", "PatchClientCredentialResponseContent": ".types", + "PatchRateLimitPolicyConfigurationRequestContent": ".types", + "PatchRateLimitPolicyConfigurationRequestContentAction": ".types", + "PatchRateLimitPolicyConfigurationRequestContentActionAction": ".types", + "PatchRateLimitPolicyConfigurationRequestContentOne": ".types", + "PatchRateLimitPolicyConfigurationRequestContentOneAction": ".types", + "PatchRateLimitPolicyConfigurationRequestContentZero": ".types", + "PatchRateLimitPolicyConfigurationRequestContentZeroAction": ".types", "PatchSupplementalSignalsResponseContent": ".types", "PaymentRequiredError": ".errors", "PermissionRequestPayload": ".types", @@ -5105,6 +5133,16 @@ "PublicKeyCredential": ".types", "PublicKeyCredentialAlgorithmEnum": ".types", "PublicKeyCredentialTypeEnum": ".types", + "RateLimitPolicy": ".types", + "RateLimitPolicyConfiguration": ".types", + "RateLimitPolicyConfigurationAction": ".types", + "RateLimitPolicyConfigurationActionAction": ".types", + "RateLimitPolicyConfigurationOne": ".types", + "RateLimitPolicyConfigurationOneAction": ".types", + "RateLimitPolicyConfigurationZero": ".types", + "RateLimitPolicyConfigurationZeroAction": ".types", + "RateLimitPolicyConsumerEnum": ".types", + "RateLimitPolicyResourceEnum": ".types", "RefreshTokenDate": ".types", "RefreshTokenDateObject": ".types", "RefreshTokenDevice": ".types", @@ -5252,7 +5290,6 @@ "TokenQuota": ".types", "TokenQuotaClientCredentials": ".types", "TokenQuotaConfiguration": ".types", - "TokenProvider": ".token_provider", "TooManyRequestsError": ".errors", "TooManyRequestsSchema": ".types", "TooManyRequestsSchemaError": ".types", @@ -5371,6 +5408,7 @@ "UpdateOrganizationDiscoveryDomainResponseContent": ".types", "UpdateOrganizationResponseContent": ".types", "UpdatePhoneTemplateResponseContent": ".types", + "UpdateRateLimitPolicyResponseContent": ".types", "UpdateRefreshTokenResponseContent": ".types", "UpdateResourceServerResponseContent": ".types", "UpdateRiskAssessmentsSettingsNewDeviceResponseContent": ".types", @@ -5466,6 +5504,7 @@ "network_acls": ".network_acls", "organizations": ".organizations", "prompts": ".prompts", + "rate_limit_policies": ".rate_limit_policies", "refresh_tokens": ".refresh_tokens", "resource_servers": ".resource_servers", "risk_assessments": ".risk_assessments", @@ -5568,8 +5607,6 @@ def __dir__(): "AssociateOrganizationClientGrantResponseContent", "AsyncApprovalNotificationsChannelsEnum", "AsyncAuth0", - "AsyncManagementClient", - "AsyncTokenProvider", "AttackProtectionCaptchaArkoseResponseContent", "AttackProtectionCaptchaAuthChallengeRequest", "AttackProtectionCaptchaAuthChallengeResponseContent", @@ -6508,6 +6545,7 @@ def __dir__(): "CreatePhoneTemplateResponseContent", "CreatePhoneTemplateTestNotificationResponseContent", "CreatePublicKeyDeviceCredentialResponseContent", + "CreateRateLimitPolicyResponseContent", "CreateResourceServerResponseContent", "CreateRoleResponseContent", "CreateRuleResponseContent", @@ -7621,6 +7659,7 @@ def __dir__(): "GetOrganizationResponseContent", "GetPartialsResponseContent", "GetPhoneTemplateResponseContent", + "GetRateLimitPolicyResponseContent", "GetRefreshTokenResponseContent", "GetRefreshTokensPaginatedResponseContent", "GetResourceServerResponseContent", @@ -7702,6 +7741,7 @@ def __dir__(): "ListFlowsRequestParametersHydrateEnum", "ListFlowsVaultConnectionsOffsetPaginatedResponseContent", "ListFormsOffsetPaginatedResponseContent", + "ListGroupRolesResponseContent", "ListGroupsPaginatedResponseContent", "ListGuardianPoliciesResponseContent", "ListHooksOffsetPaginatedResponseContent", @@ -7716,6 +7756,7 @@ def __dir__(): "ListOrganizationMembersPaginatedResponseContent", "ListOrganizationsPaginatedResponseContent", "ListPhoneTemplatesResponseContent", + "ListRateLimitPoliciesPaginatedResponseContent", "ListRefreshTokensPaginatedResponseContent", "ListResourceServerOffsetPaginatedResponseContent", "ListRolePermissionsOffsetPaginatedResponseContent", @@ -7787,7 +7828,6 @@ def __dir__(): "LogStreamSumoEnum", "LogStreamSumoResponseSchema", "LogStreamSumoSink", - "ManagementClient", "MdlPresentationProperties", "MdlPresentationRequest", "MdlPresentationRequestProperties", @@ -7839,6 +7879,13 @@ def __dir__(): "PasswordMaxLengthExceededPolicyEnum", "PasswordSequentialCharactersPolicyEnum", "PatchClientCredentialResponseContent", + "PatchRateLimitPolicyConfigurationRequestContent", + "PatchRateLimitPolicyConfigurationRequestContentAction", + "PatchRateLimitPolicyConfigurationRequestContentActionAction", + "PatchRateLimitPolicyConfigurationRequestContentOne", + "PatchRateLimitPolicyConfigurationRequestContentOneAction", + "PatchRateLimitPolicyConfigurationRequestContentZero", + "PatchRateLimitPolicyConfigurationRequestContentZeroAction", "PatchSupplementalSignalsResponseContent", "PaymentRequiredError", "PermissionRequestPayload", @@ -7867,6 +7914,16 @@ def __dir__(): "PublicKeyCredential", "PublicKeyCredentialAlgorithmEnum", "PublicKeyCredentialTypeEnum", + "RateLimitPolicy", + "RateLimitPolicyConfiguration", + "RateLimitPolicyConfigurationAction", + "RateLimitPolicyConfigurationActionAction", + "RateLimitPolicyConfigurationOne", + "RateLimitPolicyConfigurationOneAction", + "RateLimitPolicyConfigurationZero", + "RateLimitPolicyConfigurationZeroAction", + "RateLimitPolicyConsumerEnum", + "RateLimitPolicyResourceEnum", "RefreshTokenDate", "RefreshTokenDateObject", "RefreshTokenDevice", @@ -8011,7 +8068,6 @@ def __dir__(): "TestEventDataContent", "TokenExchangeProfileResponseContent", "TokenExchangeProfileTypeEnum", - "TokenProvider", "TokenQuota", "TokenQuotaClientCredentials", "TokenQuotaConfiguration", @@ -8133,6 +8189,7 @@ def __dir__(): "UpdateOrganizationDiscoveryDomainResponseContent", "UpdateOrganizationResponseContent", "UpdatePhoneTemplateResponseContent", + "UpdateRateLimitPolicyResponseContent", "UpdateRefreshTokenResponseContent", "UpdateResourceServerResponseContent", "UpdateRiskAssessmentsSettingsNewDeviceResponseContent", @@ -8228,6 +8285,7 @@ def __dir__(): "network_acls", "organizations", "prompts", + "rate_limit_policies", "refresh_tokens", "resource_servers", "risk_assessments", diff --git a/src/auth0/management/actions/client.py b/src/auth0/management/actions/client.py index e6fb5e55..e29c621a 100644 --- a/src/auth0/management/actions/client.py +++ b/src/auth0/management/actions/client.py @@ -284,7 +284,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateActionResponseContent: """ - Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. + Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed. Parameters ---------- @@ -734,7 +734,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateActionResponseContent: """ - Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. + Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed. Parameters ---------- diff --git a/src/auth0/management/actions/raw_client.py b/src/auth0/management/actions/raw_client.py index 0a3634cb..9f632a3c 100644 --- a/src/auth0/management/actions/raw_client.py +++ b/src/auth0/management/actions/raw_client.py @@ -519,7 +519,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateActionResponseContent]: """ - Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. + Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed. Parameters ---------- @@ -1325,7 +1325,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateActionResponseContent]: """ - Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. + Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed. Parameters ---------- diff --git a/src/auth0/management/actions/versions/raw_client.py b/src/auth0/management/actions/versions/raw_client.py index 94e4c9f4..b8c15694 100644 --- a/src/auth0/management/actions/versions/raw_client.py +++ b/src/auth0/management/actions/versions/raw_client.py @@ -280,9 +280,6 @@ def deploy( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[DeployActionVersionRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -605,9 +602,6 @@ async def deploy( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[DeployActionVersionRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/branding/phone/templates/raw_client.py b/src/auth0/management/branding/phone/templates/raw_client.py index de52bf9c..9258e6ec 100644 --- a/src/auth0/management/branding/phone/templates/raw_client.py +++ b/src/auth0/management/branding/phone/templates/raw_client.py @@ -565,9 +565,6 @@ def reset( f"branding/phone/templates/{encode_path_param(id)}/reset", method="PATCH", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1280,9 +1277,6 @@ async def reset( f"branding/phone/templates/{encode_path_param(id)}/reset", method="PATCH", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/branding/templates/client.py b/src/auth0/management/branding/templates/client.py index 2fda9cc8..2559261d 100644 --- a/src/auth0/management/branding/templates/client.py +++ b/src/auth0/management/branding/templates/client.py @@ -62,28 +62,28 @@ def update_universal_login( """ Update the Universal Login branding template. -

When content-type header is set to application/json:

-
+        When `content-type` header is set to `application/json`:
+
+        ```json
         {
-          "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+          "template": "{% assign resolved_dir = dir | default: \\"auto\\" %}{%- auth0:head -%}{%- auth0:widget -%}"
         }
-        
+ ``` + + When `content-type` header is set to `text/html`: -

- When content-type header is set to text/html: -

-
-        <!DOCTYPE html>
+        ```html
+        
         {% assign resolved_dir = dir | default: "auto" %}
-        <html lang="{{locale}}" dir="{{resolved_dir}}">
-          <head>
+        
+          
             {%- auth0:head -%}
-          </head>
-          <body class="_widget-auto-layout">
+          
+          
             {%- auth0:widget -%}
-          </body>
-        </html>
-        
+ + + ``` Parameters ---------- @@ -192,28 +192,28 @@ async def update_universal_login( """ Update the Universal Login branding template. -

When content-type header is set to application/json:

-
+        When `content-type` header is set to `application/json`:
+
+        ```json
         {
-          "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+          "template": "{% assign resolved_dir = dir | default: \\"auto\\" %}{%- auth0:head -%}{%- auth0:widget -%}"
         }
-        
+ ``` + + When `content-type` header is set to `text/html`: -

- When content-type header is set to text/html: -

-
-        <!DOCTYPE html>
+        ```html
+        
         {% assign resolved_dir = dir | default: "auto" %}
-        <html lang="{{locale}}" dir="{{resolved_dir}}">
-          <head>
+        
+          
             {%- auth0:head -%}
-          </head>
-          <body class="_widget-auto-layout">
+          
+          
             {%- auth0:widget -%}
-          </body>
-        </html>
-        
+ + + ``` Parameters ---------- diff --git a/src/auth0/management/branding/templates/raw_client.py b/src/auth0/management/branding/templates/raw_client.py index c370cf09..f98c5c2b 100644 --- a/src/auth0/management/branding/templates/raw_client.py +++ b/src/auth0/management/branding/templates/raw_client.py @@ -131,28 +131,28 @@ def update_universal_login( """ Update the Universal Login branding template. -

When content-type header is set to application/json:

-
+        When `content-type` header is set to `application/json`:
+
+        ```json
         {
-          "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+          "template": "{% assign resolved_dir = dir | default: \\"auto\\" %}{%- auth0:head -%}{%- auth0:widget -%}"
         }
-        
+ ``` + + When `content-type` header is set to `text/html`: -

- When content-type header is set to text/html: -

-
-        <!DOCTYPE html>
+        ```html
+        
         {% assign resolved_dir = dir | default: "auto" %}
-        <html lang="{{locale}}" dir="{{resolved_dir}}">
-          <head>
+        
+          
             {%- auth0:head -%}
-          </head>
-          <body class="_widget-auto-layout">
+          
+          
             {%- auth0:widget -%}
-          </body>
-        </html>
-        
+ + + ``` Parameters ---------- @@ -171,9 +171,6 @@ def update_universal_login( json=convert_and_respect_annotation_metadata( object_=request, annotation=UpdateUniversalLoginTemplateRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -434,28 +431,28 @@ async def update_universal_login( """ Update the Universal Login branding template. -

When content-type header is set to application/json:

-
+        When `content-type` header is set to `application/json`:
+
+        ```json
         {
-          "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+          "template": "{% assign resolved_dir = dir | default: \\"auto\\" %}{%- auth0:head -%}{%- auth0:widget -%}"
         }
-        
+ ``` + + When `content-type` header is set to `text/html`: -

- When content-type header is set to text/html: -

-
-        <!DOCTYPE html>
+        ```html
+        
         {% assign resolved_dir = dir | default: "auto" %}
-        <html lang="{{locale}}" dir="{{resolved_dir}}">
-          <head>
+        
+          
             {%- auth0:head -%}
-          </head>
-          <body class="_widget-auto-layout">
+          
+          
             {%- auth0:widget -%}
-          </body>
-        </html>
-        
+ + + ``` Parameters ---------- @@ -474,9 +471,6 @@ async def update_universal_login( json=convert_and_respect_annotation_metadata( object_=request, annotation=UpdateUniversalLoginTemplateRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/client.py b/src/auth0/management/client.py index b5c3ebec..387c92b1 100644 --- a/src/auth0/management/client.py +++ b/src/auth0/management/client.py @@ -36,6 +36,7 @@ from .network_acls.client import AsyncNetworkAclsClient, NetworkAclsClient from .organizations.client import AsyncOrganizationsClient, OrganizationsClient from .prompts.client import AsyncPromptsClient, PromptsClient + from .rate_limit_policies.client import AsyncRateLimitPoliciesClient, RateLimitPoliciesClient from .refresh_tokens.client import AsyncRefreshTokensClient, RefreshTokensClient from .resource_servers.client import AsyncResourceServersClient, ResourceServersClient from .risk_assessments.client import AsyncRiskAssessmentsClient, RiskAssessmentsClient @@ -161,6 +162,7 @@ def __init__( self._network_acls: typing.Optional[NetworkAclsClient] = None self._organizations: typing.Optional[OrganizationsClient] = None self._prompts: typing.Optional[PromptsClient] = None + self._rate_limit_policies: typing.Optional[RateLimitPoliciesClient] = None self._refresh_tokens: typing.Optional[RefreshTokensClient] = None self._resource_servers: typing.Optional[ResourceServersClient] = None self._roles: typing.Optional[RolesClient] = None @@ -360,6 +362,14 @@ def prompts(self): self._prompts = PromptsClient(client_wrapper=self._client_wrapper) return self._prompts + @property + def rate_limit_policies(self): + if self._rate_limit_policies is None: + from .rate_limit_policies.client import RateLimitPoliciesClient # noqa: E402 + + self._rate_limit_policies = RateLimitPoliciesClient(client_wrapper=self._client_wrapper) + return self._rate_limit_policies + @property def refresh_tokens(self): if self._refresh_tokens is None: @@ -663,6 +673,7 @@ def __init__( self._network_acls: typing.Optional[AsyncNetworkAclsClient] = None self._organizations: typing.Optional[AsyncOrganizationsClient] = None self._prompts: typing.Optional[AsyncPromptsClient] = None + self._rate_limit_policies: typing.Optional[AsyncRateLimitPoliciesClient] = None self._refresh_tokens: typing.Optional[AsyncRefreshTokensClient] = None self._resource_servers: typing.Optional[AsyncResourceServersClient] = None self._roles: typing.Optional[AsyncRolesClient] = None @@ -862,6 +873,14 @@ def prompts(self): self._prompts = AsyncPromptsClient(client_wrapper=self._client_wrapper) return self._prompts + @property + def rate_limit_policies(self): + if self._rate_limit_policies is None: + from .rate_limit_policies.client import AsyncRateLimitPoliciesClient # noqa: E402 + + self._rate_limit_policies = AsyncRateLimitPoliciesClient(client_wrapper=self._client_wrapper) + return self._rate_limit_policies + @property def refresh_tokens(self): if self._refresh_tokens is None: diff --git a/src/auth0/management/connections/client.py b/src/auth0/management/connections/client.py index 1893d550..d1a56085 100644 --- a/src/auth0/management/connections/client.py +++ b/src/auth0/management/connections/client.py @@ -66,25 +66,23 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[ConnectionForList, ListConnectionsCheckpointPaginatedResponseContent]: """ - Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + Retrieves detailed list of all [connections](https://auth0.com/docs/authenticate/identity-providers) that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 connections. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -162,9 +160,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateConnectionResponseContent: """ - Creates a new connection according to the JSON object received in body. + Creates a new connection according to the JSON object received in `body`. - Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. + **Note:** If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. Parameters ---------- @@ -241,7 +239,7 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> GetConnectionResponseContent: """ - Retrieve details for a specified connection along with options that can be used for identity provider configuration. + Retrieve details for a specified [connection](https://auth0.com/docs/authenticate/identity-providers) along with options that can be used for identity provider configuration. Parameters ---------- @@ -282,9 +280,9 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + Removes a specific [connection](https://auth0.com/docs/authenticate/identity-providers) from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name. + **Note:** If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent [create connection](https://auth0.com/docs/api/management/v2/connections/post-connections) requests, if they use an identical connection name. Parameters ---------- @@ -328,9 +326,9 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateConnectionResponseContent: """ - Update details for a specific connection, including option properties for identity provider configuration. + Update details for a specific [connection](https://auth0.com/docs/authenticate/identity-providers), including option properties for identity provider configuration. - Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. + **Note**: If you use the `options` parameter, the entire `options` object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option. Parameters ---------- @@ -396,7 +394,7 @@ def update( def check_status(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message + Retrieves the status of an ad/ldap connection referenced by its `ID`. `200 OK` http status code response is returned when the connection is online, otherwise a `404` status code is returned along with an error message Parameters ---------- @@ -498,25 +496,23 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[ConnectionForList, ListConnectionsCheckpointPaginatedResponseContent]: """ - Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + Retrieves detailed list of all [connections](https://auth0.com/docs/authenticate/identity-providers) that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 connections. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -603,9 +599,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateConnectionResponseContent: """ - Creates a new connection according to the JSON object received in body. + Creates a new connection according to the JSON object received in `body`. - Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. + **Note:** If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. Parameters ---------- @@ -690,7 +686,7 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> GetConnectionResponseContent: """ - Retrieve details for a specified connection along with options that can be used for identity provider configuration. + Retrieve details for a specified [connection](https://auth0.com/docs/authenticate/identity-providers) along with options that can be used for identity provider configuration. Parameters ---------- @@ -739,9 +735,9 @@ async def main() -> None: async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + Removes a specific [connection](https://auth0.com/docs/authenticate/identity-providers) from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name. + **Note:** If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent [create connection](https://auth0.com/docs/api/management/v2/connections/post-connections) requests, if they use an identical connection name. Parameters ---------- @@ -793,9 +789,9 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateConnectionResponseContent: """ - Update details for a specific connection, including option properties for identity provider configuration. + Update details for a specific [connection](https://auth0.com/docs/authenticate/identity-providers), including option properties for identity provider configuration. - Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. + **Note**: If you use the `options` parameter, the entire `options` object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option. Parameters ---------- @@ -869,7 +865,7 @@ async def main() -> None: async def check_status(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message + Retrieves the status of an ad/ldap connection referenced by its `ID`. `200 OK` http status code response is returned when the connection is online, otherwise a `404` status code is returned along with an error message Parameters ---------- diff --git a/src/auth0/management/connections/clients/client.py b/src/auth0/management/connections/clients/client.py index 4ee5934d..7d28300c 100644 --- a/src/auth0/management/connections/clients/client.py +++ b/src/auth0/management/connections/clients/client.py @@ -38,9 +38,9 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[ConnectionEnabledClient, GetConnectionEnabledClientsResponseContent]: """ - Retrieve all clients that have the specified connection enabled. + Retrieve all clients that have the specified [connection](https://auth0.com/docs/authenticate/identity-providers) enabled. - Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. + **Note**: The first time you call this endpoint, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no further results are remaining. Parameters ---------- @@ -148,9 +148,9 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[ConnectionEnabledClient, GetConnectionEnabledClientsResponseContent]: """ - Retrieve all clients that have the specified connection enabled. + Retrieve all clients that have the specified [connection](https://auth0.com/docs/authenticate/identity-providers) enabled. - Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. + **Note**: The first time you call this endpoint, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no further results are remaining. Parameters ---------- diff --git a/src/auth0/management/connections/clients/raw_client.py b/src/auth0/management/connections/clients/raw_client.py index 03909174..c5b74c7e 100644 --- a/src/auth0/management/connections/clients/raw_client.py +++ b/src/auth0/management/connections/clients/raw_client.py @@ -39,9 +39,9 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[ConnectionEnabledClient, GetConnectionEnabledClientsResponseContent]: """ - Retrieve all clients that have the specified connection enabled. + Retrieve all clients that have the specified [connection](https://auth0.com/docs/authenticate/identity-providers) enabled. - Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. + **Note**: The first time you call this endpoint, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no further results are remaining. Parameters ---------- @@ -182,9 +182,6 @@ def update( json=convert_and_respect_annotation_metadata( object_=request, annotation=UpdateEnabledClientConnectionsRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -269,9 +266,9 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[ConnectionEnabledClient, GetConnectionEnabledClientsResponseContent]: """ - Retrieve all clients that have the specified connection enabled. + Retrieve all clients that have the specified [connection](https://auth0.com/docs/authenticate/identity-providers) enabled. - Note: The first time you call this endpoint, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining. + **Note**: The first time you call this endpoint, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no further results are remaining. Parameters ---------- @@ -415,9 +412,6 @@ async def update( json=convert_and_respect_annotation_metadata( object_=request, annotation=UpdateEnabledClientConnectionsRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/connections/directory_provisioning/raw_client.py b/src/auth0/management/connections/directory_provisioning/raw_client.py index 517f3454..4704fdad 100644 --- a/src/auth0/management/connections/directory_provisioning/raw_client.py +++ b/src/auth0/management/connections/directory_provisioning/raw_client.py @@ -277,9 +277,6 @@ def create( annotation=typing.Optional[CreateDirectoryProvisioningRequestContent], direction="write", ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -489,9 +486,6 @@ def update( annotation=typing.Optional[UpdateDirectoryProvisioningRequestContent], direction="write", ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1151,9 +1145,6 @@ async def create( annotation=typing.Optional[CreateDirectoryProvisioningRequestContent], direction="write", ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1365,9 +1356,6 @@ async def update( annotation=typing.Optional[UpdateDirectoryProvisioningRequestContent], direction="write", ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/connections/keys/raw_client.py b/src/auth0/management/connections/keys/raw_client.py index 02fb302a..575c96a0 100644 --- a/src/auth0/management/connections/keys/raw_client.py +++ b/src/auth0/management/connections/keys/raw_client.py @@ -161,9 +161,6 @@ def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[PostConnectionKeysRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -283,9 +280,6 @@ def rotate( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[RotateConnectionKeysRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -497,9 +491,6 @@ async def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[PostConnectionKeysRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -619,9 +610,6 @@ async def rotate( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[RotateConnectionKeysRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/connections/raw_client.py b/src/auth0/management/connections/raw_client.py index 4d8f8cc8..5f86221c 100644 --- a/src/auth0/management/connections/raw_client.py +++ b/src/auth0/management/connections/raw_client.py @@ -54,25 +54,23 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[ConnectionForList, ListConnectionsCheckpointPaginatedResponseContent]: """ - Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + Retrieves detailed list of all [connections](https://auth0.com/docs/authenticate/identity-providers) that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 connections. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -207,9 +205,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateConnectionResponseContent]: """ - Creates a new connection according to the JSON object received in body. + Creates a new connection according to the JSON object received in `body`. - Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. + **Note:** If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. Parameters ---------- @@ -360,7 +358,7 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetConnectionResponseContent]: """ - Retrieve details for a specified connection along with options that can be used for identity provider configuration. + Retrieve details for a specified [connection](https://auth0.com/docs/authenticate/identity-providers) along with options that can be used for identity provider configuration. Parameters ---------- @@ -466,9 +464,9 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + Removes a specific [connection](https://auth0.com/docs/authenticate/identity-providers) from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name. + **Note:** If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent [create connection](https://auth0.com/docs/api/management/v2/connections/post-connections) requests, if they use an identical connection name. Parameters ---------- @@ -559,9 +557,9 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateConnectionResponseContent]: """ - Update details for a specific connection, including option properties for identity provider configuration. + Update details for a specific [connection](https://auth0.com/docs/authenticate/identity-providers), including option properties for identity provider configuration. - Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. + **Note**: If you use the `options` parameter, the entire `options` object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option. Parameters ---------- @@ -712,7 +710,7 @@ def update( def check_status(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message + Retrieves the status of an ad/ldap connection referenced by its `ID`. `200 OK` http status code response is returned when the connection is online, otherwise a `404` status code is returned along with an error message Parameters ---------- @@ -815,25 +813,23 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[ConnectionForList, ListConnectionsCheckpointPaginatedResponseContent]: """ - Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. + Retrieves detailed list of all [connections](https://auth0.com/docs/authenticate/identity-providers) that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 connections. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -971,9 +967,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateConnectionResponseContent]: """ - Creates a new connection according to the JSON object received in body. + Creates a new connection according to the JSON object received in `body`. - Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. + **Note:** If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. Parameters ---------- @@ -1124,7 +1120,7 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetConnectionResponseContent]: """ - Retrieve details for a specified connection along with options that can be used for identity provider configuration. + Retrieve details for a specified [connection](https://auth0.com/docs/authenticate/identity-providers) along with options that can be used for identity provider configuration. Parameters ---------- @@ -1232,9 +1228,9 @@ async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. + Removes a specific [connection](https://auth0.com/docs/authenticate/identity-providers) from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name. + **Note:** If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent [create connection](https://auth0.com/docs/api/management/v2/connections/post-connections) requests, if they use an identical connection name. Parameters ---------- @@ -1325,9 +1321,9 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateConnectionResponseContent]: """ - Update details for a specific connection, including option properties for identity provider configuration. + Update details for a specific [connection](https://auth0.com/docs/authenticate/identity-providers), including option properties for identity provider configuration. - Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. + **Note**: If you use the `options` parameter, the entire `options` object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option. Parameters ---------- @@ -1480,7 +1476,7 @@ async def check_status( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message + Retrieves the status of an ad/ldap connection referenced by its `ID`. `200 OK` http status code response is returned when the connection is online, otherwise a `404` status code is returned along with an error message Parameters ---------- diff --git a/src/auth0/management/connections/scim_configuration/client.py b/src/auth0/management/connections/scim_configuration/client.py index 291ff239..a21dfa05 100644 --- a/src/auth0/management/connections/scim_configuration/client.py +++ b/src/auth0/management/connections/scim_configuration/client.py @@ -91,7 +91,7 @@ def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetScimConfigurationResponseContent: """ - Retrieves a scim configuration by its connectionId. + Retrieves a scim configuration by its `connectionId`. Parameters ---------- @@ -162,7 +162,7 @@ def create( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Deletes a scim configuration by its connectionId. + Deletes a scim configuration by its `connectionId`. Parameters ---------- @@ -199,7 +199,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateScimConfigurationResponseContent: """ - Update a scim configuration by its connectionId. + Update a scim configuration by its `connectionId`. Parameters ---------- @@ -242,7 +242,7 @@ def get_default_mapping( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetScimConfigurationDefaultMappingResponseContent: """ - Retrieves a scim configuration's default mapping by its connectionId. + Retrieves a scim configuration's default mapping by its `connectionId`. Parameters ---------- @@ -355,7 +355,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetScimConfigurationResponseContent: """ - Retrieves a scim configuration by its connectionId. + Retrieves a scim configuration by its `connectionId`. Parameters ---------- @@ -442,7 +442,7 @@ async def main() -> None: async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Deletes a scim configuration by its connectionId. + Deletes a scim configuration by its `connectionId`. Parameters ---------- @@ -487,7 +487,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateScimConfigurationResponseContent: """ - Update a scim configuration by its connectionId. + Update a scim configuration by its `connectionId`. Parameters ---------- @@ -538,7 +538,7 @@ async def get_default_mapping( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetScimConfigurationDefaultMappingResponseContent: """ - Retrieves a scim configuration's default mapping by its connectionId. + Retrieves a scim configuration's default mapping by its `connectionId`. Parameters ---------- diff --git a/src/auth0/management/connections/scim_configuration/raw_client.py b/src/auth0/management/connections/scim_configuration/raw_client.py index 331ddf5d..3fd10470 100644 --- a/src/auth0/management/connections/scim_configuration/raw_client.py +++ b/src/auth0/management/connections/scim_configuration/raw_client.py @@ -147,7 +147,7 @@ def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetScimConfigurationResponseContent]: """ - Retrieves a scim configuration by its connectionId. + Retrieves a scim configuration by its `connectionId`. Parameters ---------- @@ -239,9 +239,6 @@ def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[CreateScimConfigurationRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -288,7 +285,7 @@ def create( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Deletes a scim configuration by its connectionId. + Deletes a scim configuration by its `connectionId`. Parameters ---------- @@ -350,7 +347,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateScimConfigurationResponseContent]: """ - Update a scim configuration by its connectionId. + Update a scim configuration by its `connectionId`. Parameters ---------- @@ -431,7 +428,7 @@ def get_default_mapping( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetScimConfigurationDefaultMappingResponseContent]: """ - Retrieves a scim configuration's default mapping by its connectionId. + Retrieves a scim configuration's default mapping by its `connectionId`. Parameters ---------- @@ -610,7 +607,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetScimConfigurationResponseContent]: """ - Retrieves a scim configuration by its connectionId. + Retrieves a scim configuration by its `connectionId`. Parameters ---------- @@ -702,9 +699,6 @@ async def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=typing.Optional[CreateScimConfigurationRequestContent], direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -753,7 +747,7 @@ async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Deletes a scim configuration by its connectionId. + Deletes a scim configuration by its `connectionId`. Parameters ---------- @@ -815,7 +809,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateScimConfigurationResponseContent]: """ - Update a scim configuration by its connectionId. + Update a scim configuration by its `connectionId`. Parameters ---------- @@ -896,7 +890,7 @@ async def get_default_mapping( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetScimConfigurationDefaultMappingResponseContent]: """ - Retrieves a scim configuration's default mapping by its connectionId. + Retrieves a scim configuration's default mapping by its `connectionId`. Parameters ---------- diff --git a/src/auth0/management/connections/scim_configuration/tokens/client.py b/src/auth0/management/connections/scim_configuration/tokens/client.py index a96ef28a..39e6ec5f 100644 --- a/src/auth0/management/connections/scim_configuration/tokens/client.py +++ b/src/auth0/management/connections/scim_configuration/tokens/client.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> RawTokensClient: def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetScimTokensResponseContent: """ - Retrieves all scim tokens by its connection id. + Retrieves all scim tokens by its connection `id`. Parameters ---------- @@ -106,7 +106,7 @@ def create( def delete(self, id: str, token_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Deletes a scim token by its connection id and tokenId. + Deletes a scim token by its connection `id` and `tokenId`. Parameters ---------- @@ -158,7 +158,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetScimTokensResponseContent: """ - Retrieves all scim tokens by its connection id. + Retrieves all scim tokens by its connection `id`. Parameters ---------- @@ -251,7 +251,7 @@ async def main() -> None: async def delete(self, id: str, token_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Deletes a scim token by its connection id and tokenId. + Deletes a scim token by its connection `id` and `tokenId`. Parameters ---------- diff --git a/src/auth0/management/connections/scim_configuration/tokens/raw_client.py b/src/auth0/management/connections/scim_configuration/tokens/raw_client.py index 98197d36..1d44256b 100644 --- a/src/auth0/management/connections/scim_configuration/tokens/raw_client.py +++ b/src/auth0/management/connections/scim_configuration/tokens/raw_client.py @@ -29,7 +29,7 @@ def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetScimTokensResponseContent]: """ - Retrieves all scim tokens by its connection id. + Retrieves all scim tokens by its connection `id`. Parameters ---------- @@ -189,7 +189,7 @@ def delete( self, id: str, token_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ - Deletes a scim token by its connection id and tokenId. + Deletes a scim token by its connection `id` and `tokenId`. Parameters ---------- @@ -254,7 +254,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetScimTokensResponseContent]: """ - Retrieves all scim tokens by its connection id. + Retrieves all scim tokens by its connection `id`. Parameters ---------- @@ -414,7 +414,7 @@ async def delete( self, id: str, token_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Deletes a scim token by its connection id and tokenId. + Deletes a scim token by its connection `id` and `tokenId`. Parameters ---------- diff --git a/src/auth0/management/core/client_wrapper.py b/src/auth0/management/core/client_wrapper.py index 60ebc5a6..cad2e314 100644 --- a/src/auth0/management/core/client_wrapper.py +++ b/src/auth0/management/core/client_wrapper.py @@ -1,11 +1,6 @@ # This file was auto-generated by Fern from our API Definition. -# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning -import base64 -import platform -import sys import typing -from json import dumps import httpx from .http_client import AsyncHttpClient, HttpClient @@ -31,18 +26,15 @@ def __init__( self._logging = logging def get_headers(self) -> typing.Dict[str, str]: - py_version = platform.python_version() - version = sys.modules["auth0"].__version__ - - auth0_client = dumps({ - "name": "auth0-python", - "version": version, - "env": {"python": py_version} - }).encode("utf-8") + import platform headers: typing.Dict[str, str] = { - "User-Agent": f"Python/{py_version}", - "Auth0-Client": base64.b64encode(auth0_client).decode(), + "User-Agent": "auth0-python/5.5.0", + "X-Fern-Language": "Python", + "X-Fern-Runtime": f"python/{platform.python_version()}", + "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", + "X-Fern-SDK-Name": "auth0-python", + "X-Fern-SDK-Version": "5.5.0", **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Bearer {self._get_token()}" diff --git a/src/auth0/management/custom_domains/client.py b/src/auth0/management/custom_domains/client.py index 2b979249..a38090d0 100644 --- a/src/auth0/management/custom_domains/client.py +++ b/src/auth0/management/custom_domains/client.py @@ -48,7 +48,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> ListCustomDomainsResponseContent: """ - Retrieve details on custom domains. + Retrieve details on [custom domains](https://auth0.com/docs/custom-domains). Parameters ---------- @@ -114,7 +114,6 @@ def create( - custom_client_ip_header - tls_policy - TLS Policies: - recommended - for modern usage this includes TLS 1.2 only @@ -311,23 +310,31 @@ def update( - custom_client_ip_header - tls_policy -
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to + **Updating CUSTOM_CLIENT_IP_HEADER for a custom domain** + + To update the `custom_client_ip_header` for a domain, the body to send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+ ```json + { "custom_client_ip_header": "cf-connecting-ip" } + ``` + + **Updating TLS_POLICY for a custom domain** + To update the `tls_policy` for a domain, the body to send should be: + + ```json + { "tls_policy": "recommended" } + ``` TLS Policies: - recommended - for modern usage this includes TLS 1.2 only - Some considerations: - The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. - - The compatible TLS policy is no longer supported. + - The `compatible` TLS policy is no longer supported. Parameters ---------- @@ -412,12 +419,12 @@ def verify( """ Run the verification process on a custom domain. - Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. + Note: Check the `status` field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. - For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. + For `self_managed_certs`, when the custom domain is verified for the first time, the response will also include the `cname_api_key` which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. - Learn more about verifying custom domains that use Auth0 Managed certificates. - Learn more about verifying custom domains that use Self Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains#step-2-verify-ownership) about verifying custom domains that use Auth0 Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership) about verifying custom domains that use Self Managed certificates. Parameters ---------- @@ -472,7 +479,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> ListCustomDomainsResponseContent: """ - Retrieve details on custom domains. + Retrieve details on [custom domains](https://auth0.com/docs/custom-domains). Parameters ---------- @@ -546,7 +553,6 @@ async def create( - custom_client_ip_header - tls_policy - TLS Policies: - recommended - for modern usage this includes TLS 1.2 only @@ -783,23 +789,31 @@ async def update( - custom_client_ip_header - tls_policy -
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to + **Updating CUSTOM_CLIENT_IP_HEADER for a custom domain** + + To update the `custom_client_ip_header` for a domain, the body to send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+ ```json + { "custom_client_ip_header": "cf-connecting-ip" } + ``` + + **Updating TLS_POLICY for a custom domain** + To update the `tls_policy` for a domain, the body to send should be: + + ```json + { "tls_policy": "recommended" } + ``` TLS Policies: - recommended - for modern usage this includes TLS 1.2 only - Some considerations: - The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. - - The compatible TLS policy is no longer supported. + - The `compatible` TLS policy is no longer supported. Parameters ---------- @@ -900,12 +914,12 @@ async def verify( """ Run the verification process on a custom domain. - Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. + Note: Check the `status` field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. - For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. + For `self_managed_certs`, when the custom domain is verified for the first time, the response will also include the `cname_api_key` which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. - Learn more about verifying custom domains that use Auth0 Managed certificates. - Learn more about verifying custom domains that use Self Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains#step-2-verify-ownership) about verifying custom domains that use Auth0 Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership) about verifying custom domains that use Self Managed certificates. Parameters ---------- diff --git a/src/auth0/management/custom_domains/raw_client.py b/src/auth0/management/custom_domains/raw_client.py index 7fc9fb40..bcf336a1 100644 --- a/src/auth0/management/custom_domains/raw_client.py +++ b/src/auth0/management/custom_domains/raw_client.py @@ -49,7 +49,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListCustomDomainsResponseContent]: """ - Retrieve details on custom domains. + Retrieve details on [custom domains](https://auth0.com/docs/custom-domains). Parameters ---------- @@ -159,7 +159,6 @@ def create( - custom_client_ip_header - tls_policy - TLS Policies: - recommended - for modern usage this includes TLS 1.2 only @@ -620,23 +619,31 @@ def update( - custom_client_ip_header - tls_policy -
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to + **Updating CUSTOM_CLIENT_IP_HEADER for a custom domain** + + To update the `custom_client_ip_header` for a domain, the body to send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+ ```json + { "custom_client_ip_header": "cf-connecting-ip" } + ``` + + **Updating TLS_POLICY for a custom domain** + To update the `tls_policy` for a domain, the body to send should be: + + ```json + { "tls_policy": "recommended" } + ``` TLS Policies: - recommended - for modern usage this includes TLS 1.2 only - Some considerations: - The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. - - The compatible TLS policy is no longer supported. + - The `compatible` TLS policy is no longer supported. Parameters ---------- @@ -843,12 +850,12 @@ def verify( """ Run the verification process on a custom domain. - Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. + Note: Check the `status` field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. - For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. + For `self_managed_certs`, when the custom domain is verified for the first time, the response will also include the `cname_api_key` which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. - Learn more about verifying custom domains that use Auth0 Managed certificates. - Learn more about verifying custom domains that use Self Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains#step-2-verify-ownership) about verifying custom domains that use Auth0 Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership) about verifying custom domains that use Self Managed certificates. Parameters ---------- @@ -957,7 +964,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListCustomDomainsResponseContent]: """ - Retrieve details on custom domains. + Retrieve details on [custom domains](https://auth0.com/docs/custom-domains). Parameters ---------- @@ -1067,7 +1074,6 @@ async def create( - custom_client_ip_header - tls_policy - TLS Policies: - recommended - for modern usage this includes TLS 1.2 only @@ -1530,23 +1536,31 @@ async def update( - custom_client_ip_header - tls_policy -
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to + **Updating CUSTOM_CLIENT_IP_HEADER for a custom domain** + + To update the `custom_client_ip_header` for a domain, the body to send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+ ```json + { "custom_client_ip_header": "cf-connecting-ip" } + ``` + + **Updating TLS_POLICY for a custom domain** + To update the `tls_policy` for a domain, the body to send should be: + + ```json + { "tls_policy": "recommended" } + ``` TLS Policies: - recommended - for modern usage this includes TLS 1.2 only - Some considerations: - The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. - - The compatible TLS policy is no longer supported. + - The `compatible` TLS policy is no longer supported. Parameters ---------- @@ -1753,12 +1767,12 @@ async def verify( """ Run the verification process on a custom domain. - Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. + Note: Check the `status` field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. - For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. + For `self_managed_certs`, when the custom domain is verified for the first time, the response will also include the `cname_api_key` which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. - Learn more about verifying custom domains that use Auth0 Managed certificates. - Learn more about verifying custom domains that use Self Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains#step-2-verify-ownership) about verifying custom domains that use Auth0 Managed certificates. + [Learn more](https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership) about verifying custom domains that use Self Managed certificates. Parameters ---------- diff --git a/src/auth0/management/event_streams/raw_client.py b/src/auth0/management/event_streams/raw_client.py index 0f795b7b..fb5bff0a 100644 --- a/src/auth0/management/event_streams/raw_client.py +++ b/src/auth0/management/event_streams/raw_client.py @@ -166,9 +166,6 @@ def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=EventStreamsCreateRequest, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -747,9 +744,6 @@ async def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=EventStreamsCreateRequest, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/flows/vault/connections/raw_client.py b/src/auth0/management/flows/vault/connections/raw_client.py index 334adfad..0f840891 100644 --- a/src/auth0/management/flows/vault/connections/raw_client.py +++ b/src/auth0/management/flows/vault/connections/raw_client.py @@ -172,9 +172,6 @@ def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateFlowsVaultConnectionRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -672,9 +669,6 @@ async def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateFlowsVaultConnectionRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/groups/__init__.py b/src/auth0/management/groups/__init__.py index 6184be4a..6969bd19 100644 --- a/src/auth0/management/groups/__init__.py +++ b/src/auth0/management/groups/__init__.py @@ -6,8 +6,8 @@ from importlib import import_module if typing.TYPE_CHECKING: - from . import members -_dynamic_imports: typing.Dict[str, str] = {"members": ".members"} + from . import members, roles +_dynamic_imports: typing.Dict[str, str] = {"members": ".members", "roles": ".roles"} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +31,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["members"] +__all__ = ["members", "roles"] diff --git a/src/auth0/management/groups/client.py b/src/auth0/management/groups/client.py index 5f837923..59e3178b 100644 --- a/src/auth0/management/groups/client.py +++ b/src/auth0/management/groups/client.py @@ -14,6 +14,7 @@ if typing.TYPE_CHECKING: from .members.client import AsyncMembersClient, MembersClient + from .roles.client import AsyncRolesClient, RolesClient class GroupsClient: @@ -21,6 +22,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._members: typing.Optional[MembersClient] = None + self._roles: typing.Optional[RolesClient] = None @property def with_raw_response(self) -> RawGroupsClient: @@ -187,12 +189,21 @@ def members(self): self._members = MembersClient(client_wrapper=self._client_wrapper) return self._members + @property + def roles(self): + if self._roles is None: + from .roles.client import RolesClient # noqa: E402 + + self._roles = RolesClient(client_wrapper=self._client_wrapper) + return self._roles + class AsyncGroupsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._members: typing.Optional[AsyncMembersClient] = None + self._roles: typing.Optional[AsyncRolesClient] = None @property def with_raw_response(self) -> AsyncRawGroupsClient: @@ -383,3 +394,11 @@ def members(self): self._members = AsyncMembersClient(client_wrapper=self._client_wrapper) return self._members + + @property + def roles(self): + if self._roles is None: + from .roles.client import AsyncRolesClient # noqa: E402 + + self._roles = AsyncRolesClient(client_wrapper=self._client_wrapper) + return self._roles diff --git a/src/auth0/management/groups/roles/__init__.py b/src/auth0/management/groups/roles/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/groups/roles/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/groups/roles/client.py b/src/auth0/management/groups/roles/client.py new file mode 100644 index 00000000..a85cbd75 --- /dev/null +++ b/src/auth0/management/groups/roles/client.py @@ -0,0 +1,314 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.pagination import AsyncPager, SyncPager +from ...core.request_options import RequestOptions +from ...types.list_group_roles_response_content import ListGroupRolesResponseContent +from ...types.role import Role +from .raw_client import AsyncRawRolesClient, RawRolesClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawRolesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawRolesClient + """ + return self._raw_client + + def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Role, ListGroupRolesResponseContent]: + """ + Lists the roles assigned to a group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Role, ListGroupRolesResponseContent] + Group's roles successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.groups.roles.list( + id="id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list(id, from_=from_, take=take, request_options=request_options) + + def create( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Assign one or more roles to a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to assign to the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.groups.roles.create( + id="id", + roles=["roles"], + ) + """ + _response = self._raw_client.create(id, roles=roles, request_options=request_options) + return _response.data + + def delete( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Unassign one or more roles from a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to remove from the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.groups.roles.delete( + id="id", + roles=["roles"], + ) + """ + _response = self._raw_client.delete(id, roles=roles, request_options=request_options) + return _response.data + + +class AsyncRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawRolesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawRolesClient + """ + return self._raw_client + + async def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Role, ListGroupRolesResponseContent]: + """ + Lists the roles assigned to a group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Role, ListGroupRolesResponseContent] + Group's roles successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.groups.roles.list( + id="id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list(id, from_=from_, take=take, request_options=request_options) + + async def create( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Assign one or more roles to a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to assign to the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.groups.roles.create( + id="id", + roles=["roles"], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(id, roles=roles, request_options=request_options) + return _response.data + + async def delete( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Unassign one or more roles from a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to remove from the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.groups.roles.delete( + id="id", + roles=["roles"], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(id, roles=roles, request_options=request_options) + return _response.data diff --git a/src/auth0/management/groups/roles/raw_client.py b/src/auth0/management/groups/roles/raw_client.py new file mode 100644 index 00000000..becdc4bd --- /dev/null +++ b/src/auth0/management/groups/roles/raw_client.py @@ -0,0 +1,637 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.http_response import AsyncHttpResponse, HttpResponse +from ...core.jsonable_encoder import encode_path_param +from ...core.pagination import AsyncPager, SyncPager +from ...core.parse_error import ParsingError +from ...core.pydantic_utilities import parse_obj_as +from ...core.request_options import RequestOptions +from ...errors.bad_request_error import BadRequestError +from ...errors.forbidden_error import ForbiddenError +from ...errors.not_found_error import NotFoundError +from ...errors.too_many_requests_error import TooManyRequestsError +from ...errors.unauthorized_error import UnauthorizedError +from ...types.list_group_roles_response_content import ListGroupRolesResponseContent +from ...types.role import Role +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Role, ListGroupRolesResponseContent]: + """ + Lists the roles assigned to a group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Role, ListGroupRolesResponseContent] + Group's roles successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"groups/{encode_path_param(id)}/roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListGroupRolesResponseContent, + parse_obj_as( + type_=ListGroupRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[None]: + """ + Assign one or more roles to a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to assign to the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"groups/{encode_path_param(id)}/roles", + method="POST", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[None]: + """ + Unassign one or more roles from a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to remove from the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"groups/{encode_path_param(id)}/roles", + method="DELETE", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Role, ListGroupRolesResponseContent]: + """ + Lists the roles assigned to a group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Role, ListGroupRolesResponseContent] + Group's roles successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"groups/{encode_path_param(id)}/roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListGroupRolesResponseContent, + parse_obj_as( + type_=ListGroupRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Assign one or more roles to a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to assign to the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"groups/{encode_path_param(id)}/roles", + method="POST", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete( + self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Unassign one or more roles from a specified group. + + Parameters + ---------- + id : str + Unique identifier for the group (service-generated). + + roles : typing.Sequence[str] + Array of role IDs to remove from the group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"groups/{encode_path_param(id)}/roles", + method="DELETE", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/guardian/enrollments/client.py b/src/auth0/management/guardian/enrollments/client.py index 016d7920..648234ab 100644 --- a/src/auth0/management/guardian/enrollments/client.py +++ b/src/auth0/management/guardian/enrollments/client.py @@ -40,10 +40,7 @@ def create_ticket( request_options: typing.Optional[RequestOptions] = None, ) -> CreateGuardianEnrollmentTicketResponseContent: """ - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- - Note: Users cannot enroll in Email as a factor through custom enrollment tickets. + Create a [multi-factor authentication (MFA) enrollment ticket](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets), and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. Parameters ---------- @@ -129,7 +126,7 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. + Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review [Reset User Multi-Factor Authentication and Recovery Codes](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa). Parameters ---------- @@ -185,10 +182,7 @@ async def create_ticket( request_options: typing.Optional[RequestOptions] = None, ) -> CreateGuardianEnrollmentTicketResponseContent: """ - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- - Note: Users cannot enroll in Email as a factor through custom enrollment tickets. + Create a [multi-factor authentication (MFA) enrollment ticket](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets), and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. Parameters ---------- @@ -290,7 +284,7 @@ async def main() -> None: async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. + Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review [Reset User Multi-Factor Authentication and Recovery Codes](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa). Parameters ---------- diff --git a/src/auth0/management/guardian/enrollments/raw_client.py b/src/auth0/management/guardian/enrollments/raw_client.py index 48c492b5..1f0f6959 100644 --- a/src/auth0/management/guardian/enrollments/raw_client.py +++ b/src/auth0/management/guardian/enrollments/raw_client.py @@ -39,10 +39,7 @@ def create_ticket( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateGuardianEnrollmentTicketResponseContent]: """ - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- - Note: Users cannot enroll in Email as a factor through custom enrollment tickets. + Create a [multi-factor authentication (MFA) enrollment ticket](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets), and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. Parameters ---------- @@ -229,7 +226,7 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. + Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review [Reset User Multi-Factor Authentication and Recovery Codes](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa). Parameters ---------- @@ -310,10 +307,7 @@ async def create_ticket( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateGuardianEnrollmentTicketResponseContent]: """ - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- - Note: Users cannot enroll in Email as a factor through custom enrollment tickets. + Create a [multi-factor authentication (MFA) enrollment ticket](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets), and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. Parameters ---------- @@ -502,7 +496,7 @@ async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. + Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review [Reset User Multi-Factor Authentication and Recovery Codes](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa). Parameters ---------- diff --git a/src/auth0/management/guardian/factors/push_notification/client.py b/src/auth0/management/guardian/factors/push_notification/client.py index 88d5e902..dfce5d9a 100644 --- a/src/auth0/management/guardian/factors/push_notification/client.py +++ b/src/auth0/management/guardian/factors/push_notification/client.py @@ -304,7 +304,7 @@ def get_sns_provider( self, *, request_options: typing.Optional[RequestOptions] = None ) -> GetGuardianFactorsProviderSnsResponseContent: """ - Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. + Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review [Configure Push Notifications for MFA](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa). Parameters ---------- @@ -339,7 +339,7 @@ def set_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> SetGuardianFactorsProviderPushNotificationSnsResponseContent: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- @@ -391,7 +391,7 @@ def update_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateGuardianFactorsProviderPushNotificationSnsResponseContent: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- @@ -811,7 +811,7 @@ async def get_sns_provider( self, *, request_options: typing.Optional[RequestOptions] = None ) -> GetGuardianFactorsProviderSnsResponseContent: """ - Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. + Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review [Configure Push Notifications for MFA](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa). Parameters ---------- @@ -854,7 +854,7 @@ async def set_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> SetGuardianFactorsProviderPushNotificationSnsResponseContent: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- @@ -914,7 +914,7 @@ async def update_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateGuardianFactorsProviderPushNotificationSnsResponseContent: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- diff --git a/src/auth0/management/guardian/factors/push_notification/raw_client.py b/src/auth0/management/guardian/factors/push_notification/raw_client.py index dbf3f3e8..7cd5bfd2 100644 --- a/src/auth0/management/guardian/factors/push_notification/raw_client.py +++ b/src/auth0/management/guardian/factors/push_notification/raw_client.py @@ -654,7 +654,7 @@ def get_sns_provider( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetGuardianFactorsProviderSnsResponseContent]: """ - Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. + Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review [Configure Push Notifications for MFA](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa). Parameters ---------- @@ -734,7 +734,7 @@ def set_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SetGuardianFactorsProviderPushNotificationSnsResponseContent]: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- @@ -835,7 +835,7 @@ def update_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateGuardianFactorsProviderPushNotificationSnsResponseContent]: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- @@ -1685,7 +1685,7 @@ async def get_sns_provider( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetGuardianFactorsProviderSnsResponseContent]: """ - Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. + Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review [Configure Push Notifications for MFA](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa). Parameters ---------- @@ -1765,7 +1765,7 @@ async def set_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SetGuardianFactorsProviderPushNotificationSnsResponseContent]: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- @@ -1866,7 +1866,7 @@ async def update_sns_provider( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateGuardianFactorsProviderPushNotificationSnsResponseContent]: """ - Configure the AWS SNS push notification provider configuration (subscription required). + Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required). Parameters ---------- diff --git a/src/auth0/management/guardian/policies/client.py b/src/auth0/management/guardian/policies/client.py index 2dc0c5ea..d49870cc 100644 --- a/src/auth0/management/guardian/policies/client.py +++ b/src/auth0/management/guardian/policies/client.py @@ -30,15 +30,14 @@ def with_raw_response(self) -> RawPoliciesClient: def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListGuardianPoliciesResponseContent: """ - Retrieve the multi-factor authentication (MFA) policies configured for your tenant. + Retrieve the [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) configured for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -66,15 +65,14 @@ def set( self, *, request: SetGuardianPoliciesRequestContent, request_options: typing.Optional[RequestOptions] = None ) -> SetGuardianPoliciesResponseContent: """ - Set multi-factor authentication (MFA) policies for your tenant. + Set [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -122,15 +120,14 @@ async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> ListGuardianPoliciesResponseContent: """ - Retrieve the multi-factor authentication (MFA) policies configured for your tenant. + Retrieve the [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) configured for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -166,15 +163,14 @@ async def set( self, *, request: SetGuardianPoliciesRequestContent, request_options: typing.Optional[RequestOptions] = None ) -> SetGuardianPoliciesResponseContent: """ - Set multi-factor authentication (MFA) policies for your tenant. + Set [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- diff --git a/src/auth0/management/guardian/policies/raw_client.py b/src/auth0/management/guardian/policies/raw_client.py index 1598a66e..e442df46 100644 --- a/src/auth0/management/guardian/policies/raw_client.py +++ b/src/auth0/management/guardian/policies/raw_client.py @@ -29,15 +29,14 @@ def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[ListGuardianPoliciesResponseContent]: """ - Retrieve the multi-factor authentication (MFA) policies configured for your tenant. + Retrieve the [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) configured for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -110,15 +109,14 @@ def set( self, *, request: SetGuardianPoliciesRequestContent, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SetGuardianPoliciesResponseContent]: """ - Set multi-factor authentication (MFA) policies for your tenant. + Set [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -136,9 +134,6 @@ def set( "guardian/policies", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -203,15 +198,14 @@ async def list( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[ListGuardianPoliciesResponseContent]: """ - Retrieve the multi-factor authentication (MFA) policies configured for your tenant. + Retrieve the [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) configured for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -284,15 +278,14 @@ async def set( self, *, request: SetGuardianPoliciesRequestContent, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[SetGuardianPoliciesResponseContent]: """ - Set multi-factor authentication (MFA) policies for your tenant. + Set [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for your tenant. The following policies are supported: -
    -
  • all-applications policy prompts with MFA for all logins.
  • -
  • confidence-score policy prompts with MFA only for low confidence logins.
  • -
- Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. + - `all-applications` policy prompts with MFA for all logins. + - `confidence-score` policy prompts with MFA only for low confidence logins. + + **Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details. Parameters ---------- @@ -310,9 +303,6 @@ async def set( "guardian/policies", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/hooks/client.py b/src/auth0/management/hooks/client.py index 743dbcfa..0ccf416d 100644 --- a/src/auth0/management/hooks/client.py +++ b/src/auth0/management/hooks/client.py @@ -51,7 +51,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Hook, ListHooksOffsetPaginatedResponseContent]: """ - Retrieve all hooks. Accepts a list of fields to include or exclude in the result. + Retrieve all [hooks](https://auth0.com/docs/hooks). Accepts a list of fields to include or exclude in the result. Parameters ---------- @@ -176,7 +176,7 @@ def get( self, id: str, *, fields: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> GetHookResponseContent: """ - Retrieve a hook by its ID. Accepts a list of fields to include in the result. + Retrieve [a hook](https://auth0.com/docs/hooks) by its ID. Accepts a list of fields to include in the result. Parameters ---------- @@ -330,7 +330,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Hook, ListHooksOffsetPaginatedResponseContent]: """ - Retrieve all hooks. Accepts a list of fields to include or exclude in the result. + Retrieve all [hooks](https://auth0.com/docs/hooks). Accepts a list of fields to include or exclude in the result. Parameters ---------- @@ -472,7 +472,7 @@ async def get( self, id: str, *, fields: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> GetHookResponseContent: """ - Retrieve a hook by its ID. Accepts a list of fields to include in the result. + Retrieve [a hook](https://auth0.com/docs/hooks) by its ID. Accepts a list of fields to include in the result. Parameters ---------- diff --git a/src/auth0/management/hooks/raw_client.py b/src/auth0/management/hooks/raw_client.py index 9aefaf59..bb14d75f 100644 --- a/src/auth0/management/hooks/raw_client.py +++ b/src/auth0/management/hooks/raw_client.py @@ -46,7 +46,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Hook, ListHooksOffsetPaginatedResponseContent]: """ - Retrieve all hooks. Accepts a list of fields to include or exclude in the result. + Retrieve all [hooks](https://auth0.com/docs/hooks). Accepts a list of fields to include or exclude in the result. Parameters ---------- @@ -307,7 +307,7 @@ def get( self, id: str, *, fields: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetHookResponseContent]: """ - Retrieve a hook by its ID. Accepts a list of fields to include in the result. + Retrieve [a hook](https://auth0.com/docs/hooks) by its ID. Accepts a list of fields to include in the result. Parameters ---------- @@ -638,7 +638,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Hook, ListHooksOffsetPaginatedResponseContent]: """ - Retrieve all hooks. Accepts a list of fields to include or exclude in the result. + Retrieve all [hooks](https://auth0.com/docs/hooks). Accepts a list of fields to include or exclude in the result. Parameters ---------- @@ -902,7 +902,7 @@ async def get( self, id: str, *, fields: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetHookResponseContent]: """ - Retrieve a hook by its ID. Accepts a list of fields to include in the result. + Retrieve [a hook](https://auth0.com/docs/hooks) by its ID. Accepts a list of fields to include in the result. Parameters ---------- diff --git a/src/auth0/management/hooks/secrets/raw_client.py b/src/auth0/management/hooks/secrets/raw_client.py index 09d0073c..d9ac00d1 100644 --- a/src/auth0/management/hooks/secrets/raw_client.py +++ b/src/auth0/management/hooks/secrets/raw_client.py @@ -156,9 +156,6 @@ def create( f"hooks/{encode_path_param(id)}/secrets", method="POST", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -257,9 +254,6 @@ def delete( f"hooks/{encode_path_param(id)}/secrets", method="DELETE", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -347,9 +341,6 @@ def update( f"hooks/{encode_path_param(id)}/secrets", method="PATCH", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -562,9 +553,6 @@ async def create( f"hooks/{encode_path_param(id)}/secrets", method="POST", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -663,9 +651,6 @@ async def delete( f"hooks/{encode_path_param(id)}/secrets", method="DELETE", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -753,9 +738,6 @@ async def update( f"hooks/{encode_path_param(id)}/secrets", method="PATCH", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/jobs/verification_email/client.py b/src/auth0/management/jobs/verification_email/client.py index ec38a3f8..cc61de0c 100644 --- a/src/auth0/management/jobs/verification_email/client.py +++ b/src/auth0/management/jobs/verification_email/client.py @@ -37,7 +37,7 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateVerificationEmailResponseContent: """ - Send an email to the specified user that asks them to click a link to verify their email address. + Send an email to the specified user that asks them to click a link to [verify their email address](https://auth0.com/docs/email/custom#verification-email). Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent. @@ -108,7 +108,7 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateVerificationEmailResponseContent: """ - Send an email to the specified user that asks them to click a link to verify their email address. + Send an email to the specified user that asks them to click a link to [verify their email address](https://auth0.com/docs/email/custom#verification-email). Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent. diff --git a/src/auth0/management/jobs/verification_email/raw_client.py b/src/auth0/management/jobs/verification_email/raw_client.py index d19fbfa5..c999a168 100644 --- a/src/auth0/management/jobs/verification_email/raw_client.py +++ b/src/auth0/management/jobs/verification_email/raw_client.py @@ -36,7 +36,7 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateVerificationEmailResponseContent]: """ - Send an email to the specified user that asks them to click a link to verify their email address. + Send an email to the specified user that asks them to click a link to [verify their email address](https://auth0.com/docs/email/custom#verification-email). Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent. @@ -156,7 +156,7 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateVerificationEmailResponseContent]: """ - Send an email to the specified user that asks them to click a link to verify their email address. + Send an email to the specified user that asks them to click a link to [verify their email address](https://auth0.com/docs/email/custom#verification-email). Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent. diff --git a/src/auth0/management/log_streams/raw_client.py b/src/auth0/management/log_streams/raw_client.py index 25b9ff5b..2a04643d 100644 --- a/src/auth0/management/log_streams/raw_client.py +++ b/src/auth0/management/log_streams/raw_client.py @@ -410,9 +410,6 @@ def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateLogStreamRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1397,9 +1394,6 @@ async def create( json=convert_and_respect_annotation_metadata( object_=request, annotation=CreateLogStreamRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/logs/client.py b/src/auth0/management/logs/client.py index 03a2fd0e..1a4be76e 100644 --- a/src/auth0/management/logs/client.py +++ b/src/auth0/management/logs/client.py @@ -41,33 +41,30 @@ def list( """ Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). + Set custom search criteria using the `q` parameter, or search from a specific log ID (_"search from checkpoint"_). - For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. + For more information on all possible event types, their respective acronyms, and descriptions, see [Log Event Type Codes](https://auth0.com/docs/logs/log-event-type-codes). -
To set custom search criteria, use the following parameters:
+ **To set custom search criteria, use the following parameters:** -
    -
  • q: Search Criteria using Query String Syntax
  • -
  • page: Page index of the results to return. First page is 0.
  • -
  • per_page: Number of results per page.
  • -
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • -
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • -
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • -
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • -
+ - **q:** Search Criteria using [Query String Syntax](https://auth0.com/docs/logs/log-search-query-syntax) + - **page:** Page index of the results to return. First page is 0. + - **per_page:** Number of results per page. + - **sort:** Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1` + - **fields:** Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields. + - **include_fields:** Whether specified fields are to be included (true) or excluded (false). + - **include_totals:** Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). **Deprecated:** this field is deprecated and should be removed from use. See [Search Engine V3 Breaking Changes](https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination) - For more information on the list of fields that can be used in fields and sort, see Searchable Fields. + For more information on the list of fields that can be used in `fields` and `sort`, see [Searchable Fields](https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields). - Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. + Auth0 [limits the number of logs](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations) you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the [get logs by checkpoint method](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint). -
To search from a checkpoint log ID, use the following parameters:
-
    -
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • -
  • take: Number of entries to retrieve when using the from parameter.
  • -
+ **To search from a checkpoint log ID, use the following parameters:** - Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. + - **from:** Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the `take` parameter. If you use `from` at the same time as `q`, `from` takes precedence and `q` is ignored. + - **take:** Number of entries to retrieve when using the `from` parameter. + + **Important:** When fetching logs from a checkpoint log ID, any parameter other than `from` and `take` will be ignored, and date ordering is not guaranteed. Parameters ---------- @@ -197,33 +194,30 @@ async def list( """ Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). + Set custom search criteria using the `q` parameter, or search from a specific log ID (_"search from checkpoint"_). + + For more information on all possible event types, their respective acronyms, and descriptions, see [Log Event Type Codes](https://auth0.com/docs/logs/log-event-type-codes). - For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. + **To set custom search criteria, use the following parameters:** -
To set custom search criteria, use the following parameters:
+ - **q:** Search Criteria using [Query String Syntax](https://auth0.com/docs/logs/log-search-query-syntax) + - **page:** Page index of the results to return. First page is 0. + - **per_page:** Number of results per page. + - **sort:** Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1` + - **fields:** Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields. + - **include_fields:** Whether specified fields are to be included (true) or excluded (false). + - **include_totals:** Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). **Deprecated:** this field is deprecated and should be removed from use. See [Search Engine V3 Breaking Changes](https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination) -
    -
  • q: Search Criteria using Query String Syntax
  • -
  • page: Page index of the results to return. First page is 0.
  • -
  • per_page: Number of results per page.
  • -
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • -
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • -
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • -
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • -
+ For more information on the list of fields that can be used in `fields` and `sort`, see [Searchable Fields](https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields). - For more information on the list of fields that can be used in fields and sort, see Searchable Fields. + Auth0 [limits the number of logs](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations) you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the [get logs by checkpoint method](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint). - Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. + **To search from a checkpoint log ID, use the following parameters:** -
To search from a checkpoint log ID, use the following parameters:
-
    -
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • -
  • take: Number of entries to retrieve when using the from parameter.
  • -
+ - **from:** Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the `take` parameter. If you use `from` at the same time as `q`, `from` takes precedence and `q` is ignored. + - **take:** Number of entries to retrieve when using the `from` parameter. - Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. + **Important:** When fetching logs from a checkpoint log ID, any parameter other than `from` and `take` will be ignored, and date ordering is not guaranteed. Parameters ---------- diff --git a/src/auth0/management/logs/raw_client.py b/src/auth0/management/logs/raw_client.py index 4cedb4f0..7398e40e 100644 --- a/src/auth0/management/logs/raw_client.py +++ b/src/auth0/management/logs/raw_client.py @@ -41,33 +41,30 @@ def list( """ Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). + Set custom search criteria using the `q` parameter, or search from a specific log ID (_"search from checkpoint"_). - For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. + For more information on all possible event types, their respective acronyms, and descriptions, see [Log Event Type Codes](https://auth0.com/docs/logs/log-event-type-codes). -
To set custom search criteria, use the following parameters:
+ **To set custom search criteria, use the following parameters:** -
    -
  • q: Search Criteria using Query String Syntax
  • -
  • page: Page index of the results to return. First page is 0.
  • -
  • per_page: Number of results per page.
  • -
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • -
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • -
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • -
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • -
+ - **q:** Search Criteria using [Query String Syntax](https://auth0.com/docs/logs/log-search-query-syntax) + - **page:** Page index of the results to return. First page is 0. + - **per_page:** Number of results per page. + - **sort:** Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1` + - **fields:** Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields. + - **include_fields:** Whether specified fields are to be included (true) or excluded (false). + - **include_totals:** Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). **Deprecated:** this field is deprecated and should be removed from use. See [Search Engine V3 Breaking Changes](https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination) - For more information on the list of fields that can be used in fields and sort, see Searchable Fields. + For more information on the list of fields that can be used in `fields` and `sort`, see [Searchable Fields](https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields). - Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. + Auth0 [limits the number of logs](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations) you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the [get logs by checkpoint method](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint). -
To search from a checkpoint log ID, use the following parameters:
-
    -
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • -
  • take: Number of entries to retrieve when using the from parameter.
  • -
+ **To search from a checkpoint log ID, use the following parameters:** - Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. + - **from:** Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the `take` parameter. If you use `from` at the same time as `q`, `from` takes precedence and `q` is ignored. + - **take:** Number of entries to retrieve when using the `from` parameter. + + **Important:** When fetching logs from a checkpoint log ID, any parameter other than `from` and `take` will be ignored, and date ordering is not guaranteed. Parameters ---------- @@ -311,33 +308,30 @@ async def list( """ Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). + Set custom search criteria using the `q` parameter, or search from a specific log ID (_"search from checkpoint"_). + + For more information on all possible event types, their respective acronyms, and descriptions, see [Log Event Type Codes](https://auth0.com/docs/logs/log-event-type-codes). - For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. + **To set custom search criteria, use the following parameters:** -
To set custom search criteria, use the following parameters:
+ - **q:** Search Criteria using [Query String Syntax](https://auth0.com/docs/logs/log-search-query-syntax) + - **page:** Page index of the results to return. First page is 0. + - **per_page:** Number of results per page. + - **sort:** Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1` + - **fields:** Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields. + - **include_fields:** Whether specified fields are to be included (true) or excluded (false). + - **include_totals:** Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). **Deprecated:** this field is deprecated and should be removed from use. See [Search Engine V3 Breaking Changes](https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination) -
    -
  • q: Search Criteria using Query String Syntax
  • -
  • page: Page index of the results to return. First page is 0.
  • -
  • per_page: Number of results per page.
  • -
  • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
  • -
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • -
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • -
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
  • -
+ For more information on the list of fields that can be used in `fields` and `sort`, see [Searchable Fields](https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields). - For more information on the list of fields that can be used in fields and sort, see Searchable Fields. + Auth0 [limits the number of logs](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations) you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the [get logs by checkpoint method](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint). - Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. + **To search from a checkpoint log ID, use the following parameters:** -
To search from a checkpoint log ID, use the following parameters:
-
    -
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • -
  • take: Number of entries to retrieve when using the from parameter.
  • -
+ - **from:** Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the `take` parameter. If you use `from` at the same time as `q`, `from` takes precedence and `q` is ignored. + - **take:** Number of entries to retrieve when using the `from` parameter. - Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. + **Important:** When fetching logs from a checkpoint log ID, any parameter other than `from` and `take` will be ignored, and date ordering is not guaranteed. Parameters ---------- diff --git a/src/auth0/management/prompts/custom_text/raw_client.py b/src/auth0/management/prompts/custom_text/raw_client.py index 6bca6565..58a20808 100644 --- a/src/auth0/management/prompts/custom_text/raw_client.py +++ b/src/auth0/management/prompts/custom_text/raw_client.py @@ -166,9 +166,6 @@ def set( f"prompts/{encode_path_param(prompt)}/custom-text/{encode_path_param(language)}", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -370,9 +367,6 @@ async def set( f"prompts/{encode_path_param(prompt)}/custom-text/{encode_path_param(language)}", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/prompts/partials/raw_client.py b/src/auth0/management/prompts/partials/raw_client.py index 0a015263..8009369b 100644 --- a/src/auth0/management/prompts/partials/raw_client.py +++ b/src/auth0/management/prompts/partials/raw_client.py @@ -154,9 +154,6 @@ def set( f"prompts/{encode_path_param(prompt)}/partials", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -347,9 +344,6 @@ async def set( f"prompts/{encode_path_param(prompt)}/partials", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/prompts/rendering/client.py b/src/auth0/management/prompts/rendering/client.py index 1e2df27f..e3449cb7 100644 --- a/src/auth0/management/prompts/rendering/client.py +++ b/src/auth0/management/prompts/rendering/client.py @@ -127,7 +127,7 @@ def bulk_update( self, *, configs: AculConfigs, request_options: typing.Optional[RequestOptions] = None ) -> BulkUpdateAculResponseContent: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- @@ -215,7 +215,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateAculResponseContent: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- @@ -388,7 +388,7 @@ async def bulk_update( self, *, configs: AculConfigs, request_options: typing.Optional[RequestOptions] = None ) -> BulkUpdateAculResponseContent: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- @@ -492,7 +492,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateAculResponseContent: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- diff --git a/src/auth0/management/prompts/rendering/raw_client.py b/src/auth0/management/prompts/rendering/raw_client.py index 3b96c919..d3f6c6ff 100644 --- a/src/auth0/management/prompts/rendering/raw_client.py +++ b/src/auth0/management/prompts/rendering/raw_client.py @@ -198,7 +198,7 @@ def bulk_update( self, *, configs: AculConfigs, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[BulkUpdateAculResponseContent]: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- @@ -430,7 +430,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateAculResponseContent]: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- @@ -729,7 +729,7 @@ async def bulk_update( self, *, configs: AculConfigs, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[BulkUpdateAculResponseContent]: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- @@ -961,7 +961,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateAculResponseContent]: """ - Learn more about configuring render settings for advanced customization. + Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization. Parameters ---------- diff --git a/src/auth0/management/rate_limit_policies/__init__.py b/src/auth0/management/rate_limit_policies/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/rate_limit_policies/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/rate_limit_policies/client.py b/src/auth0/management/rate_limit_policies/client.py new file mode 100644 index 00000000..aa768bb5 --- /dev/null +++ b/src/auth0/management/rate_limit_policies/client.py @@ -0,0 +1,534 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.pagination import AsyncPager, SyncPager +from ..core.request_options import RequestOptions +from ..types.create_rate_limit_policy_response_content import CreateRateLimitPolicyResponseContent +from ..types.get_rate_limit_policy_response_content import GetRateLimitPolicyResponseContent +from ..types.list_rate_limit_policies_paginated_response_content import ListRateLimitPoliciesPaginatedResponseContent +from ..types.patch_rate_limit_policy_configuration_request_content import ( + PatchRateLimitPolicyConfigurationRequestContent, +) +from ..types.rate_limit_policy import RateLimitPolicy +from ..types.rate_limit_policy_configuration import RateLimitPolicyConfiguration +from ..types.rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum +from ..types.rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum +from ..types.update_rate_limit_policy_response_content import UpdateRateLimitPolicyResponseContent +from .raw_client import AsyncRawRateLimitPoliciesClient, RawRateLimitPoliciesClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RateLimitPoliciesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawRateLimitPoliciesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawRateLimitPoliciesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawRateLimitPoliciesClient + """ + return self._raw_client + + def list( + self, + *, + resource: typing.Optional[RateLimitPolicyResourceEnum] = None, + consumer: typing.Optional[RateLimitPolicyConsumerEnum] = None, + consumer_selector: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + from_: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent]: + """ + Parameters + ---------- + resource : typing.Optional[RateLimitPolicyResourceEnum] + The API protected by the Rate Limit Policy. + + consumer : typing.Optional[RateLimitPolicyConsumerEnum] + The consumer to which the rate limit policy applies. + + consumer_selector : typing.Optional[str] + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + from_ : typing.Optional[str] + Cursor for pagination. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent] + Rate limit policies retrieved successfully. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.rate_limit_policies.list( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + take=1, + from_="from", + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list( + resource=resource, + consumer=consumer, + consumer_selector=consumer_selector, + take=take, + from_=from_, + request_options=request_options, + ) + + def create( + self, + *, + resource: RateLimitPolicyResourceEnum, + consumer: RateLimitPolicyConsumerEnum, + consumer_selector: str, + configuration: RateLimitPolicyConfiguration, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreateRateLimitPolicyResponseContent: + """ + Parameters + ---------- + resource : RateLimitPolicyResourceEnum + + consumer : RateLimitPolicyConsumerEnum + + consumer_selector : str + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + configuration : RateLimitPolicyConfiguration + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreateRateLimitPolicyResponseContent + Rate limit policy successfully created. + + Examples + -------- + from auth0 import Auth0, RateLimitPolicyConfigurationZero + + client = Auth0( + token="YOUR_TOKEN", + ) + client.rate_limit_policies.create( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + configuration=RateLimitPolicyConfigurationZero( + action="allow", + ), + ) + """ + _response = self._raw_client.create( + resource=resource, + consumer=consumer, + consumer_selector=consumer_selector, + configuration=configuration, + request_options=request_options, + ) + return _response.data + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetRateLimitPolicyResponseContent: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetRateLimitPolicyResponseContent + Rate limit policy retrieved successfully. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.rate_limit_policies.get( + id="id", + ) + """ + _response = self._raw_client.get(id, request_options=request_options) + return _response.data + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.rate_limit_policies.delete( + id="id", + ) + """ + _response = self._raw_client.delete(id, request_options=request_options) + return _response.data + + def update( + self, + id: str, + *, + configuration: PatchRateLimitPolicyConfigurationRequestContent, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateRateLimitPolicyResponseContent: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + configuration : PatchRateLimitPolicyConfigurationRequestContent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateRateLimitPolicyResponseContent + Rate limit policy successfully updated. + + Examples + -------- + from auth0 import Auth0, PatchRateLimitPolicyConfigurationRequestContentZero + + client = Auth0( + token="YOUR_TOKEN", + ) + client.rate_limit_policies.update( + id="id", + configuration=PatchRateLimitPolicyConfigurationRequestContentZero( + action="allow", + ), + ) + """ + _response = self._raw_client.update(id, configuration=configuration, request_options=request_options) + return _response.data + + +class AsyncRateLimitPoliciesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawRateLimitPoliciesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawRateLimitPoliciesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawRateLimitPoliciesClient + """ + return self._raw_client + + async def list( + self, + *, + resource: typing.Optional[RateLimitPolicyResourceEnum] = None, + consumer: typing.Optional[RateLimitPolicyConsumerEnum] = None, + consumer_selector: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + from_: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent]: + """ + Parameters + ---------- + resource : typing.Optional[RateLimitPolicyResourceEnum] + The API protected by the Rate Limit Policy. + + consumer : typing.Optional[RateLimitPolicyConsumerEnum] + The consumer to which the rate limit policy applies. + + consumer_selector : typing.Optional[str] + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + from_ : typing.Optional[str] + Cursor for pagination. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent] + Rate limit policies retrieved successfully. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.rate_limit_policies.list( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + take=1, + from_="from", + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list( + resource=resource, + consumer=consumer, + consumer_selector=consumer_selector, + take=take, + from_=from_, + request_options=request_options, + ) + + async def create( + self, + *, + resource: RateLimitPolicyResourceEnum, + consumer: RateLimitPolicyConsumerEnum, + consumer_selector: str, + configuration: RateLimitPolicyConfiguration, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreateRateLimitPolicyResponseContent: + """ + Parameters + ---------- + resource : RateLimitPolicyResourceEnum + + consumer : RateLimitPolicyConsumerEnum + + consumer_selector : str + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + configuration : RateLimitPolicyConfiguration + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreateRateLimitPolicyResponseContent + Rate limit policy successfully created. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0, RateLimitPolicyConfigurationZero + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.rate_limit_policies.create( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + configuration=RateLimitPolicyConfigurationZero( + action="allow", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + resource=resource, + consumer=consumer, + consumer_selector=consumer_selector, + configuration=configuration, + request_options=request_options, + ) + return _response.data + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetRateLimitPolicyResponseContent: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetRateLimitPolicyResponseContent + Rate limit policy retrieved successfully. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.rate_limit_policies.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get(id, request_options=request_options) + return _response.data + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.rate_limit_policies.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(id, request_options=request_options) + return _response.data + + async def update( + self, + id: str, + *, + configuration: PatchRateLimitPolicyConfigurationRequestContent, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateRateLimitPolicyResponseContent: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + configuration : PatchRateLimitPolicyConfigurationRequestContent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateRateLimitPolicyResponseContent + Rate limit policy successfully updated. + + Examples + -------- + import asyncio + + from auth0 import ( + AsyncAuth0, + PatchRateLimitPolicyConfigurationRequestContentZero, + ) + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.rate_limit_policies.update( + id="id", + configuration=PatchRateLimitPolicyConfigurationRequestContentZero( + action="allow", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update(id, configuration=configuration, request_options=request_options) + return _response.data diff --git a/src/auth0/management/rate_limit_policies/raw_client.py b/src/auth0/management/rate_limit_policies/raw_client.py new file mode 100644 index 00000000..d8442e2f --- /dev/null +++ b/src/auth0/management/rate_limit_policies/raw_client.py @@ -0,0 +1,1076 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.jsonable_encoder import encode_path_param +from ..core.pagination import AsyncPager, SyncPager +from ..core.parse_error import ParsingError +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata +from ..errors.bad_request_error import BadRequestError +from ..errors.conflict_error import ConflictError +from ..errors.forbidden_error import ForbiddenError +from ..errors.not_found_error import NotFoundError +from ..errors.too_many_requests_error import TooManyRequestsError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.create_rate_limit_policy_response_content import CreateRateLimitPolicyResponseContent +from ..types.get_rate_limit_policy_response_content import GetRateLimitPolicyResponseContent +from ..types.list_rate_limit_policies_paginated_response_content import ListRateLimitPoliciesPaginatedResponseContent +from ..types.patch_rate_limit_policy_configuration_request_content import ( + PatchRateLimitPolicyConfigurationRequestContent, +) +from ..types.rate_limit_policy import RateLimitPolicy +from ..types.rate_limit_policy_configuration import RateLimitPolicyConfiguration +from ..types.rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum +from ..types.rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum +from ..types.update_rate_limit_policy_response_content import UpdateRateLimitPolicyResponseContent +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawRateLimitPoliciesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + resource: typing.Optional[RateLimitPolicyResourceEnum] = None, + consumer: typing.Optional[RateLimitPolicyConsumerEnum] = None, + consumer_selector: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + from_: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent]: + """ + Parameters + ---------- + resource : typing.Optional[RateLimitPolicyResourceEnum] + The API protected by the Rate Limit Policy. + + consumer : typing.Optional[RateLimitPolicyConsumerEnum] + The consumer to which the rate limit policy applies. + + consumer_selector : typing.Optional[str] + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + from_ : typing.Optional[str] + Cursor for pagination. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent] + Rate limit policies retrieved successfully. + """ + _response = self._client_wrapper.httpx_client.request( + "rate-limit-policies", + method="GET", + params={ + "resource": resource, + "consumer": consumer, + "consumer_selector": consumer_selector, + "take": take, + "from": from_, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListRateLimitPoliciesPaginatedResponseContent, + parse_obj_as( + type_=ListRateLimitPoliciesPaginatedResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.rate_limit_policies + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + resource=resource, + consumer=consumer, + consumer_selector=consumer_selector, + take=take, + from_=_parsed_next, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + *, + resource: RateLimitPolicyResourceEnum, + consumer: RateLimitPolicyConsumerEnum, + consumer_selector: str, + configuration: RateLimitPolicyConfiguration, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CreateRateLimitPolicyResponseContent]: + """ + Parameters + ---------- + resource : RateLimitPolicyResourceEnum + + consumer : RateLimitPolicyConsumerEnum + + consumer_selector : str + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + configuration : RateLimitPolicyConfiguration + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CreateRateLimitPolicyResponseContent] + Rate limit policy successfully created. + """ + _response = self._client_wrapper.httpx_client.request( + "rate-limit-policies", + method="POST", + json={ + "resource": resource, + "consumer": consumer, + "consumer_selector": consumer_selector, + "configuration": convert_and_respect_annotation_metadata( + object_=configuration, annotation=RateLimitPolicyConfiguration, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateRateLimitPolicyResponseContent, + parse_obj_as( + type_=CreateRateLimitPolicyResponseContent, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetRateLimitPolicyResponseContent]: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetRateLimitPolicyResponseContent] + Rate limit policy retrieved successfully. + """ + _response = self._client_wrapper.httpx_client.request( + f"rate-limit-policies/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetRateLimitPolicyResponseContent, + parse_obj_as( + type_=GetRateLimitPolicyResponseContent, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"rate-limit-policies/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def update( + self, + id: str, + *, + configuration: PatchRateLimitPolicyConfigurationRequestContent, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[UpdateRateLimitPolicyResponseContent]: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + configuration : PatchRateLimitPolicyConfigurationRequestContent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[UpdateRateLimitPolicyResponseContent] + Rate limit policy successfully updated. + """ + _response = self._client_wrapper.httpx_client.request( + f"rate-limit-policies/{encode_path_param(id)}", + method="PATCH", + json={ + "configuration": convert_and_respect_annotation_metadata( + object_=configuration, annotation=PatchRateLimitPolicyConfigurationRequestContent, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UpdateRateLimitPolicyResponseContent, + parse_obj_as( + type_=UpdateRateLimitPolicyResponseContent, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawRateLimitPoliciesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + resource: typing.Optional[RateLimitPolicyResourceEnum] = None, + consumer: typing.Optional[RateLimitPolicyConsumerEnum] = None, + consumer_selector: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + from_: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent]: + """ + Parameters + ---------- + resource : typing.Optional[RateLimitPolicyResourceEnum] + The API protected by the Rate Limit Policy. + + consumer : typing.Optional[RateLimitPolicyConsumerEnum] + The consumer to which the rate limit policy applies. + + consumer_selector : typing.Optional[str] + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + from_ : typing.Optional[str] + Cursor for pagination. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[RateLimitPolicy, ListRateLimitPoliciesPaginatedResponseContent] + Rate limit policies retrieved successfully. + """ + _response = await self._client_wrapper.httpx_client.request( + "rate-limit-policies", + method="GET", + params={ + "resource": resource, + "consumer": consumer, + "consumer_selector": consumer_selector, + "take": take, + "from": from_, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListRateLimitPoliciesPaginatedResponseContent, + parse_obj_as( + type_=ListRateLimitPoliciesPaginatedResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.rate_limit_policies + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + resource=resource, + consumer=consumer, + consumer_selector=consumer_selector, + take=take, + from_=_parsed_next, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, + *, + resource: RateLimitPolicyResourceEnum, + consumer: RateLimitPolicyConsumerEnum, + consumer_selector: str, + configuration: RateLimitPolicyConfiguration, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CreateRateLimitPolicyResponseContent]: + """ + Parameters + ---------- + resource : RateLimitPolicyResourceEnum + + consumer : RateLimitPolicyConsumerEnum + + consumer_selector : str + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + + configuration : RateLimitPolicyConfiguration + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CreateRateLimitPolicyResponseContent] + Rate limit policy successfully created. + """ + _response = await self._client_wrapper.httpx_client.request( + "rate-limit-policies", + method="POST", + json={ + "resource": resource, + "consumer": consumer, + "consumer_selector": consumer_selector, + "configuration": convert_and_respect_annotation_metadata( + object_=configuration, annotation=RateLimitPolicyConfiguration, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateRateLimitPolicyResponseContent, + parse_obj_as( + type_=CreateRateLimitPolicyResponseContent, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetRateLimitPolicyResponseContent]: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetRateLimitPolicyResponseContent] + Rate limit policy retrieved successfully. + """ + _response = await self._client_wrapper.httpx_client.request( + f"rate-limit-policies/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetRateLimitPolicyResponseContent, + parse_obj_as( + type_=GetRateLimitPolicyResponseContent, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"rate-limit-policies/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def update( + self, + id: str, + *, + configuration: PatchRateLimitPolicyConfigurationRequestContent, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[UpdateRateLimitPolicyResponseContent]: + """ + Parameters + ---------- + id : str + Unique identifier for the Rate Limit Policy. + + configuration : PatchRateLimitPolicyConfigurationRequestContent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[UpdateRateLimitPolicyResponseContent] + Rate limit policy successfully updated. + """ + _response = await self._client_wrapper.httpx_client.request( + f"rate-limit-policies/{encode_path_param(id)}", + method="PATCH", + json={ + "configuration": convert_and_respect_annotation_metadata( + object_=configuration, annotation=PatchRateLimitPolicyConfigurationRequestContent, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UpdateRateLimitPolicyResponseContent, + parse_obj_as( + type_=UpdateRateLimitPolicyResponseContent, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/roles/client.py b/src/auth0/management/roles/client.py index deedfdfa..145f3fd2 100644 --- a/src/auth0/management/roles/client.py +++ b/src/auth0/management/roles/client.py @@ -51,7 +51,7 @@ def list( """ Retrieve detailed list of user roles created in your tenant. - Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. + **Note**: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. Parameters ---------- @@ -110,9 +110,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateRoleResponseContent: """ - Create a user role for Role-Based Access Control. + Create a user role for [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. + **Note**: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. Parameters ---------- @@ -146,7 +146,7 @@ def create( def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetRoleResponseContent: """ - Retrieve details about a specific user role specified by ID. + Retrieve details about a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- @@ -177,7 +177,7 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + Delete a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. Parameters ---------- @@ -214,7 +214,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateRoleResponseContent: """ - Modify the details of a specific user role specified by ID. + Modify the details of a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- @@ -296,7 +296,7 @@ async def list( """ Retrieve detailed list of user roles created in your tenant. - Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. + **Note**: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. Parameters ---------- @@ -364,9 +364,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateRoleResponseContent: """ - Create a user role for Role-Based Access Control. + Create a user role for [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. + **Note**: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. Parameters ---------- @@ -408,7 +408,7 @@ async def main() -> None: async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetRoleResponseContent: """ - Retrieve details about a specific user role specified by ID. + Retrieve details about a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- @@ -447,7 +447,7 @@ async def main() -> None: async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + Delete a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. Parameters ---------- @@ -492,7 +492,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> UpdateRoleResponseContent: """ - Modify the details of a specific user role specified by ID. + Modify the details of a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- diff --git a/src/auth0/management/roles/permissions/client.py b/src/auth0/management/roles/permissions/client.py index 9ba53f34..60809394 100644 --- a/src/auth0/management/roles/permissions/client.py +++ b/src/auth0/management/roles/permissions/client.py @@ -96,7 +96,7 @@ def add( request_options: typing.Optional[RequestOptions] = None, ) -> None: """ - Add one or more permissions to a specified user role. + Add one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) to a specified user role. Parameters ---------- @@ -141,7 +141,7 @@ def delete( request_options: typing.Optional[RequestOptions] = None, ) -> None: """ - Remove one or more permissions from a specified user role. + Remove one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) from a specified user role. Parameters ---------- @@ -268,7 +268,7 @@ async def add( request_options: typing.Optional[RequestOptions] = None, ) -> None: """ - Add one or more permissions to a specified user role. + Add one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) to a specified user role. Parameters ---------- @@ -321,7 +321,7 @@ async def delete( request_options: typing.Optional[RequestOptions] = None, ) -> None: """ - Remove one or more permissions from a specified user role. + Remove one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) from a specified user role. Parameters ---------- diff --git a/src/auth0/management/roles/permissions/raw_client.py b/src/auth0/management/roles/permissions/raw_client.py index f798eaa8..e7539a19 100644 --- a/src/auth0/management/roles/permissions/raw_client.py +++ b/src/auth0/management/roles/permissions/raw_client.py @@ -169,7 +169,7 @@ def add( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ - Add one or more permissions to a specified user role. + Add one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) to a specified user role. Parameters ---------- @@ -264,7 +264,7 @@ def delete( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[None]: """ - Remove one or more permissions from a specified user role. + Remove one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) from a specified user role. Parameters ---------- @@ -496,7 +496,7 @@ async def add( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ - Add one or more permissions to a specified user role. + Add one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) to a specified user role. Parameters ---------- @@ -591,7 +591,7 @@ async def delete( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[None]: """ - Remove one or more permissions from a specified user role. + Remove one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) from a specified user role. Parameters ---------- diff --git a/src/auth0/management/roles/raw_client.py b/src/auth0/management/roles/raw_client.py index d27902d7..6ebfbf72 100644 --- a/src/auth0/management/roles/raw_client.py +++ b/src/auth0/management/roles/raw_client.py @@ -44,7 +44,7 @@ def list( """ Retrieve detailed list of user roles created in your tenant. - Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. + **Note**: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. Parameters ---------- @@ -161,9 +161,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateRoleResponseContent]: """ - Create a user role for Role-Based Access Control. + Create a user role for [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. + **Note**: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. Parameters ---------- @@ -272,7 +272,7 @@ def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetRoleResponseContent]: """ - Retrieve details about a specific user role specified by ID. + Retrieve details about a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- @@ -368,7 +368,7 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + Delete a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. Parameters ---------- @@ -463,7 +463,7 @@ def update( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdateRoleResponseContent]: """ - Modify the details of a specific user role specified by ID. + Modify the details of a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- @@ -577,7 +577,7 @@ async def list( """ Retrieve detailed list of user roles created in your tenant. - Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. + **Note**: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. Parameters ---------- @@ -697,9 +697,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateRoleResponseContent]: """ - Create a user role for Role-Based Access Control. + Create a user role for [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. + **Note**: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. Parameters ---------- @@ -808,7 +808,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetRoleResponseContent]: """ - Retrieve details about a specific user role specified by ID. + Retrieve details about a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- @@ -906,7 +906,7 @@ async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. + Delete a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. Parameters ---------- @@ -1001,7 +1001,7 @@ async def update( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdateRoleResponseContent]: """ - Modify the details of a specific user role specified by ID. + Modify the details of a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID. Parameters ---------- diff --git a/src/auth0/management/roles/users/client.py b/src/auth0/management/roles/users/client.py index 528e1c7c..bc0fc4fa 100644 --- a/src/auth0/management/roles/users/client.py +++ b/src/auth0/management/roles/users/client.py @@ -37,25 +37,23 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[RoleUser, ListRoleUsersPaginatedResponseContent]: """ - Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. + Retrieve list of users associated with a specific role. For Dashboard instructions, review [View Users Assigned to Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles). This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -100,9 +98,9 @@ def assign( self, id: str, *, users: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. + Assign one or more users to an existing user role. To learn more, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. + **Note**: New roles cannot be created through this action. Parameters ---------- @@ -159,25 +157,23 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[RoleUser, ListRoleUsersPaginatedResponseContent]: """ - Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. + Retrieve list of users associated with a specific role. For Dashboard instructions, review [View Users Assigned to Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles). This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -231,9 +227,9 @@ async def assign( self, id: str, *, users: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. + Assign one or more users to an existing user role. To learn more, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. + **Note**: New roles cannot be created through this action. Parameters ---------- diff --git a/src/auth0/management/roles/users/raw_client.py b/src/auth0/management/roles/users/raw_client.py index 5740807f..2cd28d13 100644 --- a/src/auth0/management/roles/users/raw_client.py +++ b/src/auth0/management/roles/users/raw_client.py @@ -37,25 +37,23 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[RoleUser, ListRoleUsersPaginatedResponseContent]: """ - Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. + Retrieve list of users associated with a specific role. For Dashboard instructions, review [View Users Assigned to Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles). This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -172,9 +170,9 @@ def assign( self, id: str, *, users: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ - Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. + Assign one or more users to an existing user role. To learn more, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. + **Note**: New roles cannot be created through this action. Parameters ---------- @@ -284,25 +282,23 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[RoleUser, ListRoleUsersPaginatedResponseContent]: """ - Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. + Retrieve list of users associated with a specific role. For Dashboard instructions, review [View Users Assigned to Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles). This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ + - Offset pagination + - Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. -

Checkpoint Pagination

+ **Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
  • -
- Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining. + - `from`: Optional id from which to start selection. + - `take`: The total amount of entries to retrieve when using the from parameter. Defaults to 50. + + **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. Parameters ---------- @@ -422,9 +418,9 @@ async def assign( self, id: str, *, users: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. + Assign one or more users to an existing user role. To learn more, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. + **Note**: New roles cannot be created through this action. Parameters ---------- diff --git a/src/auth0/management/rules/client.py b/src/auth0/management/rules/client.py index e8ad8446..fff4c1fd 100644 --- a/src/auth0/management/rules/client.py +++ b/src/auth0/management/rules/client.py @@ -43,7 +43,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Rule, ListRulesOffsetPaginatedResponseContent]: """ - Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. + Retrieve a filtered list of [rules](https://auth0.com/docs/rules). Accepts a list of fields to include or exclude. Parameters ---------- @@ -114,9 +114,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateRuleResponseContent: """ - Create a new rule. + Create a [new rule](https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api). - Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. + Note: Changing a rule's stage of execution from the default `login_success` can change the rule's function signature to have user omitted. Parameters ---------- @@ -166,7 +166,7 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> GetRuleResponseContent: """ - Retrieve rule details. Accepts a list of fields to include or exclude in the result. + Retrieve [rule](https://auth0.com/docs/rules) details. Accepts a list of fields to include or exclude in the result. Parameters ---------- @@ -317,7 +317,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Rule, ListRulesOffsetPaginatedResponseContent]: """ - Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. + Retrieve a filtered list of [rules](https://auth0.com/docs/rules). Accepts a list of fields to include or exclude. Parameters ---------- @@ -397,9 +397,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateRuleResponseContent: """ - Create a new rule. + Create a [new rule](https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api). - Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. + Note: Changing a rule's stage of execution from the default `login_success` can change the rule's function signature to have user omitted. Parameters ---------- @@ -457,7 +457,7 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> GetRuleResponseContent: """ - Retrieve rule details. Accepts a list of fields to include or exclude in the result. + Retrieve [rule](https://auth0.com/docs/rules) details. Accepts a list of fields to include or exclude in the result. Parameters ---------- diff --git a/src/auth0/management/rules/raw_client.py b/src/auth0/management/rules/raw_client.py index c39ed6f3..516f0afc 100644 --- a/src/auth0/management/rules/raw_client.py +++ b/src/auth0/management/rules/raw_client.py @@ -44,7 +44,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Rule, ListRulesOffsetPaginatedResponseContent]: """ - Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. + Retrieve a filtered list of [rules](https://auth0.com/docs/rules). Accepts a list of fields to include or exclude. Parameters ---------- @@ -184,9 +184,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateRuleResponseContent]: """ - Create a new rule. + Create a [new rule](https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api). - Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. + Note: Changing a rule's stage of execution from the default `login_success` can change the rule's function signature to have user omitted. Parameters ---------- @@ -308,7 +308,7 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetRuleResponseContent]: """ - Retrieve rule details. Accepts a list of fields to include or exclude in the result. + Retrieve [rule](https://auth0.com/docs/rules) details. Accepts a list of fields to include or exclude in the result. Parameters ---------- @@ -644,7 +644,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Rule, ListRulesOffsetPaginatedResponseContent]: """ - Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. + Retrieve a filtered list of [rules](https://auth0.com/docs/rules). Accepts a list of fields to include or exclude. Parameters ---------- @@ -787,9 +787,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateRuleResponseContent]: """ - Create a new rule. + Create a [new rule](https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api). - Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. + Note: Changing a rule's stage of execution from the default `login_success` can change the rule's function signature to have user omitted. Parameters ---------- @@ -911,7 +911,7 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetRuleResponseContent]: """ - Retrieve rule details. Accepts a list of fields to include or exclude in the result. + Retrieve [rule](https://auth0.com/docs/rules) details. Accepts a list of fields to include or exclude in the result. Parameters ---------- diff --git a/src/auth0/management/self_service_profiles/custom_text/raw_client.py b/src/auth0/management/self_service_profiles/custom_text/raw_client.py index 39afa0ba..c1f127ad 100644 --- a/src/auth0/management/self_service_profiles/custom_text/raw_client.py +++ b/src/auth0/management/self_service_profiles/custom_text/raw_client.py @@ -168,9 +168,6 @@ def set( f"self-service-profiles/{encode_path_param(id)}/custom-text/{encode_path_param(language)}/{encode_path_param(page)}", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -377,9 +374,6 @@ async def set( f"self-service-profiles/{encode_path_param(id)}/custom-text/{encode_path_param(language)}/{encode_path_param(page)}", method="PUT", json=request, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/types/__init__.py b/src/auth0/management/types/__init__.py index 191ef50b..e321ebd3 100644 --- a/src/auth0/management/types/__init__.py +++ b/src/auth0/management/types/__init__.py @@ -1095,6 +1095,7 @@ CreatePhoneTemplateTestNotificationResponseContent, ) from .create_public_key_device_credential_response_content import CreatePublicKeyDeviceCredentialResponseContent + from .create_rate_limit_policy_response_content import CreateRateLimitPolicyResponseContent from .create_resource_server_response_content import CreateResourceServerResponseContent from .create_role_response_content import CreateRoleResponseContent from .create_rule_response_content import CreateRuleResponseContent @@ -2652,6 +2653,7 @@ from .get_organization_response_content import GetOrganizationResponseContent from .get_partials_response_content import GetPartialsResponseContent from .get_phone_template_response_content import GetPhoneTemplateResponseContent + from .get_rate_limit_policy_response_content import GetRateLimitPolicyResponseContent from .get_refresh_token_response_content import GetRefreshTokenResponseContent from .get_refresh_tokens_paginated_response_content import GetRefreshTokensPaginatedResponseContent from .get_resource_server_response_content import GetResourceServerResponseContent @@ -2745,6 +2747,7 @@ ListFlowsVaultConnectionsOffsetPaginatedResponseContent, ) from .list_forms_offset_paginated_response_content import ListFormsOffsetPaginatedResponseContent + from .list_group_roles_response_content import ListGroupRolesResponseContent from .list_groups_paginated_response_content import ListGroupsPaginatedResponseContent from .list_guardian_policies_response_content import ListGuardianPoliciesResponseContent from .list_hooks_offset_paginated_response_content import ListHooksOffsetPaginatedResponseContent @@ -2769,6 +2772,7 @@ from .list_organization_members_paginated_response_content import ListOrganizationMembersPaginatedResponseContent from .list_organizations_paginated_response_content import ListOrganizationsPaginatedResponseContent from .list_phone_templates_response_content import ListPhoneTemplatesResponseContent + from .list_rate_limit_policies_paginated_response_content import ListRateLimitPoliciesPaginatedResponseContent from .list_refresh_tokens_paginated_response_content import ListRefreshTokensPaginatedResponseContent from .list_resource_server_offset_paginated_response_content import ListResourceServerOffsetPaginatedResponseContent from .list_role_permissions_offset_paginated_response_content import ( @@ -2902,6 +2906,25 @@ from .password_max_length_exceeded_policy_enum import PasswordMaxLengthExceededPolicyEnum from .password_sequential_characters_policy_enum import PasswordSequentialCharactersPolicyEnum from .patch_client_credential_response_content import PatchClientCredentialResponseContent + from .patch_rate_limit_policy_configuration_request_content import PatchRateLimitPolicyConfigurationRequestContent + from .patch_rate_limit_policy_configuration_request_content_action import ( + PatchRateLimitPolicyConfigurationRequestContentAction, + ) + from .patch_rate_limit_policy_configuration_request_content_action_action import ( + PatchRateLimitPolicyConfigurationRequestContentActionAction, + ) + from .patch_rate_limit_policy_configuration_request_content_one import ( + PatchRateLimitPolicyConfigurationRequestContentOne, + ) + from .patch_rate_limit_policy_configuration_request_content_one_action import ( + PatchRateLimitPolicyConfigurationRequestContentOneAction, + ) + from .patch_rate_limit_policy_configuration_request_content_zero import ( + PatchRateLimitPolicyConfigurationRequestContentZero, + ) + from .patch_rate_limit_policy_configuration_request_content_zero_action import ( + PatchRateLimitPolicyConfigurationRequestContentZeroAction, + ) from .patch_supplemental_signals_response_content import PatchSupplementalSignalsResponseContent from .permission_request_payload import PermissionRequestPayload from .permissions_response_payload import PermissionsResponsePayload @@ -2928,6 +2951,16 @@ from .public_key_credential import PublicKeyCredential from .public_key_credential_algorithm_enum import PublicKeyCredentialAlgorithmEnum from .public_key_credential_type_enum import PublicKeyCredentialTypeEnum + from .rate_limit_policy import RateLimitPolicy + from .rate_limit_policy_configuration import RateLimitPolicyConfiguration + from .rate_limit_policy_configuration_action import RateLimitPolicyConfigurationAction + from .rate_limit_policy_configuration_action_action import RateLimitPolicyConfigurationActionAction + from .rate_limit_policy_configuration_one import RateLimitPolicyConfigurationOne + from .rate_limit_policy_configuration_one_action import RateLimitPolicyConfigurationOneAction + from .rate_limit_policy_configuration_zero import RateLimitPolicyConfigurationZero + from .rate_limit_policy_configuration_zero_action import RateLimitPolicyConfigurationZeroAction + from .rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum + from .rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum from .refresh_token_date import RefreshTokenDate from .refresh_token_date_object import RefreshTokenDateObject from .refresh_token_device import RefreshTokenDevice @@ -3232,6 +3265,7 @@ from .update_organization_discovery_domain_response_content import UpdateOrganizationDiscoveryDomainResponseContent from .update_organization_response_content import UpdateOrganizationResponseContent from .update_phone_template_response_content import UpdatePhoneTemplateResponseContent + from .update_rate_limit_policy_response_content import UpdateRateLimitPolicyResponseContent from .update_refresh_token_response_content import UpdateRefreshTokenResponseContent from .update_resource_server_response_content import UpdateResourceServerResponseContent from .update_risk_assessments_settings_new_device_response_content import ( @@ -4306,6 +4340,7 @@ "CreatePhoneTemplateResponseContent": ".create_phone_template_response_content", "CreatePhoneTemplateTestNotificationResponseContent": ".create_phone_template_test_notification_response_content", "CreatePublicKeyDeviceCredentialResponseContent": ".create_public_key_device_credential_response_content", + "CreateRateLimitPolicyResponseContent": ".create_rate_limit_policy_response_content", "CreateResourceServerResponseContent": ".create_resource_server_response_content", "CreateRoleResponseContent": ".create_role_response_content", "CreateRuleResponseContent": ".create_rule_response_content", @@ -5415,6 +5450,7 @@ "GetOrganizationResponseContent": ".get_organization_response_content", "GetPartialsResponseContent": ".get_partials_response_content", "GetPhoneTemplateResponseContent": ".get_phone_template_response_content", + "GetRateLimitPolicyResponseContent": ".get_rate_limit_policy_response_content", "GetRefreshTokenResponseContent": ".get_refresh_token_response_content", "GetRefreshTokensPaginatedResponseContent": ".get_refresh_tokens_paginated_response_content", "GetResourceServerResponseContent": ".get_resource_server_response_content", @@ -5494,6 +5530,7 @@ "ListFlowsRequestParametersHydrateEnum": ".list_flows_request_parameters_hydrate_enum", "ListFlowsVaultConnectionsOffsetPaginatedResponseContent": ".list_flows_vault_connections_offset_paginated_response_content", "ListFormsOffsetPaginatedResponseContent": ".list_forms_offset_paginated_response_content", + "ListGroupRolesResponseContent": ".list_group_roles_response_content", "ListGroupsPaginatedResponseContent": ".list_groups_paginated_response_content", "ListGuardianPoliciesResponseContent": ".list_guardian_policies_response_content", "ListHooksOffsetPaginatedResponseContent": ".list_hooks_offset_paginated_response_content", @@ -5508,6 +5545,7 @@ "ListOrganizationMembersPaginatedResponseContent": ".list_organization_members_paginated_response_content", "ListOrganizationsPaginatedResponseContent": ".list_organizations_paginated_response_content", "ListPhoneTemplatesResponseContent": ".list_phone_templates_response_content", + "ListRateLimitPoliciesPaginatedResponseContent": ".list_rate_limit_policies_paginated_response_content", "ListRefreshTokensPaginatedResponseContent": ".list_refresh_tokens_paginated_response_content", "ListResourceServerOffsetPaginatedResponseContent": ".list_resource_server_offset_paginated_response_content", "ListRolePermissionsOffsetPaginatedResponseContent": ".list_role_permissions_offset_paginated_response_content", @@ -5629,6 +5667,13 @@ "PasswordMaxLengthExceededPolicyEnum": ".password_max_length_exceeded_policy_enum", "PasswordSequentialCharactersPolicyEnum": ".password_sequential_characters_policy_enum", "PatchClientCredentialResponseContent": ".patch_client_credential_response_content", + "PatchRateLimitPolicyConfigurationRequestContent": ".patch_rate_limit_policy_configuration_request_content", + "PatchRateLimitPolicyConfigurationRequestContentAction": ".patch_rate_limit_policy_configuration_request_content_action", + "PatchRateLimitPolicyConfigurationRequestContentActionAction": ".patch_rate_limit_policy_configuration_request_content_action_action", + "PatchRateLimitPolicyConfigurationRequestContentOne": ".patch_rate_limit_policy_configuration_request_content_one", + "PatchRateLimitPolicyConfigurationRequestContentOneAction": ".patch_rate_limit_policy_configuration_request_content_one_action", + "PatchRateLimitPolicyConfigurationRequestContentZero": ".patch_rate_limit_policy_configuration_request_content_zero", + "PatchRateLimitPolicyConfigurationRequestContentZeroAction": ".patch_rate_limit_policy_configuration_request_content_zero_action", "PatchSupplementalSignalsResponseContent": ".patch_supplemental_signals_response_content", "PermissionRequestPayload": ".permission_request_payload", "PermissionsResponsePayload": ".permissions_response_payload", @@ -5655,6 +5700,16 @@ "PublicKeyCredential": ".public_key_credential", "PublicKeyCredentialAlgorithmEnum": ".public_key_credential_algorithm_enum", "PublicKeyCredentialTypeEnum": ".public_key_credential_type_enum", + "RateLimitPolicy": ".rate_limit_policy", + "RateLimitPolicyConfiguration": ".rate_limit_policy_configuration", + "RateLimitPolicyConfigurationAction": ".rate_limit_policy_configuration_action", + "RateLimitPolicyConfigurationActionAction": ".rate_limit_policy_configuration_action_action", + "RateLimitPolicyConfigurationOne": ".rate_limit_policy_configuration_one", + "RateLimitPolicyConfigurationOneAction": ".rate_limit_policy_configuration_one_action", + "RateLimitPolicyConfigurationZero": ".rate_limit_policy_configuration_zero", + "RateLimitPolicyConfigurationZeroAction": ".rate_limit_policy_configuration_zero_action", + "RateLimitPolicyConsumerEnum": ".rate_limit_policy_consumer_enum", + "RateLimitPolicyResourceEnum": ".rate_limit_policy_resource_enum", "RefreshTokenDate": ".refresh_token_date", "RefreshTokenDateObject": ".refresh_token_date_object", "RefreshTokenDevice": ".refresh_token_device", @@ -5917,6 +5972,7 @@ "UpdateOrganizationDiscoveryDomainResponseContent": ".update_organization_discovery_domain_response_content", "UpdateOrganizationResponseContent": ".update_organization_response_content", "UpdatePhoneTemplateResponseContent": ".update_phone_template_response_content", + "UpdateRateLimitPolicyResponseContent": ".update_rate_limit_policy_response_content", "UpdateRefreshTokenResponseContent": ".update_refresh_token_response_content", "UpdateResourceServerResponseContent": ".update_resource_server_response_content", "UpdateRiskAssessmentsSettingsNewDeviceResponseContent": ".update_risk_assessments_settings_new_device_response_content", @@ -7001,6 +7057,7 @@ def __dir__(): "CreatePhoneTemplateResponseContent", "CreatePhoneTemplateTestNotificationResponseContent", "CreatePublicKeyDeviceCredentialResponseContent", + "CreateRateLimitPolicyResponseContent", "CreateResourceServerResponseContent", "CreateRoleResponseContent", "CreateRuleResponseContent", @@ -8110,6 +8167,7 @@ def __dir__(): "GetOrganizationResponseContent", "GetPartialsResponseContent", "GetPhoneTemplateResponseContent", + "GetRateLimitPolicyResponseContent", "GetRefreshTokenResponseContent", "GetRefreshTokensPaginatedResponseContent", "GetResourceServerResponseContent", @@ -8189,6 +8247,7 @@ def __dir__(): "ListFlowsRequestParametersHydrateEnum", "ListFlowsVaultConnectionsOffsetPaginatedResponseContent", "ListFormsOffsetPaginatedResponseContent", + "ListGroupRolesResponseContent", "ListGroupsPaginatedResponseContent", "ListGuardianPoliciesResponseContent", "ListHooksOffsetPaginatedResponseContent", @@ -8203,6 +8262,7 @@ def __dir__(): "ListOrganizationMembersPaginatedResponseContent", "ListOrganizationsPaginatedResponseContent", "ListPhoneTemplatesResponseContent", + "ListRateLimitPoliciesPaginatedResponseContent", "ListRefreshTokensPaginatedResponseContent", "ListResourceServerOffsetPaginatedResponseContent", "ListRolePermissionsOffsetPaginatedResponseContent", @@ -8324,6 +8384,13 @@ def __dir__(): "PasswordMaxLengthExceededPolicyEnum", "PasswordSequentialCharactersPolicyEnum", "PatchClientCredentialResponseContent", + "PatchRateLimitPolicyConfigurationRequestContent", + "PatchRateLimitPolicyConfigurationRequestContentAction", + "PatchRateLimitPolicyConfigurationRequestContentActionAction", + "PatchRateLimitPolicyConfigurationRequestContentOne", + "PatchRateLimitPolicyConfigurationRequestContentOneAction", + "PatchRateLimitPolicyConfigurationRequestContentZero", + "PatchRateLimitPolicyConfigurationRequestContentZeroAction", "PatchSupplementalSignalsResponseContent", "PermissionRequestPayload", "PermissionsResponsePayload", @@ -8350,6 +8417,16 @@ def __dir__(): "PublicKeyCredential", "PublicKeyCredentialAlgorithmEnum", "PublicKeyCredentialTypeEnum", + "RateLimitPolicy", + "RateLimitPolicyConfiguration", + "RateLimitPolicyConfigurationAction", + "RateLimitPolicyConfigurationActionAction", + "RateLimitPolicyConfigurationOne", + "RateLimitPolicyConfigurationOneAction", + "RateLimitPolicyConfigurationZero", + "RateLimitPolicyConfigurationZeroAction", + "RateLimitPolicyConsumerEnum", + "RateLimitPolicyResourceEnum", "RefreshTokenDate", "RefreshTokenDateObject", "RefreshTokenDevice", @@ -8612,6 +8689,7 @@ def __dir__(): "UpdateOrganizationDiscoveryDomainResponseContent", "UpdateOrganizationResponseContent", "UpdatePhoneTemplateResponseContent", + "UpdateRateLimitPolicyResponseContent", "UpdateRefreshTokenResponseContent", "UpdateResourceServerResponseContent", "UpdateRiskAssessmentsSettingsNewDeviceResponseContent", diff --git a/src/auth0/management/types/client_external_metadata_type_enum.py b/src/auth0/management/types/client_external_metadata_type_enum.py index d8853927..85b988ec 100644 --- a/src/auth0/management/types/client_external_metadata_type_enum.py +++ b/src/auth0/management/types/client_external_metadata_type_enum.py @@ -2,4 +2,4 @@ import typing -ClientExternalMetadataTypeEnum = typing.Union[typing.Literal["cimd"], typing.Any] +ClientExternalMetadataTypeEnum = typing.Union[typing.Literal["cimd", "dcr"], typing.Any] diff --git a/src/auth0/management/types/connection_properties_options.py b/src/auth0/management/types/connection_properties_options.py index d11a79f2..848c1a2f 100644 --- a/src/auth0/management/types/connection_properties_options.py +++ b/src/auth0/management/types/connection_properties_options.py @@ -10,6 +10,7 @@ from .connection_attributes import ConnectionAttributes from .connection_authentication_methods import ConnectionAuthenticationMethods from .connection_custom_scripts import ConnectionCustomScripts +from .connection_dpop_signing_alg_enum import ConnectionDpopSigningAlgEnum from .connection_federated_connections_access_tokens import ConnectionFederatedConnectionsAccessTokens from .connection_gateway_authentication import ConnectionGatewayAuthentication from .connection_id_token_signed_response_algs import ConnectionIdTokenSignedResponseAlgs @@ -99,6 +100,7 @@ class ConnectionPropertiesOptions(UniversalBaseModel): password_options: typing.Optional[ConnectionPasswordOptions] = None assertion_decryption_settings: typing.Optional[ConnectionAssertionDecryptionSettings] = None id_token_signed_response_algs: typing.Optional[ConnectionIdTokenSignedResponseAlgs] = None + dpop_signing_alg: typing.Optional[ConnectionDpopSigningAlgEnum] = None token_endpoint_auth_method: typing.Optional[ConnectionTokenEndpointAuthMethodEnum] = None token_endpoint_auth_signing_alg: typing.Optional[ConnectionTokenEndpointAuthSigningAlgEnum] = None token_endpoint_jwtca_aud_format: typing.Optional[ConnectionTokenEndpointJwtcaAudFormatEnumOidc] = None diff --git a/src/auth0/management/types/create_rate_limit_policy_response_content.py b/src/auth0/management/types/create_rate_limit_policy_response_content.py new file mode 100644 index 00000000..2a90db38 --- /dev/null +++ b/src/auth0/management/types/create_rate_limit_policy_response_content.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration import RateLimitPolicyConfiguration +from .rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum +from .rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum + + +class CreateRateLimitPolicyResponseContent(UniversalBaseModel): + id: str = pydantic.Field() + """ + Unique identifier for the Rate Limit Policy. + """ + + resource: RateLimitPolicyResourceEnum + consumer: RateLimitPolicyConsumerEnum + consumer_selector: str = pydantic.Field() + """ + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + """ + + configuration: RateLimitPolicyConfiguration + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was created. + """ + + updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/create_user_response_content.py b/src/auth0/management/types/create_user_response_content.py index 917803a6..b1dc97a6 100644 --- a/src/auth0/management/types/create_user_response_content.py +++ b/src/auth0/management/types/create_user_response_content.py @@ -70,12 +70,14 @@ class CreateUserResponseContent(UniversalBaseModel): List of multi-factor authentication providers with which this user has enrolled. """ + multifactor_last_modified: typing.Optional[UserDateSchema] = None last_ip: typing.Optional[str] = pydantic.Field(default=None) """ Last IP address from which this user logged in. """ last_login: typing.Optional[UserDateSchema] = None + last_password_reset: typing.Optional[UserDateSchema] = None logins_count: typing.Optional[int] = pydantic.Field(default=None) """ Total number of logins this user has performed. diff --git a/src/auth0/management/types/get_rate_limit_policy_response_content.py b/src/auth0/management/types/get_rate_limit_policy_response_content.py new file mode 100644 index 00000000..90bee455 --- /dev/null +++ b/src/auth0/management/types/get_rate_limit_policy_response_content.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration import RateLimitPolicyConfiguration +from .rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum +from .rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum + + +class GetRateLimitPolicyResponseContent(UniversalBaseModel): + id: str = pydantic.Field() + """ + Unique identifier for the Rate Limit Policy. + """ + + resource: RateLimitPolicyResourceEnum + consumer: RateLimitPolicyConsumerEnum + consumer_selector: str = pydantic.Field() + """ + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + """ + + configuration: RateLimitPolicyConfiguration + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was created. + """ + + updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/get_user_response_content.py b/src/auth0/management/types/get_user_response_content.py index 59b00416..12a660c6 100644 --- a/src/auth0/management/types/get_user_response_content.py +++ b/src/auth0/management/types/get_user_response_content.py @@ -70,12 +70,14 @@ class GetUserResponseContent(UniversalBaseModel): List of multi-factor authentication providers with which this user has enrolled. """ + multifactor_last_modified: typing.Optional[UserDateSchema] = None last_ip: typing.Optional[str] = pydantic.Field(default=None) """ Last IP address from which this user logged in. """ last_login: typing.Optional[UserDateSchema] = None + last_password_reset: typing.Optional[UserDateSchema] = None logins_count: typing.Optional[int] = pydantic.Field(default=None) """ Total number of logins this user has performed. diff --git a/src/auth0/management/types/list_group_roles_response_content.py b/src/auth0/management/types/list_group_roles_response_content.py new file mode 100644 index 00000000..ebdc5a38 --- /dev/null +++ b/src/auth0/management/types/list_group_roles_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .role import Role + + +class ListGroupRolesResponseContent(UniversalBaseModel): + roles: typing.List[Role] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_rate_limit_policies_paginated_response_content.py b/src/auth0/management/types/list_rate_limit_policies_paginated_response_content.py new file mode 100644 index 00000000..9cac792d --- /dev/null +++ b/src/auth0/management/types/list_rate_limit_policies_paginated_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy import RateLimitPolicy + + +class ListRateLimitPoliciesPaginatedResponseContent(UniversalBaseModel): + rate_limit_policies: typing.Optional[typing.List[RateLimitPolicy]] = None + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/oauth_scope.py b/src/auth0/management/types/oauth_scope.py index ba0faec0..cbf45e39 100644 --- a/src/auth0/management/types/oauth_scope.py +++ b/src/auth0/management/types/oauth_scope.py @@ -103,6 +103,9 @@ "read:grants", "delete:grants", "read:group_members", + "create:group_roles", + "read:group_roles", + "delete:group_roles", "read:groups", "delete:groups", "create:guardian_enrollment_tickets", @@ -161,6 +164,10 @@ "delete:phone_templates", "read:prompts", "update:prompts", + "create:rate_limit_policies", + "read:rate_limit_policies", + "update:rate_limit_policies", + "delete:rate_limit_policies", "read:refresh_tokens", "update:refresh_tokens", "delete:refresh_tokens", diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content.py new file mode 100644 index 00000000..21c904a7 --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .patch_rate_limit_policy_configuration_request_content_action import ( + PatchRateLimitPolicyConfigurationRequestContentAction, +) +from .patch_rate_limit_policy_configuration_request_content_one import ( + PatchRateLimitPolicyConfigurationRequestContentOne, +) +from .patch_rate_limit_policy_configuration_request_content_zero import ( + PatchRateLimitPolicyConfigurationRequestContentZero, +) + +PatchRateLimitPolicyConfigurationRequestContent = typing.Union[ + PatchRateLimitPolicyConfigurationRequestContentZero, + PatchRateLimitPolicyConfigurationRequestContentOne, + PatchRateLimitPolicyConfigurationRequestContentAction, +] diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action.py new file mode 100644 index 00000000..8f2793c1 --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .patch_rate_limit_policy_configuration_request_content_action_action import ( + PatchRateLimitPolicyConfigurationRequestContentActionAction, +) + + +class PatchRateLimitPolicyConfigurationRequestContentAction(UniversalBaseModel): + action: PatchRateLimitPolicyConfigurationRequestContentActionAction = pydantic.Field() + """ + Determines the action to take when the rate limit is exceeded. + """ + + limit: int = pydantic.Field() + """ + The maximum number of requests allowed in a single refresh window. + """ + + redirect_uri: str = pydantic.Field() + """ + The HTTPS URI to redirect to when the rate limit is exceeded. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action_action.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action_action.py new file mode 100644 index 00000000..74688b27 --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_action_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PatchRateLimitPolicyConfigurationRequestContentActionAction = typing.Union[typing.Literal["redirect"], typing.Any] diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one.py new file mode 100644 index 00000000..fee3c933 --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .patch_rate_limit_policy_configuration_request_content_one_action import ( + PatchRateLimitPolicyConfigurationRequestContentOneAction, +) + + +class PatchRateLimitPolicyConfigurationRequestContentOne(UniversalBaseModel): + action: PatchRateLimitPolicyConfigurationRequestContentOneAction = pydantic.Field() + """ + Determines the action to take when the rate limit is exceeded. + """ + + limit: int = pydantic.Field() + """ + The maximum number of requests allowed in a single refresh window. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one_action.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one_action.py new file mode 100644 index 00000000..b0d7568d --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_one_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PatchRateLimitPolicyConfigurationRequestContentOneAction = typing.Union[typing.Literal["block", "log"], typing.Any] diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero.py new file mode 100644 index 00000000..c5993b0c --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .patch_rate_limit_policy_configuration_request_content_zero_action import ( + PatchRateLimitPolicyConfigurationRequestContentZeroAction, +) + + +class PatchRateLimitPolicyConfigurationRequestContentZero(UniversalBaseModel): + action: PatchRateLimitPolicyConfigurationRequestContentZeroAction = pydantic.Field() + """ + Determines the action to take when the rate limit is exceeded. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero_action.py b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero_action.py new file mode 100644 index 00000000..d3ca6657 --- /dev/null +++ b/src/auth0/management/types/patch_rate_limit_policy_configuration_request_content_zero_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PatchRateLimitPolicyConfigurationRequestContentZeroAction = typing.Union[typing.Literal["allow"], typing.Any] diff --git a/src/auth0/management/types/rate_limit_policy.py b/src/auth0/management/types/rate_limit_policy.py new file mode 100644 index 00000000..bcc146d6 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration import RateLimitPolicyConfiguration +from .rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum +from .rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum + + +class RateLimitPolicy(UniversalBaseModel): + id: str = pydantic.Field() + """ + Unique identifier for the Rate Limit Policy. + """ + + resource: RateLimitPolicyResourceEnum + consumer: RateLimitPolicyConsumerEnum + consumer_selector: str = pydantic.Field() + """ + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + """ + + configuration: RateLimitPolicyConfiguration + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was created. + """ + + updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/rate_limit_policy_configuration.py b/src/auth0/management/types/rate_limit_policy_configuration.py new file mode 100644 index 00000000..d579a9fd --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .rate_limit_policy_configuration_action import RateLimitPolicyConfigurationAction +from .rate_limit_policy_configuration_one import RateLimitPolicyConfigurationOne +from .rate_limit_policy_configuration_zero import RateLimitPolicyConfigurationZero + +RateLimitPolicyConfiguration = typing.Union[ + RateLimitPolicyConfigurationZero, RateLimitPolicyConfigurationOne, RateLimitPolicyConfigurationAction +] diff --git a/src/auth0/management/types/rate_limit_policy_configuration_action.py b/src/auth0/management/types/rate_limit_policy_configuration_action.py new file mode 100644 index 00000000..159cf1e0 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration_action.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration_action_action import RateLimitPolicyConfigurationActionAction + + +class RateLimitPolicyConfigurationAction(UniversalBaseModel): + action: RateLimitPolicyConfigurationActionAction = pydantic.Field() + """ + Determines the action to take when the rate limit is exceeded. + """ + + limit: int = pydantic.Field() + """ + The maximum number of requests allowed in a single refresh window. + """ + + redirect_uri: str = pydantic.Field() + """ + The HTTPS URI to redirect to when the rate limit is exceeded. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/rate_limit_policy_configuration_action_action.py b/src/auth0/management/types/rate_limit_policy_configuration_action_action.py new file mode 100644 index 00000000..e6ec781c --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration_action_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RateLimitPolicyConfigurationActionAction = typing.Union[typing.Literal["redirect"], typing.Any] diff --git a/src/auth0/management/types/rate_limit_policy_configuration_one.py b/src/auth0/management/types/rate_limit_policy_configuration_one.py new file mode 100644 index 00000000..ed90431e --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration_one.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration_one_action import RateLimitPolicyConfigurationOneAction + + +class RateLimitPolicyConfigurationOne(UniversalBaseModel): + action: RateLimitPolicyConfigurationOneAction = pydantic.Field() + """ + Determines the action to take when the rate limit is exceeded. + """ + + limit: int = pydantic.Field() + """ + The maximum number of requests allowed in a single refresh window. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/rate_limit_policy_configuration_one_action.py b/src/auth0/management/types/rate_limit_policy_configuration_one_action.py new file mode 100644 index 00000000..888c29b6 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration_one_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RateLimitPolicyConfigurationOneAction = typing.Union[typing.Literal["block", "log"], typing.Any] diff --git a/src/auth0/management/types/rate_limit_policy_configuration_zero.py b/src/auth0/management/types/rate_limit_policy_configuration_zero.py new file mode 100644 index 00000000..562108c4 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration_zero.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration_zero_action import RateLimitPolicyConfigurationZeroAction + + +class RateLimitPolicyConfigurationZero(UniversalBaseModel): + action: RateLimitPolicyConfigurationZeroAction = pydantic.Field() + """ + Determines the action to take when the rate limit is exceeded. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/rate_limit_policy_configuration_zero_action.py b/src/auth0/management/types/rate_limit_policy_configuration_zero_action.py new file mode 100644 index 00000000..99265031 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_configuration_zero_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RateLimitPolicyConfigurationZeroAction = typing.Union[typing.Literal["allow"], typing.Any] diff --git a/src/auth0/management/types/rate_limit_policy_consumer_enum.py b/src/auth0/management/types/rate_limit_policy_consumer_enum.py new file mode 100644 index 00000000..10923ef1 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_consumer_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RateLimitPolicyConsumerEnum = typing.Union[typing.Literal["client"], typing.Any] diff --git a/src/auth0/management/types/rate_limit_policy_resource_enum.py b/src/auth0/management/types/rate_limit_policy_resource_enum.py new file mode 100644 index 00000000..d064a821 --- /dev/null +++ b/src/auth0/management/types/rate_limit_policy_resource_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RateLimitPolicyResourceEnum = typing.Union[typing.Literal["oauth_authentication_api"], typing.Any] diff --git a/src/auth0/management/types/update_connection_options.py b/src/auth0/management/types/update_connection_options.py index 2b81da2e..c72129db 100644 --- a/src/auth0/management/types/update_connection_options.py +++ b/src/auth0/management/types/update_connection_options.py @@ -10,6 +10,7 @@ from .connection_attributes import ConnectionAttributes from .connection_authentication_methods import ConnectionAuthenticationMethods from .connection_custom_scripts import ConnectionCustomScripts +from .connection_dpop_signing_alg_enum import ConnectionDpopSigningAlgEnum from .connection_federated_connections_access_tokens import ConnectionFederatedConnectionsAccessTokens from .connection_gateway_authentication import ConnectionGatewayAuthentication from .connection_id_token_signed_response_algs import ConnectionIdTokenSignedResponseAlgs @@ -99,6 +100,7 @@ class UpdateConnectionOptions(UniversalBaseModel): password_options: typing.Optional[ConnectionPasswordOptions] = None assertion_decryption_settings: typing.Optional[ConnectionAssertionDecryptionSettings] = None id_token_signed_response_algs: typing.Optional[ConnectionIdTokenSignedResponseAlgs] = None + dpop_signing_alg: typing.Optional[ConnectionDpopSigningAlgEnum] = None token_endpoint_auth_method: typing.Optional[ConnectionTokenEndpointAuthMethodEnum] = None token_endpoint_auth_signing_alg: typing.Optional[ConnectionTokenEndpointAuthSigningAlgEnum] = None token_endpoint_jwtca_aud_format: typing.Optional[ConnectionTokenEndpointJwtcaAudFormatEnumOidc] = None diff --git a/src/auth0/management/types/update_rate_limit_policy_response_content.py b/src/auth0/management/types/update_rate_limit_policy_response_content.py new file mode 100644 index 00000000..07977682 --- /dev/null +++ b/src/auth0/management/types/update_rate_limit_policy_response_content.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rate_limit_policy_configuration import RateLimitPolicyConfiguration +from .rate_limit_policy_consumer_enum import RateLimitPolicyConsumerEnum +from .rate_limit_policy_resource_enum import RateLimitPolicyResourceEnum + + +class UpdateRateLimitPolicyResponseContent(UniversalBaseModel): + id: str = pydantic.Field() + """ + Unique identifier for the Rate Limit Policy. + """ + + resource: RateLimitPolicyResourceEnum + consumer: RateLimitPolicyConsumerEnum + consumer_selector: str = pydantic.Field() + """ + Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + """ + + configuration: RateLimitPolicyConfiguration + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was created. + """ + + updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date and time when the rate limit policy was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/update_user_response_content.py b/src/auth0/management/types/update_user_response_content.py index 7582bbed..4eefc9f6 100644 --- a/src/auth0/management/types/update_user_response_content.py +++ b/src/auth0/management/types/update_user_response_content.py @@ -70,12 +70,14 @@ class UpdateUserResponseContent(UniversalBaseModel): List of multi-factor authentication providers with which this user has enrolled. """ + multifactor_last_modified: typing.Optional[UserDateSchema] = None last_ip: typing.Optional[str] = pydantic.Field(default=None) """ Last IP address from which this user logged in. """ last_login: typing.Optional[UserDateSchema] = None + last_password_reset: typing.Optional[UserDateSchema] = None logins_count: typing.Optional[int] = pydantic.Field(default=None) """ Total number of logins this user has performed. diff --git a/src/auth0/management/types/user_response_schema.py b/src/auth0/management/types/user_response_schema.py index 5d1e5842..4e5c3da5 100644 --- a/src/auth0/management/types/user_response_schema.py +++ b/src/auth0/management/types/user_response_schema.py @@ -70,12 +70,14 @@ class UserResponseSchema(UniversalBaseModel): List of multi-factor authentication providers with which this user has enrolled. """ + multifactor_last_modified: typing.Optional[UserDateSchema] = None last_ip: typing.Optional[str] = pydantic.Field(default=None) """ Last IP address from which this user logged in. """ last_login: typing.Optional[UserDateSchema] = None + last_password_reset: typing.Optional[UserDateSchema] = None logins_count: typing.Optional[int] = pydantic.Field(default=None) """ Total number of logins this user has performed. diff --git a/src/auth0/management/user_attribute_profiles/client.py b/src/auth0/management/user_attribute_profiles/client.py index 4f81a258..4de7a095 100644 --- a/src/auth0/management/user_attribute_profiles/client.py +++ b/src/auth0/management/user_attribute_profiles/client.py @@ -95,7 +95,7 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateUserAttributeProfileResponseContent: """ - Create a User Attribute Profile + Create a User Attribute Profile. Parameters ---------- @@ -387,7 +387,7 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateUserAttributeProfileResponseContent: """ - Create a User Attribute Profile + Create a User Attribute Profile. Parameters ---------- diff --git a/src/auth0/management/user_attribute_profiles/raw_client.py b/src/auth0/management/user_attribute_profiles/raw_client.py index 94520647..618b5514 100644 --- a/src/auth0/management/user_attribute_profiles/raw_client.py +++ b/src/auth0/management/user_attribute_profiles/raw_client.py @@ -158,7 +158,7 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateUserAttributeProfileResponseContent]: """ - Create a User Attribute Profile + Create a User Attribute Profile. Parameters ---------- @@ -816,7 +816,7 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateUserAttributeProfileResponseContent]: """ - Create a User Attribute Profile + Create a User Attribute Profile. Parameters ---------- diff --git a/src/auth0/management/users/authentication_methods/raw_client.py b/src/auth0/management/users/authentication_methods/raw_client.py index 54218411..2987c56a 100644 --- a/src/auth0/management/users/authentication_methods/raw_client.py +++ b/src/auth0/management/users/authentication_methods/raw_client.py @@ -397,9 +397,6 @@ def set( json=convert_and_respect_annotation_metadata( object_=request, annotation=SetUserAuthenticationMethodsRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1232,9 +1229,6 @@ async def set( json=convert_and_respect_annotation_metadata( object_=request, annotation=SetUserAuthenticationMethodsRequestContent, direction="write" ), - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) diff --git a/src/auth0/management/users/authenticators/client.py b/src/auth0/management/users/authenticators/client.py index c0999659..e4af1008 100644 --- a/src/auth0/management/users/authenticators/client.py +++ b/src/auth0/management/users/authenticators/client.py @@ -24,7 +24,7 @@ def with_raw_response(self) -> RawAuthenticatorsClient: def delete_all(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. + Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). Parameters ---------- @@ -70,7 +70,7 @@ def with_raw_response(self) -> AsyncRawAuthenticatorsClient: async def delete_all(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. + Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). Parameters ---------- diff --git a/src/auth0/management/users/authenticators/raw_client.py b/src/auth0/management/users/authenticators/raw_client.py index 1a731e06..67fa11ac 100644 --- a/src/auth0/management/users/authenticators/raw_client.py +++ b/src/auth0/management/users/authenticators/raw_client.py @@ -23,7 +23,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def delete_all(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. + Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). Parameters ---------- @@ -107,7 +107,7 @@ async def delete_all( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. + Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). Parameters ---------- diff --git a/src/auth0/management/users/client.py b/src/auth0/management/users/client.py index 664ef051..597bf26c 100644 --- a/src/auth0/management/users/client.py +++ b/src/auth0/management/users/client.py @@ -94,14 +94,18 @@ def list( - Sort the users to be returned - Select the fields to be returned - Specify the number of users to retrieve per page and the page index - - The q query parameter can be used to get users that match the specified criteria using query string syntax. - Learn more about searching for users. - Read about best practices when working with the API endpoints for retrieving users. - Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. + The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax) + + [Learn more about searching for users.](https://auth0.com/docs/users/search/v3) + + Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users. + + + + Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension. Parameters ---------- @@ -205,9 +209,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateUserResponseContent: """ - Create a new user for a given database or passwordless connection. + Create a new user for a given [database](https://auth0.com/docs/connections/database) or [passwordless](https://auth0.com/docs/connections/passwordless) connection. - Note: connection is required but other parameters such as email and password are dependent upon the type of connection. + Note: `connection` is required but other parameters such as `email` and `password` are dependent upon the type of connection. Parameters ---------- @@ -362,7 +366,7 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> GetUserResponseContent: """ - Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. + Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint). Parameters ---------- @@ -403,7 +407,7 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. + Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see [Delete Users](https://auth0.com/docs/manage-users/user-accounts/delete-users). Parameters ---------- @@ -460,64 +464,84 @@ def update( These are the attributes that can be updated at the root level: -
    -
  • app_metadata
  • -
  • blocked
  • -
  • email
  • -
  • email_verified
  • -
  • family_name
  • -
  • given_name
  • -
  • name
  • -
  • nickname
  • -
  • password
  • -
  • phone_number
  • -
  • phone_verified
  • -
  • picture
  • -
  • username
  • -
  • user_metadata
  • -
  • verify_email
  • -
+ - app_metadata + - blocked + - email + - email_verified + - family_name + - given_name + - name + - nickname + - password + - phone_number + - phone_verified + - picture + - username + - user_metadata + - verify_email Some considerations: -
    -
  • The properties of the new object will replace the old ones.
  • -
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • -
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • -
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • -
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • -
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • -
  • Supported attributes can be unset by supplying null as the value.
  • -
- -
Updating a field (non-metadata property)
+ + - The properties of the new object will replace the old ones. + - The metadata fields are an exception to this rule (`user_metadata` and `app_metadata`). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level. + - If you are updating `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of a secondary identity, you need to specify the `connection` property too. + - If you are updating `email` or `phone_number` you can specify, optionally, the `client_id` property. + - Updating `email_verified` is not supported for enterprise and passwordless sms connections. + - Updating the `blocked` to `false` does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state. + - Supported attributes can be unset by supplying `null` as the value. + + **Updating a field (non-metadata property)** + To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+ ```json + { "email_verified": true } + ``` - To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+ **Updating a user metadata root property** - The modified object ends up with the following user_metadata property:
{
+        Let's assume that our test user has the following `user_metadata`:
+
+        ```json
+        { "user_metadata" : { "profileCode": 1479 } }
+        ```
+
+        To add the field `addresses` the body to send should be:
+
+        ```json
+        { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+        ```
+
+        The modified object ends up with the following `user_metadata` property:
+
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": { "work_address": "100 Industrial Way" }
           }
-        }
+ } + ``` + + **Updating an inner user metadata property** -
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
+        If there's existing user metadata to which we want to add  `"home_address": "742 Evergreen Terrace"` (using the `addresses` property) we should send the whole `addresses` object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:
+
+        ```json
+        {
           "user_metadata": {
             "addresses": {
               "work_address": "100 Industrial Way",
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` + + The modified object ends up with the following `user_metadata` property: - The modified object ends up with the following user_metadata property: -
{
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": {
@@ -525,7 +549,8 @@ def update(
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` Parameters ---------- @@ -633,7 +658,7 @@ def regenerate_recovery_code( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RegenerateUsersRecoveryCodeResponseContent: """ - Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. Parameters ---------- @@ -883,14 +908,18 @@ async def list( - Sort the users to be returned - Select the fields to be returned - Specify the number of users to retrieve per page and the page index - - The q query parameter can be used to get users that match the specified criteria using query string syntax. - Learn more about searching for users. - Read about best practices when working with the API endpoints for retrieving users. - Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. + The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax) + + [Learn more about searching for users.](https://auth0.com/docs/users/search/v3) + + Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users. + + + + Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension. Parameters ---------- @@ -1003,9 +1032,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> CreateUserResponseContent: """ - Create a new user for a given database or passwordless connection. + Create a new user for a given [database](https://auth0.com/docs/connections/database) or [passwordless](https://auth0.com/docs/connections/passwordless) connection. - Note: connection is required but other parameters such as email and password are dependent upon the type of connection. + Note: `connection` is required but other parameters such as `email` and `password` are dependent upon the type of connection. Parameters ---------- @@ -1176,7 +1205,7 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> GetUserResponseContent: """ - Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. + Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint). Parameters ---------- @@ -1225,7 +1254,7 @@ async def main() -> None: async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. + Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see [Delete Users](https://auth0.com/docs/manage-users/user-accounts/delete-users). Parameters ---------- @@ -1290,64 +1319,84 @@ async def update( These are the attributes that can be updated at the root level: -
    -
  • app_metadata
  • -
  • blocked
  • -
  • email
  • -
  • email_verified
  • -
  • family_name
  • -
  • given_name
  • -
  • name
  • -
  • nickname
  • -
  • password
  • -
  • phone_number
  • -
  • phone_verified
  • -
  • picture
  • -
  • username
  • -
  • user_metadata
  • -
  • verify_email
  • -
+ - app_metadata + - blocked + - email + - email_verified + - family_name + - given_name + - name + - nickname + - password + - phone_number + - phone_verified + - picture + - username + - user_metadata + - verify_email Some considerations: -
    -
  • The properties of the new object will replace the old ones.
  • -
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • -
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • -
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • -
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • -
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • -
  • Supported attributes can be unset by supplying null as the value.
  • -
- -
Updating a field (non-metadata property)
+ + - The properties of the new object will replace the old ones. + - The metadata fields are an exception to this rule (`user_metadata` and `app_metadata`). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level. + - If you are updating `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of a secondary identity, you need to specify the `connection` property too. + - If you are updating `email` or `phone_number` you can specify, optionally, the `client_id` property. + - Updating `email_verified` is not supported for enterprise and passwordless sms connections. + - Updating the `blocked` to `false` does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state. + - Supported attributes can be unset by supplying `null` as the value. + + **Updating a field (non-metadata property)** + To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+ ```json + { "email_verified": true } + ``` - To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+ **Updating a user metadata root property** - The modified object ends up with the following user_metadata property:
{
+        Let's assume that our test user has the following `user_metadata`:
+
+        ```json
+        { "user_metadata" : { "profileCode": 1479 } }
+        ```
+
+        To add the field `addresses` the body to send should be:
+
+        ```json
+        { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+        ```
+
+        The modified object ends up with the following `user_metadata` property:
+
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": { "work_address": "100 Industrial Way" }
           }
-        }
+ } + ``` + + **Updating an inner user metadata property** -
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
+        If there's existing user metadata to which we want to add  `"home_address": "742 Evergreen Terrace"` (using the `addresses` property) we should send the whole `addresses` object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:
+
+        ```json
+        {
           "user_metadata": {
             "addresses": {
               "work_address": "100 Industrial Way",
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` + + The modified object ends up with the following `user_metadata` property: - The modified object ends up with the following user_metadata property: -
{
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": {
@@ -1355,7 +1404,8 @@ async def update(
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` Parameters ---------- @@ -1471,7 +1521,7 @@ async def regenerate_recovery_code( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RegenerateUsersRecoveryCodeResponseContent: """ - Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. Parameters ---------- diff --git a/src/auth0/management/users/enrollments/client.py b/src/auth0/management/users/enrollments/client.py index 3e83529a..4e8093cf 100644 --- a/src/auth0/management/users/enrollments/client.py +++ b/src/auth0/management/users/enrollments/client.py @@ -25,7 +25,7 @@ def with_raw_response(self) -> RawEnrollmentsClient: def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[UsersEnrollment]: """ - Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. + 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. Parameters ---------- @@ -74,7 +74,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[UsersEnrollment]: """ - Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. + 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. Parameters ---------- diff --git a/src/auth0/management/users/enrollments/raw_client.py b/src/auth0/management/users/enrollments/raw_client.py index 40ac9b27..59bac1e1 100644 --- a/src/auth0/management/users/enrollments/raw_client.py +++ b/src/auth0/management/users/enrollments/raw_client.py @@ -27,7 +27,7 @@ def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[typing.List[UsersEnrollment]]: """ - Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. + 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. Parameters ---------- @@ -130,7 +130,7 @@ async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[typing.List[UsersEnrollment]]: """ - Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. + 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. Parameters ---------- diff --git a/src/auth0/management/users/identities/client.py b/src/auth0/management/users/identities/client.py index 516d1182..7687f4a9 100644 --- a/src/auth0/management/users/identities/client.py +++ b/src/auth0/management/users/identities/client.py @@ -44,30 +44,31 @@ def link( Note: There are two ways of invoking the endpoint: -
    -
  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: -
    -              POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -              Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
    -              {
    -                "link_with": "SECONDARY_ACCOUNT_JWT"
    -              }
    -            
    - In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. -
  • -
  • With a token generated by the API V2 containing the update:users scope: -
    -            POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -            Authorization: "Bearer YOUR_API_V2_TOKEN"
    -            {
    -              "provider": "SECONDARY_ACCOUNT_PROVIDER",
    -              "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
    -              "user_id": "SECONDARY_ACCOUNT_USER_ID"
    -            }
    -            
    - In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. -
  • -
+ - With the authenticated primary account's JWT in the Authorization header, which has the `update:current_user_identities` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + { + "link_with": "SECONDARY_ACCOUNT_JWT" + } + ``` + + In this case, only the `link_with` param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + + - With a token generated by the API V2 containing the `update:users` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer YOUR_API_V2_TOKEN" + { + "provider": "SECONDARY_ACCOUNT_PROVIDER", + "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + "user_id": "SECONDARY_ACCOUNT_USER_ID" + } + ``` + + In this case you need to send `provider` and `user_id` in the body. Optionally you can also send the `connection_id` param which is suitable for identifying a particular database connection for the 'auth0' provider. Parameters ---------- @@ -125,7 +126,7 @@ def delete( """ Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. - Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. + Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review [Unlink User Accounts](https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts). Parameters ---------- @@ -193,30 +194,31 @@ async def link( Note: There are two ways of invoking the endpoint: -
    -
  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: -
    -              POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -              Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
    -              {
    -                "link_with": "SECONDARY_ACCOUNT_JWT"
    -              }
    -            
    - In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. -
  • -
  • With a token generated by the API V2 containing the update:users scope: -
    -            POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -            Authorization: "Bearer YOUR_API_V2_TOKEN"
    -            {
    -              "provider": "SECONDARY_ACCOUNT_PROVIDER",
    -              "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
    -              "user_id": "SECONDARY_ACCOUNT_USER_ID"
    -            }
    -            
    - In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. -
  • -
+ - With the authenticated primary account's JWT in the Authorization header, which has the `update:current_user_identities` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + { + "link_with": "SECONDARY_ACCOUNT_JWT" + } + ``` + + In this case, only the `link_with` param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + + - With a token generated by the API V2 containing the `update:users` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer YOUR_API_V2_TOKEN" + { + "provider": "SECONDARY_ACCOUNT_PROVIDER", + "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + "user_id": "SECONDARY_ACCOUNT_USER_ID" + } + ``` + + In this case you need to send `provider` and `user_id` in the body. Optionally you can also send the `connection_id` param which is suitable for identifying a particular database connection for the 'auth0' provider. Parameters ---------- @@ -282,7 +284,7 @@ async def delete( """ Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. - Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. + Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review [Unlink User Accounts](https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts). Parameters ---------- diff --git a/src/auth0/management/users/identities/raw_client.py b/src/auth0/management/users/identities/raw_client.py index 204ecaa4..42bd5917 100644 --- a/src/auth0/management/users/identities/raw_client.py +++ b/src/auth0/management/users/identities/raw_client.py @@ -45,30 +45,31 @@ def link( Note: There are two ways of invoking the endpoint: -
    -
  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: -
    -              POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -              Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
    -              {
    -                "link_with": "SECONDARY_ACCOUNT_JWT"
    -              }
    -            
    - In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. -
  • -
  • With a token generated by the API V2 containing the update:users scope: -
    -            POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -            Authorization: "Bearer YOUR_API_V2_TOKEN"
    -            {
    -              "provider": "SECONDARY_ACCOUNT_PROVIDER",
    -              "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
    -              "user_id": "SECONDARY_ACCOUNT_USER_ID"
    -            }
    -            
    - In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. -
  • -
+ - With the authenticated primary account's JWT in the Authorization header, which has the `update:current_user_identities` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + { + "link_with": "SECONDARY_ACCOUNT_JWT" + } + ``` + + In this case, only the `link_with` param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + + - With a token generated by the API V2 containing the `update:users` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer YOUR_API_V2_TOKEN" + { + "provider": "SECONDARY_ACCOUNT_PROVIDER", + "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + "user_id": "SECONDARY_ACCOUNT_USER_ID" + } + ``` + + In this case you need to send `provider` and `user_id` in the body. Optionally you can also send the `connection_id` param which is suitable for identifying a particular database connection for the 'auth0' provider. Parameters ---------- @@ -196,7 +197,7 @@ def delete( """ Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. - Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. + Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review [Unlink User Accounts](https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts). Parameters ---------- @@ -305,30 +306,31 @@ async def link( Note: There are two ways of invoking the endpoint: -
    -
  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: -
    -              POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -              Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
    -              {
    -                "link_with": "SECONDARY_ACCOUNT_JWT"
    -              }
    -            
    - In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. -
  • -
  • With a token generated by the API V2 containing the update:users scope: -
    -            POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    -            Authorization: "Bearer YOUR_API_V2_TOKEN"
    -            {
    -              "provider": "SECONDARY_ACCOUNT_PROVIDER",
    -              "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
    -              "user_id": "SECONDARY_ACCOUNT_USER_ID"
    -            }
    -            
    - In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. -
  • -
+ - With the authenticated primary account's JWT in the Authorization header, which has the `update:current_user_identities` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + { + "link_with": "SECONDARY_ACCOUNT_JWT" + } + ``` + + In this case, only the `link_with` param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + + - With a token generated by the API V2 containing the `update:users` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer YOUR_API_V2_TOKEN" + { + "provider": "SECONDARY_ACCOUNT_PROVIDER", + "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + "user_id": "SECONDARY_ACCOUNT_USER_ID" + } + ``` + + In this case you need to send `provider` and `user_id` in the body. Optionally you can also send the `connection_id` param which is suitable for identifying a particular database connection for the 'auth0' provider. Parameters ---------- @@ -456,7 +458,7 @@ async def delete( """ Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. - Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. + Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review [Unlink User Accounts](https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts). Parameters ---------- diff --git a/src/auth0/management/users/multifactor/client.py b/src/auth0/management/users/multifactor/client.py index 13e9e2c0..0b493652 100644 --- a/src/auth0/management/users/multifactor/client.py +++ b/src/auth0/management/users/multifactor/client.py @@ -25,7 +25,7 @@ def with_raw_response(self) -> RawMultifactorClient: def invalidate_remember_browser(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ - Invalidate all remembered browsers across all authentication factors for a user. + Invalidate all remembered browsers across all [authentication factors](https://auth0.com/docs/multifactor-authentication) for a user. Parameters ---------- @@ -57,7 +57,7 @@ def delete_provider( self, id: str, provider: UserMultifactorProviderEnum, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + Remove a [multifactor](https://auth0.com/docs/multifactor-authentication) authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. Parameters ---------- @@ -109,7 +109,7 @@ async def invalidate_remember_browser( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Invalidate all remembered browsers across all authentication factors for a user. + Invalidate all remembered browsers across all [authentication factors](https://auth0.com/docs/multifactor-authentication) for a user. Parameters ---------- @@ -149,7 +149,7 @@ async def delete_provider( self, id: str, provider: UserMultifactorProviderEnum, *, request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + Remove a [multifactor](https://auth0.com/docs/multifactor-authentication) authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. Parameters ---------- diff --git a/src/auth0/management/users/multifactor/raw_client.py b/src/auth0/management/users/multifactor/raw_client.py index 52a8fb88..3d983129 100644 --- a/src/auth0/management/users/multifactor/raw_client.py +++ b/src/auth0/management/users/multifactor/raw_client.py @@ -27,7 +27,7 @@ def invalidate_remember_browser( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ - Invalidate all remembered browsers across all authentication factors for a user. + Invalidate all remembered browsers across all [authentication factors](https://auth0.com/docs/multifactor-authentication) for a user. Parameters ---------- @@ -95,7 +95,7 @@ def delete_provider( self, id: str, provider: UserMultifactorProviderEnum, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ - Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + Remove a [multifactor](https://auth0.com/docs/multifactor-authentication) authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. Parameters ---------- @@ -193,7 +193,7 @@ async def invalidate_remember_browser( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Invalidate all remembered browsers across all authentication factors for a user. + Invalidate all remembered browsers across all [authentication factors](https://auth0.com/docs/multifactor-authentication) for a user. Parameters ---------- @@ -261,7 +261,7 @@ async def delete_provider( self, id: str, provider: UserMultifactorProviderEnum, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. + Remove a [multifactor](https://auth0.com/docs/multifactor-authentication) authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. Parameters ---------- diff --git a/src/auth0/management/users/organizations/client.py b/src/auth0/management/users/organizations/client.py index ca774c48..4b0cf57e 100644 --- a/src/auth0/management/users/organizations/client.py +++ b/src/auth0/management/users/organizations/client.py @@ -37,7 +37,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Organization, ListUserOrganizationsOffsetPaginatedResponseContent]: """ - Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. + Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations). Parameters ---------- @@ -110,7 +110,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Organization, ListUserOrganizationsOffsetPaginatedResponseContent]: """ - Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. + Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations). Parameters ---------- diff --git a/src/auth0/management/users/organizations/raw_client.py b/src/auth0/management/users/organizations/raw_client.py index ebd75799..5ac8a97f 100644 --- a/src/auth0/management/users/organizations/raw_client.py +++ b/src/auth0/management/users/organizations/raw_client.py @@ -34,7 +34,7 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> SyncPager[Organization, ListUserOrganizationsOffsetPaginatedResponseContent]: """ - Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. + Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations). Parameters ---------- @@ -146,7 +146,7 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncPager[Organization, ListUserOrganizationsOffsetPaginatedResponseContent]: """ - Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. + Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations). Parameters ---------- diff --git a/src/auth0/management/users/raw_client.py b/src/auth0/management/users/raw_client.py index a6bdf789..917d0338 100644 --- a/src/auth0/management/users/raw_client.py +++ b/src/auth0/management/users/raw_client.py @@ -59,14 +59,18 @@ def list( - Sort the users to be returned - Select the fields to be returned - Specify the number of users to retrieve per page and the page index - - The q query parameter can be used to get users that match the specified criteria using query string syntax. - Learn more about searching for users. - Read about best practices when working with the API endpoints for retrieving users. - Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. + The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax) + + [Learn more about searching for users.](https://auth0.com/docs/users/search/v3) + + Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users. + + + + Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension. Parameters ---------- @@ -239,9 +243,9 @@ def create( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateUserResponseContent]: """ - Create a new user for a given database or passwordless connection. + Create a new user for a given [database](https://auth0.com/docs/connections/database) or [passwordless](https://auth0.com/docs/connections/passwordless) connection. - Note: connection is required but other parameters such as email and password are dependent upon the type of connection. + Note: `connection` is required but other parameters such as `email` and `password` are dependent upon the type of connection. Parameters ---------- @@ -520,7 +524,7 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetUserResponseContent]: """ - Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. + Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint). Parameters ---------- @@ -626,7 +630,7 @@ def get( def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ - Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. + Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see [Delete Users](https://auth0.com/docs/manage-users/user-accounts/delete-users). Parameters ---------- @@ -730,64 +734,84 @@ def update( These are the attributes that can be updated at the root level: -
    -
  • app_metadata
  • -
  • blocked
  • -
  • email
  • -
  • email_verified
  • -
  • family_name
  • -
  • given_name
  • -
  • name
  • -
  • nickname
  • -
  • password
  • -
  • phone_number
  • -
  • phone_verified
  • -
  • picture
  • -
  • username
  • -
  • user_metadata
  • -
  • verify_email
  • -
+ - app_metadata + - blocked + - email + - email_verified + - family_name + - given_name + - name + - nickname + - password + - phone_number + - phone_verified + - picture + - username + - user_metadata + - verify_email Some considerations: -
    -
  • The properties of the new object will replace the old ones.
  • -
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • -
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • -
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • -
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • -
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • -
  • Supported attributes can be unset by supplying null as the value.
  • -
- -
Updating a field (non-metadata property)
+ + - The properties of the new object will replace the old ones. + - The metadata fields are an exception to this rule (`user_metadata` and `app_metadata`). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level. + - If you are updating `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of a secondary identity, you need to specify the `connection` property too. + - If you are updating `email` or `phone_number` you can specify, optionally, the `client_id` property. + - Updating `email_verified` is not supported for enterprise and passwordless sms connections. + - Updating the `blocked` to `false` does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state. + - Supported attributes can be unset by supplying `null` as the value. + + **Updating a field (non-metadata property)** + To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+ ```json + { "email_verified": true } + ``` - To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+ **Updating a user metadata root property** - The modified object ends up with the following user_metadata property:
{
+        Let's assume that our test user has the following `user_metadata`:
+
+        ```json
+        { "user_metadata" : { "profileCode": 1479 } }
+        ```
+
+        To add the field `addresses` the body to send should be:
+
+        ```json
+        { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+        ```
+
+        The modified object ends up with the following `user_metadata` property:
+
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": { "work_address": "100 Industrial Way" }
           }
-        }
+ } + ``` + + **Updating an inner user metadata property** -
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
+        If there's existing user metadata to which we want to add  `"home_address": "742 Evergreen Terrace"` (using the `addresses` property) we should send the whole `addresses` object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:
+
+        ```json
+        {
           "user_metadata": {
             "addresses": {
               "work_address": "100 Industrial Way",
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` + + The modified object ends up with the following `user_metadata` property: - The modified object ends up with the following user_metadata property: -
{
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": {
@@ -795,7 +819,8 @@ def update(
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` Parameters ---------- @@ -971,7 +996,7 @@ def regenerate_recovery_code( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RegenerateUsersRecoveryCodeResponseContent]: """ - Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. Parameters ---------- @@ -1179,14 +1204,18 @@ async def list( - Sort the users to be returned - Select the fields to be returned - Specify the number of users to retrieve per page and the page index - - The q query parameter can be used to get users that match the specified criteria using query string syntax. - Learn more about searching for users. - Read about best practices when working with the API endpoints for retrieving users. - Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. + The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax) + + [Learn more about searching for users.](https://auth0.com/docs/users/search/v3) + + Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users. + + + + Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension. Parameters ---------- @@ -1362,9 +1391,9 @@ async def create( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateUserResponseContent]: """ - Create a new user for a given database or passwordless connection. + Create a new user for a given [database](https://auth0.com/docs/connections/database) or [passwordless](https://auth0.com/docs/connections/passwordless) connection. - Note: connection is required but other parameters such as email and password are dependent upon the type of connection. + Note: `connection` is required but other parameters such as `email` and `password` are dependent upon the type of connection. Parameters ---------- @@ -1643,7 +1672,7 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetUserResponseContent]: """ - Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. + Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint). Parameters ---------- @@ -1751,7 +1780,7 @@ async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. + Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see [Delete Users](https://auth0.com/docs/manage-users/user-accounts/delete-users). Parameters ---------- @@ -1855,64 +1884,84 @@ async def update( These are the attributes that can be updated at the root level: -
    -
  • app_metadata
  • -
  • blocked
  • -
  • email
  • -
  • email_verified
  • -
  • family_name
  • -
  • given_name
  • -
  • name
  • -
  • nickname
  • -
  • password
  • -
  • phone_number
  • -
  • phone_verified
  • -
  • picture
  • -
  • username
  • -
  • user_metadata
  • -
  • verify_email
  • -
+ - app_metadata + - blocked + - email + - email_verified + - family_name + - given_name + - name + - nickname + - password + - phone_number + - phone_verified + - picture + - username + - user_metadata + - verify_email Some considerations: -
    -
  • The properties of the new object will replace the old ones.
  • -
  • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
  • -
  • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
  • -
  • If you are updating email or phone_number you can specify, optionally, the client_id property.
  • -
  • Updating email_verified is not supported for enterprise and passwordless sms connections.
  • -
  • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
  • -
  • Supported attributes can be unset by supplying null as the value.
  • -
- -
Updating a field (non-metadata property)
+ + - The properties of the new object will replace the old ones. + - The metadata fields are an exception to this rule (`user_metadata` and `app_metadata`). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level. + - If you are updating `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of a secondary identity, you need to specify the `connection` property too. + - If you are updating `email` or `phone_number` you can specify, optionally, the `client_id` property. + - Updating `email_verified` is not supported for enterprise and passwordless sms connections. + - Updating the `blocked` to `false` does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state. + - Supported attributes can be unset by supplying `null` as the value. + + **Updating a field (non-metadata property)** + To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+ ```json + { "email_verified": true } + ``` - To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+ **Updating a user metadata root property** - The modified object ends up with the following user_metadata property:
{
+        Let's assume that our test user has the following `user_metadata`:
+
+        ```json
+        { "user_metadata" : { "profileCode": 1479 } }
+        ```
+
+        To add the field `addresses` the body to send should be:
+
+        ```json
+        { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+        ```
+
+        The modified object ends up with the following `user_metadata` property:
+
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": { "work_address": "100 Industrial Way" }
           }
-        }
+ } + ``` + + **Updating an inner user metadata property** -
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
+        If there's existing user metadata to which we want to add  `"home_address": "742 Evergreen Terrace"` (using the `addresses` property) we should send the whole `addresses` object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:
+
+        ```json
+        {
           "user_metadata": {
             "addresses": {
               "work_address": "100 Industrial Way",
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` + + The modified object ends up with the following `user_metadata` property: - The modified object ends up with the following user_metadata property: -
{
+        ```json
+        {
           "user_metadata": {
             "profileCode": 1479,
             "addresses": {
@@ -1920,7 +1969,8 @@ async def update(
               "home_address": "742 Evergreen Terrace"
             }
           }
-        }
+ } + ``` Parameters ---------- @@ -2096,7 +2146,7 @@ async def regenerate_recovery_code( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RegenerateUsersRecoveryCodeResponseContent]: """ - Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. + Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. Parameters ---------- diff --git a/src/auth0/management/users/roles/client.py b/src/auth0/management/users/roles/client.py index 7b65ec3e..4c68ee53 100644 --- a/src/auth0/management/users/roles/client.py +++ b/src/auth0/management/users/roles/client.py @@ -40,7 +40,7 @@ def list( """ Retrieve detailed list of all user roles currently assigned to a user. - Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. + **Note**: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: [Get user roles assigned to an Organization member](https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles). Parameters ---------- @@ -91,9 +91,9 @@ def assign( self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. + Assign one or more existing user roles to a user. For more information, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. + **Note**: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: [Assign user roles to an Organization member](https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles). Parameters ---------- @@ -131,7 +131,7 @@ def delete( """ Remove one or more specified user roles assigned to a user. - Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. + **Note**: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: [Delete user roles from an Organization member](https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles). Parameters ---------- @@ -191,7 +191,7 @@ async def list( """ Retrieve detailed list of all user roles currently assigned to a user. - Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. + **Note**: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: [Get user roles assigned to an Organization member](https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles). Parameters ---------- @@ -251,9 +251,9 @@ async def assign( self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> None: """ - Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. + Assign one or more existing user roles to a user. For more information, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. + **Note**: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: [Assign user roles to an Organization member](https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles). Parameters ---------- @@ -299,7 +299,7 @@ async def delete( """ Remove one or more specified user roles assigned to a user. - Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. + **Note**: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: [Delete user roles from an Organization member](https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles). Parameters ---------- diff --git a/src/auth0/management/users/roles/raw_client.py b/src/auth0/management/users/roles/raw_client.py index c66039ff..7cfd5daa 100644 --- a/src/auth0/management/users/roles/raw_client.py +++ b/src/auth0/management/users/roles/raw_client.py @@ -40,7 +40,7 @@ def list( """ Retrieve detailed list of all user roles currently assigned to a user. - Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. + **Note**: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: [Get user roles assigned to an Organization member](https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles). Parameters ---------- @@ -163,9 +163,9 @@ def assign( self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: """ - Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. + Assign one or more existing user roles to a user. For more information, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. + **Note**: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: [Assign user roles to an Organization member](https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles). Parameters ---------- @@ -256,7 +256,7 @@ def delete( """ Remove one or more specified user roles assigned to a user. - Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. + **Note**: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: [Delete user roles from an Organization member](https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles). Parameters ---------- @@ -347,7 +347,7 @@ async def list( """ Retrieve detailed list of all user roles currently assigned to a user. - Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. + **Note**: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: [Get user roles assigned to an Organization member](https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles). Parameters ---------- @@ -473,9 +473,9 @@ async def assign( self, id: str, *, roles: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: """ - Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. + Assign one or more existing user roles to a user. For more information, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). - Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. + **Note**: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: [Assign user roles to an Organization member](https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles). Parameters ---------- @@ -566,7 +566,7 @@ async def delete( """ Remove one or more specified user roles assigned to a user. - Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. + **Note**: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: [Delete user roles from an Organization member](https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles). Parameters ---------- diff --git a/tests/wire/test_groups_roles.py b/tests/wire/test_groups_roles.py new file mode 100644 index 00000000..10de9cc2 --- /dev/null +++ b/tests/wire/test_groups_roles.py @@ -0,0 +1,35 @@ +from .conftest import get_client, verify_request_count + + +def test_groups_roles_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "groups.roles.list_.0" + client = get_client(test_id) + client.groups.roles.list( + id="id", + from_="from", + take=1, + ) + verify_request_count(test_id, "GET", "/groups/id/roles", {"from": "from", "take": "1"}, 1) + + +def test_groups_roles_create() -> None: + """Test create endpoint with WireMock""" + test_id = "groups.roles.create.0" + client = get_client(test_id) + client.groups.roles.create( + id="id", + roles=["roles"], + ) + verify_request_count(test_id, "POST", "/groups/id/roles", None, 1) + + +def test_groups_roles_delete() -> None: + """Test delete endpoint with WireMock""" + test_id = "groups.roles.delete.0" + client = get_client(test_id) + client.groups.roles.delete( + id="id", + roles=["roles"], + ) + verify_request_count(test_id, "DELETE", "/groups/id/roles", None, 1) diff --git a/tests/wire/test_rateLimitPolicies.py b/tests/wire/test_rateLimitPolicies.py new file mode 100644 index 00000000..702d9968 --- /dev/null +++ b/tests/wire/test_rateLimitPolicies.py @@ -0,0 +1,77 @@ +from .conftest import get_client, verify_request_count + +from auth0.management import PatchRateLimitPolicyConfigurationRequestContentZero, RateLimitPolicyConfigurationZero + + +def test_rateLimitPolicies_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "rate_limit_policies.list_.0" + client = get_client(test_id) + client.rate_limit_policies.list( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + take=1, + from_="from", + ) + verify_request_count( + test_id, + "GET", + "/rate-limit-policies", + { + "resource": "oauth_authentication_api", + "consumer": "client", + "consumer_selector": "consumer_selector", + "take": "1", + "from": "from", + }, + 1, + ) + + +def test_rateLimitPolicies_create() -> None: + """Test create endpoint with WireMock""" + test_id = "rate_limit_policies.create.0" + client = get_client(test_id) + client.rate_limit_policies.create( + resource="oauth_authentication_api", + consumer="client", + consumer_selector="consumer_selector", + configuration=RateLimitPolicyConfigurationZero( + action="allow", + ), + ) + verify_request_count(test_id, "POST", "/rate-limit-policies", None, 1) + + +def test_rateLimitPolicies_get() -> None: + """Test get endpoint with WireMock""" + test_id = "rate_limit_policies.get.0" + client = get_client(test_id) + client.rate_limit_policies.get( + id="id", + ) + verify_request_count(test_id, "GET", "/rate-limit-policies/id", None, 1) + + +def test_rateLimitPolicies_delete() -> None: + """Test delete endpoint with WireMock""" + test_id = "rate_limit_policies.delete.0" + client = get_client(test_id) + client.rate_limit_policies.delete( + id="id", + ) + verify_request_count(test_id, "DELETE", "/rate-limit-policies/id", None, 1) + + +def test_rateLimitPolicies_update() -> None: + """Test update endpoint with WireMock""" + test_id = "rate_limit_policies.update.0" + client = get_client(test_id) + client.rate_limit_policies.update( + id="id", + configuration=PatchRateLimitPolicyConfigurationRequestContentZero( + action="allow", + ), + ) + verify_request_count(test_id, "PATCH", "/rate-limit-policies/id", None, 1) diff --git a/wiremock/wiremock-mappings.json b/wiremock/wiremock-mappings.json index 1b89b94e..dc52a4eb 100644 --- a/wiremock/wiremock-mappings.json +++ b/wiremock/wiremock-mappings.json @@ -3812,6 +3812,194 @@ } } }, + { + "id": "ffa760a3-13f2-4a02-8c0b-0a50833659d1", + "name": "Get rate limit policies - default", + "request": { + "urlPathTemplate": "/rate-limit-policies", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "queryParameters": { + "resource": { + "equalTo": "oauth_authentication_api" + }, + "consumer": { + "equalTo": "client" + }, + "consumer_selector": { + "equalTo": "consumer_selector" + }, + "take": { + "equalTo": "1" + }, + "from": { + "equalTo": "from" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"rate_limit_policies\": [\n {\n \"id\": \"id\",\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"consumer_selector\",\n \"configuration\": {\n \"action\": \"allow\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "ffa760a3-13f2-4a02-8c0b-0a50833659d1", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + }, + "postServeActions": [] + }, + { + "id": "8d96433a-d9e1-4c04-b3c7-6a38e20fb85f", + "name": "Create a rate limit policy - default", + "request": { + "urlPathTemplate": "/rate-limit-policies", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } + }, + "response": { + "status": 201, + "body": "{\n \"id\": \"id\",\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"consumer_selector\",\n \"configuration\": {\n \"action\": \"allow\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "8d96433a-d9e1-4c04-b3c7-6a38e20fb85f", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "252162e3-2c11-4b7f-aa9a-b9f245700110", + "name": "Get a rate limit policy - default", + "request": { + "urlPathTemplate": "/rate-limit-policies/{id}", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"consumer_selector\",\n \"configuration\": {\n \"action\": \"allow\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "252162e3-2c11-4b7f-aa9a-b9f245700110", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "8827be53-c433-4722-9aef-6c36aedd8e8f", + "name": "Delete a rate limit policy - default", + "request": { + "urlPathTemplate": "/rate-limit-policies/{id}", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "8827be53-c433-4722-9aef-6c36aedd8e8f", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "067fc71d-f738-4be0-bbd8-7b63d5cef466", + "name": "Update a rate limit policy - default", + "request": { + "urlPathTemplate": "/rate-limit-policies/{id}", + "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"resource\": \"oauth_authentication_api\",\n \"consumer\": \"client\",\n \"consumer_selector\": \"consumer_selector\",\n \"configuration\": {\n \"action\": \"allow\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "067fc71d-f738-4be0-bbd8-7b63d5cef466", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "1be8f43f-0f7e-4335-879a-b48d21ecfac6", "name": "Get refresh tokens - default", @@ -5836,7 +6024,7 @@ }, "response": { "status": 200, - "body": "{\n \"start\": 1.1,\n \"limit\": 1.1,\n \"length\": 1.1,\n \"total\": 1.1,\n \"users\": [\n {\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {}\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n }\n ]\n}", + "body": "{\n \"start\": 1.1,\n \"limit\": 1.1,\n \"length\": 1.1,\n \"total\": 1.1,\n \"users\": [\n {\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {}\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"multifactor_last_modified\": \"multifactor_last_modified\",\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"last_password_reset\": \"last_password_reset\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n }\n ]\n}", "headers": { "Content-Type": "application/json" } @@ -5868,7 +6056,7 @@ }, "response": { "status": 201, - "body": "{\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {\n \"connection\": \"connection\",\n \"user_id\": \"user_id\",\n \"provider\": \"ad\",\n \"isSocial\": true,\n \"access_token\": \"access_token\",\n \"access_token_secret\": \"access_token_secret\",\n \"refresh_token\": \"refresh_token\"\n }\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n}", + "body": "{\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {\n \"connection\": \"connection\",\n \"user_id\": \"user_id\",\n \"provider\": \"ad\",\n \"isSocial\": true,\n \"access_token\": \"access_token\",\n \"access_token_secret\": \"access_token_secret\",\n \"refresh_token\": \"refresh_token\"\n }\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"multifactor_last_modified\": \"multifactor_last_modified\",\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"last_password_reset\": \"last_password_reset\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n}", "headers": { "Content-Type": "application/json" } @@ -5910,7 +6098,7 @@ }, "response": { "status": 200, - "body": "[\n {\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {}\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n }\n]", + "body": "[\n {\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {}\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"multifactor_last_modified\": \"multifactor_last_modified\",\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"last_password_reset\": \"last_password_reset\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n }\n]", "headers": { "Content-Type": "application/json" } @@ -5955,7 +6143,7 @@ }, "response": { "status": 200, - "body": "{\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {\n \"connection\": \"connection\",\n \"user_id\": \"user_id\",\n \"provider\": \"ad\",\n \"isSocial\": true,\n \"access_token\": \"access_token\",\n \"access_token_secret\": \"access_token_secret\",\n \"refresh_token\": \"refresh_token\"\n }\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n}", + "body": "{\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {\n \"connection\": \"connection\",\n \"user_id\": \"user_id\",\n \"provider\": \"ad\",\n \"isSocial\": true,\n \"access_token\": \"access_token\",\n \"access_token_secret\": \"access_token_secret\",\n \"refresh_token\": \"refresh_token\"\n }\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"multifactor_last_modified\": \"multifactor_last_modified\",\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"last_password_reset\": \"last_password_reset\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n}", "headers": { "Content-Type": "application/json" } @@ -6027,7 +6215,7 @@ }, "response": { "status": 200, - "body": "{\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {\n \"connection\": \"connection\",\n \"user_id\": \"user_id\",\n \"provider\": \"ad\",\n \"isSocial\": true,\n \"access_token\": \"access_token\",\n \"access_token_secret\": \"access_token_secret\",\n \"refresh_token\": \"refresh_token\"\n }\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n}", + "body": "{\n \"user_id\": \"user_id\",\n \"email\": \"email\",\n \"email_verified\": true,\n \"username\": \"username\",\n \"phone_number\": \"phone_number\",\n \"phone_verified\": true,\n \"created_at\": \"created_at\",\n \"updated_at\": \"updated_at\",\n \"identities\": [\n {\n \"connection\": \"connection\",\n \"user_id\": \"user_id\",\n \"provider\": \"ad\",\n \"isSocial\": true,\n \"access_token\": \"access_token\",\n \"access_token_secret\": \"access_token_secret\",\n \"refresh_token\": \"refresh_token\"\n }\n ],\n \"app_metadata\": {\n \"key\": \"value\"\n },\n \"user_metadata\": {\n \"key\": \"value\"\n },\n \"picture\": \"picture\",\n \"name\": \"name\",\n \"nickname\": \"nickname\",\n \"multifactor\": [\n \"multifactor\"\n ],\n \"multifactor_last_modified\": \"multifactor_last_modified\",\n \"last_ip\": \"last_ip\",\n \"last_login\": \"last_login\",\n \"last_password_reset\": \"last_password_reset\",\n \"logins_count\": 1,\n \"blocked\": true,\n \"given_name\": \"given_name\",\n \"family_name\": \"family_name\"\n}", "headers": { "Content-Type": "application/json" } @@ -9728,6 +9916,122 @@ } } }, + { + "id": "a6180ede-b842-44df-ae1d-d9243c735673", + "name": "Get a group's roles - default", + "request": { + "urlPathTemplate": "/groups/{id}/roles", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"roles\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "a6180ede-b842-44df-ae1d-d9243c735673", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "89bf9bc1-fdef-4324-af0b-ae27bc06a0b7", + "name": "Assign roles to a group - default", + "request": { + "urlPathTemplate": "/groups/{id}/roles", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "89bf9bc1-fdef-4324-af0b-ae27bc06a0b7", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "8524f74e-b4e7-406d-847c-49ff4fda5446", + "name": "Remove roles from a group - default", + "request": { + "urlPathTemplate": "/groups/{id}/roles", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "8524f74e-b4e7-406d-847c-49ff4fda5446", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "a2982e98-d69b-4815-a50d-57f1267374d8", "name": "Create a multi-factor authentication enrollment ticket - default", @@ -15075,6 +15379,6 @@ } ], "meta": { - "total": 406 + "total": 414 } } \ No newline at end of file From 93aa46af9923eab95e03ca85d5839e2b5afc5d39 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 04:54:40 +0000 Subject: [PATCH 2/5] [fern-replay] Applied customizations Patches applied (1): - patch-4894603d: chore: Restore custom wiring in management/__init__.py --- .fern/replay.lock | 100 +++++++++++++++++++++++++++---- src/auth0/management/__init__.py | 11 ++++ 2 files changed, 99 insertions(+), 12 deletions(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 6a8f72b7..8cba18a2 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -25,22 +25,28 @@ generations: cli_version: unknown generator_versions: fernapi/fern-python-sdk: 5.12.10 -current_generation: 812b8ca16fc2740001f9839ce5c88f85fed87c6e + - commit_sha: a6b05e768329fac22fd4da6fbe711006e23029f8 + tree_hash: 7d5c57084d9ebef687bb0c3446e81432b93dddf0 + timestamp: 2026-05-26T04:54:34.809Z + cli_version: unknown + generator_versions: + fernapi/fern-python-sdk: 5.12.10 +current_generation: a6b05e768329fac22fd4da6fbe711006e23029f8 patches: - id: patch-4894603d - content_hash: sha256:85d8e392938ef0338e526c1cc9abe95cc3b51986f1145d7b25ceef95605d282c + content_hash: sha256:09d8cd6f9f5c2aee1d72f67be687d870c9145144262b28f81513c64915494584 original_commit: 4894603d03409962bc60a34712de8abffe919e2c original_message: "chore: Restore custom wiring in management/__init__.py" original_author: Kunal Dawar - base_generation: 812b8ca16fc2740001f9839ce5c88f85fed87c6e + base_generation: a6b05e768329fac22fd4da6fbe711006e23029f8 files: - src/auth0/management/__init__.py patch_content: | diff --git a/src/auth0/management/__init__.py b/src/auth0/management/__init__.py - index 46338c3..4fd6baf 100644 + index 71b8e8c..ecd00f0 100644 --- a/src/auth0/management/__init__.py +++ b/src/auth0/management/__init__.py - @@ -2743,6 +2743,8 @@ if typing.TYPE_CHECKING: + @@ -2766,6 +2766,8 @@ if typing.TYPE_CHECKING: from .environment import Auth0Environment from .event_streams import EventStreamsCreateRequest from .version import __version__ @@ -49,7 +55,7 @@ patches: _dynamic_imports: typing.Dict[str, str] = { "Action": ".types", "ActionBase": ".types", - @@ -2803,6 +2805,8 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -2826,6 +2828,8 @@ _dynamic_imports: typing.Dict[str, str] = { "AssociateOrganizationClientGrantResponseContent": ".types", "AsyncApprovalNotificationsChannelsEnum": ".types", "AsyncAuth0": ".client", @@ -58,7 +64,7 @@ patches: "AttackProtectionCaptchaArkoseResponseContent": ".types", "AttackProtectionCaptchaAuthChallengeRequest": ".types", "AttackProtectionCaptchaAuthChallengeResponseContent": ".types", - @@ -3761,6 +3765,7 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -3785,6 +3789,7 @@ _dynamic_imports: typing.Dict[str, str] = { "CredentialDeviceTypeEnum": ".types", "CredentialId": ".types", "CustomDomain": ".types", @@ -66,7 +72,7 @@ patches: "CustomDomainCustomClientIpHeader": ".types", "CustomDomainCustomClientIpHeaderEnum": ".types", "CustomDomainProvisioningTypeEnum": ".types", - @@ -5020,6 +5025,7 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -5047,6 +5052,7 @@ _dynamic_imports: typing.Dict[str, str] = { "LogStreamSumoEnum": ".types", "LogStreamSumoResponseSchema": ".types", "LogStreamSumoSink": ".types", @@ -74,7 +80,7 @@ patches: "MdlPresentationProperties": ".types", "MdlPresentationRequest": ".types", "MdlPresentationRequestProperties": ".types", - @@ -5246,6 +5252,7 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -5290,6 +5296,7 @@ _dynamic_imports: typing.Dict[str, str] = { "TokenQuota": ".types", "TokenQuotaClientCredentials": ".types", "TokenQuotaConfiguration": ".types", @@ -82,7 +88,7 @@ patches: "TooManyRequestsError": ".errors", "TooManyRequestsSchema": ".types", "TooManyRequestsSchemaError": ".types", - @@ -5561,6 +5568,8 @@ __all__ = [ + @@ -5607,6 +5614,8 @@ __all__ = [ "AssociateOrganizationClientGrantResponseContent", "AsyncApprovalNotificationsChannelsEnum", "AsyncAuth0", @@ -91,7 +97,7 @@ patches: "AttackProtectionCaptchaArkoseResponseContent", "AttackProtectionCaptchaAuthChallengeRequest", "AttackProtectionCaptchaAuthChallengeResponseContent", - @@ -7778,6 +7787,7 @@ __all__ = [ + @@ -7828,6 +7837,7 @@ __all__ = [ "LogStreamSumoEnum", "LogStreamSumoResponseSchema", "LogStreamSumoSink", @@ -99,7 +105,7 @@ patches: "MdlPresentationProperties", "MdlPresentationRequest", "MdlPresentationRequestProperties", - @@ -8001,6 +8011,7 @@ __all__ = [ + @@ -8068,6 +8078,7 @@ __all__ = [ "TestEventDataContent", "TokenExchangeProfileResponseContent", "TokenExchangeProfileTypeEnum", @@ -1109,6 +1115,7 @@ patches: CreatePhoneTemplateResponseContent, CreatePhoneTemplateTestNotificationResponseContent, CreatePublicKeyDeviceCredentialResponseContent, + CreateRateLimitPolicyResponseContent, CreateResourceServerResponseContent, CreateRoleResponseContent, CreateRuleResponseContent, @@ -2218,6 +2225,7 @@ patches: GetOrganizationResponseContent, GetPartialsResponseContent, GetPhoneTemplateResponseContent, + GetRateLimitPolicyResponseContent, GetRefreshTokenResponseContent, GetRefreshTokensPaginatedResponseContent, GetResourceServerResponseContent, @@ -2297,6 +2305,7 @@ patches: ListFlowsRequestParametersHydrateEnum, ListFlowsVaultConnectionsOffsetPaginatedResponseContent, ListFormsOffsetPaginatedResponseContent, + ListGroupRolesResponseContent, ListGroupsPaginatedResponseContent, ListGuardianPoliciesResponseContent, ListHooksOffsetPaginatedResponseContent, @@ -2311,6 +2320,7 @@ patches: ListOrganizationMembersPaginatedResponseContent, ListOrganizationsPaginatedResponseContent, ListPhoneTemplatesResponseContent, + ListRateLimitPoliciesPaginatedResponseContent, ListRefreshTokensPaginatedResponseContent, ListResourceServerOffsetPaginatedResponseContent, ListRolePermissionsOffsetPaginatedResponseContent, @@ -2432,6 +2442,13 @@ patches: PasswordMaxLengthExceededPolicyEnum, PasswordSequentialCharactersPolicyEnum, PatchClientCredentialResponseContent, + PatchRateLimitPolicyConfigurationRequestContent, + PatchRateLimitPolicyConfigurationRequestContentAction, + PatchRateLimitPolicyConfigurationRequestContentActionAction, + PatchRateLimitPolicyConfigurationRequestContentOne, + PatchRateLimitPolicyConfigurationRequestContentOneAction, + PatchRateLimitPolicyConfigurationRequestContentZero, + PatchRateLimitPolicyConfigurationRequestContentZeroAction, PatchSupplementalSignalsResponseContent, PermissionRequestPayload, PermissionsResponsePayload, @@ -2458,6 +2475,16 @@ patches: PublicKeyCredential, PublicKeyCredentialAlgorithmEnum, PublicKeyCredentialTypeEnum, + RateLimitPolicy, + RateLimitPolicyConfiguration, + RateLimitPolicyConfigurationAction, + RateLimitPolicyConfigurationActionAction, + RateLimitPolicyConfigurationOne, + RateLimitPolicyConfigurationOneAction, + RateLimitPolicyConfigurationZero, + RateLimitPolicyConfigurationZeroAction, + RateLimitPolicyConsumerEnum, + RateLimitPolicyResourceEnum, RefreshTokenDate, RefreshTokenDateObject, RefreshTokenDevice, @@ -2720,6 +2747,7 @@ patches: UpdateOrganizationDiscoveryDomainResponseContent, UpdateOrganizationResponseContent, UpdatePhoneTemplateResponseContent, + UpdateRateLimitPolicyResponseContent, UpdateRefreshTokenResponseContent, UpdateResourceServerResponseContent, UpdateRiskAssessmentsSettingsNewDeviceResponseContent, @@ -2830,6 +2858,7 @@ patches: network_acls, organizations, prompts, + rate_limit_policies, refresh_tokens, resource_servers, risk_assessments, @@ -3856,6 +3885,7 @@ patches: "CreatePhoneTemplateResponseContent": ".types", "CreatePhoneTemplateTestNotificationResponseContent": ".types", "CreatePublicKeyDeviceCredentialResponseContent": ".types", + "CreateRateLimitPolicyResponseContent": ".types", "CreateResourceServerResponseContent": ".types", "CreateRoleResponseContent": ".types", "CreateRuleResponseContent": ".types", @@ -4970,6 +5000,7 @@ patches: "GetOrganizationResponseContent": ".types", "GetPartialsResponseContent": ".types", "GetPhoneTemplateResponseContent": ".types", + "GetRateLimitPolicyResponseContent": ".types", "GetRefreshTokenResponseContent": ".types", "GetRefreshTokensPaginatedResponseContent": ".types", "GetResourceServerResponseContent": ".types", @@ -5051,6 +5082,7 @@ patches: "ListFlowsRequestParametersHydrateEnum": ".types", "ListFlowsVaultConnectionsOffsetPaginatedResponseContent": ".types", "ListFormsOffsetPaginatedResponseContent": ".types", + "ListGroupRolesResponseContent": ".types", "ListGroupsPaginatedResponseContent": ".types", "ListGuardianPoliciesResponseContent": ".types", "ListHooksOffsetPaginatedResponseContent": ".types", @@ -5065,6 +5097,7 @@ patches: "ListOrganizationMembersPaginatedResponseContent": ".types", "ListOrganizationsPaginatedResponseContent": ".types", "ListPhoneTemplatesResponseContent": ".types", + "ListRateLimitPoliciesPaginatedResponseContent": ".types", "ListRefreshTokensPaginatedResponseContent": ".types", "ListResourceServerOffsetPaginatedResponseContent": ".types", "ListRolePermissionsOffsetPaginatedResponseContent": ".types", @@ -5188,6 +5221,13 @@ patches: "PasswordMaxLengthExceededPolicyEnum": ".types", "PasswordSequentialCharactersPolicyEnum": ".types", "PatchClientCredentialResponseContent": ".types", + "PatchRateLimitPolicyConfigurationRequestContent": ".types", + "PatchRateLimitPolicyConfigurationRequestContentAction": ".types", + "PatchRateLimitPolicyConfigurationRequestContentActionAction": ".types", + "PatchRateLimitPolicyConfigurationRequestContentOne": ".types", + "PatchRateLimitPolicyConfigurationRequestContentOneAction": ".types", + "PatchRateLimitPolicyConfigurationRequestContentZero": ".types", + "PatchRateLimitPolicyConfigurationRequestContentZeroAction": ".types", "PatchSupplementalSignalsResponseContent": ".types", "PaymentRequiredError": ".errors", "PermissionRequestPayload": ".types", @@ -5216,6 +5256,16 @@ patches: "PublicKeyCredential": ".types", "PublicKeyCredentialAlgorithmEnum": ".types", "PublicKeyCredentialTypeEnum": ".types", + "RateLimitPolicy": ".types", + "RateLimitPolicyConfiguration": ".types", + "RateLimitPolicyConfigurationAction": ".types", + "RateLimitPolicyConfigurationActionAction": ".types", + "RateLimitPolicyConfigurationOne": ".types", + "RateLimitPolicyConfigurationOneAction": ".types", + "RateLimitPolicyConfigurationZero": ".types", + "RateLimitPolicyConfigurationZeroAction": ".types", + "RateLimitPolicyConsumerEnum": ".types", + "RateLimitPolicyResourceEnum": ".types", "RefreshTokenDate": ".types", "RefreshTokenDateObject": ".types", "RefreshTokenDevice": ".types", @@ -5482,6 +5532,7 @@ patches: "UpdateOrganizationDiscoveryDomainResponseContent": ".types", "UpdateOrganizationResponseContent": ".types", "UpdatePhoneTemplateResponseContent": ".types", + "UpdateRateLimitPolicyResponseContent": ".types", "UpdateRefreshTokenResponseContent": ".types", "UpdateResourceServerResponseContent": ".types", "UpdateRiskAssessmentsSettingsNewDeviceResponseContent": ".types", @@ -5577,6 +5628,7 @@ patches: "network_acls": ".network_acls", "organizations": ".organizations", "prompts": ".prompts", + "rate_limit_policies": ".rate_limit_policies", "refresh_tokens": ".refresh_tokens", "resource_servers": ".resource_servers", "risk_assessments": ".risk_assessments", @@ -6619,6 +6671,7 @@ patches: "CreatePhoneTemplateResponseContent", "CreatePhoneTemplateTestNotificationResponseContent", "CreatePublicKeyDeviceCredentialResponseContent", + "CreateRateLimitPolicyResponseContent", "CreateResourceServerResponseContent", "CreateRoleResponseContent", "CreateRuleResponseContent", @@ -7732,6 +7785,7 @@ patches: "GetOrganizationResponseContent", "GetPartialsResponseContent", "GetPhoneTemplateResponseContent", + "GetRateLimitPolicyResponseContent", "GetRefreshTokenResponseContent", "GetRefreshTokensPaginatedResponseContent", "GetResourceServerResponseContent", @@ -7813,6 +7867,7 @@ patches: "ListFlowsRequestParametersHydrateEnum", "ListFlowsVaultConnectionsOffsetPaginatedResponseContent", "ListFormsOffsetPaginatedResponseContent", + "ListGroupRolesResponseContent", "ListGroupsPaginatedResponseContent", "ListGuardianPoliciesResponseContent", "ListHooksOffsetPaginatedResponseContent", @@ -7827,6 +7882,7 @@ patches: "ListOrganizationMembersPaginatedResponseContent", "ListOrganizationsPaginatedResponseContent", "ListPhoneTemplatesResponseContent", + "ListRateLimitPoliciesPaginatedResponseContent", "ListRefreshTokensPaginatedResponseContent", "ListResourceServerOffsetPaginatedResponseContent", "ListRolePermissionsOffsetPaginatedResponseContent", @@ -7950,6 +8006,13 @@ patches: "PasswordMaxLengthExceededPolicyEnum", "PasswordSequentialCharactersPolicyEnum", "PatchClientCredentialResponseContent", + "PatchRateLimitPolicyConfigurationRequestContent", + "PatchRateLimitPolicyConfigurationRequestContentAction", + "PatchRateLimitPolicyConfigurationRequestContentActionAction", + "PatchRateLimitPolicyConfigurationRequestContentOne", + "PatchRateLimitPolicyConfigurationRequestContentOneAction", + "PatchRateLimitPolicyConfigurationRequestContentZero", + "PatchRateLimitPolicyConfigurationRequestContentZeroAction", "PatchSupplementalSignalsResponseContent", "PaymentRequiredError", "PermissionRequestPayload", @@ -7978,6 +8041,16 @@ patches: "PublicKeyCredential", "PublicKeyCredentialAlgorithmEnum", "PublicKeyCredentialTypeEnum", + "RateLimitPolicy", + "RateLimitPolicyConfiguration", + "RateLimitPolicyConfigurationAction", + "RateLimitPolicyConfigurationActionAction", + "RateLimitPolicyConfigurationOne", + "RateLimitPolicyConfigurationOneAction", + "RateLimitPolicyConfigurationZero", + "RateLimitPolicyConfigurationZeroAction", + "RateLimitPolicyConsumerEnum", + "RateLimitPolicyResourceEnum", "RefreshTokenDate", "RefreshTokenDateObject", "RefreshTokenDevice", @@ -8244,6 +8317,7 @@ patches: "UpdateOrganizationDiscoveryDomainResponseContent", "UpdateOrganizationResponseContent", "UpdatePhoneTemplateResponseContent", + "UpdateRateLimitPolicyResponseContent", "UpdateRefreshTokenResponseContent", "UpdateResourceServerResponseContent", "UpdateRiskAssessmentsSettingsNewDeviceResponseContent", @@ -8339,6 +8413,7 @@ patches: "network_acls", "organizations", "prompts", + "rate_limit_policies", "refresh_tokens", "resource_servers", "risk_assessments", @@ -8358,3 +8433,4 @@ patches: "users", "verifiable_credentials", ] + user_owned: true diff --git a/src/auth0/management/__init__.py b/src/auth0/management/__init__.py index 71b8e8cc..ecd00f0b 100644 --- a/src/auth0/management/__init__.py +++ b/src/auth0/management/__init__.py @@ -2766,6 +2766,8 @@ from .environment import Auth0Environment from .event_streams import EventStreamsCreateRequest from .version import __version__ + from .management_client import AsyncManagementClient, CustomDomainHeader, ManagementClient + from .token_provider import AsyncTokenProvider, TokenProvider _dynamic_imports: typing.Dict[str, str] = { "Action": ".types", "ActionBase": ".types", @@ -2826,6 +2828,8 @@ "AssociateOrganizationClientGrantResponseContent": ".types", "AsyncApprovalNotificationsChannelsEnum": ".types", "AsyncAuth0": ".client", + "AsyncManagementClient": ".management_client", + "AsyncTokenProvider": ".token_provider", "AttackProtectionCaptchaArkoseResponseContent": ".types", "AttackProtectionCaptchaAuthChallengeRequest": ".types", "AttackProtectionCaptchaAuthChallengeResponseContent": ".types", @@ -3785,6 +3789,7 @@ "CredentialDeviceTypeEnum": ".types", "CredentialId": ".types", "CustomDomain": ".types", + "CustomDomainHeader": ".management_client", "CustomDomainCustomClientIpHeader": ".types", "CustomDomainCustomClientIpHeaderEnum": ".types", "CustomDomainProvisioningTypeEnum": ".types", @@ -5047,6 +5052,7 @@ "LogStreamSumoEnum": ".types", "LogStreamSumoResponseSchema": ".types", "LogStreamSumoSink": ".types", + "ManagementClient": ".management_client", "MdlPresentationProperties": ".types", "MdlPresentationRequest": ".types", "MdlPresentationRequestProperties": ".types", @@ -5290,6 +5296,7 @@ "TokenQuota": ".types", "TokenQuotaClientCredentials": ".types", "TokenQuotaConfiguration": ".types", + "TokenProvider": ".token_provider", "TooManyRequestsError": ".errors", "TooManyRequestsSchema": ".types", "TooManyRequestsSchemaError": ".types", @@ -5607,6 +5614,8 @@ def __dir__(): "AssociateOrganizationClientGrantResponseContent", "AsyncApprovalNotificationsChannelsEnum", "AsyncAuth0", + "AsyncManagementClient", + "AsyncTokenProvider", "AttackProtectionCaptchaArkoseResponseContent", "AttackProtectionCaptchaAuthChallengeRequest", "AttackProtectionCaptchaAuthChallengeResponseContent", @@ -7828,6 +7837,7 @@ def __dir__(): "LogStreamSumoEnum", "LogStreamSumoResponseSchema", "LogStreamSumoSink", + "ManagementClient", "MdlPresentationProperties", "MdlPresentationRequest", "MdlPresentationRequestProperties", @@ -8068,6 +8078,7 @@ def __dir__(): "TestEventDataContent", "TokenExchangeProfileResponseContent", "TokenExchangeProfileTypeEnum", + "TokenProvider", "TokenQuota", "TokenQuotaClientCredentials", "TokenQuotaConfiguration", From 7271f15759cfb545c9ef82b5a4f519ffe0a89db2 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Tue, 26 May 2026 19:44:52 +0530 Subject: [PATCH 3/5] Revert wrapper file to preserve Auth0 telemetry customizations --- src/auth0/management/core/client_wrapper.py | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/auth0/management/core/client_wrapper.py b/src/auth0/management/core/client_wrapper.py index cad2e314..60ebc5a6 100644 --- a/src/auth0/management/core/client_wrapper.py +++ b/src/auth0/management/core/client_wrapper.py @@ -1,6 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning +import base64 +import platform +import sys import typing +from json import dumps import httpx from .http_client import AsyncHttpClient, HttpClient @@ -26,15 +31,18 @@ def __init__( self._logging = logging def get_headers(self) -> typing.Dict[str, str]: - import platform + py_version = platform.python_version() + version = sys.modules["auth0"].__version__ + + auth0_client = dumps({ + "name": "auth0-python", + "version": version, + "env": {"python": py_version} + }).encode("utf-8") headers: typing.Dict[str, str] = { - "User-Agent": "auth0-python/5.5.0", - "X-Fern-Language": "Python", - "X-Fern-Runtime": f"python/{platform.python_version()}", - "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", - "X-Fern-SDK-Name": "auth0-python", - "X-Fern-SDK-Version": "5.5.0", + "User-Agent": f"Python/{py_version}", + "Auth0-Client": base64.b64encode(auth0_client).decode(), **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Bearer {self._get_token()}" From 08d9e9dd9d9ea427cd6f87a3e2891804665d4103 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 15:18:29 +0000 Subject: [PATCH 4/5] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 5.14.3 Signed-off-by: Sourav Basu --- reference.md | 1398 ++++++++++++++++- src/auth0/management/__init__.py | 62 +- src/auth0/management/core/client_wrapper.py | 22 +- .../management/core/pydantic_utilities.py | 16 +- .../management/organizations/__init__.py | 13 +- src/auth0/management/organizations/client.py | 19 + .../organizations/groups/__init__.py | 34 + .../management/organizations/groups/client.py | 176 +++ .../organizations/groups/raw_client.py | 254 +++ .../organizations/groups/roles/__init__.py | 4 + .../organizations/groups/roles/client.py | 366 +++++ .../organizations/groups/roles/raw_client.py | 679 ++++++++ .../organizations/members/__init__.py | 6 +- .../organizations/members/client.py | 19 + .../members/effective_roles/__init__.py | 34 + .../members/effective_roles/client.py | 188 +++ .../members/effective_roles/raw_client.py | 266 ++++ .../effective_roles/sources/__init__.py | 34 + .../members/effective_roles/sources/client.py | 63 + .../sources/groups/__init__.py | 4 + .../effective_roles/sources/groups/client.py | 179 +++ .../sources/groups/raw_client.py | 278 ++++ .../effective_roles/sources/raw_client.py | 13 + src/auth0/management/roles/__init__.py | 6 +- src/auth0/management/roles/client.py | 19 + src/auth0/management/roles/groups/__init__.py | 4 + src/auth0/management/roles/groups/client.py | 314 ++++ .../management/roles/groups/raw_client.py | 637 ++++++++ src/auth0/management/types/__init__.py | 57 + ...ganization_group_roles_response_content.py | 24 + ...st_organization_groups_response_content.py | 24 + ...member_effective_roles_response_content.py | 24 + ...ber_role_source_groups_response_content.py | 24 + .../list_role_groups_response_content.py | 24 + ...ermission_role_sources_response_content.py | 28 + ..._effective_permissions_response_content.py | 28 + ...t_user_effective_roles_response_content.py | 24 + ...ser_role_source_groups_response_content.py | 24 + src/auth0/management/types/oauth_scope.py | 10 + .../organization_member_effective_role.py | 38 + ...ganization_member_effective_role_source.py | 5 + ...r_effective_permission_response_content.py | 43 + ...r_effective_permission_role_source_enum.py | 5 + ...permission_role_source_response_content.py | 38 + .../user_effective_permission_source_enum.py | 5 + .../management/types/user_effective_role.py | 38 + .../types/user_effective_role_source.py | 5 + src/auth0/management/users/__init__.py | 6 + src/auth0/management/users/client.py | 38 + .../users/effective_permissions/__init__.py | 34 + .../users/effective_permissions/client.py | 198 +++ .../users/effective_permissions/raw_client.py | 289 ++++ .../effective_permissions/sources/__init__.py | 34 + .../effective_permissions/sources/client.py | 63 + .../sources/raw_client.py | 13 + .../sources/roles/__init__.py | 4 + .../sources/roles/client.py | 193 +++ .../sources/roles/raw_client.py | 309 ++++ .../users/effective_roles/__init__.py | 34 + .../users/effective_roles/client.py | 176 +++ .../users/effective_roles/raw_client.py | 254 +++ .../users/effective_roles/sources/__init__.py | 34 + .../users/effective_roles/sources/client.py | 63 + .../sources/groups/__init__.py | 4 + .../effective_roles/sources/groups/client.py | 161 ++ .../sources/groups/raw_client.py | 266 ++++ .../effective_roles/sources/raw_client.py | 13 + tests/wire/test_organizations_groups.py | 13 + tests/wire/test_organizations_groups_roles.py | 40 + ...st_organizations_members_effectiveRoles.py | 16 + ...s_members_effectiveRoles_sources_groups.py | 21 + tests/wire/test_roles_groups.py | 35 + tests/wire/test_users_effectivePermissions.py | 20 + ...sers_effectivePermissions_sources_roles.py | 26 + tests/wire/test_users_effectiveRoles.py | 13 + ...est_users_effectiveRoles_sources_groups.py | 20 + wiremock/wiremock-mappings.json | 572 ++++++- 77 files changed, 8428 insertions(+), 109 deletions(-) create mode 100644 src/auth0/management/organizations/groups/__init__.py create mode 100644 src/auth0/management/organizations/groups/client.py create mode 100644 src/auth0/management/organizations/groups/raw_client.py create mode 100644 src/auth0/management/organizations/groups/roles/__init__.py create mode 100644 src/auth0/management/organizations/groups/roles/client.py create mode 100644 src/auth0/management/organizations/groups/roles/raw_client.py create mode 100644 src/auth0/management/organizations/members/effective_roles/__init__.py create mode 100644 src/auth0/management/organizations/members/effective_roles/client.py create mode 100644 src/auth0/management/organizations/members/effective_roles/raw_client.py create mode 100644 src/auth0/management/organizations/members/effective_roles/sources/__init__.py create mode 100644 src/auth0/management/organizations/members/effective_roles/sources/client.py create mode 100644 src/auth0/management/organizations/members/effective_roles/sources/groups/__init__.py create mode 100644 src/auth0/management/organizations/members/effective_roles/sources/groups/client.py create mode 100644 src/auth0/management/organizations/members/effective_roles/sources/groups/raw_client.py create mode 100644 src/auth0/management/organizations/members/effective_roles/sources/raw_client.py create mode 100644 src/auth0/management/roles/groups/__init__.py create mode 100644 src/auth0/management/roles/groups/client.py create mode 100644 src/auth0/management/roles/groups/raw_client.py create mode 100644 src/auth0/management/types/list_organization_group_roles_response_content.py create mode 100644 src/auth0/management/types/list_organization_groups_response_content.py create mode 100644 src/auth0/management/types/list_organization_member_effective_roles_response_content.py create mode 100644 src/auth0/management/types/list_organization_member_role_source_groups_response_content.py create mode 100644 src/auth0/management/types/list_role_groups_response_content.py create mode 100644 src/auth0/management/types/list_user_effective_permission_role_sources_response_content.py create mode 100644 src/auth0/management/types/list_user_effective_permissions_response_content.py create mode 100644 src/auth0/management/types/list_user_effective_roles_response_content.py create mode 100644 src/auth0/management/types/list_user_role_source_groups_response_content.py create mode 100644 src/auth0/management/types/organization_member_effective_role.py create mode 100644 src/auth0/management/types/organization_member_effective_role_source.py create mode 100644 src/auth0/management/types/user_effective_permission_response_content.py create mode 100644 src/auth0/management/types/user_effective_permission_role_source_enum.py create mode 100644 src/auth0/management/types/user_effective_permission_role_source_response_content.py create mode 100644 src/auth0/management/types/user_effective_permission_source_enum.py create mode 100644 src/auth0/management/types/user_effective_role.py create mode 100644 src/auth0/management/types/user_effective_role_source.py create mode 100644 src/auth0/management/users/effective_permissions/__init__.py create mode 100644 src/auth0/management/users/effective_permissions/client.py create mode 100644 src/auth0/management/users/effective_permissions/raw_client.py create mode 100644 src/auth0/management/users/effective_permissions/sources/__init__.py create mode 100644 src/auth0/management/users/effective_permissions/sources/client.py create mode 100644 src/auth0/management/users/effective_permissions/sources/raw_client.py create mode 100644 src/auth0/management/users/effective_permissions/sources/roles/__init__.py create mode 100644 src/auth0/management/users/effective_permissions/sources/roles/client.py create mode 100644 src/auth0/management/users/effective_permissions/sources/roles/raw_client.py create mode 100644 src/auth0/management/users/effective_roles/__init__.py create mode 100644 src/auth0/management/users/effective_roles/client.py create mode 100644 src/auth0/management/users/effective_roles/raw_client.py create mode 100644 src/auth0/management/users/effective_roles/sources/__init__.py create mode 100644 src/auth0/management/users/effective_roles/sources/client.py create mode 100644 src/auth0/management/users/effective_roles/sources/groups/__init__.py create mode 100644 src/auth0/management/users/effective_roles/sources/groups/client.py create mode 100644 src/auth0/management/users/effective_roles/sources/groups/raw_client.py create mode 100644 src/auth0/management/users/effective_roles/sources/raw_client.py create mode 100644 tests/wire/test_organizations_groups.py create mode 100644 tests/wire/test_organizations_groups_roles.py create mode 100644 tests/wire/test_organizations_members_effectiveRoles.py create mode 100644 tests/wire/test_organizations_members_effectiveRoles_sources_groups.py create mode 100644 tests/wire/test_roles_groups.py create mode 100644 tests/wire/test_users_effectivePermissions.py create mode 100644 tests/wire/test_users_effectivePermissions_sources_roles.py create mode 100644 tests/wire/test_users_effectiveRoles.py create mode 100644 tests/wire/test_users_effectiveRoles_sources_groups.py diff --git a/reference.md b/reference.md index cc537eb3..3a1d33a2 100644 --- a/reference.md +++ b/reference.md @@ -32601,6 +32601,486 @@ client.organizations.members.delete( + + +
+ +## Organizations Groups +
client.organizations.groups.list(...) -> ListOrganizationGroupsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the groups that are assigned to the specified organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.organizations.groups.list( + organization_id="organization_id", + from_="from", + take=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**organization_id:** `str` — ID of the organization + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Organizations Groups Roles +
client.organizations.groups.roles.list(...) -> ListOrganizationGroupRolesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the roles assigned to the specified group in the context of an organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.organizations.groups.roles.list( + organization_id="organization_id", + group_id="group_id", + from_="from", + take=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**organization_id:** `str` — ID of the organization + +
+
+ +
+
+ +**group_id:** `str` — ID of the group + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.organizations.groups.roles.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more roles to a specified group in the context of an organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.organizations.groups.roles.create( + organization_id="organization_id", + group_id="group_id", + roles=[ + "roles" + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**organization_id:** `str` — ID of the organization + +
+
+ +
+
+ +**group_id:** `str` — ID of the group + +
+
+ +
+
+ +**roles:** `typing.List[str]` — Array of role IDs to assign to organization group. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.organizations.groups.roles.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Unassign one or more roles from a specified group in the context of an organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.organizations.groups.roles.delete( + organization_id="organization_id", + group_id="group_id", + roles=[ + "roles" + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**organization_id:** `str` — ID of the organization + +
+
+ +
+
+ +**group_id:** `str` — ID of the group + +
+
+ +
+
+ +**roles:** `typing.List[str]` — Array of role IDs to delete from organization group. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Organizations Members EffectiveRoles +
client.organizations.members.effective_roles.list(...) -> ListOrganizationMemberEffectiveRolesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the roles assigned to an organization member directly or through group membership. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.organizations.members.effective_roles.list( + id="id", + user_id="user_id", + from_="from", + take=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — Organization identifier. + +
+
+ +
+
+ +**user_id:** `str` — ID of the user to list effective roles for. + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -32673,15 +33153,110 @@ client.organizations.members.roles.list(
-**user_id:** `str` — ID of the user to associate roles with. - -
-
- +**user_id:** `str` — ID of the user to associate roles with. + + + + +
+
+ +**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**per_page:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ + + + + + +
+ +
client.organizations.members.roles.assign(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more roles to a user to determine their access for a specific Organization. + +Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.organizations.members.roles.assign( + id="id", + user_id="user_id", + roles=[ + "roles" + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+
-**page:** `typing.Optional[int]` — Page index of the results to return. First page is 0. +**id:** `str` — Organization identifier.
@@ -32689,7 +33264,7 @@ client.organizations.members.roles.list(
-**per_page:** `typing.Optional[int]` — Number of results per page. Defaults to 50. +**user_id:** `str` — ID of the user to associate roles with.
@@ -32697,7 +33272,7 @@ client.organizations.members.roles.list(
-**include_totals:** `typing.Optional[bool]` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). +**roles:** `typing.List[str]` — List of roles IDs to associated with the user.
@@ -32717,7 +33292,7 @@ client.organizations.members.roles.list(
-
client.organizations.members.roles.assign(...) +
client.organizations.members.roles.delete(...)
@@ -32729,9 +33304,9 @@ client.organizations.members.roles.list(
-Assign one or more roles to a user to determine their access for a specific Organization. +Remove one or more Organization-specific roles from a given user. -Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call. +Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.
@@ -32754,7 +33329,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.organizations.members.roles.assign( +client.organizations.members.roles.delete( id="id", user_id="user_id", roles=[ @@ -32784,7 +33359,7 @@ client.organizations.members.roles.assign(
-**user_id:** `str` — ID of the user to associate roles with. +**user_id:** `str` — User ID of the organization member to remove roles from.
@@ -32792,7 +33367,7 @@ client.organizations.members.roles.assign(
-**roles:** `typing.List[str]` — List of roles IDs to associated with the user. +**roles:** `typing.List[str]` — List of roles IDs associated with the organization member to remove.
@@ -32812,7 +33387,8 @@ client.organizations.members.roles.assign(
-
client.organizations.members.roles.delete(...) +## Organizations Members EffectiveRoles Sources Groups +
client.organizations.members.effective_roles.sources.groups.list(...) -> ListOrganizationMemberRoleSourceGroupsResponseContent
@@ -32824,9 +33400,7 @@ client.organizations.members.roles.assign(
-Remove one or more Organization-specific roles from a given user. - -Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call. +Lists the groups which grant the org member a given role.
@@ -32849,12 +33423,12 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.organizations.members.roles.delete( +client.organizations.members.effective_roles.sources.groups.list( id="id", user_id="user_id", - roles=[ - "roles" - ], + from_="from", + take=1, + role_id="role_id", ) ``` @@ -32879,7 +33453,7 @@ client.organizations.members.roles.delete(
-**user_id:** `str` — User ID of the organization member to remove roles from. +**user_id:** `str` — ID of the user to list role source groups for.
@@ -32887,7 +33461,23 @@ client.organizations.members.roles.delete(
-**roles:** `typing.List[str]` — List of roles IDs associated with the organization member to remove. +**role_id:** `str` — The role ID to get group sources for. + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50.
@@ -33648,11 +34238,212 @@ client.prompts.partials.set(
-**request:** `SetPartialsRequestContent` - -
-
- +**request:** `SetPartialsRequestContent` + + +
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ + + + + + +
+ +## RiskAssessments Settings +
client.risk_assessments.settings.get() -> GetRiskAssessmentsSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the tenant settings for risk assessments +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.risk_assessments.settings.get() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.risk_assessments.settings.update(...) -> UpdateRiskAssessmentsSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the tenant settings for risk assessments +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.risk_assessments.settings.update( + enabled=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**enabled:** `bool` — Whether or not risk assessment is enabled. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## RiskAssessments Settings NewDevice +
client.risk_assessments.settings.new_device.get() -> GetRiskAssessmentsSettingsNewDeviceResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the risk assessment settings for the new device assessor +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.risk_assessments.settings.new_device.get() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+
@@ -33668,8 +34459,7 @@ client.prompts.partials.set(
-## RiskAssessments Settings -
client.risk_assessments.settings.get() -> GetRiskAssessmentsSettingsResponseContent +
client.risk_assessments.settings.new_device.update(...) -> UpdateRiskAssessmentsSettingsNewDeviceResponseContent
@@ -33681,7 +34471,7 @@ client.prompts.partials.set(
-Gets the tenant settings for risk assessments +Updates the risk assessment settings for the new device assessor
@@ -33704,7 +34494,9 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.risk_assessments.settings.get() +client.risk_assessments.settings.new_device.update( + remember_for=1, +) ``` @@ -33720,6 +34512,14 @@ client.risk_assessments.settings.get()
+**remember_for:** `int` — Length of time to remember devices for, in days. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -33732,7 +34532,8 @@ client.risk_assessments.settings.get()
-
client.risk_assessments.settings.update(...) -> UpdateRiskAssessmentsSettingsResponseContent +## Roles Groups +
client.roles.groups.get(...) -> ListRoleGroupsResponseContent
@@ -33744,7 +34545,7 @@ client.risk_assessments.settings.get()
-Updates the tenant settings for risk assessments +Lists the groups to which the specified role is assigned.
@@ -33767,8 +34568,10 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.risk_assessments.settings.update( - enabled=True, +client.roles.groups.get( + id="id", + from_="from", + take=1, ) ``` @@ -33785,7 +34588,23 @@ client.risk_assessments.settings.update(
-**enabled:** `bool` — Whether or not risk assessment is enabled. +**id:** `str` — Unique identifier for the role (service-generated). + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50.
@@ -33805,8 +34624,7 @@ client.risk_assessments.settings.update(
-## RiskAssessments Settings NewDevice -
client.risk_assessments.settings.new_device.get() -> GetRiskAssessmentsSettingsNewDeviceResponseContent +
client.roles.groups.create(...)
@@ -33818,7 +34636,7 @@ client.risk_assessments.settings.update(
-Gets the risk assessment settings for the new device assessor +Assign one or more groups to a specified role.
@@ -33841,7 +34659,12 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.risk_assessments.settings.new_device.get() +client.roles.groups.create( + id="id", + groups=[ + "groups" + ], +) ``` @@ -33857,6 +34680,22 @@ client.risk_assessments.settings.new_device.get()
+**id:** `str` — Unique identifier for the role (service-generated). + +
+
+ +
+
+ +**groups:** `typing.List[str]` — Array of group IDs to assign to the role. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -33869,7 +34708,7 @@ client.risk_assessments.settings.new_device.get()
-
client.risk_assessments.settings.new_device.update(...) -> UpdateRiskAssessmentsSettingsNewDeviceResponseContent +
client.roles.groups.delete(...)
@@ -33881,7 +34720,7 @@ client.risk_assessments.settings.new_device.get()
-Updates the risk assessment settings for the new device assessor +Unassign one or more groups from a specified role.
@@ -33904,8 +34743,11 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.risk_assessments.settings.new_device.update( - remember_for=1, +client.roles.groups.delete( + id="id", + groups=[ + "groups" + ], ) ``` @@ -33922,7 +34764,15 @@ client.risk_assessments.settings.new_device.update(
-**remember_for:** `int` — Length of time to remember devices for, in days. +**id:** `str` — Unique identifier for the role (service-generated). + +
+
+ +
+
+ +**groups:** `typing.List[str]` — Array of group IDs to remove from the role.
@@ -35898,7 +36748,180 @@ client.users.authentication_methods.delete(
-Modify the authentication method with the given ID from the specified user. For more information, review Manage Authentication Methods with Management API. +Modify the authentication method with the given ID from the specified user. For more information, review Manage Authentication Methods with Management API. +
+
+ +
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.users.authentication_methods.update( + id="id", + authentication_method_id="authentication_method_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The ID of the user in question. + +
+
+ +
+
+ +**authentication_method_id:** `str` — The ID of the authentication method to update. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — A human-readable label to identify the authentication method. + +
+
+ +
+
+ +**preferred_authentication_method:** `typing.Optional[PreferredAuthenticationMethodEnum]` — Preferred phone authentication method + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +## Users Authenticators +
client.users.authenticators.delete_all(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.users.authenticators.delete_all( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user to delete. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Users ConnectedAccounts +
client.users.connected_accounts.list(...) -> ListUserConnectedAccountsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve all connected accounts associated with the user.
@@ -35921,9 +36944,10 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.users.authentication_methods.update( +client.users.connected_accounts.list( id="id", - authentication_method_id="authentication_method_id", + from_="from", + take=1, ) ``` @@ -35940,15 +36964,7 @@ client.users.authentication_methods.update(
-**id:** `str` — The ID of the user in question. - -
-
- -
-
- -**authentication_method_id:** `str` — The ID of the authentication method to update. +**id:** `str` — ID of the user to list connected accounts for.
@@ -35956,7 +36972,7 @@ client.users.authentication_methods.update(
-**name:** `typing.Optional[str]` — A human-readable label to identify the authentication method. +**from:** `typing.Optional[str]` — Optional Id from which to start selection.
@@ -35964,7 +36980,7 @@ client.users.authentication_methods.update(
-**preferred_authentication_method:** `typing.Optional[PreferredAuthenticationMethodEnum]` — Preferred phone authentication method +**take:** `typing.Optional[int]` — Number of results to return. Defaults to 10 with a maximum of 20
@@ -35984,8 +37000,8 @@ client.users.authentication_methods.update(
-## Users Authenticators -
client.users.authenticators.delete_all(...) +## Users EffectivePermissions +
client.users.effective_permissions.list(...) -> ListUserEffectivePermissionsResponseContent
@@ -35997,7 +37013,7 @@ client.users.authentication_methods.update(
-Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api). +Returns the list of effective permissions for a user, taking into account permissions granted directly to the user, as well as those inherited through roles and group memberships.
@@ -36020,8 +37036,11 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.users.authenticators.delete_all( +client.users.effective_permissions.list( id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", ) ``` @@ -36038,7 +37057,31 @@ client.users.authenticators.delete_all(
-**id:** `str` — ID of the user to delete. +**id:** `str` — ID of the user to retrieve the permissions for. + +
+
+ +
+
+ +**resource_server_identifier:** `str` — The identifier of the resource server for which to calculate user permissions. + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50.
@@ -36058,8 +37101,8 @@ client.users.authenticators.delete_all(
-## Users ConnectedAccounts -
client.users.connected_accounts.list(...) -> ListUserConnectedAccountsResponseContent +## Users EffectiveRoles +
client.users.effective_roles.list(...) -> ListUserEffectiveRolesResponseContent
@@ -36071,7 +37114,7 @@ client.users.authenticators.delete_all(
-Retrieve all connected accounts associated with the user. +Retrieve detailed list of effective roles for a user, including roles assigned directly and through group memberships.
@@ -36094,7 +37137,7 @@ client = Auth0( environment=Auth0Environment.DEFAULT, ) -client.users.connected_accounts.list( +client.users.effective_roles.list( id="id", from_="from", take=1, @@ -36114,7 +37157,7 @@ client.users.connected_accounts.list(
-**id:** `str` — ID of the user to list connected accounts for. +**id:** `str` — ID of the user to list effective roles for.
@@ -36130,7 +37173,7 @@ client.users.connected_accounts.list(
-**take:** `typing.Optional[int]` — Number of results to return. Defaults to 10 with a maximum of 20 +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50.
@@ -38046,6 +39089,217 @@ client.users.sessions.delete(
+ + +
+ +## Users EffectivePermissions Sources Roles +
client.users.effective_permissions.sources.roles.list(...) -> ListUserEffectivePermissionRoleSourcesResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the roles which grant the user a given permission, including roles assigned directly to the user and those inherited through group memberships. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.users.effective_permissions.sources.roles.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + permission_name="permission_name", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user to retrieve the permissions for. + +
+
+ +
+
+ +**resource_server_identifier:** `str` — The identifier of the resource server for which to calculate user permissions. + +
+
+ +
+
+ +**permission_name:** `str` — Name of this permission + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Users EffectiveRoles Sources Groups +
client.users.effective_roles.sources.groups.list(...) -> ListUserRoleSourceGroupsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the groups that grant a user a specific role. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from auth0.management import Auth0 +from auth0.management.environment import Auth0Environment + +client = Auth0( + token="", + environment=Auth0Environment.DEFAULT, +) + +client.users.effective_roles.sources.groups.list( + id="id", + role_id="role_id", + from_="from", + take=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — ID of the user to list role source groups for. + +
+
+ +
+
+ +**role_id:** `str` — ID of the role to get source groups for. + +
+
+ +
+
+ +**from:** `typing.Optional[str]` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `typing.Optional[int]` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
diff --git a/src/auth0/management/__init__.py b/src/auth0/management/__init__.py index ecd00f0b..a48ff10f 100644 --- a/src/auth0/management/__init__.py +++ b/src/auth0/management/__init__.py @@ -2198,7 +2198,11 @@ ListOrganizationClientGrantsOffsetPaginatedResponseContent, ListOrganizationConnectionsOffsetPaginatedResponseContent, ListOrganizationDiscoveryDomainsResponseContent, + ListOrganizationGroupRolesResponseContent, + ListOrganizationGroupsResponseContent, ListOrganizationInvitationsOffsetPaginatedResponseContent, + ListOrganizationMemberEffectiveRolesResponseContent, + ListOrganizationMemberRoleSourceGroupsResponseContent, ListOrganizationMemberRolesOffsetPaginatedResponseContent, ListOrganizationMembersPaginatedResponseContent, ListOrganizationsPaginatedResponseContent, @@ -2206,6 +2210,7 @@ ListRateLimitPoliciesPaginatedResponseContent, ListRefreshTokensPaginatedResponseContent, ListResourceServerOffsetPaginatedResponseContent, + ListRoleGroupsResponseContent, ListRolePermissionsOffsetPaginatedResponseContent, ListRoleUsersPaginatedResponseContent, ListRolesOffsetPaginatedResponseContent, @@ -2221,9 +2226,13 @@ ListUserBlocksByIdentifierResponseContent, ListUserBlocksResponseContent, ListUserConnectedAccountsResponseContent, + ListUserEffectivePermissionRoleSourcesResponseContent, + ListUserEffectivePermissionsResponseContent, + ListUserEffectiveRolesResponseContent, ListUserGrantsOffsetPaginatedResponseContent, ListUserOrganizationsOffsetPaginatedResponseContent, ListUserPermissionsOffsetPaginatedResponseContent, + ListUserRoleSourceGroupsResponseContent, ListUserRolesOffsetPaginatedResponseContent, ListUserSessionsPaginatedResponseContent, ListUsersOffsetPaginatedResponseContent, @@ -2313,6 +2322,8 @@ OrganizationInvitationInvitee, OrganizationInvitationInviter, OrganizationMember, + OrganizationMemberEffectiveRole, + OrganizationMemberEffectiveRoleSource, OrganizationMemberRole, OrganizationMetadata, OrganizationUsageEnum, @@ -2674,6 +2685,12 @@ UserAuthenticationMethodPropertiesEnum, UserBlockIdentifier, UserDateSchema, + UserEffectivePermissionResponseContent, + UserEffectivePermissionRoleSourceEnum, + UserEffectivePermissionRoleSourceResponseContent, + UserEffectivePermissionSourceEnum, + UserEffectiveRole, + UserEffectiveRoleSource, UserEnrollmentAuthMethodEnum, UserEnrollmentStatusEnum, UserGrant, @@ -2766,8 +2783,6 @@ from .environment import Auth0Environment from .event_streams import EventStreamsCreateRequest from .version import __version__ - from .management_client import AsyncManagementClient, CustomDomainHeader, ManagementClient - from .token_provider import AsyncTokenProvider, TokenProvider _dynamic_imports: typing.Dict[str, str] = { "Action": ".types", "ActionBase": ".types", @@ -2828,8 +2843,6 @@ "AssociateOrganizationClientGrantResponseContent": ".types", "AsyncApprovalNotificationsChannelsEnum": ".types", "AsyncAuth0": ".client", - "AsyncManagementClient": ".management_client", - "AsyncTokenProvider": ".token_provider", "AttackProtectionCaptchaArkoseResponseContent": ".types", "AttackProtectionCaptchaAuthChallengeRequest": ".types", "AttackProtectionCaptchaAuthChallengeResponseContent": ".types", @@ -3789,7 +3802,6 @@ "CredentialDeviceTypeEnum": ".types", "CredentialId": ".types", "CustomDomain": ".types", - "CustomDomainHeader": ".management_client", "CustomDomainCustomClientIpHeader": ".types", "CustomDomainCustomClientIpHeaderEnum": ".types", "CustomDomainProvisioningTypeEnum": ".types", @@ -4975,7 +4987,11 @@ "ListOrganizationClientGrantsOffsetPaginatedResponseContent": ".types", "ListOrganizationConnectionsOffsetPaginatedResponseContent": ".types", "ListOrganizationDiscoveryDomainsResponseContent": ".types", + "ListOrganizationGroupRolesResponseContent": ".types", + "ListOrganizationGroupsResponseContent": ".types", "ListOrganizationInvitationsOffsetPaginatedResponseContent": ".types", + "ListOrganizationMemberEffectiveRolesResponseContent": ".types", + "ListOrganizationMemberRoleSourceGroupsResponseContent": ".types", "ListOrganizationMemberRolesOffsetPaginatedResponseContent": ".types", "ListOrganizationMembersPaginatedResponseContent": ".types", "ListOrganizationsPaginatedResponseContent": ".types", @@ -4983,6 +4999,7 @@ "ListRateLimitPoliciesPaginatedResponseContent": ".types", "ListRefreshTokensPaginatedResponseContent": ".types", "ListResourceServerOffsetPaginatedResponseContent": ".types", + "ListRoleGroupsResponseContent": ".types", "ListRolePermissionsOffsetPaginatedResponseContent": ".types", "ListRoleUsersPaginatedResponseContent": ".types", "ListRolesOffsetPaginatedResponseContent": ".types", @@ -4998,9 +5015,13 @@ "ListUserBlocksByIdentifierResponseContent": ".types", "ListUserBlocksResponseContent": ".types", "ListUserConnectedAccountsResponseContent": ".types", + "ListUserEffectivePermissionRoleSourcesResponseContent": ".types", + "ListUserEffectivePermissionsResponseContent": ".types", + "ListUserEffectiveRolesResponseContent": ".types", "ListUserGrantsOffsetPaginatedResponseContent": ".types", "ListUserOrganizationsOffsetPaginatedResponseContent": ".types", "ListUserPermissionsOffsetPaginatedResponseContent": ".types", + "ListUserRoleSourceGroupsResponseContent": ".types", "ListUserRolesOffsetPaginatedResponseContent": ".types", "ListUserSessionsPaginatedResponseContent": ".types", "ListUsersOffsetPaginatedResponseContent": ".types", @@ -5052,7 +5073,6 @@ "LogStreamSumoEnum": ".types", "LogStreamSumoResponseSchema": ".types", "LogStreamSumoSink": ".types", - "ManagementClient": ".management_client", "MdlPresentationProperties": ".types", "MdlPresentationRequest": ".types", "MdlPresentationRequestProperties": ".types", @@ -5092,6 +5112,8 @@ "OrganizationInvitationInvitee": ".types", "OrganizationInvitationInviter": ".types", "OrganizationMember": ".types", + "OrganizationMemberEffectiveRole": ".types", + "OrganizationMemberEffectiveRoleSource": ".types", "OrganizationMemberRole": ".types", "OrganizationMetadata": ".types", "OrganizationUsageEnum": ".types", @@ -5296,7 +5318,6 @@ "TokenQuota": ".types", "TokenQuotaClientCredentials": ".types", "TokenQuotaConfiguration": ".types", - "TokenProvider": ".token_provider", "TooManyRequestsError": ".errors", "TooManyRequestsSchema": ".types", "TooManyRequestsSchemaError": ".types", @@ -5459,6 +5480,12 @@ "UserAuthenticationMethodPropertiesEnum": ".types", "UserBlockIdentifier": ".types", "UserDateSchema": ".types", + "UserEffectivePermissionResponseContent": ".types", + "UserEffectivePermissionRoleSourceEnum": ".types", + "UserEffectivePermissionRoleSourceResponseContent": ".types", + "UserEffectivePermissionSourceEnum": ".types", + "UserEffectiveRole": ".types", + "UserEffectiveRoleSource": ".types", "UserEnrollmentAuthMethodEnum": ".types", "UserEnrollmentStatusEnum": ".types", "UserGrant": ".types", @@ -5614,8 +5641,6 @@ def __dir__(): "AssociateOrganizationClientGrantResponseContent", "AsyncApprovalNotificationsChannelsEnum", "AsyncAuth0", - "AsyncManagementClient", - "AsyncTokenProvider", "AttackProtectionCaptchaArkoseResponseContent", "AttackProtectionCaptchaAuthChallengeRequest", "AttackProtectionCaptchaAuthChallengeResponseContent", @@ -7760,7 +7785,11 @@ def __dir__(): "ListOrganizationClientGrantsOffsetPaginatedResponseContent", "ListOrganizationConnectionsOffsetPaginatedResponseContent", "ListOrganizationDiscoveryDomainsResponseContent", + "ListOrganizationGroupRolesResponseContent", + "ListOrganizationGroupsResponseContent", "ListOrganizationInvitationsOffsetPaginatedResponseContent", + "ListOrganizationMemberEffectiveRolesResponseContent", + "ListOrganizationMemberRoleSourceGroupsResponseContent", "ListOrganizationMemberRolesOffsetPaginatedResponseContent", "ListOrganizationMembersPaginatedResponseContent", "ListOrganizationsPaginatedResponseContent", @@ -7768,6 +7797,7 @@ def __dir__(): "ListRateLimitPoliciesPaginatedResponseContent", "ListRefreshTokensPaginatedResponseContent", "ListResourceServerOffsetPaginatedResponseContent", + "ListRoleGroupsResponseContent", "ListRolePermissionsOffsetPaginatedResponseContent", "ListRoleUsersPaginatedResponseContent", "ListRolesOffsetPaginatedResponseContent", @@ -7783,9 +7813,13 @@ def __dir__(): "ListUserBlocksByIdentifierResponseContent", "ListUserBlocksResponseContent", "ListUserConnectedAccountsResponseContent", + "ListUserEffectivePermissionRoleSourcesResponseContent", + "ListUserEffectivePermissionsResponseContent", + "ListUserEffectiveRolesResponseContent", "ListUserGrantsOffsetPaginatedResponseContent", "ListUserOrganizationsOffsetPaginatedResponseContent", "ListUserPermissionsOffsetPaginatedResponseContent", + "ListUserRoleSourceGroupsResponseContent", "ListUserRolesOffsetPaginatedResponseContent", "ListUserSessionsPaginatedResponseContent", "ListUsersOffsetPaginatedResponseContent", @@ -7837,7 +7871,6 @@ def __dir__(): "LogStreamSumoEnum", "LogStreamSumoResponseSchema", "LogStreamSumoSink", - "ManagementClient", "MdlPresentationProperties", "MdlPresentationRequest", "MdlPresentationRequestProperties", @@ -7877,6 +7910,8 @@ def __dir__(): "OrganizationInvitationInvitee", "OrganizationInvitationInviter", "OrganizationMember", + "OrganizationMemberEffectiveRole", + "OrganizationMemberEffectiveRoleSource", "OrganizationMemberRole", "OrganizationMetadata", "OrganizationUsageEnum", @@ -8078,7 +8113,6 @@ def __dir__(): "TestEventDataContent", "TokenExchangeProfileResponseContent", "TokenExchangeProfileTypeEnum", - "TokenProvider", "TokenQuota", "TokenQuotaClientCredentials", "TokenQuotaConfiguration", @@ -8244,6 +8278,12 @@ def __dir__(): "UserAuthenticationMethodPropertiesEnum", "UserBlockIdentifier", "UserDateSchema", + "UserEffectivePermissionResponseContent", + "UserEffectivePermissionRoleSourceEnum", + "UserEffectivePermissionRoleSourceResponseContent", + "UserEffectivePermissionSourceEnum", + "UserEffectiveRole", + "UserEffectiveRoleSource", "UserEnrollmentAuthMethodEnum", "UserEnrollmentStatusEnum", "UserGrant", diff --git a/src/auth0/management/core/client_wrapper.py b/src/auth0/management/core/client_wrapper.py index 60ebc5a6..cad2e314 100644 --- a/src/auth0/management/core/client_wrapper.py +++ b/src/auth0/management/core/client_wrapper.py @@ -1,11 +1,6 @@ # This file was auto-generated by Fern from our API Definition. -# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning -import base64 -import platform -import sys import typing -from json import dumps import httpx from .http_client import AsyncHttpClient, HttpClient @@ -31,18 +26,15 @@ def __init__( self._logging = logging def get_headers(self) -> typing.Dict[str, str]: - py_version = platform.python_version() - version = sys.modules["auth0"].__version__ - - auth0_client = dumps({ - "name": "auth0-python", - "version": version, - "env": {"python": py_version} - }).encode("utf-8") + import platform headers: typing.Dict[str, str] = { - "User-Agent": f"Python/{py_version}", - "Auth0-Client": base64.b64encode(auth0_client).decode(), + "User-Agent": "auth0-python/5.5.0", + "X-Fern-Language": "Python", + "X-Fern-Runtime": f"python/{platform.python_version()}", + "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", + "X-Fern-SDK-Name": "auth0-python", + "X-Fern-SDK-Version": "5.5.0", **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Bearer {self._get_token()}" diff --git a/src/auth0/management/core/pydantic_utilities.py b/src/auth0/management/core/pydantic_utilities.py index fea3a08d..df3e720d 100644 --- a/src/auth0/management/core/pydantic_utilities.py +++ b/src/auth0/management/core/pydantic_utilities.py @@ -310,6 +310,18 @@ def parse_sse_obj(sse: "ServerSentEvent", type_: Type[T]) -> T: return parse_obj_as(type_, sse_event) +_type_adapter_cache: Dict[int, Any] = {} + + +def _get_type_adapter(type_: Type[Any]) -> Any: + key = id(type_) + adapter = _type_adapter_cache.get(key) + if adapter is None: + adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] + _type_adapter_cache[key] = adapter + return adapter + + def parse_obj_as(type_: Type[T], object_: Any) -> T: # convert_and_respect_annotation_metadata is required for TypedDict aliasing. # @@ -342,8 +354,8 @@ def parse_obj_as(type_: Type[T], object_: Any) -> T: else: dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] - return adapter.validate_python(dealiased_object) + adapter = _get_type_adapter(type_) + return adapter.validate_python(dealiased_object) # type: ignore[no-any-return] return pydantic.parse_obj_as(type_, dealiased_object) diff --git a/src/auth0/management/organizations/__init__.py b/src/auth0/management/organizations/__init__.py index 8f9c49df..ca170602 100644 --- a/src/auth0/management/organizations/__init__.py +++ b/src/auth0/management/organizations/__init__.py @@ -6,12 +6,13 @@ from importlib import import_module if typing.TYPE_CHECKING: - from . import client_grants, connections, discovery_domains, enabled_connections, invitations, members + from . import client_grants, connections, discovery_domains, enabled_connections, groups, invitations, members _dynamic_imports: typing.Dict[str, str] = { "client_grants": ".client_grants", "connections": ".connections", "discovery_domains": ".discovery_domains", "enabled_connections": ".enabled_connections", + "groups": ".groups", "invitations": ".invitations", "members": ".members", } @@ -38,4 +39,12 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["client_grants", "connections", "discovery_domains", "enabled_connections", "invitations", "members"] +__all__ = [ + "client_grants", + "connections", + "discovery_domains", + "enabled_connections", + "groups", + "invitations", + "members", +] diff --git a/src/auth0/management/organizations/client.py b/src/auth0/management/organizations/client.py index 5d8136f4..0e867bda 100644 --- a/src/auth0/management/organizations/client.py +++ b/src/auth0/management/organizations/client.py @@ -25,6 +25,7 @@ from .connections.client import AsyncConnectionsClient, ConnectionsClient from .discovery_domains.client import AsyncDiscoveryDomainsClient, DiscoveryDomainsClient from .enabled_connections.client import AsyncEnabledConnectionsClient, EnabledConnectionsClient + from .groups.client import AsyncGroupsClient, GroupsClient from .invitations.client import AsyncInvitationsClient, InvitationsClient from .members.client import AsyncMembersClient, MembersClient # this is used as the default value for optional parameters @@ -41,6 +42,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._enabled_connections: typing.Optional[EnabledConnectionsClient] = None self._invitations: typing.Optional[InvitationsClient] = None self._members: typing.Optional[MembersClient] = None + self._groups: typing.Optional[GroupsClient] = None @property def with_raw_response(self) -> RawOrganizationsClient: @@ -389,6 +391,14 @@ def members(self): self._members = MembersClient(client_wrapper=self._client_wrapper) return self._members + @property + def groups(self): + if self._groups is None: + from .groups.client import GroupsClient # noqa: E402 + + self._groups = GroupsClient(client_wrapper=self._client_wrapper) + return self._groups + class AsyncOrganizationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -400,6 +410,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._enabled_connections: typing.Optional[AsyncEnabledConnectionsClient] = None self._invitations: typing.Optional[AsyncInvitationsClient] = None self._members: typing.Optional[AsyncMembersClient] = None + self._groups: typing.Optional[AsyncGroupsClient] = None @property def with_raw_response(self) -> AsyncRawOrganizationsClient: @@ -796,3 +807,11 @@ def members(self): self._members = AsyncMembersClient(client_wrapper=self._client_wrapper) return self._members + + @property + def groups(self): + if self._groups is None: + from .groups.client import AsyncGroupsClient # noqa: E402 + + self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) + return self._groups diff --git a/src/auth0/management/organizations/groups/__init__.py b/src/auth0/management/organizations/groups/__init__.py new file mode 100644 index 00000000..686aa754 --- /dev/null +++ b/src/auth0/management/organizations/groups/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import roles +_dynamic_imports: typing.Dict[str, str] = {"roles": ".roles"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["roles"] diff --git a/src/auth0/management/organizations/groups/client.py b/src/auth0/management/organizations/groups/client.py new file mode 100644 index 00000000..c267a4ee --- /dev/null +++ b/src/auth0/management/organizations/groups/client.py @@ -0,0 +1,176 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.pagination import AsyncPager, SyncPager +from ...core.request_options import RequestOptions +from ...types.group import Group +from ...types.list_organization_groups_response_content import ListOrganizationGroupsResponseContent +from .raw_client import AsyncRawGroupsClient, RawGroupsClient + +if typing.TYPE_CHECKING: + from .roles.client import AsyncRolesClient, RolesClient + + +class GroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._roles: typing.Optional[RolesClient] = None + + @property + def with_raw_response(self) -> RawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGroupsClient + """ + return self._raw_client + + def list( + self, + organization_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListOrganizationGroupsResponseContent]: + """ + Lists the groups that are assigned to the specified organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListOrganizationGroupsResponseContent] + Organization groups successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.organizations.groups.list( + organization_id="organization_id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list(organization_id, from_=from_, take=take, request_options=request_options) + + @property + def roles(self): + if self._roles is None: + from .roles.client import RolesClient # noqa: E402 + + self._roles = RolesClient(client_wrapper=self._client_wrapper) + return self._roles + + +class AsyncGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._roles: typing.Optional[AsyncRolesClient] = None + + @property + def with_raw_response(self) -> AsyncRawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGroupsClient + """ + return self._raw_client + + async def list( + self, + organization_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListOrganizationGroupsResponseContent]: + """ + Lists the groups that are assigned to the specified organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListOrganizationGroupsResponseContent] + Organization groups successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.organizations.groups.list( + organization_id="organization_id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list(organization_id, from_=from_, take=take, request_options=request_options) + + @property + def roles(self): + if self._roles is None: + from .roles.client import AsyncRolesClient # noqa: E402 + + self._roles = AsyncRolesClient(client_wrapper=self._client_wrapper) + return self._roles diff --git a/src/auth0/management/organizations/groups/raw_client.py b/src/auth0/management/organizations/groups/raw_client.py new file mode 100644 index 00000000..e883ffca --- /dev/null +++ b/src/auth0/management/organizations/groups/raw_client.py @@ -0,0 +1,254 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import encode_path_param +from ...core.pagination import AsyncPager, SyncPager +from ...core.parse_error import ParsingError +from ...core.pydantic_utilities import parse_obj_as +from ...core.request_options import RequestOptions +from ...errors.bad_request_error import BadRequestError +from ...errors.forbidden_error import ForbiddenError +from ...errors.too_many_requests_error import TooManyRequestsError +from ...errors.unauthorized_error import UnauthorizedError +from ...types.group import Group +from ...types.list_organization_groups_response_content import ListOrganizationGroupsResponseContent +from pydantic import ValidationError + + +class RawGroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + organization_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListOrganizationGroupsResponseContent]: + """ + Lists the groups that are assigned to the specified organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListOrganizationGroupsResponseContent] + Organization groups successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationGroupsResponseContent, + parse_obj_as( + type_=ListOrganizationGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + organization_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + organization_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListOrganizationGroupsResponseContent]: + """ + Lists the groups that are assigned to the specified organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListOrganizationGroupsResponseContent] + Organization groups successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationGroupsResponseContent, + parse_obj_as( + type_=ListOrganizationGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + organization_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/organizations/groups/roles/__init__.py b/src/auth0/management/organizations/groups/roles/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/organizations/groups/roles/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/organizations/groups/roles/client.py b/src/auth0/management/organizations/groups/roles/client.py new file mode 100644 index 00000000..5464449e --- /dev/null +++ b/src/auth0/management/organizations/groups/roles/client.py @@ -0,0 +1,366 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ....core.pagination import AsyncPager, SyncPager +from ....core.request_options import RequestOptions +from ....types.list_organization_group_roles_response_content import ListOrganizationGroupRolesResponseContent +from ....types.role import Role +from .raw_client import AsyncRawRolesClient, RawRolesClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawRolesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawRolesClient + """ + return self._raw_client + + def list( + self, + organization_id: str, + group_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Role, ListOrganizationGroupRolesResponseContent]: + """ + Lists the roles assigned to the specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Role, ListOrganizationGroupRolesResponseContent] + Organization group roles successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.organizations.groups.roles.list( + organization_id="organization_id", + group_id="group_id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list(organization_id, group_id, from_=from_, take=take, request_options=request_options) + + def create( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Assign one or more roles to a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to assign to organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.organizations.groups.roles.create( + organization_id="organization_id", + group_id="group_id", + roles=["roles"], + ) + """ + _response = self._raw_client.create(organization_id, group_id, roles=roles, request_options=request_options) + return _response.data + + def delete( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Unassign one or more roles from a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to delete from organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.organizations.groups.roles.delete( + organization_id="organization_id", + group_id="group_id", + roles=["roles"], + ) + """ + _response = self._raw_client.delete(organization_id, group_id, roles=roles, request_options=request_options) + return _response.data + + +class AsyncRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawRolesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawRolesClient + """ + return self._raw_client + + async def list( + self, + organization_id: str, + group_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Role, ListOrganizationGroupRolesResponseContent]: + """ + Lists the roles assigned to the specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Role, ListOrganizationGroupRolesResponseContent] + Organization group roles successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.organizations.groups.roles.list( + organization_id="organization_id", + group_id="group_id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list( + organization_id, group_id, from_=from_, take=take, request_options=request_options + ) + + async def create( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Assign one or more roles to a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to assign to organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.organizations.groups.roles.create( + organization_id="organization_id", + group_id="group_id", + roles=["roles"], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + organization_id, group_id, roles=roles, request_options=request_options + ) + return _response.data + + async def delete( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Unassign one or more roles from a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to delete from organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.organizations.groups.roles.delete( + organization_id="organization_id", + group_id="group_id", + roles=["roles"], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete( + organization_id, group_id, roles=roles, request_options=request_options + ) + return _response.data diff --git a/src/auth0/management/organizations/groups/roles/raw_client.py b/src/auth0/management/organizations/groups/roles/raw_client.py new file mode 100644 index 00000000..6e52689e --- /dev/null +++ b/src/auth0/management/organizations/groups/roles/raw_client.py @@ -0,0 +1,679 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ....core.api_error import ApiError +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ....core.http_response import AsyncHttpResponse, HttpResponse +from ....core.jsonable_encoder import encode_path_param +from ....core.pagination import AsyncPager, SyncPager +from ....core.parse_error import ParsingError +from ....core.pydantic_utilities import parse_obj_as +from ....core.request_options import RequestOptions +from ....errors.bad_request_error import BadRequestError +from ....errors.conflict_error import ConflictError +from ....errors.forbidden_error import ForbiddenError +from ....errors.too_many_requests_error import TooManyRequestsError +from ....errors.unauthorized_error import UnauthorizedError +from ....types.list_organization_group_roles_response_content import ListOrganizationGroupRolesResponseContent +from ....types.role import Role +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + organization_id: str, + group_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Role, ListOrganizationGroupRolesResponseContent]: + """ + Lists the roles assigned to the specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Role, ListOrganizationGroupRolesResponseContent] + Organization group roles successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups/{encode_path_param(group_id)}/roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationGroupRolesResponseContent, + parse_obj_as( + type_=ListOrganizationGroupRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + organization_id, + group_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[None]: + """ + Assign one or more roles to a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to assign to organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups/{encode_path_param(group_id)}/roles", + method="POST", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[None]: + """ + Unassign one or more roles from a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to delete from organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups/{encode_path_param(group_id)}/roles", + method="DELETE", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + organization_id: str, + group_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Role, ListOrganizationGroupRolesResponseContent]: + """ + Lists the roles assigned to the specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Role, ListOrganizationGroupRolesResponseContent] + Organization group roles successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups/{encode_path_param(group_id)}/roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationGroupRolesResponseContent, + parse_obj_as( + type_=ListOrganizationGroupRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + organization_id, + group_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[None]: + """ + Assign one or more roles to a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to assign to organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups/{encode_path_param(group_id)}/roles", + method="POST", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete( + self, + organization_id: str, + group_id: str, + *, + roles: typing.Sequence[str], + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[None]: + """ + Unassign one or more roles from a specified group in the context of an organization. + + Parameters + ---------- + organization_id : str + ID of the organization + + group_id : str + ID of the group + + roles : typing.Sequence[str] + Array of role IDs to delete from organization group. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(organization_id)}/groups/{encode_path_param(group_id)}/roles", + method="DELETE", + json={ + "roles": roles, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/organizations/members/__init__.py b/src/auth0/management/organizations/members/__init__.py index 686aa754..afd3bf71 100644 --- a/src/auth0/management/organizations/members/__init__.py +++ b/src/auth0/management/organizations/members/__init__.py @@ -6,8 +6,8 @@ from importlib import import_module if typing.TYPE_CHECKING: - from . import roles -_dynamic_imports: typing.Dict[str, str] = {"roles": ".roles"} + from . import effective_roles, roles +_dynamic_imports: typing.Dict[str, str] = {"effective_roles": ".effective_roles", "roles": ".roles"} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +31,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["roles"] +__all__ = ["effective_roles", "roles"] diff --git a/src/auth0/management/organizations/members/client.py b/src/auth0/management/organizations/members/client.py index 22dbe6ee..5f7e1bca 100644 --- a/src/auth0/management/organizations/members/client.py +++ b/src/auth0/management/organizations/members/client.py @@ -14,6 +14,7 @@ from .raw_client import AsyncRawMembersClient, RawMembersClient if typing.TYPE_CHECKING: + from .effective_roles.client import AsyncEffectiveRolesClient, EffectiveRolesClient from .roles.client import AsyncRolesClient, RolesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -23,6 +24,7 @@ class MembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMembersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper + self._effective_roles: typing.Optional[EffectiveRolesClient] = None self._roles: typing.Optional[RolesClient] = None @property @@ -191,6 +193,14 @@ def delete( _response = self._raw_client.delete(id, members=members, request_options=request_options) return _response.data + @property + def effective_roles(self): + if self._effective_roles is None: + from .effective_roles.client import EffectiveRolesClient # noqa: E402 + + self._effective_roles = EffectiveRolesClient(client_wrapper=self._client_wrapper) + return self._effective_roles + @property def roles(self): if self._roles is None: @@ -204,6 +214,7 @@ class AsyncMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMembersClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper + self._effective_roles: typing.Optional[AsyncEffectiveRolesClient] = None self._roles: typing.Optional[AsyncRolesClient] = None @property @@ -397,6 +408,14 @@ async def main() -> None: _response = await self._raw_client.delete(id, members=members, request_options=request_options) return _response.data + @property + def effective_roles(self): + if self._effective_roles is None: + from .effective_roles.client import AsyncEffectiveRolesClient # noqa: E402 + + self._effective_roles = AsyncEffectiveRolesClient(client_wrapper=self._client_wrapper) + return self._effective_roles + @property def roles(self): if self._roles is None: diff --git a/src/auth0/management/organizations/members/effective_roles/__init__.py b/src/auth0/management/organizations/members/effective_roles/__init__.py new file mode 100644 index 00000000..504a42f7 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import sources +_dynamic_imports: typing.Dict[str, str] = {"sources": ".sources"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["sources"] diff --git a/src/auth0/management/organizations/members/effective_roles/client.py b/src/auth0/management/organizations/members/effective_roles/client.py new file mode 100644 index 00000000..e9732d31 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/client.py @@ -0,0 +1,188 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ....core.pagination import AsyncPager, SyncPager +from ....core.request_options import RequestOptions +from ....types.list_organization_member_effective_roles_response_content import ( + ListOrganizationMemberEffectiveRolesResponseContent, +) +from ....types.organization_member_effective_role import OrganizationMemberEffectiveRole +from .raw_client import AsyncRawEffectiveRolesClient, RawEffectiveRolesClient + +if typing.TYPE_CHECKING: + from .sources.client import AsyncSourcesClient, SourcesClient + + +class EffectiveRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawEffectiveRolesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._sources: typing.Optional[SourcesClient] = None + + @property + def with_raw_response(self) -> RawEffectiveRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawEffectiveRolesClient + """ + return self._raw_client + + def list( + self, + id: str, + user_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent]: + """ + Lists the roles assigned to an organization member directly or through group membership. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent] + Organization member's effective roles successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.organizations.members.effective_roles.list( + id="id", + user_id="user_id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list(id, user_id, from_=from_, take=take, request_options=request_options) + + @property + def sources(self): + if self._sources is None: + from .sources.client import SourcesClient # noqa: E402 + + self._sources = SourcesClient(client_wrapper=self._client_wrapper) + return self._sources + + +class AsyncEffectiveRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawEffectiveRolesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._sources: typing.Optional[AsyncSourcesClient] = None + + @property + def with_raw_response(self) -> AsyncRawEffectiveRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawEffectiveRolesClient + """ + return self._raw_client + + async def list( + self, + id: str, + user_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent]: + """ + Lists the roles assigned to an organization member directly or through group membership. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent] + Organization member's effective roles successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.organizations.members.effective_roles.list( + id="id", + user_id="user_id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list(id, user_id, from_=from_, take=take, request_options=request_options) + + @property + def sources(self): + if self._sources is None: + from .sources.client import AsyncSourcesClient # noqa: E402 + + self._sources = AsyncSourcesClient(client_wrapper=self._client_wrapper) + return self._sources diff --git a/src/auth0/management/organizations/members/effective_roles/raw_client.py b/src/auth0/management/organizations/members/effective_roles/raw_client.py new file mode 100644 index 00000000..5177f2b1 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/raw_client.py @@ -0,0 +1,266 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ....core.api_error import ApiError +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ....core.jsonable_encoder import encode_path_param +from ....core.pagination import AsyncPager, SyncPager +from ....core.parse_error import ParsingError +from ....core.pydantic_utilities import parse_obj_as +from ....core.request_options import RequestOptions +from ....errors.bad_request_error import BadRequestError +from ....errors.forbidden_error import ForbiddenError +from ....errors.too_many_requests_error import TooManyRequestsError +from ....errors.unauthorized_error import UnauthorizedError +from ....types.list_organization_member_effective_roles_response_content import ( + ListOrganizationMemberEffectiveRolesResponseContent, +) +from ....types.organization_member_effective_role import OrganizationMemberEffectiveRole +from pydantic import ValidationError + + +class RawEffectiveRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + user_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent]: + """ + Lists the roles assigned to an organization member directly or through group membership. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent] + Organization member's effective roles successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(id)}/members/{encode_path_param(user_id)}/effective-roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationMemberEffectiveRolesResponseContent, + parse_obj_as( + type_=ListOrganizationMemberEffectiveRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + user_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawEffectiveRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + user_id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent]: + """ + Lists the roles assigned to an organization member directly or through group membership. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[OrganizationMemberEffectiveRole, ListOrganizationMemberEffectiveRolesResponseContent] + Organization member's effective roles successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(id)}/members/{encode_path_param(user_id)}/effective-roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationMemberEffectiveRolesResponseContent, + parse_obj_as( + type_=ListOrganizationMemberEffectiveRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + user_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/organizations/members/effective_roles/sources/__init__.py b/src/auth0/management/organizations/members/effective_roles/sources/__init__.py new file mode 100644 index 00000000..345b2fe1 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/sources/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import groups +_dynamic_imports: typing.Dict[str, str] = {"groups": ".groups"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["groups"] diff --git a/src/auth0/management/organizations/members/effective_roles/sources/client.py b/src/auth0/management/organizations/members/effective_roles/sources/client.py new file mode 100644 index 00000000..72d2517f --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/sources/client.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .raw_client import AsyncRawSourcesClient, RawSourcesClient + +if typing.TYPE_CHECKING: + from .groups.client import AsyncGroupsClient, GroupsClient + + +class SourcesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawSourcesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._groups: typing.Optional[GroupsClient] = None + + @property + def with_raw_response(self) -> RawSourcesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawSourcesClient + """ + return self._raw_client + + @property + def groups(self): + if self._groups is None: + from .groups.client import GroupsClient # noqa: E402 + + self._groups = GroupsClient(client_wrapper=self._client_wrapper) + return self._groups + + +class AsyncSourcesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawSourcesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._groups: typing.Optional[AsyncGroupsClient] = None + + @property + def with_raw_response(self) -> AsyncRawSourcesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawSourcesClient + """ + return self._raw_client + + @property + def groups(self): + if self._groups is None: + from .groups.client import AsyncGroupsClient # noqa: E402 + + self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) + return self._groups diff --git a/src/auth0/management/organizations/members/effective_roles/sources/groups/__init__.py b/src/auth0/management/organizations/members/effective_roles/sources/groups/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/sources/groups/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/organizations/members/effective_roles/sources/groups/client.py b/src/auth0/management/organizations/members/effective_roles/sources/groups/client.py new file mode 100644 index 00000000..f90e95a4 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/sources/groups/client.py @@ -0,0 +1,179 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ......core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ......core.pagination import AsyncPager, SyncPager +from ......core.request_options import RequestOptions +from ......types.group import Group +from ......types.list_organization_member_role_source_groups_response_content import ( + ListOrganizationMemberRoleSourceGroupsResponseContent, +) +from .raw_client import AsyncRawGroupsClient, RawGroupsClient + + +class GroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGroupsClient + """ + return self._raw_client + + def list( + self, + id: str, + user_id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent]: + """ + Lists the groups which grant the org member a given role. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list role source groups for. + + role_id : str + The role ID to get group sources for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent] + Organization member role source groups successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.organizations.members.effective_roles.sources.groups.list( + id="id", + user_id="user_id", + from_="from", + take=1, + role_id="role_id", + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list( + id, user_id, role_id=role_id, from_=from_, take=take, request_options=request_options + ) + + +class AsyncGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGroupsClient + """ + return self._raw_client + + async def list( + self, + id: str, + user_id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent]: + """ + Lists the groups which grant the org member a given role. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list role source groups for. + + role_id : str + The role ID to get group sources for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent] + Organization member role source groups successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = ( + await client.organizations.members.effective_roles.sources.groups.list( + id="id", + user_id="user_id", + from_="from", + take=1, + role_id="role_id", + ) + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list( + id, user_id, role_id=role_id, from_=from_, take=take, request_options=request_options + ) diff --git a/src/auth0/management/organizations/members/effective_roles/sources/groups/raw_client.py b/src/auth0/management/organizations/members/effective_roles/sources/groups/raw_client.py new file mode 100644 index 00000000..214b49e3 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/sources/groups/raw_client.py @@ -0,0 +1,278 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ......core.api_error import ApiError +from ......core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ......core.jsonable_encoder import encode_path_param +from ......core.pagination import AsyncPager, SyncPager +from ......core.parse_error import ParsingError +from ......core.pydantic_utilities import parse_obj_as +from ......core.request_options import RequestOptions +from ......errors.bad_request_error import BadRequestError +from ......errors.forbidden_error import ForbiddenError +from ......errors.too_many_requests_error import TooManyRequestsError +from ......errors.unauthorized_error import UnauthorizedError +from ......types.group import Group +from ......types.list_organization_member_role_source_groups_response_content import ( + ListOrganizationMemberRoleSourceGroupsResponseContent, +) +from pydantic import ValidationError + + +class RawGroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + user_id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent]: + """ + Lists the groups which grant the org member a given role. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list role source groups for. + + role_id : str + The role ID to get group sources for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent] + Organization member role source groups successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(id)}/members/{encode_path_param(user_id)}/effective-roles/sources/groups", + method="GET", + params={ + "from": from_, + "take": take, + "role_id": role_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationMemberRoleSourceGroupsResponseContent, + parse_obj_as( + type_=ListOrganizationMemberRoleSourceGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + user_id, + role_id=role_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + user_id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent]: + """ + Lists the groups which grant the org member a given role. + + Parameters + ---------- + id : str + Organization identifier. + + user_id : str + ID of the user to list role source groups for. + + role_id : str + The role ID to get group sources for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListOrganizationMemberRoleSourceGroupsResponseContent] + Organization member role source groups successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"organizations/{encode_path_param(id)}/members/{encode_path_param(user_id)}/effective-roles/sources/groups", + method="GET", + params={ + "from": from_, + "take": take, + "role_id": role_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrganizationMemberRoleSourceGroupsResponseContent, + parse_obj_as( + type_=ListOrganizationMemberRoleSourceGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + user_id, + role_id=role_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/organizations/members/effective_roles/sources/raw_client.py b/src/auth0/management/organizations/members/effective_roles/sources/raw_client.py new file mode 100644 index 00000000..ac212ad3 --- /dev/null +++ b/src/auth0/management/organizations/members/effective_roles/sources/raw_client.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper + + +class RawSourcesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + +class AsyncRawSourcesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper diff --git a/src/auth0/management/roles/__init__.py b/src/auth0/management/roles/__init__.py index 0ec75933..390349e1 100644 --- a/src/auth0/management/roles/__init__.py +++ b/src/auth0/management/roles/__init__.py @@ -6,8 +6,8 @@ from importlib import import_module if typing.TYPE_CHECKING: - from . import permissions, users -_dynamic_imports: typing.Dict[str, str] = {"permissions": ".permissions", "users": ".users"} + from . import groups, permissions, users +_dynamic_imports: typing.Dict[str, str] = {"groups": ".groups", "permissions": ".permissions", "users": ".users"} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +31,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["permissions", "users"] +__all__ = ["groups", "permissions", "users"] diff --git a/src/auth0/management/roles/client.py b/src/auth0/management/roles/client.py index 145f3fd2..c24f805b 100644 --- a/src/auth0/management/roles/client.py +++ b/src/auth0/management/roles/client.py @@ -15,6 +15,7 @@ from .raw_client import AsyncRawRolesClient, RawRolesClient if typing.TYPE_CHECKING: + from .groups.client import AsyncGroupsClient, GroupsClient from .permissions.client import AsyncPermissionsClient, PermissionsClient from .users.client import AsyncUsersClient, UsersClient # this is used as the default value for optional parameters @@ -25,6 +26,7 @@ class RolesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawRolesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper + self._groups: typing.Optional[GroupsClient] = None self._permissions: typing.Optional[PermissionsClient] = None self._users: typing.Optional[UsersClient] = None @@ -249,6 +251,14 @@ def update( _response = self._raw_client.update(id, name=name, description=description, request_options=request_options) return _response.data + @property + def groups(self): + if self._groups is None: + from .groups.client import GroupsClient # noqa: E402 + + self._groups = GroupsClient(client_wrapper=self._client_wrapper) + return self._groups + @property def permissions(self): if self._permissions is None: @@ -270,6 +280,7 @@ class AsyncRolesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawRolesClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper + self._groups: typing.Optional[AsyncGroupsClient] = None self._permissions: typing.Optional[AsyncPermissionsClient] = None self._users: typing.Optional[AsyncUsersClient] = None @@ -537,6 +548,14 @@ async def main() -> None: ) return _response.data + @property + def groups(self): + if self._groups is None: + from .groups.client import AsyncGroupsClient # noqa: E402 + + self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) + return self._groups + @property def permissions(self): if self._permissions is None: diff --git a/src/auth0/management/roles/groups/__init__.py b/src/auth0/management/roles/groups/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/roles/groups/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/roles/groups/client.py b/src/auth0/management/roles/groups/client.py new file mode 100644 index 00000000..00d7b0fb --- /dev/null +++ b/src/auth0/management/roles/groups/client.py @@ -0,0 +1,314 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.pagination import AsyncPager, SyncPager +from ...core.request_options import RequestOptions +from ...types.group import Group +from ...types.list_role_groups_response_content import ListRoleGroupsResponseContent +from .raw_client import AsyncRawGroupsClient, RawGroupsClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class GroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGroupsClient + """ + return self._raw_client + + def get( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListRoleGroupsResponseContent]: + """ + Lists the groups to which the specified role is assigned. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListRoleGroupsResponseContent] + Role's groups successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.roles.groups.get( + id="id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.get(id, from_=from_, take=take, request_options=request_options) + + def create( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Assign one or more groups to a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to assign to the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.roles.groups.create( + id="id", + groups=["groups"], + ) + """ + _response = self._raw_client.create(id, groups=groups, request_options=request_options) + return _response.data + + def delete( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Unassign one or more groups from a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to remove from the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + client.roles.groups.delete( + id="id", + groups=["groups"], + ) + """ + _response = self._raw_client.delete(id, groups=groups, request_options=request_options) + return _response.data + + +class AsyncGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGroupsClient + """ + return self._raw_client + + async def get( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListRoleGroupsResponseContent]: + """ + Lists the groups to which the specified role is assigned. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListRoleGroupsResponseContent] + Role's groups successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.roles.groups.get( + id="id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.get(id, from_=from_, take=take, request_options=request_options) + + async def create( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Assign one or more groups to a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to assign to the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.roles.groups.create( + id="id", + groups=["groups"], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(id, groups=groups, request_options=request_options) + return _response.data + + async def delete( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Unassign one or more groups from a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to remove from the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.roles.groups.delete( + id="id", + groups=["groups"], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(id, groups=groups, request_options=request_options) + return _response.data diff --git a/src/auth0/management/roles/groups/raw_client.py b/src/auth0/management/roles/groups/raw_client.py new file mode 100644 index 00000000..54d1ec33 --- /dev/null +++ b/src/auth0/management/roles/groups/raw_client.py @@ -0,0 +1,637 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.http_response import AsyncHttpResponse, HttpResponse +from ...core.jsonable_encoder import encode_path_param +from ...core.pagination import AsyncPager, SyncPager +from ...core.parse_error import ParsingError +from ...core.pydantic_utilities import parse_obj_as +from ...core.request_options import RequestOptions +from ...errors.bad_request_error import BadRequestError +from ...errors.forbidden_error import ForbiddenError +from ...errors.not_found_error import NotFoundError +from ...errors.too_many_requests_error import TooManyRequestsError +from ...errors.unauthorized_error import UnauthorizedError +from ...types.group import Group +from ...types.list_role_groups_response_content import ListRoleGroupsResponseContent +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawGroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListRoleGroupsResponseContent]: + """ + Lists the groups to which the specified role is assigned. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListRoleGroupsResponseContent] + Role's groups successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"roles/{encode_path_param(id)}/groups", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListRoleGroupsResponseContent, + parse_obj_as( + type_=ListRoleGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.get( + id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[None]: + """ + Assign one or more groups to a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to assign to the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"roles/{encode_path_param(id)}/groups", + method="POST", + json={ + "groups": groups, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[None]: + """ + Unassign one or more groups from a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to remove from the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"roles/{encode_path_param(id)}/groups", + method="DELETE", + json={ + "groups": groups, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListRoleGroupsResponseContent]: + """ + Lists the groups to which the specified role is assigned. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListRoleGroupsResponseContent] + Role's groups successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"roles/{encode_path_param(id)}/groups", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListRoleGroupsResponseContent, + parse_obj_as( + type_=ListRoleGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.get( + id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Assign one or more groups to a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to assign to the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"roles/{encode_path_param(id)}/groups", + method="POST", + json={ + "groups": groups, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete( + self, id: str, *, groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Unassign one or more groups from a specified role. + + Parameters + ---------- + id : str + Unique identifier for the role (service-generated). + + groups : typing.Sequence[str] + Array of group IDs to remove from the role. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"roles/{encode_path_param(id)}/groups", + method="DELETE", + json={ + "groups": groups, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/types/__init__.py b/src/auth0/management/types/__init__.py index e321ebd3..8c65437e 100644 --- a/src/auth0/management/types/__init__.py +++ b/src/auth0/management/types/__init__.py @@ -2763,9 +2763,17 @@ ListOrganizationConnectionsOffsetPaginatedResponseContent, ) from .list_organization_discovery_domains_response_content import ListOrganizationDiscoveryDomainsResponseContent + from .list_organization_group_roles_response_content import ListOrganizationGroupRolesResponseContent + from .list_organization_groups_response_content import ListOrganizationGroupsResponseContent from .list_organization_invitations_offset_paginated_response_content import ( ListOrganizationInvitationsOffsetPaginatedResponseContent, ) + from .list_organization_member_effective_roles_response_content import ( + ListOrganizationMemberEffectiveRolesResponseContent, + ) + from .list_organization_member_role_source_groups_response_content import ( + ListOrganizationMemberRoleSourceGroupsResponseContent, + ) from .list_organization_member_roles_offset_paginated_response_content import ( ListOrganizationMemberRolesOffsetPaginatedResponseContent, ) @@ -2775,6 +2783,7 @@ from .list_rate_limit_policies_paginated_response_content import ListRateLimitPoliciesPaginatedResponseContent from .list_refresh_tokens_paginated_response_content import ListRefreshTokensPaginatedResponseContent from .list_resource_server_offset_paginated_response_content import ListResourceServerOffsetPaginatedResponseContent + from .list_role_groups_response_content import ListRoleGroupsResponseContent from .list_role_permissions_offset_paginated_response_content import ( ListRolePermissionsOffsetPaginatedResponseContent, ) @@ -2796,6 +2805,11 @@ from .list_user_blocks_by_identifier_response_content import ListUserBlocksByIdentifierResponseContent from .list_user_blocks_response_content import ListUserBlocksResponseContent from .list_user_connected_accounts_response_content import ListUserConnectedAccountsResponseContent + from .list_user_effective_permission_role_sources_response_content import ( + ListUserEffectivePermissionRoleSourcesResponseContent, + ) + from .list_user_effective_permissions_response_content import ListUserEffectivePermissionsResponseContent + from .list_user_effective_roles_response_content import ListUserEffectiveRolesResponseContent from .list_user_grants_offset_paginated_response_content import ListUserGrantsOffsetPaginatedResponseContent from .list_user_organizations_offset_paginated_response_content import ( ListUserOrganizationsOffsetPaginatedResponseContent, @@ -2803,6 +2817,7 @@ from .list_user_permissions_offset_paginated_response_content import ( ListUserPermissionsOffsetPaginatedResponseContent, ) + from .list_user_role_source_groups_response_content import ListUserRoleSourceGroupsResponseContent from .list_user_roles_offset_paginated_response_content import ListUserRolesOffsetPaginatedResponseContent from .list_user_sessions_paginated_response_content import ListUserSessionsPaginatedResponseContent from .list_users_offset_paginated_response_content import ListUsersOffsetPaginatedResponseContent @@ -2894,6 +2909,8 @@ from .organization_invitation_invitee import OrganizationInvitationInvitee from .organization_invitation_inviter import OrganizationInvitationInviter from .organization_member import OrganizationMember + from .organization_member_effective_role import OrganizationMemberEffectiveRole + from .organization_member_effective_role_source import OrganizationMemberEffectiveRoleSource from .organization_member_role import OrganizationMemberRole from .organization_metadata import OrganizationMetadata from .organization_usage_enum import OrganizationUsageEnum @@ -3323,6 +3340,12 @@ from .user_authentication_method_properties_enum import UserAuthenticationMethodPropertiesEnum from .user_block_identifier import UserBlockIdentifier from .user_date_schema import UserDateSchema + from .user_effective_permission_response_content import UserEffectivePermissionResponseContent + from .user_effective_permission_role_source_enum import UserEffectivePermissionRoleSourceEnum + from .user_effective_permission_role_source_response_content import UserEffectivePermissionRoleSourceResponseContent + from .user_effective_permission_source_enum import UserEffectivePermissionSourceEnum + from .user_effective_role import UserEffectiveRole + from .user_effective_role_source import UserEffectiveRoleSource from .user_enrollment_auth_method_enum import UserEnrollmentAuthMethodEnum from .user_enrollment_status_enum import UserEnrollmentStatusEnum from .user_grant import UserGrant @@ -5540,7 +5563,11 @@ "ListOrganizationClientGrantsOffsetPaginatedResponseContent": ".list_organization_client_grants_offset_paginated_response_content", "ListOrganizationConnectionsOffsetPaginatedResponseContent": ".list_organization_connections_offset_paginated_response_content", "ListOrganizationDiscoveryDomainsResponseContent": ".list_organization_discovery_domains_response_content", + "ListOrganizationGroupRolesResponseContent": ".list_organization_group_roles_response_content", + "ListOrganizationGroupsResponseContent": ".list_organization_groups_response_content", "ListOrganizationInvitationsOffsetPaginatedResponseContent": ".list_organization_invitations_offset_paginated_response_content", + "ListOrganizationMemberEffectiveRolesResponseContent": ".list_organization_member_effective_roles_response_content", + "ListOrganizationMemberRoleSourceGroupsResponseContent": ".list_organization_member_role_source_groups_response_content", "ListOrganizationMemberRolesOffsetPaginatedResponseContent": ".list_organization_member_roles_offset_paginated_response_content", "ListOrganizationMembersPaginatedResponseContent": ".list_organization_members_paginated_response_content", "ListOrganizationsPaginatedResponseContent": ".list_organizations_paginated_response_content", @@ -5548,6 +5575,7 @@ "ListRateLimitPoliciesPaginatedResponseContent": ".list_rate_limit_policies_paginated_response_content", "ListRefreshTokensPaginatedResponseContent": ".list_refresh_tokens_paginated_response_content", "ListResourceServerOffsetPaginatedResponseContent": ".list_resource_server_offset_paginated_response_content", + "ListRoleGroupsResponseContent": ".list_role_groups_response_content", "ListRolePermissionsOffsetPaginatedResponseContent": ".list_role_permissions_offset_paginated_response_content", "ListRoleUsersPaginatedResponseContent": ".list_role_users_paginated_response_content", "ListRolesOffsetPaginatedResponseContent": ".list_roles_offset_paginated_response_content", @@ -5563,9 +5591,13 @@ "ListUserBlocksByIdentifierResponseContent": ".list_user_blocks_by_identifier_response_content", "ListUserBlocksResponseContent": ".list_user_blocks_response_content", "ListUserConnectedAccountsResponseContent": ".list_user_connected_accounts_response_content", + "ListUserEffectivePermissionRoleSourcesResponseContent": ".list_user_effective_permission_role_sources_response_content", + "ListUserEffectivePermissionsResponseContent": ".list_user_effective_permissions_response_content", + "ListUserEffectiveRolesResponseContent": ".list_user_effective_roles_response_content", "ListUserGrantsOffsetPaginatedResponseContent": ".list_user_grants_offset_paginated_response_content", "ListUserOrganizationsOffsetPaginatedResponseContent": ".list_user_organizations_offset_paginated_response_content", "ListUserPermissionsOffsetPaginatedResponseContent": ".list_user_permissions_offset_paginated_response_content", + "ListUserRoleSourceGroupsResponseContent": ".list_user_role_source_groups_response_content", "ListUserRolesOffsetPaginatedResponseContent": ".list_user_roles_offset_paginated_response_content", "ListUserSessionsPaginatedResponseContent": ".list_user_sessions_paginated_response_content", "ListUsersOffsetPaginatedResponseContent": ".list_users_offset_paginated_response_content", @@ -5655,6 +5687,8 @@ "OrganizationInvitationInvitee": ".organization_invitation_invitee", "OrganizationInvitationInviter": ".organization_invitation_inviter", "OrganizationMember": ".organization_member", + "OrganizationMemberEffectiveRole": ".organization_member_effective_role", + "OrganizationMemberEffectiveRoleSource": ".organization_member_effective_role_source", "OrganizationMemberRole": ".organization_member_role", "OrganizationMetadata": ".organization_metadata", "OrganizationUsageEnum": ".organization_usage_enum", @@ -6016,6 +6050,12 @@ "UserAuthenticationMethodPropertiesEnum": ".user_authentication_method_properties_enum", "UserBlockIdentifier": ".user_block_identifier", "UserDateSchema": ".user_date_schema", + "UserEffectivePermissionResponseContent": ".user_effective_permission_response_content", + "UserEffectivePermissionRoleSourceEnum": ".user_effective_permission_role_source_enum", + "UserEffectivePermissionRoleSourceResponseContent": ".user_effective_permission_role_source_response_content", + "UserEffectivePermissionSourceEnum": ".user_effective_permission_source_enum", + "UserEffectiveRole": ".user_effective_role", + "UserEffectiveRoleSource": ".user_effective_role_source", "UserEnrollmentAuthMethodEnum": ".user_enrollment_auth_method_enum", "UserEnrollmentStatusEnum": ".user_enrollment_status_enum", "UserGrant": ".user_grant", @@ -8257,7 +8297,11 @@ def __dir__(): "ListOrganizationClientGrantsOffsetPaginatedResponseContent", "ListOrganizationConnectionsOffsetPaginatedResponseContent", "ListOrganizationDiscoveryDomainsResponseContent", + "ListOrganizationGroupRolesResponseContent", + "ListOrganizationGroupsResponseContent", "ListOrganizationInvitationsOffsetPaginatedResponseContent", + "ListOrganizationMemberEffectiveRolesResponseContent", + "ListOrganizationMemberRoleSourceGroupsResponseContent", "ListOrganizationMemberRolesOffsetPaginatedResponseContent", "ListOrganizationMembersPaginatedResponseContent", "ListOrganizationsPaginatedResponseContent", @@ -8265,6 +8309,7 @@ def __dir__(): "ListRateLimitPoliciesPaginatedResponseContent", "ListRefreshTokensPaginatedResponseContent", "ListResourceServerOffsetPaginatedResponseContent", + "ListRoleGroupsResponseContent", "ListRolePermissionsOffsetPaginatedResponseContent", "ListRoleUsersPaginatedResponseContent", "ListRolesOffsetPaginatedResponseContent", @@ -8280,9 +8325,13 @@ def __dir__(): "ListUserBlocksByIdentifierResponseContent", "ListUserBlocksResponseContent", "ListUserConnectedAccountsResponseContent", + "ListUserEffectivePermissionRoleSourcesResponseContent", + "ListUserEffectivePermissionsResponseContent", + "ListUserEffectiveRolesResponseContent", "ListUserGrantsOffsetPaginatedResponseContent", "ListUserOrganizationsOffsetPaginatedResponseContent", "ListUserPermissionsOffsetPaginatedResponseContent", + "ListUserRoleSourceGroupsResponseContent", "ListUserRolesOffsetPaginatedResponseContent", "ListUserSessionsPaginatedResponseContent", "ListUsersOffsetPaginatedResponseContent", @@ -8372,6 +8421,8 @@ def __dir__(): "OrganizationInvitationInvitee", "OrganizationInvitationInviter", "OrganizationMember", + "OrganizationMemberEffectiveRole", + "OrganizationMemberEffectiveRoleSource", "OrganizationMemberRole", "OrganizationMetadata", "OrganizationUsageEnum", @@ -8733,6 +8784,12 @@ def __dir__(): "UserAuthenticationMethodPropertiesEnum", "UserBlockIdentifier", "UserDateSchema", + "UserEffectivePermissionResponseContent", + "UserEffectivePermissionRoleSourceEnum", + "UserEffectivePermissionRoleSourceResponseContent", + "UserEffectivePermissionSourceEnum", + "UserEffectiveRole", + "UserEffectiveRoleSource", "UserEnrollmentAuthMethodEnum", "UserEnrollmentStatusEnum", "UserGrant", diff --git a/src/auth0/management/types/list_organization_group_roles_response_content.py b/src/auth0/management/types/list_organization_group_roles_response_content.py new file mode 100644 index 00000000..5b19a848 --- /dev/null +++ b/src/auth0/management/types/list_organization_group_roles_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .role import Role + + +class ListOrganizationGroupRolesResponseContent(UniversalBaseModel): + roles: typing.List[Role] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_organization_groups_response_content.py b/src/auth0/management/types/list_organization_groups_response_content.py new file mode 100644 index 00000000..d04d7627 --- /dev/null +++ b/src/auth0/management/types/list_organization_groups_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .group import Group + + +class ListOrganizationGroupsResponseContent(UniversalBaseModel): + groups: typing.List[Group] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_organization_member_effective_roles_response_content.py b/src/auth0/management/types/list_organization_member_effective_roles_response_content.py new file mode 100644 index 00000000..0ee07d60 --- /dev/null +++ b/src/auth0/management/types/list_organization_member_effective_roles_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .organization_member_effective_role import OrganizationMemberEffectiveRole + + +class ListOrganizationMemberEffectiveRolesResponseContent(UniversalBaseModel): + roles: typing.List[OrganizationMemberEffectiveRole] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + Cursor for the next page of results + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_organization_member_role_source_groups_response_content.py b/src/auth0/management/types/list_organization_member_role_source_groups_response_content.py new file mode 100644 index 00000000..76d2c3b8 --- /dev/null +++ b/src/auth0/management/types/list_organization_member_role_source_groups_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .group import Group + + +class ListOrganizationMemberRoleSourceGroupsResponseContent(UniversalBaseModel): + groups: typing.List[Group] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_role_groups_response_content.py b/src/auth0/management/types/list_role_groups_response_content.py new file mode 100644 index 00000000..c62969a5 --- /dev/null +++ b/src/auth0/management/types/list_role_groups_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .group import Group + + +class ListRoleGroupsResponseContent(UniversalBaseModel): + groups: typing.List[Group] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_user_effective_permission_role_sources_response_content.py b/src/auth0/management/types/list_user_effective_permission_role_sources_response_content.py new file mode 100644 index 00000000..008c34ad --- /dev/null +++ b/src/auth0/management/types/list_user_effective_permission_role_sources_response_content.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .user_effective_permission_role_source_response_content import UserEffectivePermissionRoleSourceResponseContent + + +class ListUserEffectivePermissionRoleSourcesResponseContent(UniversalBaseModel): + roles: typing.List[UserEffectivePermissionRoleSourceResponseContent] = pydantic.Field() + """ + Roles with the specified permission assigned to the user, both directly and via groups. + """ + + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_user_effective_permissions_response_content.py b/src/auth0/management/types/list_user_effective_permissions_response_content.py new file mode 100644 index 00000000..1b8a01c1 --- /dev/null +++ b/src/auth0/management/types/list_user_effective_permissions_response_content.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .user_effective_permission_response_content import UserEffectivePermissionResponseContent + + +class ListUserEffectivePermissionsResponseContent(UniversalBaseModel): + permissions: typing.List[UserEffectivePermissionResponseContent] = pydantic.Field() + """ + List of permissions assigned to the user. + """ + + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_user_effective_roles_response_content.py b/src/auth0/management/types/list_user_effective_roles_response_content.py new file mode 100644 index 00000000..918cae58 --- /dev/null +++ b/src/auth0/management/types/list_user_effective_roles_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .user_effective_role import UserEffectiveRole + + +class ListUserEffectiveRolesResponseContent(UniversalBaseModel): + roles: typing.List[UserEffectiveRole] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + Cursor for the next page of results + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/list_user_role_source_groups_response_content.py b/src/auth0/management/types/list_user_role_source_groups_response_content.py new file mode 100644 index 00000000..81798967 --- /dev/null +++ b/src/auth0/management/types/list_user_role_source_groups_response_content.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .group import Group + + +class ListUserRoleSourceGroupsResponseContent(UniversalBaseModel): + groups: typing.List[Group] + next: typing.Optional[str] = pydantic.Field(default=None) + """ + A cursor to be used as the "from" query parameter for the next page of results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/oauth_scope.py b/src/auth0/management/types/oauth_scope.py index cbf45e39..46f2db01 100644 --- a/src/auth0/management/types/oauth_scope.py +++ b/src/auth0/management/types/oauth_scope.py @@ -140,9 +140,15 @@ "read:organization_discovery_domains", "update:organization_discovery_domains", "delete:organization_discovery_domains", + "create:organization_group_roles", + "read:organization_group_roles", + "delete:organization_group_roles", + "read:organization_groups", "create:organization_invitations", "read:organization_invitations", "delete:organization_invitations", + "read:organization_member_effective_roles", + "read:organization_member_role_source_groups", "create:organization_member_roles", "read:organization_member_roles", "delete:organization_member_roles", @@ -221,7 +227,11 @@ "read:user_attribute_profiles", "update:user_attribute_profiles", "delete:user_attribute_profiles", + "read:user_effective_permissions", + "read:user_effective_roles", "read:user_idp_tokens", + "read:user_permission_source_roles", + "read:user_role_source_groups", "create:user_tickets", "create:users", "read:users", diff --git a/src/auth0/management/types/organization_member_effective_role.py b/src/auth0/management/types/organization_member_effective_role.py new file mode 100644 index 00000000..b512aed4 --- /dev/null +++ b/src/auth0/management/types/organization_member_effective_role.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .organization_member_effective_role_source import OrganizationMemberEffectiveRoleSource + + +class OrganizationMemberEffectiveRole(UniversalBaseModel): + id: str = pydantic.Field() + """ + Role ID + """ + + name: str = pydantic.Field() + """ + Role name + """ + + description: str = pydantic.Field() + """ + Role description + """ + + sources: typing.List[OrganizationMemberEffectiveRoleSource] = pydantic.Field() + """ + Sources of the role assignment (direct or through group membership) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/organization_member_effective_role_source.py b/src/auth0/management/types/organization_member_effective_role_source.py new file mode 100644 index 00000000..5f08b7b7 --- /dev/null +++ b/src/auth0/management/types/organization_member_effective_role_source.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +OrganizationMemberEffectiveRoleSource = typing.Union[typing.Literal["direct", "groups"], typing.Any] diff --git a/src/auth0/management/types/user_effective_permission_response_content.py b/src/auth0/management/types/user_effective_permission_response_content.py new file mode 100644 index 00000000..043d725f --- /dev/null +++ b/src/auth0/management/types/user_effective_permission_response_content.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .user_effective_permission_source_enum import UserEffectivePermissionSourceEnum + + +class UserEffectivePermissionResponseContent(UniversalBaseModel): + resource_server_identifier: typing.Optional[str] = pydantic.Field(default=None) + """ + Resource server (API) identifier that this permission is for. + """ + + permission_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Name of this permission. + """ + + resource_server_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Resource server (API) name this permission is for. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Description of this permission. + """ + + sources: typing.Optional[typing.List[UserEffectivePermissionSourceEnum]] = pydantic.Field(default=None) + """ + List of sources where this permission is coming from. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/user_effective_permission_role_source_enum.py b/src/auth0/management/types/user_effective_permission_role_source_enum.py new file mode 100644 index 00000000..77739ce1 --- /dev/null +++ b/src/auth0/management/types/user_effective_permission_role_source_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UserEffectivePermissionRoleSourceEnum = typing.Union[typing.Literal["direct", "groups"], typing.Any] diff --git a/src/auth0/management/types/user_effective_permission_role_source_response_content.py b/src/auth0/management/types/user_effective_permission_role_source_response_content.py new file mode 100644 index 00000000..a24adfb3 --- /dev/null +++ b/src/auth0/management/types/user_effective_permission_role_source_response_content.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .user_effective_permission_role_source_enum import UserEffectivePermissionRoleSourceEnum + + +class UserEffectivePermissionRoleSourceResponseContent(UniversalBaseModel): + id: typing.Optional[str] = pydantic.Field(default=None) + """ + ID for this role. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + Name of this role. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Description of this role. + """ + + sources: typing.Optional[typing.List[UserEffectivePermissionRoleSourceEnum]] = pydantic.Field(default=None) + """ + List of sources where this role is coming from. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/user_effective_permission_source_enum.py b/src/auth0/management/types/user_effective_permission_source_enum.py new file mode 100644 index 00000000..e6e2a0ff --- /dev/null +++ b/src/auth0/management/types/user_effective_permission_source_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UserEffectivePermissionSourceEnum = typing.Union[typing.Literal["direct", "roles"], typing.Any] diff --git a/src/auth0/management/types/user_effective_role.py b/src/auth0/management/types/user_effective_role.py new file mode 100644 index 00000000..200c4834 --- /dev/null +++ b/src/auth0/management/types/user_effective_role.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .user_effective_role_source import UserEffectiveRoleSource + + +class UserEffectiveRole(UniversalBaseModel): + id: str = pydantic.Field() + """ + Role ID + """ + + name: str = pydantic.Field() + """ + Role name + """ + + description: str = pydantic.Field() + """ + Role description + """ + + sources: typing.List[UserEffectiveRoleSource] = pydantic.Field() + """ + Sources of the role assignment (direct or through group membership) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/auth0/management/types/user_effective_role_source.py b/src/auth0/management/types/user_effective_role_source.py new file mode 100644 index 00000000..48dcd602 --- /dev/null +++ b/src/auth0/management/types/user_effective_role_source.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UserEffectiveRoleSource = typing.Union[typing.Literal["direct", "groups"], typing.Any] diff --git a/src/auth0/management/users/__init__.py b/src/auth0/management/users/__init__.py index e8dfda44..4f606d21 100644 --- a/src/auth0/management/users/__init__.py +++ b/src/auth0/management/users/__init__.py @@ -10,6 +10,8 @@ authentication_methods, authenticators, connected_accounts, + effective_permissions, + effective_roles, enrollments, federated_connections_tokensets, groups, @@ -27,6 +29,8 @@ "authentication_methods": ".authentication_methods", "authenticators": ".authenticators", "connected_accounts": ".connected_accounts", + "effective_permissions": ".effective_permissions", + "effective_roles": ".effective_roles", "enrollments": ".enrollments", "federated_connections_tokensets": ".federated_connections_tokensets", "groups": ".groups", @@ -67,6 +71,8 @@ def __dir__(): "authentication_methods", "authenticators", "connected_accounts", + "effective_permissions", + "effective_roles", "enrollments", "federated_connections_tokensets", "groups", diff --git a/src/auth0/management/users/client.py b/src/auth0/management/users/client.py index 597bf26c..c9d5259a 100644 --- a/src/auth0/management/users/client.py +++ b/src/auth0/management/users/client.py @@ -22,6 +22,8 @@ from .authentication_methods.client import AsyncAuthenticationMethodsClient, AuthenticationMethodsClient from .authenticators.client import AsyncAuthenticatorsClient, AuthenticatorsClient from .connected_accounts.client import AsyncConnectedAccountsClient, ConnectedAccountsClient + from .effective_permissions.client import AsyncEffectivePermissionsClient, EffectivePermissionsClient + from .effective_roles.client import AsyncEffectiveRolesClient, EffectiveRolesClient from .enrollments.client import AsyncEnrollmentsClient, EnrollmentsClient from .federated_connections_tokensets.client import ( AsyncFederatedConnectionsTokensetsClient, @@ -48,6 +50,8 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._authentication_methods: typing.Optional[AuthenticationMethodsClient] = None self._authenticators: typing.Optional[AuthenticatorsClient] = None self._connected_accounts: typing.Optional[ConnectedAccountsClient] = None + self._effective_permissions: typing.Optional[EffectivePermissionsClient] = None + self._effective_roles: typing.Optional[EffectiveRolesClient] = None self._enrollments: typing.Optional[EnrollmentsClient] = None self._federated_connections_tokensets: typing.Optional[FederatedConnectionsTokensetsClient] = None self._groups: typing.Optional[GroupsClient] = None @@ -756,6 +760,22 @@ def connected_accounts(self): self._connected_accounts = ConnectedAccountsClient(client_wrapper=self._client_wrapper) return self._connected_accounts + @property + def effective_permissions(self): + if self._effective_permissions is None: + from .effective_permissions.client import EffectivePermissionsClient # noqa: E402 + + self._effective_permissions = EffectivePermissionsClient(client_wrapper=self._client_wrapper) + return self._effective_permissions + + @property + def effective_roles(self): + if self._effective_roles is None: + from .effective_roles.client import EffectiveRolesClient # noqa: E402 + + self._effective_roles = EffectiveRolesClient(client_wrapper=self._client_wrapper) + return self._effective_roles + @property def enrollments(self): if self._enrollments is None: @@ -862,6 +882,8 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._authentication_methods: typing.Optional[AsyncAuthenticationMethodsClient] = None self._authenticators: typing.Optional[AsyncAuthenticatorsClient] = None self._connected_accounts: typing.Optional[AsyncConnectedAccountsClient] = None + self._effective_permissions: typing.Optional[AsyncEffectivePermissionsClient] = None + self._effective_roles: typing.Optional[AsyncEffectiveRolesClient] = None self._enrollments: typing.Optional[AsyncEnrollmentsClient] = None self._federated_connections_tokensets: typing.Optional[AsyncFederatedConnectionsTokensetsClient] = None self._groups: typing.Optional[AsyncGroupsClient] = None @@ -1635,6 +1657,22 @@ def connected_accounts(self): self._connected_accounts = AsyncConnectedAccountsClient(client_wrapper=self._client_wrapper) return self._connected_accounts + @property + def effective_permissions(self): + if self._effective_permissions is None: + from .effective_permissions.client import AsyncEffectivePermissionsClient # noqa: E402 + + self._effective_permissions = AsyncEffectivePermissionsClient(client_wrapper=self._client_wrapper) + return self._effective_permissions + + @property + def effective_roles(self): + if self._effective_roles is None: + from .effective_roles.client import AsyncEffectiveRolesClient # noqa: E402 + + self._effective_roles = AsyncEffectiveRolesClient(client_wrapper=self._client_wrapper) + return self._effective_roles + @property def enrollments(self): if self._enrollments is None: diff --git a/src/auth0/management/users/effective_permissions/__init__.py b/src/auth0/management/users/effective_permissions/__init__.py new file mode 100644 index 00000000..504a42f7 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import sources +_dynamic_imports: typing.Dict[str, str] = {"sources": ".sources"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["sources"] diff --git a/src/auth0/management/users/effective_permissions/client.py b/src/auth0/management/users/effective_permissions/client.py new file mode 100644 index 00000000..8a1154d2 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/client.py @@ -0,0 +1,198 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.pagination import AsyncPager, SyncPager +from ...core.request_options import RequestOptions +from ...types.list_user_effective_permissions_response_content import ListUserEffectivePermissionsResponseContent +from ...types.user_effective_permission_response_content import UserEffectivePermissionResponseContent +from .raw_client import AsyncRawEffectivePermissionsClient, RawEffectivePermissionsClient + +if typing.TYPE_CHECKING: + from .sources.client import AsyncSourcesClient, SourcesClient + + +class EffectivePermissionsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawEffectivePermissionsClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._sources: typing.Optional[SourcesClient] = None + + @property + def with_raw_response(self) -> RawEffectivePermissionsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawEffectivePermissionsClient + """ + return self._raw_client + + def list( + self, + id: str, + *, + resource_server_identifier: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent]: + """ + Returns the list of effective permissions for a user, taking into account permissions granted directly to the user, as well as those inherited through roles and group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent] + User's effective permissions successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.users.effective_permissions.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list( + id, + resource_server_identifier=resource_server_identifier, + from_=from_, + take=take, + request_options=request_options, + ) + + @property + def sources(self): + if self._sources is None: + from .sources.client import SourcesClient # noqa: E402 + + self._sources = SourcesClient(client_wrapper=self._client_wrapper) + return self._sources + + +class AsyncEffectivePermissionsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawEffectivePermissionsClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._sources: typing.Optional[AsyncSourcesClient] = None + + @property + def with_raw_response(self) -> AsyncRawEffectivePermissionsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawEffectivePermissionsClient + """ + return self._raw_client + + async def list( + self, + id: str, + *, + resource_server_identifier: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent]: + """ + Returns the list of effective permissions for a user, taking into account permissions granted directly to the user, as well as those inherited through roles and group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent] + User's effective permissions successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.users.effective_permissions.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list( + id, + resource_server_identifier=resource_server_identifier, + from_=from_, + take=take, + request_options=request_options, + ) + + @property + def sources(self): + if self._sources is None: + from .sources.client import AsyncSourcesClient # noqa: E402 + + self._sources = AsyncSourcesClient(client_wrapper=self._client_wrapper) + return self._sources diff --git a/src/auth0/management/users/effective_permissions/raw_client.py b/src/auth0/management/users/effective_permissions/raw_client.py new file mode 100644 index 00000000..3fcc8169 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/raw_client.py @@ -0,0 +1,289 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import encode_path_param +from ...core.pagination import AsyncPager, SyncPager +from ...core.parse_error import ParsingError +from ...core.pydantic_utilities import parse_obj_as +from ...core.request_options import RequestOptions +from ...errors.bad_request_error import BadRequestError +from ...errors.forbidden_error import ForbiddenError +from ...errors.not_found_error import NotFoundError +from ...errors.too_many_requests_error import TooManyRequestsError +from ...errors.unauthorized_error import UnauthorizedError +from ...types.list_user_effective_permissions_response_content import ListUserEffectivePermissionsResponseContent +from ...types.user_effective_permission_response_content import UserEffectivePermissionResponseContent +from pydantic import ValidationError + + +class RawEffectivePermissionsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + *, + resource_server_identifier: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent]: + """ + Returns the list of effective permissions for a user, taking into account permissions granted directly to the user, as well as those inherited through roles and group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent] + User's effective permissions successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-permissions", + method="GET", + params={ + "from": from_, + "take": take, + "resource_server_identifier": resource_server_identifier, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserEffectivePermissionsResponseContent, + parse_obj_as( + type_=ListUserEffectivePermissionsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.permissions + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + resource_server_identifier=resource_server_identifier, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawEffectivePermissionsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + *, + resource_server_identifier: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent]: + """ + Returns the list of effective permissions for a user, taking into account permissions granted directly to the user, as well as those inherited through roles and group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[UserEffectivePermissionResponseContent, ListUserEffectivePermissionsResponseContent] + User's effective permissions successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-permissions", + method="GET", + params={ + "from": from_, + "take": take, + "resource_server_identifier": resource_server_identifier, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserEffectivePermissionsResponseContent, + parse_obj_as( + type_=ListUserEffectivePermissionsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.permissions + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + resource_server_identifier=resource_server_identifier, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/users/effective_permissions/sources/__init__.py b/src/auth0/management/users/effective_permissions/sources/__init__.py new file mode 100644 index 00000000..686aa754 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/sources/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import roles +_dynamic_imports: typing.Dict[str, str] = {"roles": ".roles"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["roles"] diff --git a/src/auth0/management/users/effective_permissions/sources/client.py b/src/auth0/management/users/effective_permissions/sources/client.py new file mode 100644 index 00000000..95383a21 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/sources/client.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .raw_client import AsyncRawSourcesClient, RawSourcesClient + +if typing.TYPE_CHECKING: + from .roles.client import AsyncRolesClient, RolesClient + + +class SourcesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawSourcesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._roles: typing.Optional[RolesClient] = None + + @property + def with_raw_response(self) -> RawSourcesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawSourcesClient + """ + return self._raw_client + + @property + def roles(self): + if self._roles is None: + from .roles.client import RolesClient # noqa: E402 + + self._roles = RolesClient(client_wrapper=self._client_wrapper) + return self._roles + + +class AsyncSourcesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawSourcesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._roles: typing.Optional[AsyncRolesClient] = None + + @property + def with_raw_response(self) -> AsyncRawSourcesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawSourcesClient + """ + return self._raw_client + + @property + def roles(self): + if self._roles is None: + from .roles.client import AsyncRolesClient # noqa: E402 + + self._roles = AsyncRolesClient(client_wrapper=self._client_wrapper) + return self._roles diff --git a/src/auth0/management/users/effective_permissions/sources/raw_client.py b/src/auth0/management/users/effective_permissions/sources/raw_client.py new file mode 100644 index 00000000..e5f566c6 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/sources/raw_client.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper + + +class RawSourcesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + +class AsyncRawSourcesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper diff --git a/src/auth0/management/users/effective_permissions/sources/roles/__init__.py b/src/auth0/management/users/effective_permissions/sources/roles/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/sources/roles/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/users/effective_permissions/sources/roles/client.py b/src/auth0/management/users/effective_permissions/sources/roles/client.py new file mode 100644 index 00000000..6183b9b4 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/sources/roles/client.py @@ -0,0 +1,193 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.pagination import AsyncPager, SyncPager +from .....core.request_options import RequestOptions +from .....types.list_user_effective_permission_role_sources_response_content import ( + ListUserEffectivePermissionRoleSourcesResponseContent, +) +from .....types.user_effective_permission_role_source_response_content import ( + UserEffectivePermissionRoleSourceResponseContent, +) +from .raw_client import AsyncRawRolesClient, RawRolesClient + + +class RolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawRolesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawRolesClient + """ + return self._raw_client + + def list( + self, + id: str, + *, + resource_server_identifier: str, + permission_name: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[ + UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent + ]: + """ + Lists the roles which grant the user a given permission, including roles assigned directly to the user and those inherited through group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + permission_name : str + Name of this permission + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent] + User's effective permission role sources successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.users.effective_permissions.sources.roles.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + permission_name="permission_name", + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list( + id, + resource_server_identifier=resource_server_identifier, + permission_name=permission_name, + from_=from_, + take=take, + request_options=request_options, + ) + + +class AsyncRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawRolesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawRolesClient + """ + return self._raw_client + + async def list( + self, + id: str, + *, + resource_server_identifier: str, + permission_name: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[ + UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent + ]: + """ + Lists the roles which grant the user a given permission, including roles assigned directly to the user and those inherited through group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + permission_name : str + Name of this permission + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent] + User's effective permission role sources successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.users.effective_permissions.sources.roles.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + permission_name="permission_name", + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list( + id, + resource_server_identifier=resource_server_identifier, + permission_name=permission_name, + from_=from_, + take=take, + request_options=request_options, + ) diff --git a/src/auth0/management/users/effective_permissions/sources/roles/raw_client.py b/src/auth0/management/users/effective_permissions/sources/roles/raw_client.py new file mode 100644 index 00000000..542c18d0 --- /dev/null +++ b/src/auth0/management/users/effective_permissions/sources/roles/raw_client.py @@ -0,0 +1,309 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import encode_path_param +from .....core.pagination import AsyncPager, SyncPager +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....errors.bad_request_error import BadRequestError +from .....errors.forbidden_error import ForbiddenError +from .....errors.not_found_error import NotFoundError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....types.list_user_effective_permission_role_sources_response_content import ( + ListUserEffectivePermissionRoleSourcesResponseContent, +) +from .....types.user_effective_permission_role_source_response_content import ( + UserEffectivePermissionRoleSourceResponseContent, +) +from pydantic import ValidationError + + +class RawRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + *, + resource_server_identifier: str, + permission_name: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[ + UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent + ]: + """ + Lists the roles which grant the user a given permission, including roles assigned directly to the user and those inherited through group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + permission_name : str + Name of this permission + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent] + User's effective permission role sources successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-permissions/sources/effective-roles", + method="GET", + params={ + "from": from_, + "take": take, + "resource_server_identifier": resource_server_identifier, + "permission_name": permission_name, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserEffectivePermissionRoleSourcesResponseContent, + parse_obj_as( + type_=ListUserEffectivePermissionRoleSourcesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + resource_server_identifier=resource_server_identifier, + permission_name=permission_name, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + *, + resource_server_identifier: str, + permission_name: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[ + UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent + ]: + """ + Lists the roles which grant the user a given permission, including roles assigned directly to the user and those inherited through group memberships. + + Parameters + ---------- + id : str + ID of the user to retrieve the permissions for. + + resource_server_identifier : str + The identifier of the resource server for which to calculate user permissions. + + permission_name : str + Name of this permission + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[UserEffectivePermissionRoleSourceResponseContent, ListUserEffectivePermissionRoleSourcesResponseContent] + User's effective permission role sources successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-permissions/sources/effective-roles", + method="GET", + params={ + "from": from_, + "take": take, + "resource_server_identifier": resource_server_identifier, + "permission_name": permission_name, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserEffectivePermissionRoleSourcesResponseContent, + parse_obj_as( + type_=ListUserEffectivePermissionRoleSourcesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + resource_server_identifier=resource_server_identifier, + permission_name=permission_name, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/users/effective_roles/__init__.py b/src/auth0/management/users/effective_roles/__init__.py new file mode 100644 index 00000000..504a42f7 --- /dev/null +++ b/src/auth0/management/users/effective_roles/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import sources +_dynamic_imports: typing.Dict[str, str] = {"sources": ".sources"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["sources"] diff --git a/src/auth0/management/users/effective_roles/client.py b/src/auth0/management/users/effective_roles/client.py new file mode 100644 index 00000000..87b46f3f --- /dev/null +++ b/src/auth0/management/users/effective_roles/client.py @@ -0,0 +1,176 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.pagination import AsyncPager, SyncPager +from ...core.request_options import RequestOptions +from ...types.list_user_effective_roles_response_content import ListUserEffectiveRolesResponseContent +from ...types.user_effective_role import UserEffectiveRole +from .raw_client import AsyncRawEffectiveRolesClient, RawEffectiveRolesClient + +if typing.TYPE_CHECKING: + from .sources.client import AsyncSourcesClient, SourcesClient + + +class EffectiveRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawEffectiveRolesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._sources: typing.Optional[SourcesClient] = None + + @property + def with_raw_response(self) -> RawEffectiveRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawEffectiveRolesClient + """ + return self._raw_client + + def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent]: + """ + Retrieve detailed list of effective roles for a user, including roles assigned directly and through group memberships. + + Parameters + ---------- + id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent] + User's effective roles successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.users.effective_roles.list( + id="id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list(id, from_=from_, take=take, request_options=request_options) + + @property + def sources(self): + if self._sources is None: + from .sources.client import SourcesClient # noqa: E402 + + self._sources = SourcesClient(client_wrapper=self._client_wrapper) + return self._sources + + +class AsyncEffectiveRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawEffectiveRolesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._sources: typing.Optional[AsyncSourcesClient] = None + + @property + def with_raw_response(self) -> AsyncRawEffectiveRolesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawEffectiveRolesClient + """ + return self._raw_client + + async def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent]: + """ + Retrieve detailed list of effective roles for a user, including roles assigned directly and through group memberships. + + Parameters + ---------- + id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent] + User's effective roles successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.users.effective_roles.list( + id="id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list(id, from_=from_, take=take, request_options=request_options) + + @property + def sources(self): + if self._sources is None: + from .sources.client import AsyncSourcesClient # noqa: E402 + + self._sources = AsyncSourcesClient(client_wrapper=self._client_wrapper) + return self._sources diff --git a/src/auth0/management/users/effective_roles/raw_client.py b/src/auth0/management/users/effective_roles/raw_client.py new file mode 100644 index 00000000..2afa42c1 --- /dev/null +++ b/src/auth0/management/users/effective_roles/raw_client.py @@ -0,0 +1,254 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import encode_path_param +from ...core.pagination import AsyncPager, SyncPager +from ...core.parse_error import ParsingError +from ...core.pydantic_utilities import parse_obj_as +from ...core.request_options import RequestOptions +from ...errors.bad_request_error import BadRequestError +from ...errors.forbidden_error import ForbiddenError +from ...errors.too_many_requests_error import TooManyRequestsError +from ...errors.unauthorized_error import UnauthorizedError +from ...types.list_user_effective_roles_response_content import ListUserEffectiveRolesResponseContent +from ...types.user_effective_role import UserEffectiveRole +from pydantic import ValidationError + + +class RawEffectiveRolesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent]: + """ + Retrieve detailed list of effective roles for a user, including roles assigned directly and through group memberships. + + Parameters + ---------- + id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent] + User's effective roles successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserEffectiveRolesResponseContent, + parse_obj_as( + type_=ListUserEffectiveRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawEffectiveRolesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + *, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent]: + """ + Retrieve detailed list of effective roles for a user, including roles assigned directly and through group memberships. + + Parameters + ---------- + id : str + ID of the user to list effective roles for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[UserEffectiveRole, ListUserEffectiveRolesResponseContent] + User's effective roles successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-roles", + method="GET", + params={ + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserEffectiveRolesResponseContent, + parse_obj_as( + type_=ListUserEffectiveRolesResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.roles + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/users/effective_roles/sources/__init__.py b/src/auth0/management/users/effective_roles/sources/__init__.py new file mode 100644 index 00000000..345b2fe1 --- /dev/null +++ b/src/auth0/management/users/effective_roles/sources/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import groups +_dynamic_imports: typing.Dict[str, str] = {"groups": ".groups"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["groups"] diff --git a/src/auth0/management/users/effective_roles/sources/client.py b/src/auth0/management/users/effective_roles/sources/client.py new file mode 100644 index 00000000..e50a1e13 --- /dev/null +++ b/src/auth0/management/users/effective_roles/sources/client.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .raw_client import AsyncRawSourcesClient, RawSourcesClient + +if typing.TYPE_CHECKING: + from .groups.client import AsyncGroupsClient, GroupsClient + + +class SourcesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawSourcesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._groups: typing.Optional[GroupsClient] = None + + @property + def with_raw_response(self) -> RawSourcesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawSourcesClient + """ + return self._raw_client + + @property + def groups(self): + if self._groups is None: + from .groups.client import GroupsClient # noqa: E402 + + self._groups = GroupsClient(client_wrapper=self._client_wrapper) + return self._groups + + +class AsyncSourcesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawSourcesClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._groups: typing.Optional[AsyncGroupsClient] = None + + @property + def with_raw_response(self) -> AsyncRawSourcesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawSourcesClient + """ + return self._raw_client + + @property + def groups(self): + if self._groups is None: + from .groups.client import AsyncGroupsClient # noqa: E402 + + self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) + return self._groups diff --git a/src/auth0/management/users/effective_roles/sources/groups/__init__.py b/src/auth0/management/users/effective_roles/sources/groups/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/auth0/management/users/effective_roles/sources/groups/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/auth0/management/users/effective_roles/sources/groups/client.py b/src/auth0/management/users/effective_roles/sources/groups/client.py new file mode 100644 index 00000000..673aa49e --- /dev/null +++ b/src/auth0/management/users/effective_roles/sources/groups/client.py @@ -0,0 +1,161 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.pagination import AsyncPager, SyncPager +from .....core.request_options import RequestOptions +from .....types.group import Group +from .....types.list_user_role_source_groups_response_content import ListUserRoleSourceGroupsResponseContent +from .raw_client import AsyncRawGroupsClient, RawGroupsClient + + +class GroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGroupsClient + """ + return self._raw_client + + def list( + self, + id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListUserRoleSourceGroupsResponseContent]: + """ + Lists the groups that grant a user a specific role. + + Parameters + ---------- + id : str + ID of the user to list role source groups for. + + role_id : str + ID of the role to get source groups for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListUserRoleSourceGroupsResponseContent] + User's role source groups successfully retrieved. + + Examples + -------- + from auth0 import Auth0 + + client = Auth0( + token="YOUR_TOKEN", + ) + response = client.users.effective_roles.sources.groups.list( + id="id", + role_id="role_id", + from_="from", + take=1, + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.list(id, role_id=role_id, from_=from_, take=take, request_options=request_options) + + +class AsyncGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGroupsClient + """ + return self._raw_client + + async def list( + self, + id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListUserRoleSourceGroupsResponseContent]: + """ + Lists the groups that grant a user a specific role. + + Parameters + ---------- + id : str + ID of the user to list role source groups for. + + role_id : str + ID of the role to get source groups for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListUserRoleSourceGroupsResponseContent] + User's role source groups successfully retrieved. + + Examples + -------- + import asyncio + + from auth0 import AsyncAuth0 + + client = AsyncAuth0( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + response = await client.users.effective_roles.sources.groups.list( + id="id", + role_id="role_id", + from_="from", + take=1, + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.list(id, role_id=role_id, from_=from_, take=take, request_options=request_options) diff --git a/src/auth0/management/users/effective_roles/sources/groups/raw_client.py b/src/auth0/management/users/effective_roles/sources/groups/raw_client.py new file mode 100644 index 00000000..9689408e --- /dev/null +++ b/src/auth0/management/users/effective_roles/sources/groups/raw_client.py @@ -0,0 +1,266 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import encode_path_param +from .....core.pagination import AsyncPager, SyncPager +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....errors.bad_request_error import BadRequestError +from .....errors.forbidden_error import ForbiddenError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....types.group import Group +from .....types.list_user_role_source_groups_response_content import ListUserRoleSourceGroupsResponseContent +from pydantic import ValidationError + + +class RawGroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[Group, ListUserRoleSourceGroupsResponseContent]: + """ + Lists the groups that grant a user a specific role. + + Parameters + ---------- + id : str + ID of the user to list role source groups for. + + role_id : str + ID of the role to get source groups for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[Group, ListUserRoleSourceGroupsResponseContent] + User's role source groups successfully retrieved. + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-roles/sources/groups", + method="GET", + params={ + "role_id": role_id, + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserRoleSourceGroupsResponseContent, + parse_obj_as( + type_=ListUserRoleSourceGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + id, + role_id=role_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + id: str, + *, + role_id: str, + from_: typing.Optional[str] = None, + take: typing.Optional[int] = 50, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[Group, ListUserRoleSourceGroupsResponseContent]: + """ + Lists the groups that grant a user a specific role. + + Parameters + ---------- + id : str + ID of the user to list role source groups for. + + role_id : str + ID of the role to get source groups for. + + from_ : typing.Optional[str] + Optional Id from which to start selection. + + take : typing.Optional[int] + Number of results per page. Defaults to 50. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[Group, ListUserRoleSourceGroupsResponseContent] + User's role source groups successfully retrieved. + """ + _response = await self._client_wrapper.httpx_client.request( + f"users/{encode_path_param(id)}/effective-roles/sources/groups", + method="GET", + params={ + "role_id": role_id, + "from": from_, + "take": take, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListUserRoleSourceGroupsResponseContent, + parse_obj_as( + type_=ListUserRoleSourceGroupsResponseContent, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.groups + _parsed_next = _parsed_response.next + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.list( + id, + role_id=role_id, + from_=_parsed_next, + take=take, + request_options=request_options, + ) + + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/auth0/management/users/effective_roles/sources/raw_client.py b/src/auth0/management/users/effective_roles/sources/raw_client.py new file mode 100644 index 00000000..e5f566c6 --- /dev/null +++ b/src/auth0/management/users/effective_roles/sources/raw_client.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper + + +class RawSourcesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + +class AsyncRawSourcesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper diff --git a/tests/wire/test_organizations_groups.py b/tests/wire/test_organizations_groups.py new file mode 100644 index 00000000..2929e974 --- /dev/null +++ b/tests/wire/test_organizations_groups.py @@ -0,0 +1,13 @@ +from .conftest import get_client, verify_request_count + + +def test_organizations_groups_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "organizations.groups.list_.0" + client = get_client(test_id) + client.organizations.groups.list( + organization_id="organization_id", + from_="from", + take=1, + ) + verify_request_count(test_id, "GET", "/organizations/organization_id/groups", {"from": "from", "take": "1"}, 1) diff --git a/tests/wire/test_organizations_groups_roles.py b/tests/wire/test_organizations_groups_roles.py new file mode 100644 index 00000000..e496c80f --- /dev/null +++ b/tests/wire/test_organizations_groups_roles.py @@ -0,0 +1,40 @@ +from .conftest import get_client, verify_request_count + + +def test_organizations_groups_roles_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "organizations.groups.roles.list_.0" + client = get_client(test_id) + client.organizations.groups.roles.list( + organization_id="organization_id", + group_id="group_id", + from_="from", + take=1, + ) + verify_request_count( + test_id, "GET", "/organizations/organization_id/groups/group_id/roles", {"from": "from", "take": "1"}, 1 + ) + + +def test_organizations_groups_roles_create() -> None: + """Test create endpoint with WireMock""" + test_id = "organizations.groups.roles.create.0" + client = get_client(test_id) + client.organizations.groups.roles.create( + organization_id="organization_id", + group_id="group_id", + roles=["roles"], + ) + verify_request_count(test_id, "POST", "/organizations/organization_id/groups/group_id/roles", None, 1) + + +def test_organizations_groups_roles_delete() -> None: + """Test delete endpoint with WireMock""" + test_id = "organizations.groups.roles.delete.0" + client = get_client(test_id) + client.organizations.groups.roles.delete( + organization_id="organization_id", + group_id="group_id", + roles=["roles"], + ) + verify_request_count(test_id, "DELETE", "/organizations/organization_id/groups/group_id/roles", None, 1) diff --git a/tests/wire/test_organizations_members_effectiveRoles.py b/tests/wire/test_organizations_members_effectiveRoles.py new file mode 100644 index 00000000..db9c8871 --- /dev/null +++ b/tests/wire/test_organizations_members_effectiveRoles.py @@ -0,0 +1,16 @@ +from .conftest import get_client, verify_request_count + + +def test_organizations_members_effectiveRoles_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "organizations.members.effective_roles.list_.0" + client = get_client(test_id) + client.organizations.members.effective_roles.list( + id="id", + user_id="user_id", + from_="from", + take=1, + ) + verify_request_count( + test_id, "GET", "/organizations/id/members/user_id/effective-roles", {"from": "from", "take": "1"}, 1 + ) diff --git a/tests/wire/test_organizations_members_effectiveRoles_sources_groups.py b/tests/wire/test_organizations_members_effectiveRoles_sources_groups.py new file mode 100644 index 00000000..92c4fb71 --- /dev/null +++ b/tests/wire/test_organizations_members_effectiveRoles_sources_groups.py @@ -0,0 +1,21 @@ +from .conftest import get_client, verify_request_count + + +def test_organizations_members_effectiveRoles_sources_groups_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "organizations.members.effective_roles.sources.groups.list_.0" + client = get_client(test_id) + client.organizations.members.effective_roles.sources.groups.list( + id="id", + user_id="user_id", + from_="from", + take=1, + role_id="role_id", + ) + verify_request_count( + test_id, + "GET", + "/organizations/id/members/user_id/effective-roles/sources/groups", + {"from": "from", "take": "1", "role_id": "role_id"}, + 1, + ) diff --git a/tests/wire/test_roles_groups.py b/tests/wire/test_roles_groups.py new file mode 100644 index 00000000..bcfcee01 --- /dev/null +++ b/tests/wire/test_roles_groups.py @@ -0,0 +1,35 @@ +from .conftest import get_client, verify_request_count + + +def test_roles_groups_get() -> None: + """Test get endpoint with WireMock""" + test_id = "roles.groups.get.0" + client = get_client(test_id) + client.roles.groups.get( + id="id", + from_="from", + take=1, + ) + verify_request_count(test_id, "GET", "/roles/id/groups", {"from": "from", "take": "1"}, 1) + + +def test_roles_groups_create() -> None: + """Test create endpoint with WireMock""" + test_id = "roles.groups.create.0" + client = get_client(test_id) + client.roles.groups.create( + id="id", + groups=["groups"], + ) + verify_request_count(test_id, "POST", "/roles/id/groups", None, 1) + + +def test_roles_groups_delete() -> None: + """Test delete endpoint with WireMock""" + test_id = "roles.groups.delete.0" + client = get_client(test_id) + client.roles.groups.delete( + id="id", + groups=["groups"], + ) + verify_request_count(test_id, "DELETE", "/roles/id/groups", None, 1) diff --git a/tests/wire/test_users_effectivePermissions.py b/tests/wire/test_users_effectivePermissions.py new file mode 100644 index 00000000..8ef11df5 --- /dev/null +++ b/tests/wire/test_users_effectivePermissions.py @@ -0,0 +1,20 @@ +from .conftest import get_client, verify_request_count + + +def test_users_effectivePermissions_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "users.effective_permissions.list_.0" + client = get_client(test_id) + client.users.effective_permissions.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + ) + verify_request_count( + test_id, + "GET", + "/users/id/effective-permissions", + {"from": "from", "take": "1", "resource_server_identifier": "resource_server_identifier"}, + 1, + ) diff --git a/tests/wire/test_users_effectivePermissions_sources_roles.py b/tests/wire/test_users_effectivePermissions_sources_roles.py new file mode 100644 index 00000000..ac420b37 --- /dev/null +++ b/tests/wire/test_users_effectivePermissions_sources_roles.py @@ -0,0 +1,26 @@ +from .conftest import get_client, verify_request_count + + +def test_users_effectivePermissions_sources_roles_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "users.effective_permissions.sources.roles.list_.0" + client = get_client(test_id) + client.users.effective_permissions.sources.roles.list( + id="id", + from_="from", + take=1, + resource_server_identifier="resource_server_identifier", + permission_name="permission_name", + ) + verify_request_count( + test_id, + "GET", + "/users/id/effective-permissions/sources/effective-roles", + { + "from": "from", + "take": "1", + "resource_server_identifier": "resource_server_identifier", + "permission_name": "permission_name", + }, + 1, + ) diff --git a/tests/wire/test_users_effectiveRoles.py b/tests/wire/test_users_effectiveRoles.py new file mode 100644 index 00000000..e1fb6379 --- /dev/null +++ b/tests/wire/test_users_effectiveRoles.py @@ -0,0 +1,13 @@ +from .conftest import get_client, verify_request_count + + +def test_users_effectiveRoles_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "users.effective_roles.list_.0" + client = get_client(test_id) + client.users.effective_roles.list( + id="id", + from_="from", + take=1, + ) + verify_request_count(test_id, "GET", "/users/id/effective-roles", {"from": "from", "take": "1"}, 1) diff --git a/tests/wire/test_users_effectiveRoles_sources_groups.py b/tests/wire/test_users_effectiveRoles_sources_groups.py new file mode 100644 index 00000000..755599ff --- /dev/null +++ b/tests/wire/test_users_effectiveRoles_sources_groups.py @@ -0,0 +1,20 @@ +from .conftest import get_client, verify_request_count + + +def test_users_effectiveRoles_sources_groups_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "users.effective_roles.sources.groups.list_.0" + client = get_client(test_id) + client.users.effective_roles.sources.groups.list( + id="id", + role_id="role_id", + from_="from", + take=1, + ) + verify_request_count( + test_id, + "GET", + "/users/id/effective-roles/sources/groups", + {"role_id": "role_id", "from": "from", "take": "1"}, + 1, + ) diff --git a/wiremock/wiremock-mappings.json b/wiremock/wiremock-mappings.json index dc52a4eb..e8ce3de0 100644 --- a/wiremock/wiremock-mappings.json +++ b/wiremock/wiremock-mappings.json @@ -13001,6 +13001,222 @@ } } }, + { + "id": "c4da691c-ffe9-48de-9227-f8ce48855cda", + "name": "Lists the groups that are assigned to the organization. - default", + "request": { + "urlPathTemplate": "/organizations/{organization_id}/groups", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "organization_id": { + "equalTo": "organization_id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"groups\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"external_id\": \"external_id\",\n \"connection_id\": \"connection_id\",\n \"tenant_name\": \"tenant_name\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "c4da691c-ffe9-48de-9227-f8ce48855cda", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "25999a58-81d7-488c-9a80-5967b5f1e6ae", + "name": "Lists the roles assigned to a group in the context of an organization. - default", + "request": { + "urlPathTemplate": "/organizations/{organization_id}/groups/{group_id}/roles", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "organization_id": { + "equalTo": "organization_id" + }, + "group_id": { + "equalTo": "group_id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"roles\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "25999a58-81d7-488c-9a80-5967b5f1e6ae", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "5f66622b-f0dc-4cab-8cb9-c5dd4f868ef6", + "name": "Assigns roles to a group in an organization context. - default", + "request": { + "urlPathTemplate": "/organizations/{organization_id}/groups/{group_id}/roles", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "organization_id": { + "equalTo": "organization_id" + }, + "group_id": { + "equalTo": "group_id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "5f66622b-f0dc-4cab-8cb9-c5dd4f868ef6", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "f3a06a3e-a047-4c64-ad21-52cf3943c125", + "name": "Removes roles assigned to a group in an organization context. - default", + "request": { + "urlPathTemplate": "/organizations/{organization_id}/groups/{group_id}/roles", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "organization_id": { + "equalTo": "organization_id" + }, + "group_id": { + "equalTo": "group_id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "f3a06a3e-a047-4c64-ad21-52cf3943c125", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "5927f1a7-b918-4d94-b4f5-66e48d50773d", + "name": "List organization member effective roles. - default", + "request": { + "urlPathTemplate": "/organizations/{id}/members/{user_id}/effective-roles", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + }, + "user_id": { + "equalTo": "user_id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"roles\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"sources\": [\n \"direct\"\n ]\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "5927f1a7-b918-4d94-b4f5-66e48d50773d", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "2c099b94-dfed-4bf8-b370-25ceade844b1", "name": "Get user roles assigned to an Organization member - default", @@ -13129,6 +13345,56 @@ } } }, + { + "id": "730f9e46-6a5a-455f-94ce-2b274a2c74f9", + "name": "List organization member role group sources. - default", + "request": { + "urlPathTemplate": "/organizations/{id}/members/{user_id}/effective-roles/sources/groups", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + }, + "user_id": { + "equalTo": "user_id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + }, + "role_id": { + "equalTo": "role_id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"groups\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"external_id\": \"external_id\",\n \"connection_id\": \"connection_id\",\n \"tenant_name\": \"tenant_name\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "730f9e46-6a5a-455f-94ce-2b274a2c74f9", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "f02cb8dc-cee0-4470-b69b-596e4d0653f9", "name": "Get render setting configurations for all screens - default", @@ -13572,6 +13838,122 @@ } } }, + { + "id": "25c64235-59ca-41e7-a5b7-7431295591d4", + "name": "Get a role's groups - default", + "request": { + "urlPathTemplate": "/roles/{id}/groups", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"groups\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"external_id\": \"external_id\",\n \"connection_id\": \"connection_id\",\n \"tenant_name\": \"tenant_name\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "25c64235-59ca-41e7-a5b7-7431295591d4", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "1b19f0e9-b733-4cf4-99e5-7536043c1d8b", + "name": "Assign groups to a role - default", + "request": { + "urlPathTemplate": "/roles/{id}/groups", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "1b19f0e9-b733-4cf4-99e5-7536043c1d8b", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "e7233c54-c20d-4709-baea-47148eb72066", + "name": "Remove groups from a role - default", + "request": { + "urlPathTemplate": "/roles/{id}/groups", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "e7233c54-c20d-4709-baea-47148eb72066", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "bf10686c-2651-4040-8299-93e4bbc9834d", "name": "Get permissions granted by role - default", @@ -14353,6 +14735,97 @@ } } }, + { + "id": "275c2e74-3552-46aa-bd98-e7945f609962", + "name": "Lists the permissions assigned to a user directly or through roles or groups. - default", + "request": { + "urlPathTemplate": "/users/{id}/effective-permissions", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + }, + "resource_server_identifier": { + "equalTo": "resource_server_identifier" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"permissions\": [\n {\n \"resource_server_identifier\": \"resource_server_identifier\",\n \"permission_name\": \"permission_name\",\n \"resource_server_name\": \"resource_server_name\",\n \"description\": \"description\",\n \"sources\": [\n \"direct\"\n ]\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "275c2e74-3552-46aa-bd98-e7945f609962", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "0a1118c7-87a0-4e15-a026-c26ae69fc942", + "name": "Lists the roles for a user with sources: directly assigned or through group membership. - default", + "request": { + "urlPathTemplate": "/users/{id}/effective-roles", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"roles\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"sources\": [\n \"direct\"\n ]\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "0a1118c7-87a0-4e15-a026-c26ae69fc942", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "b12cc020-548e-4219-bf5f-7896e003fa92", "name": "Get the First Confirmed Multi-factor Authentication (MFA) Enrollment - default", @@ -15198,6 +15671,103 @@ } } }, + { + "id": "bb869da8-6539-45f5-82b2-96dba9672d2b", + "name": "Lists the roles which grant the user a given permission (whether directly or through groups). - default", + "request": { + "urlPathTemplate": "/users/{id}/effective-permissions/sources/effective-roles", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + }, + "resource_server_identifier": { + "equalTo": "resource_server_identifier" + }, + "permission_name": { + "equalTo": "permission_name" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"roles\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"sources\": [\n \"direct\"\n ]\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "bb869da8-6539-45f5-82b2-96dba9672d2b", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "6d4f49b1-9731-4224-af65-0673be60a0c1", + "name": "Get a user's role source groups - default", + "request": { + "urlPathTemplate": "/users/{id}/effective-roles/sources/groups", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + }, + "queryParameters": { + "role_id": { + "equalTo": "role_id" + }, + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"groups\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"external_id\": \"external_id\",\n \"connection_id\": \"connection_id\",\n \"tenant_name\": \"tenant_name\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "6d4f49b1-9731-4224-af65-0673be60a0c1", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "e370a2a2-5b39-4ba1-ac2b-4b5be9ef38f2", "name": "List verifiable credential templates for a tenant. - default", @@ -15379,6 +15949,6 @@ } ], "meta": { - "total": 414 + "total": 427 } } \ No newline at end of file From 32d0dce99c86a3d5a91a7803797e35f1eedb7848 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 15:18:36 +0000 Subject: [PATCH 5/5] [fern-replay] Applied customizations Patches applied (2): - patch-4894603d: chore: Restore custom wiring in management/__init__.py - patch-7271f157: Revert wrapper file to preserve Auth0 telemetry customizations --- .fern/replay.lock | 261 +++++++++++++++++++- src/auth0/management/__init__.py | 11 + src/auth0/management/core/client_wrapper.py | 22 +- 3 files changed, 275 insertions(+), 19 deletions(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 8cba18a2..fe66dab4 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -31,22 +31,28 @@ generations: cli_version: unknown generator_versions: fernapi/fern-python-sdk: 5.12.10 -current_generation: a6b05e768329fac22fd4da6fbe711006e23029f8 + - commit_sha: 15127abb8ab299907925c41e89122d50dbe138d5 + tree_hash: 30ecce30237e3fb542f943c41737d2126c647e77 + timestamp: 2026-05-26T15:18:29.669Z + cli_version: unknown + generator_versions: + fernapi/fern-python-sdk: 5.14.3 +current_generation: 15127abb8ab299907925c41e89122d50dbe138d5 patches: - id: patch-4894603d - content_hash: sha256:09d8cd6f9f5c2aee1d72f67be687d870c9145144262b28f81513c64915494584 + content_hash: sha256:2c5caf4188d616dc6d0a85d59c179069d6a73a541af915ce9b8c3340c97afd31 original_commit: 4894603d03409962bc60a34712de8abffe919e2c original_message: "chore: Restore custom wiring in management/__init__.py" original_author: Kunal Dawar - base_generation: a6b05e768329fac22fd4da6fbe711006e23029f8 + base_generation: 15127abb8ab299907925c41e89122d50dbe138d5 files: - src/auth0/management/__init__.py patch_content: | diff --git a/src/auth0/management/__init__.py b/src/auth0/management/__init__.py - index 71b8e8c..ecd00f0 100644 + index a48ff10..46ef694 100644 --- a/src/auth0/management/__init__.py +++ b/src/auth0/management/__init__.py - @@ -2766,6 +2766,8 @@ if typing.TYPE_CHECKING: + @@ -2783,6 +2783,8 @@ if typing.TYPE_CHECKING: from .environment import Auth0Environment from .event_streams import EventStreamsCreateRequest from .version import __version__ @@ -55,7 +61,7 @@ patches: _dynamic_imports: typing.Dict[str, str] = { "Action": ".types", "ActionBase": ".types", - @@ -2826,6 +2828,8 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -2843,6 +2845,8 @@ _dynamic_imports: typing.Dict[str, str] = { "AssociateOrganizationClientGrantResponseContent": ".types", "AsyncApprovalNotificationsChannelsEnum": ".types", "AsyncAuth0": ".client", @@ -64,7 +70,7 @@ patches: "AttackProtectionCaptchaArkoseResponseContent": ".types", "AttackProtectionCaptchaAuthChallengeRequest": ".types", "AttackProtectionCaptchaAuthChallengeResponseContent": ".types", - @@ -3785,6 +3789,7 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -3802,6 +3806,7 @@ _dynamic_imports: typing.Dict[str, str] = { "CredentialDeviceTypeEnum": ".types", "CredentialId": ".types", "CustomDomain": ".types", @@ -72,7 +78,7 @@ patches: "CustomDomainCustomClientIpHeader": ".types", "CustomDomainCustomClientIpHeaderEnum": ".types", "CustomDomainProvisioningTypeEnum": ".types", - @@ -5047,6 +5052,7 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -5073,6 +5078,7 @@ _dynamic_imports: typing.Dict[str, str] = { "LogStreamSumoEnum": ".types", "LogStreamSumoResponseSchema": ".types", "LogStreamSumoSink": ".types", @@ -80,7 +86,7 @@ patches: "MdlPresentationProperties": ".types", "MdlPresentationRequest": ".types", "MdlPresentationRequestProperties": ".types", - @@ -5290,6 +5296,7 @@ _dynamic_imports: typing.Dict[str, str] = { + @@ -5318,6 +5324,7 @@ _dynamic_imports: typing.Dict[str, str] = { "TokenQuota": ".types", "TokenQuotaClientCredentials": ".types", "TokenQuotaConfiguration": ".types", @@ -88,7 +94,7 @@ patches: "TooManyRequestsError": ".errors", "TooManyRequestsSchema": ".types", "TooManyRequestsSchemaError": ".types", - @@ -5607,6 +5614,8 @@ __all__ = [ + @@ -5641,6 +5648,8 @@ __all__ = [ "AssociateOrganizationClientGrantResponseContent", "AsyncApprovalNotificationsChannelsEnum", "AsyncAuth0", @@ -97,7 +103,7 @@ patches: "AttackProtectionCaptchaArkoseResponseContent", "AttackProtectionCaptchaAuthChallengeRequest", "AttackProtectionCaptchaAuthChallengeResponseContent", - @@ -7828,6 +7837,7 @@ __all__ = [ + @@ -7871,6 +7880,7 @@ __all__ = [ "LogStreamSumoEnum", "LogStreamSumoResponseSchema", "LogStreamSumoSink", @@ -105,7 +111,7 @@ patches: "MdlPresentationProperties", "MdlPresentationRequest", "MdlPresentationRequestProperties", - @@ -8068,6 +8078,7 @@ __all__ = [ + @@ -8113,6 +8123,7 @@ __all__ = [ "TestEventDataContent", "TokenExchangeProfileResponseContent", "TokenExchangeProfileTypeEnum", @@ -2315,7 +2321,11 @@ patches: ListOrganizationClientGrantsOffsetPaginatedResponseContent, ListOrganizationConnectionsOffsetPaginatedResponseContent, ListOrganizationDiscoveryDomainsResponseContent, + ListOrganizationGroupRolesResponseContent, + ListOrganizationGroupsResponseContent, ListOrganizationInvitationsOffsetPaginatedResponseContent, + ListOrganizationMemberEffectiveRolesResponseContent, + ListOrganizationMemberRoleSourceGroupsResponseContent, ListOrganizationMemberRolesOffsetPaginatedResponseContent, ListOrganizationMembersPaginatedResponseContent, ListOrganizationsPaginatedResponseContent, @@ -2323,6 +2333,7 @@ patches: ListRateLimitPoliciesPaginatedResponseContent, ListRefreshTokensPaginatedResponseContent, ListResourceServerOffsetPaginatedResponseContent, + ListRoleGroupsResponseContent, ListRolePermissionsOffsetPaginatedResponseContent, ListRoleUsersPaginatedResponseContent, ListRolesOffsetPaginatedResponseContent, @@ -2338,9 +2349,13 @@ patches: ListUserBlocksByIdentifierResponseContent, ListUserBlocksResponseContent, ListUserConnectedAccountsResponseContent, + ListUserEffectivePermissionRoleSourcesResponseContent, + ListUserEffectivePermissionsResponseContent, + ListUserEffectiveRolesResponseContent, ListUserGrantsOffsetPaginatedResponseContent, ListUserOrganizationsOffsetPaginatedResponseContent, ListUserPermissionsOffsetPaginatedResponseContent, + ListUserRoleSourceGroupsResponseContent, ListUserRolesOffsetPaginatedResponseContent, ListUserSessionsPaginatedResponseContent, ListUsersOffsetPaginatedResponseContent, @@ -2430,6 +2445,8 @@ patches: OrganizationInvitationInvitee, OrganizationInvitationInviter, OrganizationMember, + OrganizationMemberEffectiveRole, + OrganizationMemberEffectiveRoleSource, OrganizationMemberRole, OrganizationMetadata, OrganizationUsageEnum, @@ -2791,6 +2808,12 @@ patches: UserAuthenticationMethodPropertiesEnum, UserBlockIdentifier, UserDateSchema, + UserEffectivePermissionResponseContent, + UserEffectivePermissionRoleSourceEnum, + UserEffectivePermissionRoleSourceResponseContent, + UserEffectivePermissionSourceEnum, + UserEffectiveRole, + UserEffectiveRoleSource, UserEnrollmentAuthMethodEnum, UserEnrollmentStatusEnum, UserGrant, @@ -5092,7 +5115,11 @@ patches: "ListOrganizationClientGrantsOffsetPaginatedResponseContent": ".types", "ListOrganizationConnectionsOffsetPaginatedResponseContent": ".types", "ListOrganizationDiscoveryDomainsResponseContent": ".types", + "ListOrganizationGroupRolesResponseContent": ".types", + "ListOrganizationGroupsResponseContent": ".types", "ListOrganizationInvitationsOffsetPaginatedResponseContent": ".types", + "ListOrganizationMemberEffectiveRolesResponseContent": ".types", + "ListOrganizationMemberRoleSourceGroupsResponseContent": ".types", "ListOrganizationMemberRolesOffsetPaginatedResponseContent": ".types", "ListOrganizationMembersPaginatedResponseContent": ".types", "ListOrganizationsPaginatedResponseContent": ".types", @@ -5100,6 +5127,7 @@ patches: "ListRateLimitPoliciesPaginatedResponseContent": ".types", "ListRefreshTokensPaginatedResponseContent": ".types", "ListResourceServerOffsetPaginatedResponseContent": ".types", + "ListRoleGroupsResponseContent": ".types", "ListRolePermissionsOffsetPaginatedResponseContent": ".types", "ListRoleUsersPaginatedResponseContent": ".types", "ListRolesOffsetPaginatedResponseContent": ".types", @@ -5115,9 +5143,13 @@ patches: "ListUserBlocksByIdentifierResponseContent": ".types", "ListUserBlocksResponseContent": ".types", "ListUserConnectedAccountsResponseContent": ".types", + "ListUserEffectivePermissionRoleSourcesResponseContent": ".types", + "ListUserEffectivePermissionsResponseContent": ".types", + "ListUserEffectiveRolesResponseContent": ".types", "ListUserGrantsOffsetPaginatedResponseContent": ".types", "ListUserOrganizationsOffsetPaginatedResponseContent": ".types", "ListUserPermissionsOffsetPaginatedResponseContent": ".types", + "ListUserRoleSourceGroupsResponseContent": ".types", "ListUserRolesOffsetPaginatedResponseContent": ".types", "ListUserSessionsPaginatedResponseContent": ".types", "ListUsersOffsetPaginatedResponseContent": ".types", @@ -5209,6 +5241,8 @@ patches: "OrganizationInvitationInvitee": ".types", "OrganizationInvitationInviter": ".types", "OrganizationMember": ".types", + "OrganizationMemberEffectiveRole": ".types", + "OrganizationMemberEffectiveRoleSource": ".types", "OrganizationMemberRole": ".types", "OrganizationMetadata": ".types", "OrganizationUsageEnum": ".types", @@ -5576,6 +5610,12 @@ patches: "UserAuthenticationMethodPropertiesEnum": ".types", "UserBlockIdentifier": ".types", "UserDateSchema": ".types", + "UserEffectivePermissionResponseContent": ".types", + "UserEffectivePermissionRoleSourceEnum": ".types", + "UserEffectivePermissionRoleSourceResponseContent": ".types", + "UserEffectivePermissionSourceEnum": ".types", + "UserEffectiveRole": ".types", + "UserEffectiveRoleSource": ".types", "UserEnrollmentAuthMethodEnum": ".types", "UserEnrollmentStatusEnum": ".types", "UserGrant": ".types", @@ -7877,7 +7917,11 @@ patches: "ListOrganizationClientGrantsOffsetPaginatedResponseContent", "ListOrganizationConnectionsOffsetPaginatedResponseContent", "ListOrganizationDiscoveryDomainsResponseContent", + "ListOrganizationGroupRolesResponseContent", + "ListOrganizationGroupsResponseContent", "ListOrganizationInvitationsOffsetPaginatedResponseContent", + "ListOrganizationMemberEffectiveRolesResponseContent", + "ListOrganizationMemberRoleSourceGroupsResponseContent", "ListOrganizationMemberRolesOffsetPaginatedResponseContent", "ListOrganizationMembersPaginatedResponseContent", "ListOrganizationsPaginatedResponseContent", @@ -7885,6 +7929,7 @@ patches: "ListRateLimitPoliciesPaginatedResponseContent", "ListRefreshTokensPaginatedResponseContent", "ListResourceServerOffsetPaginatedResponseContent", + "ListRoleGroupsResponseContent", "ListRolePermissionsOffsetPaginatedResponseContent", "ListRoleUsersPaginatedResponseContent", "ListRolesOffsetPaginatedResponseContent", @@ -7900,9 +7945,13 @@ patches: "ListUserBlocksByIdentifierResponseContent", "ListUserBlocksResponseContent", "ListUserConnectedAccountsResponseContent", + "ListUserEffectivePermissionRoleSourcesResponseContent", + "ListUserEffectivePermissionsResponseContent", + "ListUserEffectiveRolesResponseContent", "ListUserGrantsOffsetPaginatedResponseContent", "ListUserOrganizationsOffsetPaginatedResponseContent", "ListUserPermissionsOffsetPaginatedResponseContent", + "ListUserRoleSourceGroupsResponseContent", "ListUserRolesOffsetPaginatedResponseContent", "ListUserSessionsPaginatedResponseContent", "ListUsersOffsetPaginatedResponseContent", @@ -7994,6 +8043,8 @@ patches: "OrganizationInvitationInvitee", "OrganizationInvitationInviter", "OrganizationMember", + "OrganizationMemberEffectiveRole", + "OrganizationMemberEffectiveRoleSource", "OrganizationMemberRole", "OrganizationMetadata", "OrganizationUsageEnum", @@ -8361,6 +8412,12 @@ patches: "UserAuthenticationMethodPropertiesEnum", "UserBlockIdentifier", "UserDateSchema", + "UserEffectivePermissionResponseContent", + "UserEffectivePermissionRoleSourceEnum", + "UserEffectivePermissionRoleSourceResponseContent", + "UserEffectivePermissionSourceEnum", + "UserEffectiveRole", + "UserEffectiveRoleSource", "UserEnrollmentAuthMethodEnum", "UserEnrollmentStatusEnum", "UserGrant", @@ -8434,3 +8491,183 @@ patches: "verifiable_credentials", ] user_owned: true + - id: patch-7271f157 + content_hash: sha256:e5f014e7f8c379a0b7c3815222df83e115d542c5c9685b2a9d16285e1d18f800 + original_commit: 7271f15759cfb545c9ef82b5a4f519ffe0a89db2 + original_message: Revert wrapper file to preserve Auth0 telemetry customizations + original_author: Kunal Dawar + base_generation: 15127abb8ab299907925c41e89122d50dbe138d5 + files: + - src/auth0/management/core/client_wrapper.py + patch_content: | + diff --git a/src/auth0/management/core/client_wrapper.py b/src/auth0/management/core/client_wrapper.py + index cad2e31..60ebc5a 100644 + --- a/src/auth0/management/core/client_wrapper.py + +++ b/src/auth0/management/core/client_wrapper.py + @@ -1,6 +1,11 @@ + # This file was auto-generated by Fern from our API Definition. + +# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning + + +import base64 + +import platform + +import sys + import typing + +from json import dumps + + import httpx + from .http_client import AsyncHttpClient, HttpClient + @@ -26,15 +31,18 @@ class BaseClientWrapper: + self._logging = logging + + def get_headers(self) -> typing.Dict[str, str]: + - import platform + + py_version = platform.python_version() + + version = sys.modules["auth0"].__version__ + + + + auth0_client = dumps({ + + "name": "auth0-python", + + "version": version, + + "env": {"python": py_version} + + }).encode("utf-8") + + headers: typing.Dict[str, str] = { + - "User-Agent": "auth0-python/5.5.0", + - "X-Fern-Language": "Python", + - "X-Fern-Runtime": f"python/{platform.python_version()}", + - "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", + - "X-Fern-SDK-Name": "auth0-python", + - "X-Fern-SDK-Version": "5.5.0", + + "User-Agent": f"Python/{py_version}", + + "Auth0-Client": base64.b64encode(auth0_client).decode(), + **(self.get_custom_headers() or {}), + } + headers["Authorization"] = f"Bearer {self._get_token()}" + theirs_snapshot: + src/auth0/management/core/client_wrapper.py: | + # This file was auto-generated by Fern from our API Definition. + # Modified by Auth0 to use Auth0 telemetry format with dynamic versioning + + import base64 + import platform + import sys + import typing + from json import dumps + + import httpx + from .http_client import AsyncHttpClient, HttpClient + from .logging import LogConfig, Logger + + + class BaseClientWrapper: + def __init__( + self, + *, + token: typing.Union[str, typing.Callable[[], str]], + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + max_retries: int = 2, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + ): + self._token = token + self._headers = headers + self._base_url = base_url + self._timeout = timeout + self._max_retries = max_retries + self._logging = logging + + def get_headers(self) -> typing.Dict[str, str]: + py_version = platform.python_version() + version = sys.modules["auth0"].__version__ + + auth0_client = dumps({ + "name": "auth0-python", + "version": version, + "env": {"python": py_version} + }).encode("utf-8") + + headers: typing.Dict[str, str] = { + "User-Agent": f"Python/{py_version}", + "Auth0-Client": base64.b64encode(auth0_client).decode(), + **(self.get_custom_headers() or {}), + } + headers["Authorization"] = f"Bearer {self._get_token()}" + return headers + + def _get_token(self) -> str: + if isinstance(self._token, str): + return self._token + else: + return self._token() + + def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: + return self._headers + + def get_base_url(self) -> str: + return self._base_url + + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + + def get_max_retries(self) -> int: + return self._max_retries + + + class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Union[str, typing.Callable[[], str]], + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + max_retries: int = 2, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + httpx_client: httpx.Client, + ): + super().__init__( + token=token, headers=headers, base_url=base_url, timeout=timeout, max_retries=max_retries, logging=logging + ) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + base_max_retries=self.get_max_retries(), + logging_config=self._logging, + ) + + + class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Union[str, typing.Callable[[], str]], + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + max_retries: int = 2, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__( + token=token, headers=headers, base_url=base_url, timeout=timeout, max_retries=max_retries, logging=logging + ) + self._async_token = async_token + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + base_max_retries=self.get_max_retries(), + async_base_headers=self.async_get_headers, + logging_config=self._logging, + ) + + async def async_get_headers(self) -> typing.Dict[str, str]: + headers = self.get_headers() + if self._async_token is not None: + token = await self._async_token() + headers["Authorization"] = f"Bearer {token}" + return headers diff --git a/src/auth0/management/__init__.py b/src/auth0/management/__init__.py index a48ff10f..46ef6942 100644 --- a/src/auth0/management/__init__.py +++ b/src/auth0/management/__init__.py @@ -2783,6 +2783,8 @@ from .environment import Auth0Environment from .event_streams import EventStreamsCreateRequest from .version import __version__ + from .management_client import AsyncManagementClient, CustomDomainHeader, ManagementClient + from .token_provider import AsyncTokenProvider, TokenProvider _dynamic_imports: typing.Dict[str, str] = { "Action": ".types", "ActionBase": ".types", @@ -2843,6 +2845,8 @@ "AssociateOrganizationClientGrantResponseContent": ".types", "AsyncApprovalNotificationsChannelsEnum": ".types", "AsyncAuth0": ".client", + "AsyncManagementClient": ".management_client", + "AsyncTokenProvider": ".token_provider", "AttackProtectionCaptchaArkoseResponseContent": ".types", "AttackProtectionCaptchaAuthChallengeRequest": ".types", "AttackProtectionCaptchaAuthChallengeResponseContent": ".types", @@ -3802,6 +3806,7 @@ "CredentialDeviceTypeEnum": ".types", "CredentialId": ".types", "CustomDomain": ".types", + "CustomDomainHeader": ".management_client", "CustomDomainCustomClientIpHeader": ".types", "CustomDomainCustomClientIpHeaderEnum": ".types", "CustomDomainProvisioningTypeEnum": ".types", @@ -5073,6 +5078,7 @@ "LogStreamSumoEnum": ".types", "LogStreamSumoResponseSchema": ".types", "LogStreamSumoSink": ".types", + "ManagementClient": ".management_client", "MdlPresentationProperties": ".types", "MdlPresentationRequest": ".types", "MdlPresentationRequestProperties": ".types", @@ -5318,6 +5324,7 @@ "TokenQuota": ".types", "TokenQuotaClientCredentials": ".types", "TokenQuotaConfiguration": ".types", + "TokenProvider": ".token_provider", "TooManyRequestsError": ".errors", "TooManyRequestsSchema": ".types", "TooManyRequestsSchemaError": ".types", @@ -5641,6 +5648,8 @@ def __dir__(): "AssociateOrganizationClientGrantResponseContent", "AsyncApprovalNotificationsChannelsEnum", "AsyncAuth0", + "AsyncManagementClient", + "AsyncTokenProvider", "AttackProtectionCaptchaArkoseResponseContent", "AttackProtectionCaptchaAuthChallengeRequest", "AttackProtectionCaptchaAuthChallengeResponseContent", @@ -7871,6 +7880,7 @@ def __dir__(): "LogStreamSumoEnum", "LogStreamSumoResponseSchema", "LogStreamSumoSink", + "ManagementClient", "MdlPresentationProperties", "MdlPresentationRequest", "MdlPresentationRequestProperties", @@ -8113,6 +8123,7 @@ def __dir__(): "TestEventDataContent", "TokenExchangeProfileResponseContent", "TokenExchangeProfileTypeEnum", + "TokenProvider", "TokenQuota", "TokenQuotaClientCredentials", "TokenQuotaConfiguration", diff --git a/src/auth0/management/core/client_wrapper.py b/src/auth0/management/core/client_wrapper.py index cad2e314..60ebc5a6 100644 --- a/src/auth0/management/core/client_wrapper.py +++ b/src/auth0/management/core/client_wrapper.py @@ -1,6 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning +import base64 +import platform +import sys import typing +from json import dumps import httpx from .http_client import AsyncHttpClient, HttpClient @@ -26,15 +31,18 @@ def __init__( self._logging = logging def get_headers(self) -> typing.Dict[str, str]: - import platform + py_version = platform.python_version() + version = sys.modules["auth0"].__version__ + + auth0_client = dumps({ + "name": "auth0-python", + "version": version, + "env": {"python": py_version} + }).encode("utf-8") headers: typing.Dict[str, str] = { - "User-Agent": "auth0-python/5.5.0", - "X-Fern-Language": "Python", - "X-Fern-Runtime": f"python/{platform.python_version()}", - "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", - "X-Fern-SDK-Name": "auth0-python", - "X-Fern-SDK-Version": "5.5.0", + "User-Agent": f"Python/{py_version}", + "Auth0-Client": base64.b64encode(auth0_client).decode(), **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Bearer {self._get_token()}"