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
6 changes: 4 additions & 2 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"version": 2,
"language": "python",
"generatedAt": "2026-04-22T22:10:13.399Z",
"generatedAt": "2026-04-23T15:27:42.321Z",
"files": [
"src/workos/_client.py",
"src/workos/admin_portal/__init__.py",
Expand Down Expand Up @@ -814,6 +814,7 @@
"tests/fixtures/event_context_actor.json",
"tests/fixtures/event_context_google_analytics_session.json",
"tests/fixtures/event_list_list_metadata.json",
"tests/fixtures/event_schema.json",
"tests/fixtures/external_auth_complete_response.json",
"tests/fixtures/feature_flag.json",
"tests/fixtures/feature_flag_owner.json",
Expand Down Expand Up @@ -884,6 +885,7 @@
"tests/fixtures/list_directory.json",
"tests/fixtures/list_directory_group.json",
"tests/fixtures/list_directory_user_with_groups.json",
"tests/fixtures/list_event_schema.json",
"tests/fixtures/list_flag.json",
"tests/fixtures/list_organization.json",
"tests/fixtures/list_role_assignment.json",
Expand Down
11 changes: 10 additions & 1 deletion src/workos/authorization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# This file is auto-generated by oagen. Do not edit.

from ._resource import Authorization, AsyncAuthorization
from ._resource import (
Authorization,
AsyncAuthorization,
ResourceTargetById,
ResourceTargetByExternalId,
ParentResourceById,
ParentResourceByExternalId,
ParentById,
ParentByExternalId,
)
from .models import *
9 changes: 8 additions & 1 deletion src/workos/user_management/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# This file is auto-generated by oagen. Do not edit.

from ._resource import UserManagement, AsyncUserManagement
from ._resource import (
UserManagement,
AsyncUserManagement,
PasswordPlaintext,
PasswordHashed,
RoleSingle,
RoleMultiple,
)
from .models import *
7 changes: 5 additions & 2 deletions tests/test_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from tests.generated_helpers import load_fixture

from workos.api_keys.models import (
ApiKey,
ApiKeyValidationResponse,
ApiKeyWithValue,
OrganizationsApiKeysOrder,
Expand Down Expand Up @@ -49,7 +50,8 @@ def test_list_organization_api_keys(self, workos, httpx_mock):
)
page = workos.api_keys.list_organization_api_keys("test_organizationId")
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], ApiKey)

def test_list_organization_api_keys_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -190,7 +192,8 @@ async def test_list_organization_api_keys(self, async_workos, httpx_mock):
"test_organizationId"
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], ApiKey)

@pytest.mark.asyncio
async def test_list_organization_api_keys_empty_page(
Expand Down
13 changes: 9 additions & 4 deletions tests/test_audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from tests.generated_helpers import load_fixture

from workos.audit_logs.models import (
AuditLogActionJson,
AuditLogEvent,
AuditLogEventCreateResponse,
AuditLogExportJson,
Expand Down Expand Up @@ -58,7 +59,8 @@ def test_list_actions(self, workos, httpx_mock):
)
page = workos.audit_logs.list_actions()
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuditLogActionJson)

def test_list_actions_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -86,7 +88,8 @@ def test_list_action_schemas(self, workos, httpx_mock):
)
page = workos.audit_logs.list_action_schemas("test_actionName")
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuditLogSchemaJson)

def test_list_action_schemas_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -286,7 +289,8 @@ async def test_list_actions(self, async_workos, httpx_mock):
httpx_mock.add_response(json=load_fixture("list_audit_log_action_json.json"))
page = await async_workos.audit_logs.list_actions()
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuditLogActionJson)

@pytest.mark.asyncio
async def test_list_actions_empty_page(self, async_workos, httpx_mock):
Expand Down Expand Up @@ -315,7 +319,8 @@ async def test_list_action_schemas(self, async_workos, httpx_mock):
httpx_mock.add_response(json=load_fixture("list_audit_log_schema_json.json"))
page = await async_workos.audit_logs.list_action_schemas("test_actionName")
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuditLogSchemaJson)

@pytest.mark.asyncio
async def test_list_action_schemas_empty_page(self, async_workos, httpx_mock):
Expand Down
49 changes: 33 additions & 16 deletions tests/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
Role,
RoleAssignment,
RoleList,
UserOrganizationMembershipBaseListData,
AuthorizationAssignment,
AuthorizationOrder,
PermissionsOrder,
Expand Down Expand Up @@ -64,7 +65,8 @@ def test_list_organization_membership_resources(self, workos, httpx_mock):
permission_slug="test_permission_slug",
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationResource)

def test_list_organization_membership_resources_empty_page(
self, workos, httpx_mock
Expand Down Expand Up @@ -111,7 +113,8 @@ def test_list_resource_permissions(self, workos, httpx_mock):
"test_organization_membership_id", "test_resource_id"
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationPermission)

def test_list_resource_permissions_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -147,7 +150,8 @@ def test_list_effective_permissions_by_external_id(self, workos, httpx_mock):
"test_external_id",
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationPermission)

def test_list_effective_permissions_by_external_id_empty_page(
self, workos, httpx_mock
Expand Down Expand Up @@ -188,7 +192,8 @@ def test_list_organization_membership_role_assignments(self, workos, httpx_mock)
"test_organization_membership_id"
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], RoleAssignment)

def test_list_organization_membership_role_assignments_empty_page(
self, workos, httpx_mock
Expand Down Expand Up @@ -457,7 +462,8 @@ def test_list_resource_organization_memberships(self, workos, httpx_mock):
permission_slug="test_permission_slug",
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], UserOrganizationMembershipBaseListData)

def test_list_resource_organization_memberships_empty_page(
self, workos, httpx_mock
Expand Down Expand Up @@ -503,7 +509,8 @@ def test_list_resources(self, workos, httpx_mock):
parent=ParentById(parent_resource_id="test_value")
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationResource)

def test_list_resources_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -611,7 +618,8 @@ def test_list_memberships_for_resource(self, workos, httpx_mock):
"test_resource_id", permission_slug="test_permission_slug"
)
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], UserOrganizationMembershipBaseListData)

def test_list_memberships_for_resource_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -732,7 +740,8 @@ def test_list_permissions(self, workos, httpx_mock):
)
page = workos.authorization.list_permissions()
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationPermission)

def test_list_permissions_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -934,7 +943,8 @@ async def test_list_organization_membership_resources(
permission_slug="test_permission_slug",
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationResource)

@pytest.mark.asyncio
async def test_list_organization_membership_resources_empty_page(
Expand Down Expand Up @@ -982,7 +992,8 @@ async def test_list_resource_permissions(self, async_workos, httpx_mock):
"test_organization_membership_id", "test_resource_id"
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationPermission)

@pytest.mark.asyncio
async def test_list_resource_permissions_empty_page(self, async_workos, httpx_mock):
Expand Down Expand Up @@ -1025,7 +1036,8 @@ async def test_list_effective_permissions_by_external_id(
)
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationPermission)

@pytest.mark.asyncio
async def test_list_effective_permissions_by_external_id_empty_page(
Expand Down Expand Up @@ -1071,7 +1083,8 @@ async def test_list_organization_membership_role_assignments(
"test_organization_membership_id"
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], RoleAssignment)

@pytest.mark.asyncio
async def test_list_organization_membership_role_assignments_empty_page(
Expand Down Expand Up @@ -1338,7 +1351,8 @@ async def test_list_resource_organization_memberships(
permission_slug="test_permission_slug",
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], UserOrganizationMembershipBaseListData)

@pytest.mark.asyncio
async def test_list_resource_organization_memberships_empty_page(
Expand Down Expand Up @@ -1385,7 +1399,8 @@ async def test_list_resources(self, async_workos, httpx_mock):
parent=ParentById(parent_resource_id="test_value")
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationResource)

@pytest.mark.asyncio
async def test_list_resources_empty_page(self, async_workos, httpx_mock):
Expand Down Expand Up @@ -1492,7 +1507,8 @@ async def test_list_memberships_for_resource(self, async_workos, httpx_mock):
"test_resource_id", permission_slug="test_permission_slug"
)
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], UserOrganizationMembershipBaseListData)

@pytest.mark.asyncio
async def test_list_memberships_for_resource_empty_page(
Expand Down Expand Up @@ -1603,7 +1619,8 @@ async def test_list_permissions(self, async_workos, httpx_mock):
httpx_mock.add_response(json=load_fixture("list_authorization_permission.json"))
page = await async_workos.authorization.list_permissions()
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], AuthorizationPermission)

@pytest.mark.asyncio
async def test_list_permissions_empty_page(self, async_workos, httpx_mock):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def test_list_applications(self, workos, httpx_mock):
)
page = workos.connect.list_applications()
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], ConnectApplication)

def test_list_applications_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -295,7 +296,8 @@ async def test_list_applications(self, async_workos, httpx_mock):
httpx_mock.add_response(json=load_fixture("list_connect_application.json"))
page = await async_workos.connect.list_applications()
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], ConnectApplication)

@pytest.mark.asyncio
async def test_list_applications_empty_page(self, async_workos, httpx_mock):
Expand Down
18 changes: 12 additions & 6 deletions tests/test_directory_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def test_list_directories(self, workos, httpx_mock):
)
page = workos.directory_sync.list_directories()
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], Directory)

def test_list_directories_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -85,7 +86,8 @@ def test_list_groups(self, workos, httpx_mock):
)
page = workos.directory_sync.list_groups()
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], DirectoryGroup)

def test_list_groups_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -129,7 +131,8 @@ def test_list_users(self, workos, httpx_mock):
)
page = workos.directory_sync.list_users()
assert isinstance(page, SyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], DirectoryUserWithGroups)

def test_list_users_empty_page(self, workos, httpx_mock):
httpx_mock.add_response(json={"data": [], "list_metadata": {}})
Expand Down Expand Up @@ -249,7 +252,8 @@ async def test_list_directories(self, async_workos, httpx_mock):
httpx_mock.add_response(json=load_fixture("list_directory.json"))
page = await async_workos.directory_sync.list_directories()
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], Directory)

@pytest.mark.asyncio
async def test_list_directories_empty_page(self, async_workos, httpx_mock):
Expand Down Expand Up @@ -306,7 +310,8 @@ async def test_list_groups(self, async_workos, httpx_mock):
httpx_mock.add_response(json=load_fixture("list_directory_group.json"))
page = await async_workos.directory_sync.list_groups()
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], DirectoryGroup)

@pytest.mark.asyncio
async def test_list_groups_empty_page(self, async_workos, httpx_mock):
Expand Down Expand Up @@ -352,7 +357,8 @@ async def test_list_users(self, async_workos, httpx_mock):
)
page = await async_workos.directory_sync.list_users()
assert isinstance(page, AsyncPage)
assert isinstance(page.data, list)
assert len(page.data) == 1
assert isinstance(page.data[0], DirectoryUserWithGroups)

@pytest.mark.asyncio
async def test_list_users_empty_page(self, async_workos, httpx_mock):
Expand Down
Loading
Loading