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
4 changes: 1 addition & 3 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"language": "python",
"generatedAt": "2026-04-20T20:55:24.754Z",
"generatedAt": "2026-04-22T22:10:13.399Z",
"files": [
"src/workos/_client.py",
"src/workos/admin_portal/__init__.py",
Expand Down Expand Up @@ -814,7 +814,6 @@
"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 @@ -885,7 +884,6 @@
"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
5 changes: 5 additions & 0 deletions scripts/ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -e

./scripts/test.sh --ci
42 changes: 24 additions & 18 deletions src/workos/events/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from __future__ import annotations

from typing import TYPE_CHECKING, List, Optional, Union
from typing import TYPE_CHECKING, List, Optional, Union, cast

if TYPE_CHECKING:
from .._client import AsyncWorkOSClient, WorkOSClient

from .._types import RequestOptions, enum_value
from .models import EventSchema
from .models import EventSchema, EventSchemaVariant
from .models import EventsOrder
from .._pagination import AsyncPage, SyncPage

Expand All @@ -31,7 +31,7 @@ def list_events(
range_end: Optional[str] = None,
organization_id: Optional[str] = None,
request_options: Optional[RequestOptions] = None,
) -> SyncPage[EventSchema]:
) -> SyncPage[EventSchemaVariant]:
"""List events

List events for the current environment.
Expand All @@ -48,7 +48,7 @@ def list_events(
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
SyncPage[EventSchema]
SyncPage[EventSchemaVariant]

Raises:
BadRequestError: If the request is malformed (400).
Expand All @@ -73,12 +73,15 @@ def list_events(
}.items()
if v is not None
}
return self._client.request_page(
method="get",
path="events",
model=EventSchema,
params=params,
request_options=request_options,
return cast(
SyncPage[EventSchemaVariant],
self._client.request_page(
method="get",
path="events",
model=EventSchema, # type: ignore[arg-type] # dispatcher; pagination only calls from_dict
params=params,
request_options=request_options,
),
)


Expand All @@ -100,7 +103,7 @@ async def list_events(
range_end: Optional[str] = None,
organization_id: Optional[str] = None,
request_options: Optional[RequestOptions] = None,
) -> AsyncPage[EventSchema]:
) -> AsyncPage[EventSchemaVariant]:
"""List events

List events for the current environment.
Expand All @@ -117,7 +120,7 @@ async def list_events(
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
AsyncPage[EventSchema]
AsyncPage[EventSchemaVariant]

Raises:
BadRequestError: If the request is malformed (400).
Expand All @@ -142,10 +145,13 @@ async def list_events(
}.items()
if v is not None
}
return await self._client.request_page(
method="get",
path="events",
model=EventSchema,
params=params,
request_options=request_options,
return cast(
AsyncPage[EventSchemaVariant],
await self._client.request_page(
method="get",
path="events",
model=EventSchema, # type: ignore[arg-type] # dispatcher; pagination only calls from_dict
params=params,
request_options=request_options,
),
)
2 changes: 2 additions & 0 deletions src/workos/events/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

from .event_list_list_metadata import EventListListMetadata as EventListListMetadata
from .event_schema import EventSchema as EventSchema
from .event_schema import EventSchemaUnknown as EventSchemaUnknown
from .event_schema import EventSchemaVariant as EventSchemaVariant
from .events_order import EventsOrder as EventsOrder
Loading
Loading