diff --git a/.changelog-pending/2026-09-24T14-13-55-e2873c2f2c846fa33dcbdadaba761c23faaf2cbd.md b/.changelog-pending/2026-09-24T14-13-55-e2873c2f2c846fa33dcbdadaba761c23faaf2cbd.md new file mode 100644 index 00000000..bd7c55aa --- /dev/null +++ b/.changelog-pending/2026-09-24T14-13-55-e2873c2f2c846fa33dcbdadaba761c23faaf2cbd.md @@ -0,0 +1,6 @@ +* [#447](https://github.com/workos/workos-php/pull/447) feat(generated): regenerate from spec + + **Features** + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Added model `UserRoleAssignmentSourceGroup` + * Added `group` to `UserRoleAssignmentSource` diff --git a/.last-synced-sha b/.last-synced-sha index b7efc9db..89fbe35a 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -13ba15b32754d2d635b7799ab779867df2b611d6 +6f037208ce812063908f97744b4aaf4fdf570351 diff --git a/.oagen-manifest.json b/.oagen-manifest.json index d73f28ef..07a40923 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -642,6 +642,7 @@ "lib/Resource/UserRoleAssignment.php", "lib/Resource/UserRoleAssignmentResource.php", "lib/Resource/UserRoleAssignmentSource.php", + "lib/Resource/UserRoleAssignmentSourceGroup.php", "lib/Resource/UserRoleAssignmentSourceType.php", "lib/Resource/UserSessionsAuthMethod.php", "lib/Resource/UserSessionsImpersonator.php", @@ -1336,6 +1337,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", diff --git a/lib/Resource/UserRoleAssignmentSource.php b/lib/Resource/UserRoleAssignmentSource.php index d8dcd5d5..4b059c93 100644 --- a/lib/Resource/UserRoleAssignmentSource.php +++ b/lib/Resource/UserRoleAssignmentSource.php @@ -16,6 +16,8 @@ public function __construct( public UserRoleAssignmentSourceType $type, /** The ID of the group role assignment the role was derived from, or null if direct. */ public ?string $groupRoleAssignmentId, + /** The group the role was derived from, or null if direct. */ + public ?UserRoleAssignmentSourceGroup $group, ) { } @@ -24,6 +26,7 @@ public static function fromArray(array $data): self return new self( type: UserRoleAssignmentSourceType::from($data['type']), groupRoleAssignmentId: $data['group_role_assignment_id'] ?? null, + group: isset($data['group']) ? UserRoleAssignmentSourceGroup::fromArray($data['group']) : null, ); } @@ -32,6 +35,7 @@ public function toArray(): array return [ 'type' => $this->type->value, 'group_role_assignment_id' => $this->groupRoleAssignmentId, + 'group' => $this->group?->toArray(), ]; } } diff --git a/lib/Resource/UserRoleAssignmentSourceGroup.php b/lib/Resource/UserRoleAssignmentSourceGroup.php new file mode 100644 index 00000000..613396c6 --- /dev/null +++ b/lib/Resource/UserRoleAssignmentSourceGroup.php @@ -0,0 +1,36 @@ + $this->id, + 'name' => $this->name, + ]; + } +} diff --git a/tests/Fixtures/list_user_role_assignment.json b/tests/Fixtures/list_user_role_assignment.json index ac0737ac..a4339b6e 100644 --- a/tests/Fixtures/list_user_role_assignment.json +++ b/tests/Fixtures/list_user_role_assignment.json @@ -14,7 +14,8 @@ }, "source": { "type": "direct", - "group_role_assignment_id": null + "group_role_assignment_id": null, + "group": null }, "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" diff --git a/tests/Fixtures/user_role_assignment.json b/tests/Fixtures/user_role_assignment.json index ae717059..ae7557b5 100644 --- a/tests/Fixtures/user_role_assignment.json +++ b/tests/Fixtures/user_role_assignment.json @@ -12,7 +12,8 @@ }, "source": { "type": "direct", - "group_role_assignment_id": null + "group_role_assignment_id": null, + "group": null }, "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" diff --git a/tests/Fixtures/user_role_assignment_source.json b/tests/Fixtures/user_role_assignment_source.json index 2cdf69f3..047cbccc 100644 --- a/tests/Fixtures/user_role_assignment_source.json +++ b/tests/Fixtures/user_role_assignment_source.json @@ -1,4 +1,5 @@ { "type": "direct", - "group_role_assignment_id": null + "group_role_assignment_id": null, + "group": null } diff --git a/tests/Fixtures/user_role_assignment_source_group.json b/tests/Fixtures/user_role_assignment_source_group.json new file mode 100644 index 00000000..ab425e71 --- /dev/null +++ b/tests/Fixtures/user_role_assignment_source_group.json @@ -0,0 +1,4 @@ +{ + "id": "group_01HXYZ123456789ABCDEFGHIJ", + "name": "Marketing team" +}