Skip to content

Commit ed5b29a

Browse files
feat(generated): AdminPortal, Authorization, Webhooks, UserManagement, AuditLogs (batch 08085e9d) (#683)
Co-authored-by: workos-sdk-automation[bot] <255426317+workos-sdk-automation[bot]@users.noreply.github.com>
1 parent 804000e commit ed5b29a

33 files changed

Lines changed: 3219 additions & 18358 deletions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
* [#683](https://github.com/workos/workos-python/pull/683) fix(generated): regenerate from spec
2+
3+
**⚠️ Breaking**
4+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
5+
* Removed model `SessionReauthenticated`
6+
* Removed model `SessionReauthenticatedData`
7+
* Removed model `SessionReauthenticatedDataImpersonator`
8+
* Removed enum `SessionReauthenticatedDataAuthMethod`
9+
* Removed enum `SessionReauthenticatedDataStatus`
10+
11+
**Features**
12+
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
13+
* Added `agent.registration.created` to `CreateWebhookEndpointEvents`
14+
* Added `agent.registration.claim.attempt.created` to `CreateWebhookEndpointEvents`
15+
* Added `agent.registration.claim.completed` to `CreateWebhookEndpointEvents`
16+
* Added `agent.registration.credential.issued` to `CreateWebhookEndpointEvents`
17+
* Added `agent.registration.organization.switched` to `CreateWebhookEndpointEvents`
18+
* Added `authentication.reauthentication_succeeded` to `CreateWebhookEndpointEvents`
19+
* Added `agent.registration.created` to `UpdateWebhookEndpointEvents`
20+
* Added `agent.registration.claim.attempt.created` to `UpdateWebhookEndpointEvents`
21+
* Added `agent.registration.claim.completed` to `UpdateWebhookEndpointEvents`
22+
* Added `agent.registration.credential.issued` to `UpdateWebhookEndpointEvents`
23+
* Added `agent.registration.organization.switched` to `UpdateWebhookEndpointEvents`
24+
* Added `authentication.reauthentication_succeeded` to `UpdateWebhookEndpointEvents`
25+
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
26+
* Added `session.reauthenticated` to `CreateWebhookEndpointEvents`
27+
* Added `session.reauthenticated` to `UpdateWebhookEndpointEvents`
28+
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
29+
* Added `pipes.connected_account.connection_failed` to `CreateWebhookEndpointEvents`
30+
* Added `pipes.connected_account.connection_failed` to `UpdateWebhookEndpointEvents`
31+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
32+
* Added model `UserRoleAssignmentSource`
33+
* Added `source` to `UserRoleAssignment`
34+
* Added enum `UserRoleAssignmentSourceType`
35+
* Added parameter `UserManagementAuthentication.authorize.max_age`
36+
* Added endpoint `GET /user_management/cors_origins`
37+
* Added endpoint `GET /user_management/redirect_uris`
38+
* **[audit_logs](https://workos.com/docs/reference/audit-logs)**:
39+
* Changed the format of `AuditLogExportCreation.range_start`
40+
* Changed the format of `AuditLogExportCreation.range_end`
41+
* **[audit_logs](https://workos.com/docs/reference/audit-logs)**:
42+
* Added `expired` to `AuditLogExportState`
43+
44+
**Fixes**
45+
* **[admin_portal](https://workos.com/docs/reference/admin-portal)**:
46+
* Removed `intent_options` from `GenerateLink`
47+
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
48+
* Removed `session.reauthenticated` from `CreateWebhookEndpointEvents`
49+
* Removed `session.reauthenticated` from `UpdateWebhookEndpointEvents`

.oagen-manifest.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"language": "python",
4-
"generatedAt": "2026-07-01T16:28:45.662Z",
4+
"generatedAt": "2026-07-01T18:19:12.330Z",
55
"files": [
66
"src/workos/_client.py",
77
"src/workos/admin_portal/__init__.py",
@@ -73,6 +73,7 @@
7373
"src/workos/authorization/models/update_role.py",
7474
"src/workos/authorization/models/user_role_assignment.py",
7575
"src/workos/authorization/models/user_role_assignment_resource.py",
76+
"src/workos/authorization/models/user_role_assignment_source.py",
7677
"src/workos/client_api/__init__.py",
7778
"src/workos/client_api/_resource.py",
7879
"src/workos/client_api/models/__init__.py",
@@ -428,6 +429,7 @@
428429
"src/workos/common/models/user_organization_membership_base_list_data.py",
429430
"src/workos/common/models/user_organization_membership_base_list_data_status.py",
430431
"src/workos/common/models/user_organization_membership_status.py",
432+
"src/workos/common/models/user_role_assignment_source_type.py",
431433
"src/workos/common/models/user_sessions_auth_method.py",
432434
"src/workos/common/models/user_sessions_impersonator.py",
433435
"src/workos/common/models/user_sessions_list_item.py",
@@ -992,6 +994,7 @@
992994
"tests/fixtures/list_authorized_connect_application_list_data.json",
993995
"tests/fixtures/list_connect_application.json",
994996
"tests/fixtures/list_connection.json",
997+
"tests/fixtures/list_cors_origin_response.json",
995998
"tests/fixtures/list_directory.json",
996999
"tests/fixtures/list_directory_group.json",
9971000
"tests/fixtures/list_directory_user_with_groups.json",
@@ -1003,6 +1006,7 @@
10031006
"tests/fixtures/list_object_summary.json",
10041007
"tests/fixtures/list_organization.json",
10051008
"tests/fixtures/list_organization_api_key.json",
1009+
"tests/fixtures/list_redirect_uri.json",
10061010
"tests/fixtures/list_user.json",
10071011
"tests/fixtures/list_user_api_key.json",
10081012
"tests/fixtures/list_user_invite.json",
@@ -1159,6 +1163,7 @@
11591163
"tests/fixtures/user_organization_membership_base_list_data.json",
11601164
"tests/fixtures/user_role_assignment.json",
11611165
"tests/fixtures/user_role_assignment_resource.json",
1166+
"tests/fixtures/user_role_assignment_source.json",
11621167
"tests/fixtures/user_sessions_impersonator.json",
11631168
"tests/fixtures/user_sessions_list_item.json",
11641169
"tests/fixtures/user_updated.json",
@@ -1197,27 +1202,36 @@
11971202
"tests/fixtures/widget_session_token.json",
11981203
"tests/fixtures/widget_session_token_response.json",
11991204
"tests/test_admin_portal.py",
1205+
"tests/test_admin_portal_models_round_trip.py",
12001206
"tests/test_api_keys.py",
12011207
"tests/test_audit_logs.py",
1208+
"tests/test_audit_logs_models_round_trip.py",
12021209
"tests/test_authorization.py",
1210+
"tests/test_authorization_models_round_trip.py",
12031211
"tests/test_client_api.py",
1212+
"tests/test_common_models_round_trip.py",
12041213
"tests/test_connect.py",
1214+
"tests/test_connect_models_round_trip.py",
12051215
"tests/test_directory_sync.py",
12061216
"tests/test_events.py",
12071217
"tests/test_feature_flags.py",
12081218
"tests/test_groups.py",
1219+
"tests/test_groups_models_round_trip.py",
12091220
"tests/test_models_round_trip.py",
12101221
"tests/test_multi_factor_auth.py",
12111222
"tests/test_organization_domains.py",
12121223
"tests/test_organization_membership.py",
12131224
"tests/test_organizations.py",
1225+
"tests/test_organizations_models_round_trip.py",
12141226
"tests/test_pipes.py",
12151227
"tests/test_pipes_provider.py",
12161228
"tests/test_radar.py",
12171229
"tests/test_sso.py",
12181230
"tests/test_user_management.py",
1231+
"tests/test_user_management_models_round_trip.py",
12191232
"tests/test_vault.py",
12201233
"tests/test_webhooks.py",
1234+
"tests/test_webhooks_models_round_trip.py",
12211235
"tests/test_widgets.py"
12221236
],
12231237
"operations": {

src/workos/admin_portal/_resource.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .._client import AsyncWorkOSClient, WorkOSClient
99

1010
from .._types import RequestOptions, enum_value
11-
from .models import IntentOptions, PortalLinkResponse
11+
from .models import PortalLinkResponse
1212
from workos.common.models.generate_link_intent import GenerateLinkIntent
1313

1414

@@ -25,7 +25,6 @@ def generate_link(
2525
return_url: Optional[str] = None,
2626
success_url: Optional[str] = None,
2727
intent: Optional[Union[GenerateLinkIntent, str]] = None,
28-
intent_options: Optional[IntentOptions] = None,
2928
it_contact_emails: Optional[List[str]] = None,
3029
request_options: Optional[RequestOptions] = None,
3130
) -> PortalLinkResponse:
@@ -45,7 +44,6 @@ def generate_link(
4544
- `domain_verification` - Launch Admin Portal for Domain Verification
4645
- `certificate_renewal` - Launch Admin Portal for renewing SAML Certificates
4746
- `bring_your_own_key` - Launch Admin Portal for configuring Bring Your Own Key
48-
intent_options: Options to configure the Admin Portal based on the intent.
4947
it_contact_emails: The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails.
5048
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
5149
@@ -68,9 +66,6 @@ def generate_link(
6866
"success_url": success_url,
6967
"organization": organization,
7068
"intent": enum_value(intent) if intent is not None else None,
71-
"intent_options": intent_options.to_dict()
72-
if intent_options is not None
73-
else None,
7469
"it_contact_emails": it_contact_emails,
7570
}.items()
7671
if v is not None
@@ -97,7 +92,6 @@ async def generate_link(
9792
return_url: Optional[str] = None,
9893
success_url: Optional[str] = None,
9994
intent: Optional[Union[GenerateLinkIntent, str]] = None,
100-
intent_options: Optional[IntentOptions] = None,
10195
it_contact_emails: Optional[List[str]] = None,
10296
request_options: Optional[RequestOptions] = None,
10397
) -> PortalLinkResponse:
@@ -117,7 +111,6 @@ async def generate_link(
117111
- `domain_verification` - Launch Admin Portal for Domain Verification
118112
- `certificate_renewal` - Launch Admin Portal for renewing SAML Certificates
119113
- `bring_your_own_key` - Launch Admin Portal for configuring Bring Your Own Key
120-
intent_options: Options to configure the Admin Portal based on the intent.
121114
it_contact_emails: The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails.
122115
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
123116
@@ -140,9 +133,6 @@ async def generate_link(
140133
"success_url": success_url,
141134
"organization": organization,
142135
"intent": enum_value(intent) if intent is not None else None,
143-
"intent_options": intent_options.to_dict()
144-
if intent_options is not None
145-
else None,
146136
"it_contact_emails": it_contact_emails,
147137
}.items()
148138
if v is not None

src/workos/admin_portal/models/generate_link.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44

55
from dataclasses import dataclass
66
from enum import Enum
7-
from typing import cast
87
from typing import Any, Dict, List, Optional
98
from workos._types import _raise_deserialize_error
10-
11-
from .intent_options import IntentOptions
129
from workos.common.models.generate_link_intent import GenerateLinkIntent
1310

1411

@@ -32,8 +29,6 @@ class GenerateLink:
3229
- `domain_verification` - Launch Admin Portal for Domain Verification
3330
- `certificate_renewal` - Launch Admin Portal for renewing SAML Certificates
3431
- `bring_your_own_key` - Launch Admin Portal for configuring Bring Your Own Key"""
35-
intent_options: Optional["IntentOptions"] = None
36-
"""Options to configure the Admin Portal based on the intent."""
3732
it_contact_emails: Optional[List[str]] = None
3833
"""The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails."""
3934

@@ -48,11 +43,6 @@ def from_dict(cls, data: Dict[str, Any]) -> "GenerateLink":
4843
intent=GenerateLinkIntent(_v_intent)
4944
if (_v_intent := data.get("intent")) is not None
5045
else None,
51-
intent_options=IntentOptions.from_dict(
52-
cast(Dict[str, Any], _v_intent_options)
53-
)
54-
if (_v_intent_options := data.get("intent_options")) is not None
55-
else None,
5646
it_contact_emails=data.get("it_contact_emails"),
5747
)
5848
except (KeyError, ValueError) as e:
@@ -70,8 +60,6 @@ def to_dict(self) -> Dict[str, Any]:
7060
result["intent"] = (
7161
self.intent.value if isinstance(self.intent, Enum) else self.intent
7262
)
73-
if self.intent_options is not None:
74-
result["intent_options"] = self.intent_options.to_dict()
7563
if self.it_contact_emails is not None:
7664
result["it_contact_emails"] = self.it_contact_emails
7765
return result

src/workos/audit_logs/models/audit_log_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AuditLogExport:
2020
id: str
2121
"""The unique ID of the Audit Log Export."""
2222
state: "AuditLogExportState"
23-
"""The state of the export. Possible values: pending, ready, error."""
23+
"""The state of the export. Possible values: pending, ready, error, expired."""
2424
created_at: datetime
2525
"""An ISO 8601 timestamp."""
2626
updated_at: datetime

src/workos/audit_logs/models/audit_log_export_creation.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
from __future__ import annotations
44

55
from dataclasses import dataclass
6+
from datetime import datetime
67
from typing import Any, Dict, List, Optional
78
from workos._types import _raise_deserialize_error
9+
from workos._types import _format_datetime, _parse_datetime
810

911

1012
@dataclass(slots=True)
@@ -13,9 +15,9 @@ class AuditLogExportCreation:
1315

1416
organization_id: str
1517
"""The unique ID of the Organization."""
16-
range_start: str
18+
range_start: datetime
1719
"""ISO-8601 value for start of the export range."""
18-
range_end: str
20+
range_end: datetime
1921
"""ISO-8601 value for end of the export range."""
2022
actions: Optional[List[str]] = None
2123
"""List of actions to filter against."""
@@ -36,8 +38,8 @@ def from_dict(cls, data: Dict[str, Any]) -> "AuditLogExportCreation":
3638
try:
3739
return cls(
3840
organization_id=data["organization_id"],
39-
range_start=data["range_start"],
40-
range_end=data["range_end"],
41+
range_start=_parse_datetime(data["range_start"]),
42+
range_end=_parse_datetime(data["range_end"]),
4143
actions=data.get("actions"),
4244
actors=data.get("actors"),
4345
actor_names=data.get("actor_names"),
@@ -51,8 +53,8 @@ def to_dict(self) -> Dict[str, Any]:
5153
"""Serialize to a dictionary."""
5254
result: Dict[str, Any] = {}
5355
result["organization_id"] = self.organization_id
54-
result["range_start"] = self.range_start
55-
result["range_end"] = self.range_end
56+
result["range_start"] = _format_datetime(self.range_start)
57+
result["range_end"] = _format_datetime(self.range_end)
5658
if self.actions is not None:
5759
result["actions"] = self.actions
5860
if self.actors is not None:

src/workos/authorization/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@
5858
from .user_role_assignment_resource import (
5959
UserRoleAssignmentResource as UserRoleAssignmentResource,
6060
)
61+
from .user_role_assignment_source import (
62+
UserRoleAssignmentSource as UserRoleAssignmentSource,
63+
)

src/workos/authorization/models/user_role_assignment.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from workos.common.models.slim_role import SlimRole
1313
from .user_role_assignment_resource import UserRoleAssignmentResource
14+
from .user_role_assignment_source import UserRoleAssignmentSource
1415

1516

1617
@dataclass(slots=True)
@@ -27,6 +28,8 @@ class UserRoleAssignment:
2728
"""The role included in the assignment."""
2829
resource: "UserRoleAssignmentResource"
2930
"""The resource the role is assigned on."""
31+
source: "UserRoleAssignmentSource"
32+
"""The origin of the role assignment."""
3033
created_at: datetime
3134
"""An ISO 8601 timestamp."""
3235
updated_at: datetime
@@ -44,6 +47,9 @@ def from_dict(cls, data: Dict[str, Any]) -> "UserRoleAssignment":
4447
resource=UserRoleAssignmentResource.from_dict(
4548
cast(Dict[str, Any], data["resource"])
4649
),
50+
source=UserRoleAssignmentSource.from_dict(
51+
cast(Dict[str, Any], data["source"])
52+
),
4753
created_at=_parse_datetime(data["created_at"]),
4854
updated_at=_parse_datetime(data["updated_at"]),
4955
)
@@ -58,6 +64,7 @@ def to_dict(self) -> Dict[str, Any]:
5864
result["organization_membership_id"] = self.organization_membership_id
5965
result["role"] = self.role.to_dict()
6066
result["resource"] = self.resource.to_dict()
67+
result["source"] = self.source.to_dict()
6168
result["created_at"] = _format_datetime(self.created_at)
6269
result["updated_at"] = _format_datetime(self.updated_at)
6370
return result
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This file is auto-generated by oagen. Do not edit.
2+
3+
from __future__ import annotations
4+
5+
from dataclasses import dataclass
6+
from enum import Enum
7+
from typing import Any, Dict, Optional
8+
from workos._types import _raise_deserialize_error
9+
from workos.common.models.user_role_assignment_source_type import (
10+
UserRoleAssignmentSourceType,
11+
)
12+
13+
14+
@dataclass(slots=True)
15+
class UserRoleAssignmentSource:
16+
"""The origin of the role assignment."""
17+
18+
type: "UserRoleAssignmentSourceType"
19+
"""Whether the role was assigned directly or derived from a group."""
20+
group_role_assignment_id: Optional[str]
21+
"""The ID of the group role assignment the role was derived from, or null if direct."""
22+
23+
@classmethod
24+
def from_dict(cls, data: Dict[str, Any]) -> "UserRoleAssignmentSource":
25+
"""Deserialize from a dictionary."""
26+
try:
27+
return cls(
28+
type=UserRoleAssignmentSourceType(data["type"]),
29+
group_role_assignment_id=data["group_role_assignment_id"],
30+
)
31+
except (KeyError, ValueError) as e:
32+
_raise_deserialize_error("UserRoleAssignmentSource", e)
33+
34+
def to_dict(self) -> Dict[str, Any]:
35+
"""Serialize to a dictionary."""
36+
result: Dict[str, Any] = {}
37+
result["type"] = self.type.value if isinstance(self.type, Enum) else self.type
38+
if self.group_role_assignment_id is not None:
39+
result["group_role_assignment_id"] = self.group_role_assignment_id
40+
else:
41+
result["group_role_assignment_id"] = None
42+
return result

src/workos/common/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@
420420
UserOrganizationMembershipBaseListDataStatus as UserOrganizationMembershipBaseListDataStatus,
421421
)
422422
from .models import UserOrganizationMembershipStatus as UserOrganizationMembershipStatus
423+
from .models import UserRoleAssignmentSourceType as UserRoleAssignmentSourceType
423424
from .models import UserSessionsAuthMethod as UserSessionsAuthMethod
424425
from .models import UserSessionsImpersonator as UserSessionsImpersonator
425426
from .models import UserSessionsListItem as UserSessionsListItem

0 commit comments

Comments
 (0)