Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 249 additions & 12 deletions .fern/replay.lock

Large diffs are not rendered by default.

1,398 changes: 1,326 additions & 72 deletions reference.md

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions src/auth0/management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2198,14 +2198,19 @@
ListOrganizationClientGrantsOffsetPaginatedResponseContent,
ListOrganizationConnectionsOffsetPaginatedResponseContent,
ListOrganizationDiscoveryDomainsResponseContent,
ListOrganizationGroupRolesResponseContent,
ListOrganizationGroupsResponseContent,
ListOrganizationInvitationsOffsetPaginatedResponseContent,
ListOrganizationMemberEffectiveRolesResponseContent,
ListOrganizationMemberRoleSourceGroupsResponseContent,
ListOrganizationMemberRolesOffsetPaginatedResponseContent,
ListOrganizationMembersPaginatedResponseContent,
ListOrganizationsPaginatedResponseContent,
ListPhoneTemplatesResponseContent,
ListRateLimitPoliciesPaginatedResponseContent,
ListRefreshTokensPaginatedResponseContent,
ListResourceServerOffsetPaginatedResponseContent,
ListRoleGroupsResponseContent,
ListRolePermissionsOffsetPaginatedResponseContent,
ListRoleUsersPaginatedResponseContent,
ListRolesOffsetPaginatedResponseContent,
Expand All @@ -2221,9 +2226,13 @@
ListUserBlocksByIdentifierResponseContent,
ListUserBlocksResponseContent,
ListUserConnectedAccountsResponseContent,
ListUserEffectivePermissionRoleSourcesResponseContent,
ListUserEffectivePermissionsResponseContent,
ListUserEffectiveRolesResponseContent,
ListUserGrantsOffsetPaginatedResponseContent,
ListUserOrganizationsOffsetPaginatedResponseContent,
ListUserPermissionsOffsetPaginatedResponseContent,
ListUserRoleSourceGroupsResponseContent,
ListUserRolesOffsetPaginatedResponseContent,
ListUserSessionsPaginatedResponseContent,
ListUsersOffsetPaginatedResponseContent,
Expand Down Expand Up @@ -2313,6 +2322,8 @@
OrganizationInvitationInvitee,
OrganizationInvitationInviter,
OrganizationMember,
OrganizationMemberEffectiveRole,
OrganizationMemberEffectiveRoleSource,
OrganizationMemberRole,
OrganizationMetadata,
OrganizationUsageEnum,
Expand Down Expand Up @@ -2674,6 +2685,12 @@
UserAuthenticationMethodPropertiesEnum,
UserBlockIdentifier,
UserDateSchema,
UserEffectivePermissionResponseContent,
UserEffectivePermissionRoleSourceEnum,
UserEffectivePermissionRoleSourceResponseContent,
UserEffectivePermissionSourceEnum,
UserEffectiveRole,
UserEffectiveRoleSource,
UserEnrollmentAuthMethodEnum,
UserEnrollmentStatusEnum,
UserGrant,
Expand Down Expand Up @@ -4975,14 +4992,19 @@
"ListOrganizationClientGrantsOffsetPaginatedResponseContent": ".types",
"ListOrganizationConnectionsOffsetPaginatedResponseContent": ".types",
"ListOrganizationDiscoveryDomainsResponseContent": ".types",
"ListOrganizationGroupRolesResponseContent": ".types",
"ListOrganizationGroupsResponseContent": ".types",
"ListOrganizationInvitationsOffsetPaginatedResponseContent": ".types",
"ListOrganizationMemberEffectiveRolesResponseContent": ".types",
"ListOrganizationMemberRoleSourceGroupsResponseContent": ".types",
"ListOrganizationMemberRolesOffsetPaginatedResponseContent": ".types",
"ListOrganizationMembersPaginatedResponseContent": ".types",
"ListOrganizationsPaginatedResponseContent": ".types",
"ListPhoneTemplatesResponseContent": ".types",
"ListRateLimitPoliciesPaginatedResponseContent": ".types",
"ListRefreshTokensPaginatedResponseContent": ".types",
"ListResourceServerOffsetPaginatedResponseContent": ".types",
"ListRoleGroupsResponseContent": ".types",
"ListRolePermissionsOffsetPaginatedResponseContent": ".types",
"ListRoleUsersPaginatedResponseContent": ".types",
"ListRolesOffsetPaginatedResponseContent": ".types",
Expand All @@ -4998,9 +5020,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",
Expand Down Expand Up @@ -5092,6 +5118,8 @@
"OrganizationInvitationInvitee": ".types",
"OrganizationInvitationInviter": ".types",
"OrganizationMember": ".types",
"OrganizationMemberEffectiveRole": ".types",
"OrganizationMemberEffectiveRoleSource": ".types",
"OrganizationMemberRole": ".types",
"OrganizationMetadata": ".types",
"OrganizationUsageEnum": ".types",
Expand Down Expand Up @@ -5459,6 +5487,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",
Expand Down Expand Up @@ -7760,14 +7794,19 @@ def __dir__():
"ListOrganizationClientGrantsOffsetPaginatedResponseContent",
"ListOrganizationConnectionsOffsetPaginatedResponseContent",
"ListOrganizationDiscoveryDomainsResponseContent",
"ListOrganizationGroupRolesResponseContent",
"ListOrganizationGroupsResponseContent",
"ListOrganizationInvitationsOffsetPaginatedResponseContent",
"ListOrganizationMemberEffectiveRolesResponseContent",
"ListOrganizationMemberRoleSourceGroupsResponseContent",
"ListOrganizationMemberRolesOffsetPaginatedResponseContent",
"ListOrganizationMembersPaginatedResponseContent",
"ListOrganizationsPaginatedResponseContent",
"ListPhoneTemplatesResponseContent",
"ListRateLimitPoliciesPaginatedResponseContent",
"ListRefreshTokensPaginatedResponseContent",
"ListResourceServerOffsetPaginatedResponseContent",
"ListRoleGroupsResponseContent",
"ListRolePermissionsOffsetPaginatedResponseContent",
"ListRoleUsersPaginatedResponseContent",
"ListRolesOffsetPaginatedResponseContent",
Expand All @@ -7783,9 +7822,13 @@ def __dir__():
"ListUserBlocksByIdentifierResponseContent",
"ListUserBlocksResponseContent",
"ListUserConnectedAccountsResponseContent",
"ListUserEffectivePermissionRoleSourcesResponseContent",
"ListUserEffectivePermissionsResponseContent",
"ListUserEffectiveRolesResponseContent",
"ListUserGrantsOffsetPaginatedResponseContent",
"ListUserOrganizationsOffsetPaginatedResponseContent",
"ListUserPermissionsOffsetPaginatedResponseContent",
"ListUserRoleSourceGroupsResponseContent",
"ListUserRolesOffsetPaginatedResponseContent",
"ListUserSessionsPaginatedResponseContent",
"ListUsersOffsetPaginatedResponseContent",
Expand Down Expand Up @@ -7877,6 +7920,8 @@ def __dir__():
"OrganizationInvitationInvitee",
"OrganizationInvitationInviter",
"OrganizationMember",
"OrganizationMemberEffectiveRole",
"OrganizationMemberEffectiveRoleSource",
"OrganizationMemberRole",
"OrganizationMetadata",
"OrganizationUsageEnum",
Expand Down Expand Up @@ -8244,6 +8289,12 @@ def __dir__():
"UserAuthenticationMethodPropertiesEnum",
"UserBlockIdentifier",
"UserDateSchema",
"UserEffectivePermissionResponseContent",
"UserEffectivePermissionRoleSourceEnum",
"UserEffectivePermissionRoleSourceResponseContent",
"UserEffectivePermissionSourceEnum",
"UserEffectiveRole",
"UserEffectiveRoleSource",
"UserEnrollmentAuthMethodEnum",
"UserEnrollmentStatusEnum",
"UserGrant",
Expand Down
16 changes: 14 additions & 2 deletions src/auth0/management/core/pydantic_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down Expand Up @@ -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)


Expand Down
13 changes: 11 additions & 2 deletions src/auth0/management/organizations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand All @@ -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",
]
19 changes: 19 additions & 0 deletions src/auth0/management/organizations/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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):
Expand All @@ -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:
Expand Down Expand Up @@ -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
34 changes: 34 additions & 0 deletions src/auth0/management/organizations/groups/__init__.py
Original file line number Diff line number Diff line change
@@ -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"]
Loading