-
Notifications
You must be signed in to change notification settings - Fork 30
feat(generated): AdminPortal, Authorization, Webhooks, UserManagement, AuditLogs (batch 08085e9d) #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(generated): AdminPortal, Authorization, Webhooks, UserManagement, AuditLogs (batch 08085e9d) #683
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| * [#683](https://github.com/workos/workos-python/pull/683) fix(generated): regenerate from spec | ||
|
|
||
| **⚠️ Breaking** | ||
| * **[user_management](https://workos.com/docs/reference/authkit/user)**: | ||
| * Removed model `SessionReauthenticated` | ||
| * Removed model `SessionReauthenticatedData` | ||
| * Removed model `SessionReauthenticatedDataImpersonator` | ||
| * Removed enum `SessionReauthenticatedDataAuthMethod` | ||
| * Removed enum `SessionReauthenticatedDataStatus` | ||
|
|
||
| **Features** | ||
| * **[webhooks](https://workos.com/docs/reference/webhooks)**: | ||
| * Added `agent.registration.created` to `CreateWebhookEndpointEvents` | ||
| * Added `agent.registration.claim.attempt.created` to `CreateWebhookEndpointEvents` | ||
| * Added `agent.registration.claim.completed` to `CreateWebhookEndpointEvents` | ||
| * Added `agent.registration.credential.issued` to `CreateWebhookEndpointEvents` | ||
| * Added `agent.registration.organization.switched` to `CreateWebhookEndpointEvents` | ||
| * Added `authentication.reauthentication_succeeded` to `CreateWebhookEndpointEvents` | ||
| * Added `agent.registration.created` to `UpdateWebhookEndpointEvents` | ||
| * Added `agent.registration.claim.attempt.created` to `UpdateWebhookEndpointEvents` | ||
| * Added `agent.registration.claim.completed` to `UpdateWebhookEndpointEvents` | ||
| * Added `agent.registration.credential.issued` to `UpdateWebhookEndpointEvents` | ||
| * Added `agent.registration.organization.switched` to `UpdateWebhookEndpointEvents` | ||
| * Added `authentication.reauthentication_succeeded` to `UpdateWebhookEndpointEvents` | ||
| * **[webhooks](https://workos.com/docs/reference/webhooks)**: | ||
| * Added `session.reauthenticated` to `CreateWebhookEndpointEvents` | ||
| * Added `session.reauthenticated` to `UpdateWebhookEndpointEvents` | ||
| * **[webhooks](https://workos.com/docs/reference/webhooks)**: | ||
| * Added `pipes.connected_account.connection_failed` to `CreateWebhookEndpointEvents` | ||
| * Added `pipes.connected_account.connection_failed` to `UpdateWebhookEndpointEvents` | ||
| * **[user_management](https://workos.com/docs/reference/authkit/user)**: | ||
| * Added model `UserRoleAssignmentSource` | ||
| * Added `source` to `UserRoleAssignment` | ||
| * Added enum `UserRoleAssignmentSourceType` | ||
| * Added parameter `UserManagementAuthentication.authorize.max_age` | ||
| * Added endpoint `GET /user_management/cors_origins` | ||
| * Added endpoint `GET /user_management/redirect_uris` | ||
| * **[audit_logs](https://workos.com/docs/reference/audit-logs)**: | ||
| * Changed the format of `AuditLogExportCreation.range_start` | ||
| * Changed the format of `AuditLogExportCreation.range_end` | ||
| * **[audit_logs](https://workos.com/docs/reference/audit-logs)**: | ||
| * Added `expired` to `AuditLogExportState` | ||
|
|
||
| **Fixes** | ||
| * **[admin_portal](https://workos.com/docs/reference/admin-portal)**: | ||
| * Removed `intent_options` from `GenerateLink` | ||
| * **[webhooks](https://workos.com/docs/reference/webhooks)**: | ||
| * Removed `session.reauthenticated` from `CreateWebhookEndpointEvents` | ||
| * Removed `session.reauthenticated` from `UpdateWebhookEndpointEvents` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,10 @@ | |
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from datetime import datetime | ||
| from typing import Any, Dict, List, Optional | ||
| from workos._types import _raise_deserialize_error | ||
| from workos._types import _format_datetime, _parse_datetime | ||
|
|
||
|
|
||
| @dataclass(slots=True) | ||
|
|
@@ -13,9 +15,9 @@ class AuditLogExportCreation: | |
|
|
||
| organization_id: str | ||
| """The unique ID of the Organization.""" | ||
| range_start: str | ||
| range_start: datetime | ||
| """ISO-8601 value for start of the export range.""" | ||
| range_end: str | ||
| range_end: datetime | ||
| """ISO-8601 value for end of the export range.""" | ||
| actions: Optional[List[str]] = None | ||
| """List of actions to filter against.""" | ||
|
|
@@ -36,8 +38,8 @@ def from_dict(cls, data: Dict[str, Any]) -> "AuditLogExportCreation": | |
| try: | ||
| return cls( | ||
| organization_id=data["organization_id"], | ||
| range_start=data["range_start"], | ||
| range_end=data["range_end"], | ||
| range_start=_parse_datetime(data["range_start"]), | ||
| range_end=_parse_datetime(data["range_end"]), | ||
| actions=data.get("actions"), | ||
| actors=data.get("actors"), | ||
| actor_names=data.get("actor_names"), | ||
|
|
@@ -51,8 +53,8 @@ def to_dict(self) -> Dict[str, Any]: | |
| """Serialize to a dictionary.""" | ||
| result: Dict[str, Any] = {} | ||
| result["organization_id"] = self.organization_id | ||
| result["range_start"] = self.range_start | ||
| result["range_end"] = self.range_end | ||
| result["range_start"] = _format_datetime(self.range_start) | ||
| result["range_end"] = _format_datetime(self.range_end) | ||
|
Comment on lines
+56
to
+57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ArtifactsRepro: minimal script constructing AuditLogExportCreation with string dates and calling to_dict
Repro: command output and full traceback showing AttributeError from to_dict/_format_datetime
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/workos/audit_logs/models/audit_log_export_creation.py
Line: 56-57
Comment:
**Preserve string dates**
`range_start` and `range_end` were public ISO-8601 string fields before this regeneration, but `to_dict()` now unconditionally calls `_format_datetime()`. Existing callers that construct `AuditLogExportCreation(range_start="2022-...Z", range_end="2022-...Z")` now hit `AttributeError: 'str' object has no attribute 'isoformat'` during serialization, even though the resource method and docs still accept strings for export ranges.
How can I resolve this? If you propose a fix, please make it concise. |
||
| if self.actions is not None: | ||
| result["actions"] = self.actions | ||
| if self.actors is not None: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from enum import Enum | ||
| from typing import Any, Dict, Optional | ||
| from workos._types import _raise_deserialize_error | ||
| from workos.common.models.user_role_assignment_source_type import ( | ||
| UserRoleAssignmentSourceType, | ||
| ) | ||
|
|
||
|
|
||
| @dataclass(slots=True) | ||
| class UserRoleAssignmentSource: | ||
| """The origin of the role assignment.""" | ||
|
|
||
| type: "UserRoleAssignmentSourceType" | ||
| """Whether the role was assigned directly or derived from a group.""" | ||
| group_role_assignment_id: Optional[str] | ||
| """The ID of the group role assignment the role was derived from, or null if direct.""" | ||
|
|
||
| @classmethod | ||
| def from_dict(cls, data: Dict[str, Any]) -> "UserRoleAssignmentSource": | ||
| """Deserialize from a dictionary.""" | ||
| try: | ||
| return cls( | ||
| type=UserRoleAssignmentSourceType(data["type"]), | ||
| group_role_assignment_id=data["group_role_assignment_id"], | ||
| ) | ||
| except (KeyError, ValueError) as e: | ||
| _raise_deserialize_error("UserRoleAssignmentSource", e) | ||
|
|
||
| def to_dict(self) -> Dict[str, Any]: | ||
| """Serialize to a dictionary.""" | ||
| result: Dict[str, Any] = {} | ||
| result["type"] = self.type.value if isinstance(self.type, Enum) else self.type | ||
| if self.group_role_assignment_id is not None: | ||
| result["group_role_assignment_id"] = self.group_role_assignment_id | ||
| else: | ||
| result["group_role_assignment_id"] = None | ||
| return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 Removal of intent_options is a breaking API change for existing callers
The
intent_optionsparameter was removed from bothAdminPortal.generate_linkandAsyncAdminPortal.generate_link(src/workos/admin_portal/_resource.py:11,28-29), and from theGenerateLinkmodel. TheIntentOptions,SSOIntentOptions, andDomainVerificationIntentOptionsclasses still exist insrc/workos/admin_portal/models/and are still exported from__init__.pyvia wildcard imports. Any existing callers passingintent_options=...will get aTypeErrorat runtime. Since this is auto-generated and reflects an API spec change, it's presumably intentional, but it's a breaking change worth noting.Was this helpful? React with 👍 or 👎 to provide feedback.