Skip to content

Commit 5f6892d

Browse files
moar
1 parent ab35617 commit 5f6892d

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

src/workos/types/authorization/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@
1717
Role,
1818
RoleList,
1919
)
20-
from workos.types.authorization.role_assignment import RoleAssignment
20+
from workos.types.authorization.role_assignment import (
21+
RoleAssignment,
22+
RoleAssignmentResource,
23+
RoleAssignmentRole,
24+
)

src/workos/types/authorization/organization_membership.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ class AuthorizationOrganizationMembership(WorkOSModel):
1010
"""Representation of an Organization Membership returned by Authorization endpoints.
1111
1212
This is a separate type from the user_management OrganizationMembership because
13-
authorization endpoints return memberships without `role` and `organization_name` fields.
13+
authorization endpoints return memberships without the `role` field.
1414
"""
1515

1616
object: Literal["organization_membership"]
1717
id: str
1818
user_id: str
1919
organization_id: str
20+
organization_name: str
2021
status: LiteralOrUntyped[OrganizationMembershipStatus]
2122
custom_attributes: Optional[Mapping[str, Any]] = None
2223
created_at: str

src/workos/types/authorization/resource.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ class Resource(WorkOSModel):
88

99
object: Literal["authorization_resource"]
1010
id: str
11-
resource_type: str
12-
resource_id: str
11+
external_id: str
12+
name: str
13+
description: Optional[str] = None
14+
resource_type_slug: str
1315
organization_id: str
14-
external_id: Optional[str] = None
16+
parent_resource_id: Optional[str] = None
1517
meta: Optional[Mapping[str, Any]] = None
16-
environment_id: str
18+
environment_id: Optional[str] = None
1719
created_at: str
1820
updated_at: str

src/workos/types/authorization/role_assignment.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,26 @@
33
from workos.types.workos_model import WorkOSModel
44

55

6+
class RoleAssignmentRole(WorkOSModel):
7+
"""The role associated with a role assignment."""
8+
9+
slug: str
10+
11+
12+
class RoleAssignmentResource(WorkOSModel):
13+
"""The resource associated with a role assignment."""
14+
15+
id: str
16+
external_id: str
17+
resource_type_slug: str
18+
19+
620
class RoleAssignment(WorkOSModel):
721
"""Representation of a WorkOS Authorization Role Assignment."""
822

923
object: Literal["role_assignment"]
1024
id: str
11-
role_slug: str
12-
role_name: str
13-
role_id: str
25+
role: RoleAssignmentRole
26+
resource: RoleAssignmentResource
27+
created_at: str
28+
updated_at: str

0 commit comments

Comments
 (0)