Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* [#734](https://github.com/workos/workos-python/pull/734) feat(generated): regenerate from spec

**Features**
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Added model `UserRoleAssignmentSourceGroup`
* Added `group` to `UserRoleAssignmentSource`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
13ba15b32754d2d635b7799ab779867df2b611d6
6f037208ce812063908f97744b4aaf4fdf570351
2 changes: 2 additions & 0 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"src/workos/authorization/models/user_role_assignment.py",
"src/workos/authorization/models/user_role_assignment_resource.py",
"src/workos/authorization/models/user_role_assignment_source.py",
"src/workos/authorization/models/user_role_assignment_source_group.py",
"src/workos/client_api/__init__.py",
"src/workos/client_api/_resource.py",
"src/workos/client_api/models/__init__.py",
Expand Down Expand Up @@ -1496,6 +1497,7 @@
"tests/fixtures/user_role_assignment.json",
"tests/fixtures/user_role_assignment_resource.json",
"tests/fixtures/user_role_assignment_source.json",
"tests/fixtures/user_role_assignment_source_group.json",
"tests/fixtures/user_sessions_impersonator.json",
"tests/fixtures/user_sessions_list_item.json",
"tests/fixtures/user_updated.json",
Expand Down
3 changes: 3 additions & 0 deletions src/workos/authorization/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@
from .user_role_assignment_source import (
UserRoleAssignmentSource as UserRoleAssignmentSource,
)
from .user_role_assignment_source_group import (
UserRoleAssignmentSourceGroup as UserRoleAssignmentSourceGroup,
)
15 changes: 14 additions & 1 deletion src/workos/authorization/models/user_role_assignment_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

from dataclasses import dataclass
from enum import Enum
from typing import Any
from typing import Any, cast

from workos._types import _raise_deserialize_error
from workos.common.models.user_role_assignment_source_type import (
UserRoleAssignmentSourceType,
)

from .user_role_assignment_source_group import UserRoleAssignmentSourceGroup


@dataclass(slots=True)
class UserRoleAssignmentSource:
Expand All @@ -20,6 +22,8 @@ class UserRoleAssignmentSource:
"""Whether the role was assigned directly or derived from a group."""
group_role_assignment_id: str | None
"""The ID of the group role assignment the role was derived from, or null if direct."""
group: UserRoleAssignmentSourceGroup | None
"""The group the role was derived from, or null if direct."""

@classmethod
def from_dict(cls, data: dict[str, Any]) -> UserRoleAssignmentSource:
Expand All @@ -28,6 +32,11 @@ def from_dict(cls, data: dict[str, Any]) -> UserRoleAssignmentSource:
return cls(
type=UserRoleAssignmentSourceType(data["type"]),
group_role_assignment_id=data["group_role_assignment_id"],
group=UserRoleAssignmentSourceGroup.from_dict(
cast(dict[str, Any], _v_group)
)
if (_v_group := data["group"]) is not None
else None,
)
except (KeyError, ValueError) as e:
_raise_deserialize_error("UserRoleAssignmentSource", e)
Expand All @@ -40,4 +49,8 @@ def to_dict(self) -> dict[str, Any]:
result["group_role_assignment_id"] = self.group_role_assignment_id
else:
result["group_role_assignment_id"] = None
if self.group is not None:
result["group"] = self.group.to_dict()
else:
result["group"] = None
return result
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file is auto-generated by oagen. Do not edit.

from typing import TypeAlias

from workos.common.models.actor import Actor

UserRoleAssignmentSourceGroup: TypeAlias = Actor
2 changes: 1 addition & 1 deletion src/workos/common/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is auto-generated by oagen. Do not edit.

from .models import *
from .models import (
AccessTokenAgentRegistrationCredentialIssuedDataDetail as AccessTokenAgentRegistrationCredentialIssuedDataDetail,
)
Expand Down Expand Up @@ -221,7 +222,6 @@
from .models import ConnectedAccount as ConnectedAccount
from .models import ConnectedAccountAuthMethod as ConnectedAccountAuthMethod
from .models import ConnectedAccountConnectionRole as ConnectedAccountConnectionRole
from .models import ConnectedAccountInput as ConnectedAccountInput
from .models import ConnectedAccountInputState as ConnectedAccountInputState
from .models import ConnectedAccountState as ConnectedAccountState
from .models import ConnectionActivated as ConnectionActivated
Expand Down
Loading
Loading