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
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
* [#777](https://github.com/workos/workos-python/pull/777) feat(generated): regenerate from spec (1 change)

**⚠️ Breaking**
* **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
* Added parameter `Directories.find.directoryId`
* Added parameter `Directories.find.groupId`
* Removed parameter `Directories.find.id`
* Changed path for endpoint `GET /directories/{directoryId}/groups/{groupId}`
* Changed server default for parameter `DirectoryGroups.list`
* Changed server default for parameter `DirectoryGroups.find`
* Changed server default for parameter `DirectoryUsers.list`
* Changed server default for parameter `DirectoryUsers.find`

**Features**
* **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
* Added endpoint `GET /directories/{id}`
* Added endpoint `GET /directories/{directoryId}/groups`
* Added endpoint `GET /directories/{directoryId}/users`
* Added endpoint `GET /directories/{directoryId}/users/{userId}`
* **[multi_factor_auth](https://workos.com/docs/reference/authkit/mfa)**:
* Added model `TooManyFailedVerificationAttemptsErrorBodyWithRetryAfter`
* Changed errors for endpoint `POST /auth/challenges/{id}/verify`
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Added `config` to `CreateOrganizationConnectedAccount`
* Added `metadata` to `CreateOrganizationConnectedAccount`
* Added `config` to `OrganizationConnectedAccount`
* Added `config` to `CreateConnectedAccount`
* Added `metadata` to `CreateConnectedAccount`
* Added `config` to `ConnectedAccountInput`
* Added `too_many_failed_verification_attempts` to `ErrorBodyCode`
* Added `ip_address_required` to `ErrorBodyCode`
* Added enum `PipesProviderOwnership`
* Added parameter `PipesProvider.listForOrganization.ownership`
* Changed errors for endpoint `GET /organizations/{organizationId}/data_integration_configurations`
* Added parameter `PipesProvider.configure.ownership`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Added `radar_detection_id` to `PolicyDeniedErrorBody`
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
* Added `feature_flags.flag.created` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag.updated` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag.deleted` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag_rule.created` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag_rule.updated` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag_target.created` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag_rule.deleted` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag_target.deleted` to `CreateWebhookEndpointEvents`
* Added `feature_flags.flag.created` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag.updated` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag.deleted` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag_rule.created` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag_rule.updated` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag_target.created` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag_rule.deleted` to `UpdateWebhookEndpointEvents`
* Added `feature_flags.flag_target.deleted` to `UpdateWebhookEndpointEvents`

**Fixes**
* **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
* Changed response of `Directories.find` from `Directory` to `DirectoryGroup`
* Updated endpoint `GET /directory_groups`
* Updated endpoint `GET /directory_groups/{id}`
* Updated endpoint `GET /directory_users`
* Updated endpoint `GET /directory_users/{id}`
* **[events](https://workos.com/docs/reference/events)**:
* Updated model `EventSchema`
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Removed `policy_denied` from `ErrorBodyCode`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Changed errors for endpoint `POST /user_management/users`
* Changed errors for endpoint `POST /user_management/magic_auth`
* Changed errors for endpoint `POST /user_management/authenticate`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2029e6d3b84733c408b209a314e20fd748e3d970
cd2274094c76488d1aef6d661898b31138af5f3e
40 changes: 29 additions & 11 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@
"src/workos/common/models/data_integration_ownership.py",
"src/workos/common/models/data_integration_state.py",
"src/workos/common/models/data_integration_vended_credential.py",
"src/workos/common/models/data_integration_vended_credential_auth_method.py",
"src/workos/common/models/data_integrations_create_api_key_connection_request_connection_owner.py",
"src/workos/common/models/data_integrations_create_client_credentials_connection_request_connection_owner.py",
"src/workos/common/models/data_integrations_get_data_integration_authorize_url_request_connection_intent.py",
Expand Down Expand Up @@ -739,7 +740,7 @@
"src/workos/common/models/slow_down_oauth_error_body.py",
"src/workos/common/models/sms_challenge_quota_reached_error_body.py",
"src/workos/common/models/sms_challenge_rate_limited_error_body.py",
"src/workos/common/models/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.py",
"src/workos/common/models/sso_required_oauth_error_body_with_connection_ids_list_email.py",
"src/workos/common/models/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.py",
"src/workos/common/models/team_production_state.py",
"src/workos/common/models/token_query_grant_type.py",
Expand Down Expand Up @@ -911,7 +912,6 @@
"src/workos/pipes/__init__.py",
"src/workos/pipes/_resource.py",
"src/workos/pipes/models/__init__.py",
"src/workos/pipes/models/add_data_integrations_get_data_integration_authorize_url_request_connection_owner_literal.py",
"src/workos/pipes/models/api_key_installation.py",
"src/workos/pipes/models/connected_account_input.py",
"src/workos/pipes/models/create_connected_account.py",
Expand Down Expand Up @@ -946,6 +946,7 @@
"src/workos/pipes_provider/models/data_integration_configuration_list_response.py",
"src/workos/pipes_provider/models/data_integration_configuration_response.py",
"src/workos/pipes_provider/models/data_integration_credentials.py",
"src/workos/pipes_provider/models/pipes_provider_ownership.py",
"src/workos/platform_teams/__init__.py",
"src/workos/platform_teams/_resource.py",
"src/workos/platform_teams/models/__init__.py",
Expand Down Expand Up @@ -1643,6 +1644,7 @@
"tests/fixtures/list_data_integration.json",
"tests/fixtures/list_directory.json",
"tests/fixtures/list_directory_group.json",
"tests/fixtures/list_directory_user.json",
"tests/fixtures/list_directory_user_with_groups.json",
"tests/fixtures/list_event_schema.json",
"tests/fixtures/list_flag.json",
Expand Down Expand Up @@ -1846,7 +1848,7 @@
"tests/fixtures/sso_device_authorization_request.json",
"tests/fixtures/sso_logout_authorize_request.json",
"tests/fixtures/sso_logout_authorize_response.json",
"tests/fixtures/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.json",
"tests/fixtures/sso_required_oauth_error_body_with_connection_ids_list_email.json",
"tests/fixtures/sso_token_response.json",
"tests/fixtures/sso_token_response_oauth_token.json",
"tests/fixtures/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.json",
Expand Down Expand Up @@ -2449,20 +2451,20 @@
"sdkMethod": "create_directory_sync",
"service": "directory_sync"
},
"GET /directory_groups": {
"sdkMethod": "list_groups",
"GET /directories/{directoryId}/groups": {
"sdkMethod": "list_directory_groups",
"service": "directory_sync"
},
"GET /directory_groups/{id}": {
"sdkMethod": "get_group",
"GET /directories/{directoryId}/groups/{groupId}": {
"sdkMethod": "get_directory_group",
"service": "directory_sync"
},
"GET /directory_users": {
"sdkMethod": "list_users",
"GET /directories/{directoryId}/users": {
"sdkMethod": "list_directory_users",
"service": "directory_sync"
},
"GET /directory_users/{id}": {
"sdkMethod": "get_user",
"GET /directories/{directoryId}/users/{userId}": {
"sdkMethod": "get_directory_user",
"service": "directory_sync"
},
"GET /events": {
Expand Down Expand Up @@ -3076,6 +3078,22 @@
"GET /audit_logs/exports/{auditLogExportId}": {
"sdkMethod": "get_export",
"service": "audit_logs"
},
"GET /directory_groups": {
"sdkMethod": "list_groups",
"service": "directory_sync"
},
"GET /directory_groups/{id}": {
"sdkMethod": "get_group",
"service": "directory_sync"
},
"GET /directory_users": {
"sdkMethod": "list_users",
"service": "directory_sync"
},
"GET /directory_users/{id}": {
"sdkMethod": "get_user",
"service": "directory_sync"
}
}
}
8 changes: 4 additions & 4 deletions src/workos/audit_logs/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ def create_export(

Args:
organization_id: The unique ID of the Organization.
range_start: ISO-8601 value for start of the export range.
range_end: ISO-8601 value for end of the export range.
range_start: ISO-8601 value for start of the export range. The range must span no more than 31 days.
range_end: ISO-8601 value for end of the export range. Must be no more than 31 days after the start.
actions: List of actions to filter against.
actors: (deprecated) Deprecated. Use `actor_names` instead.
actor_names: List of actor names to filter against.
Expand Down Expand Up @@ -682,8 +682,8 @@ async def create_export(

Args:
organization_id: The unique ID of the Organization.
range_start: ISO-8601 value for start of the export range.
range_end: ISO-8601 value for end of the export range.
range_start: ISO-8601 value for start of the export range. The range must span no more than 31 days.
range_end: ISO-8601 value for end of the export range. Must be no more than 31 days after the start.
actions: List of actions to filter against.
actors: (deprecated) Deprecated. Use `actor_names` instead.
actor_names: List of actor names to filter against.
Expand Down
4 changes: 2 additions & 2 deletions src/workos/audit_logs/models/audit_log_export_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class AuditLogExportCreation:
organization_id: str
"""The unique ID of the Organization."""
range_start: datetime
"""ISO-8601 value for start of the export range."""
"""ISO-8601 value for start of the export range. The range must span no more than 31 days."""
range_end: datetime
"""ISO-8601 value for end of the export range."""
"""ISO-8601 value for end of the export range. Must be no more than 31 days after the start."""
actions: list[str] | None = None
"""List of actions to filter against."""
actors: list[str] | None = None
Expand Down
16 changes: 8 additions & 8 deletions src/workos/client_api/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def create_token(
user_id: str,
request_options: RequestOptions | None = None,
) -> ClientApiTokenResponse:
"""Generate a Client API token
"""Generate a Widgets API token

Generate a short-lived, session-bound token for the Client GraphQL API, scoped to an organization and user.
Generate a short-lived, session-bound token for the Widgets API, scoped to an organization and user.

Args:
organization_id: The ID of the organization to scope the Client API token to.
user_id: The ID of the user to issue the Client API token for.
organization_id: The ID of the organization to scope the Widgets API token to.
user_id: The ID of the user to issue the Widgets API token for.
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
Expand Down Expand Up @@ -70,13 +70,13 @@ async def create_token(
user_id: str,
request_options: RequestOptions | None = None,
) -> ClientApiTokenResponse:
"""Generate a Client API token
"""Generate a Widgets API token

Generate a short-lived, session-bound token for the Client GraphQL API, scoped to an organization and user.
Generate a short-lived, session-bound token for the Widgets API, scoped to an organization and user.

Args:
organization_id: The ID of the organization to scope the Client API token to.
user_id: The ID of the user to issue the Client API token for.
organization_id: The ID of the organization to scope the Widgets API token to.
user_id: The ID of the user to issue the Widgets API token for.
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
Expand Down
4 changes: 2 additions & 2 deletions src/workos/client_api/models/client_api_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class ClientApiToken:
"""Client Api Token model."""

organization_id: str
"""The ID of the organization to scope the Client API token to."""
"""The ID of the organization to scope the Widgets API token to."""
user_id: str
"""The ID of the user to issue the Client API token for."""
"""The ID of the user to issue the Widgets API token for."""

@classmethod
def from_dict(cls, data: dict[str, Any]) -> ClientApiToken:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ClientApiTokenResponse:
"""Client Api Token Response model."""

token: str
"""The Client API token."""
"""The Widgets API token."""

@classmethod
def from_dict(cls, data: dict[str, Any]) -> ClientApiTokenResponse:
Expand Down
8 changes: 7 additions & 1 deletion src/workos/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,12 @@
DataIntegrationsVendCredentialsRequestConnectionOwnerLiteral as DataIntegrationsVendCredentialsRequestConnectionOwnerLiteral,
)
from .models import DataIntegrationVendedCredential as DataIntegrationVendedCredential
from .models import (
DataIntegrationVendedCredentialAuthMethod as DataIntegrationVendedCredentialAuthMethod,
)
from .models import (
DataIntegrationVendedCredentialAuthMethodLiteral as DataIntegrationVendedCredentialAuthMethodLiteral,
)
from .models import (
DataIntegrationVendedCredentialUnknown as DataIntegrationVendedCredentialUnknown,
)
Expand Down Expand Up @@ -1552,7 +1558,7 @@
)
from .models import SmsChallengeRateLimitedErrorBody as SmsChallengeRateLimitedErrorBody
from .models import (
SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken as SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken,
SSORequiredOAuthErrorBodyWithConnectionIdsListEmail as SSORequiredOAuthErrorBodyWithConnectionIdsListEmail,
)
from .models import (
SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug as SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug,
Expand Down
10 changes: 8 additions & 2 deletions src/workos/common/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,12 @@
from .data_integration_vended_credential import (
DataIntegrationVendedCredentialVariant as DataIntegrationVendedCredentialVariant,
)
from .data_integration_vended_credential_auth_method import (
DataIntegrationVendedCredentialAuthMethod as DataIntegrationVendedCredentialAuthMethod,
)
from .data_integration_vended_credential_auth_method import (
DataIntegrationVendedCredentialAuthMethodLiteral as DataIntegrationVendedCredentialAuthMethodLiteral,
)
from .data_integrations_create_api_key_connection_request_connection_owner import (
DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner as DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner,
)
Expand Down Expand Up @@ -2069,8 +2075,8 @@
from .sms_challenge_rate_limited_error_body import (
SmsChallengeRateLimitedErrorBody as SmsChallengeRateLimitedErrorBody,
)
from .sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token import (
SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken as SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken,
from .sso_required_oauth_error_body_with_connection_ids_list_email import (
SSORequiredOAuthErrorBodyWithConnectionIdsListEmail as SSORequiredOAuthErrorBodyWithConnectionIdsListEmail,
Comment on lines +2078 to +2079

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Existing SSO imports fail

The rename removes SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken even though its fields have not changed. Applications importing that name from workos.common or workos.common.models now fail at startup with ImportError. Keep the old name and module as compatibility aliases while exposing the shorter name.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/common/models/__init__.py
Line: 2078-2079

Comment:
**Existing SSO imports fail**

The rename removes `SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken` even though its fields have not changed. Applications importing that name from `workos.common` or `workos.common.models` now fail at startup with `ImportError`. Keep the old name and module as compatibility aliases while exposing the shorter name.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

)
from .sub_resource_scoped_role_not_allowed_error_body_with_role_slug import (
SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug as SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class AgentAdminValidateCredentialRequestType(str, Enum):
"""Known values for AgentAdminValidateCredentialRequestType."""

API_KEY = "api_key"
"""The kind of credential being validated — an agent API key or an agent access token."""
ACCESS_TOKEN = "access_token"
"""The kind of credential being validated — an agent API key or an agent access token."""

@classmethod
def _missing_(cls, value: object) -> AgentAdminValidateCredentialRequestType | None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ class AgentBlueprintsTokenMintTokenRequestType(str, Enum):
"""Known values for AgentBlueprintsTokenMintTokenRequestType."""

USER_DELEGATED = "user_delegated"
"""How the session is minted: `user_delegated`, `autonomous`, `agent_delegated`, or `refresh`."""
AUTONOMOUS = "autonomous"
"""How the session is minted: `user_delegated`, `autonomous`, `agent_delegated`, or `refresh`."""
AGENT_DELEGATED = "agent_delegated"
"""How the session is minted: `user_delegated`, `autonomous`, `agent_delegated`, or `refresh`."""
REFRESH = "refresh"
"""How the session is minted: `user_delegated`, `autonomous`, `agent_delegated`, or `refresh`."""

@classmethod
def _missing_(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class AgentRegistrationClaimCompletedData:
"""The timestamp when the claim was created."""
updated_at: str
"""The timestamp when the claim was last updated."""
organization_id: str | None = None
"""The ID of the organization the registration belongs to."""

@classmethod
def from_dict(cls, data: dict[str, Any]) -> AgentRegistrationClaimCompletedData:
Expand All @@ -48,6 +50,7 @@ def from_dict(cls, data: dict[str, Any]) -> AgentRegistrationClaimCompletedData:
completed_at=data["completed_at"],
created_at=data["created_at"],
updated_at=data["updated_at"],
organization_id=data.get("organization_id"),
)
except (KeyError, ValueError) as e:
_raise_deserialize_error("AgentRegistrationClaimCompletedData", e)
Expand All @@ -63,4 +66,6 @@ def to_dict(self) -> dict[str, Any]:
result["completed_at"] = self.completed_at
result["created_at"] = self.created_at
result["updated_at"] = self.updated_at
if self.organization_id is not None:
result["organization_id"] = self.organization_id
return result
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class AuthenticationEmailVerificationFailedDataError:
"""The error code."""
message: str
"""A human-readable error message."""
radar_detection_id: str | None = None
"""The ID of the Radar detection that blocked the authentication. Only set on `policy_denied` errors."""

@classmethod
def from_dict(
Expand All @@ -26,6 +28,7 @@ def from_dict(
return cls(
code=data["code"],
message=data["message"],
radar_detection_id=data.get("radar_detection_id"),
)
except (KeyError, ValueError) as e:
_raise_deserialize_error(
Expand All @@ -37,4 +40,6 @@ def to_dict(self) -> dict[str, Any]:
result: dict[str, Any] = {}
result["code"] = self.code
result["message"] = self.message
if self.radar_detection_id is not None:
result["radar_detection_id"] = self.radar_detection_id
return result
Loading
Loading