Skip to content

Commit 4af7da4

Browse files
feat(generated): regenerate from spec (9 changes) (#665)
Co-authored-by: workos-sdk-automation[bot] <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Co-authored-by: Garen J. Torikian <gjtorikian@users.noreply.github.com>
1 parent ff8ad1b commit 4af7da4

76 files changed

Lines changed: 1279 additions & 323 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
- [#665](https://github.com/workos/workos-python/pull/665) feat(generated)!: regenerate from spec (9 changes)
2+
3+
**⚠️ Breaking**
4+
- **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**:
5+
- Made `expires_at` required in API key models
6+
- **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
7+
- Removed model `DsyncDeactivated`
8+
- Removed model `DsyncDeactivatedData`
9+
- Removed model `DsyncDeactivatedDataDomain`
10+
- Removed enum `DsyncDeactivatedDataType`
11+
- Removed enum `DsyncDeactivatedDataState`
12+
- **[radar](https://workos.com/docs/reference/radar)**:
13+
- Removed `domain_sign_up_rate_limit` from `RadarStandaloneResponseControl`
14+
- **[user_management](https://workos.com/docs/reference/authkit/user)**:
15+
- Removed `return_to` from `RevokeSession`
16+
17+
**Features**
18+
- **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**:
19+
- Added model `ExpireApiKey`
20+
- Added model `ApiKeyUpdated`
21+
- Added model `ApiKeyUpdatedData`
22+
- Added model `ApiKeyUpdatedDataOwner`
23+
- Added model `UserApiKeyUpdatedDataOwner`
24+
- Added model `ApiKeyUpdatedDataPreviousAttribute`
25+
- Added endpoint `POST /api_keys/{id}/expire`
26+
- **[audit_logs](https://workos.com/docs/reference/audit-logs)**:
27+
- Added `Snowflake` to `AuditLogConfigurationLogStreamType`
28+
- **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
29+
- Added `name` to `UserObject`
30+
- **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
31+
- Added model `DsyncTokenCreated`
32+
- Added model `DsyncTokenCreatedData`
33+
- Added model `DsyncTokenRevoked`
34+
- Added model `DsyncTokenRevokedData`
35+
- **[user_management](https://workos.com/docs/reference/authkit/user)**:
36+
- Added `name` to user management models
37+
- **[webhooks](https://workos.com/docs/reference/webhooks)**:
38+
- Added `api_key.updated` to `CreateWebhookEndpointEvents`
39+
- Added `api_key.updated` to `UpdateWebhookEndpointEvents`

.last-synced-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cb6857d51b453e3cbdb5bf3647d3ca229dd8af65
1+
d8c5a7de598792b1cee18d4a9842825110e5c74a

.oagen-manifest.json

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"language": "python",
4-
"generatedAt": "2026-05-26T19:47:29.645Z",
4+
"generatedAt": "2026-06-03T19:19:55.137Z",
55
"files": [
66
"src/workos/_client.py",
77
"src/workos/admin_portal/__init__.py",
@@ -19,6 +19,7 @@
1919
"src/workos/api_keys/models/api_key_owner.py",
2020
"src/workos/api_keys/models/api_key_validation_response.py",
2121
"src/workos/api_keys/models/create_organization_api_key.py",
22+
"src/workos/api_keys/models/expire_api_key.py",
2223
"src/workos/api_keys/models/organization_api_key.py",
2324
"src/workos/api_keys/models/organization_api_key_owner.py",
2425
"src/workos/api_keys/models/organization_api_key_with_value.py",
@@ -79,6 +80,10 @@
7980
"src/workos/common/models/api_key_revoked.py",
8081
"src/workos/common/models/api_key_revoked_data.py",
8182
"src/workos/common/models/api_key_revoked_data_owner.py",
83+
"src/workos/common/models/api_key_updated.py",
84+
"src/workos/common/models/api_key_updated_data.py",
85+
"src/workos/common/models/api_key_updated_data_owner.py",
86+
"src/workos/common/models/api_key_updated_data_previous_attribute.py",
8287
"src/workos/common/models/audit_log_configuration_log_stream_state.py",
8388
"src/workos/common/models/audit_log_configuration_log_stream_type.py",
8489
"src/workos/common/models/audit_log_configuration_state.py",
@@ -195,11 +200,6 @@
195200
"src/workos/common/models/dsync_activated_data_domain.py",
196201
"src/workos/common/models/dsync_activated_data_state.py",
197202
"src/workos/common/models/dsync_activated_data_type.py",
198-
"src/workos/common/models/dsync_deactivated.py",
199-
"src/workos/common/models/dsync_deactivated_data.py",
200-
"src/workos/common/models/dsync_deactivated_data_domain.py",
201-
"src/workos/common/models/dsync_deactivated_data_state.py",
202-
"src/workos/common/models/dsync_deactivated_data_type.py",
203203
"src/workos/common/models/dsync_deleted.py",
204204
"src/workos/common/models/dsync_deleted_data.py",
205205
"src/workos/common/models/dsync_deleted_data_state.py",
@@ -212,6 +212,10 @@
212212
"src/workos/common/models/dsync_group_user_added_data.py",
213213
"src/workos/common/models/dsync_group_user_removed.py",
214214
"src/workos/common/models/dsync_group_user_removed_data.py",
215+
"src/workos/common/models/dsync_token_created.py",
216+
"src/workos/common/models/dsync_token_created_data.py",
217+
"src/workos/common/models/dsync_token_revoked.py",
218+
"src/workos/common/models/dsync_token_revoked_data.py",
215219
"src/workos/common/models/dsync_user_created.py",
216220
"src/workos/common/models/dsync_user_deleted.py",
217221
"src/workos/common/models/dsync_user_updated.py",
@@ -396,6 +400,7 @@
396400
"src/workos/common/models/user.py",
397401
"src/workos/common/models/user_api_key_created_data_owner.py",
398402
"src/workos/common/models/user_api_key_revoked_data_owner.py",
403+
"src/workos/common/models/user_api_key_updated_data_owner.py",
399404
"src/workos/common/models/user_created.py",
400405
"src/workos/common/models/user_deleted.py",
401406
"src/workos/common/models/user_identities_get_item_provider.py",
@@ -674,6 +679,10 @@
674679
"tests/fixtures/api_key_revoked.json",
675680
"tests/fixtures/api_key_revoked_data.json",
676681
"tests/fixtures/api_key_revoked_data_owner.json",
682+
"tests/fixtures/api_key_updated.json",
683+
"tests/fixtures/api_key_updated_data.json",
684+
"tests/fixtures/api_key_updated_data_owner.json",
685+
"tests/fixtures/api_key_updated_data_previous_attribute.json",
677686
"tests/fixtures/api_key_validation_response.json",
678687
"tests/fixtures/application_credentials_list_item.json",
679688
"tests/fixtures/assign_role.json",
@@ -835,9 +844,6 @@
835844
"tests/fixtures/dsync_activated.json",
836845
"tests/fixtures/dsync_activated_data.json",
837846
"tests/fixtures/dsync_activated_data_domain.json",
838-
"tests/fixtures/dsync_deactivated.json",
839-
"tests/fixtures/dsync_deactivated_data.json",
840-
"tests/fixtures/dsync_deactivated_data_domain.json",
841847
"tests/fixtures/dsync_deleted.json",
842848
"tests/fixtures/dsync_deleted_data.json",
843849
"tests/fixtures/dsync_group_created.json",
@@ -848,6 +854,10 @@
848854
"tests/fixtures/dsync_group_user_added_data.json",
849855
"tests/fixtures/dsync_group_user_removed.json",
850856
"tests/fixtures/dsync_group_user_removed_data.json",
857+
"tests/fixtures/dsync_token_created.json",
858+
"tests/fixtures/dsync_token_created_data.json",
859+
"tests/fixtures/dsync_token_revoked.json",
860+
"tests/fixtures/dsync_token_revoked_data.json",
851861
"tests/fixtures/dsync_user_created.json",
852862
"tests/fixtures/dsync_user_deleted.json",
853863
"tests/fixtures/dsync_user_updated.json",
@@ -867,6 +877,7 @@
867877
"tests/fixtures/event_context_google_analytics_session.json",
868878
"tests/fixtures/event_list_list_metadata.json",
869879
"tests/fixtures/event_schema.json",
880+
"tests/fixtures/expire_api_key.json",
870881
"tests/fixtures/external_auth_complete_response.json",
871882
"tests/fixtures/feature_flag.json",
872883
"tests/fixtures/feature_flag_owner.json",
@@ -1081,6 +1092,7 @@
10811092
"tests/fixtures/user_api_key_created_data_owner.json",
10821093
"tests/fixtures/user_api_key_owner.json",
10831094
"tests/fixtures/user_api_key_revoked_data_owner.json",
1095+
"tests/fixtures/user_api_key_updated_data_owner.json",
10841096
"tests/fixtures/user_api_key_with_value.json",
10851097
"tests/fixtures/user_api_key_with_value_owner.json",
10861098
"tests/fixtures/user_authentication_factor_enroll_response.json",
@@ -1856,6 +1868,10 @@
18561868
"sdkMethod": "delete_api_key",
18571869
"service": "api_keys"
18581870
},
1871+
"POST /api_keys/{id}/expire": {
1872+
"sdkMethod": "create_api_key_expire",
1873+
"service": "api_keys"
1874+
},
18591875
"GET /user_management/users/{userId}/api_keys": {
18601876
"sdkMethod": "list_user_api_keys",
18611877
"service": "user_management"

src/workos/api_keys/_resource.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from .._types import RequestOptions, enum_value
1111
from .models import (
12+
ApiKey,
1213
ApiKeyValidationResponse,
1314
OrganizationApiKey,
1415
OrganizationApiKeyWithValue,
@@ -179,6 +180,48 @@ def delete_api_key(
179180
request_options=request_options,
180181
)
181182

183+
def create_api_key_expire(
184+
self,
185+
id: str,
186+
*,
187+
expires_at: Optional[str] = None,
188+
request_options: Optional[RequestOptions] = None,
189+
) -> ApiKey:
190+
"""Expire an API key
191+
192+
Expire an API key immediately, schedule a future expiration, or clear a scheduled future expiration.
193+
194+
Args:
195+
id: The unique ID of the API key.
196+
expires_at: When the API key should expire. If omitted or in the past, the key expires immediately. Use null to clear a scheduled future expiration.
197+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
198+
199+
Returns:
200+
ApiKey
201+
202+
Raises:
203+
NotFoundError: If the resource is not found (404).
204+
ConflictError: If a conflict occurs (409).
205+
UnprocessableEntityError: If the request data is unprocessable (422).
206+
AuthenticationError: If the API key is invalid (401).
207+
RateLimitExceededError: If rate limited (429).
208+
ServerError: If the server returns a 5xx error.
209+
"""
210+
body: Dict[str, Any] = {
211+
k: v
212+
for k, v in {
213+
"expires_at": expires_at,
214+
}.items()
215+
if v is not None
216+
}
217+
return self._client.request(
218+
method="post",
219+
path=("api_keys", str(id), "expire"),
220+
body=body,
221+
model=ApiKey,
222+
request_options=request_options,
223+
)
224+
182225

183226
class AsyncApiKeys:
184227
"""Api Keys API resources (async)."""
@@ -341,3 +384,45 @@ async def delete_api_key(
341384
path=("api_keys", str(id)),
342385
request_options=request_options,
343386
)
387+
388+
async def create_api_key_expire(
389+
self,
390+
id: str,
391+
*,
392+
expires_at: Optional[str] = None,
393+
request_options: Optional[RequestOptions] = None,
394+
) -> ApiKey:
395+
"""Expire an API key
396+
397+
Expire an API key immediately, schedule a future expiration, or clear a scheduled future expiration.
398+
399+
Args:
400+
id: The unique ID of the API key.
401+
expires_at: When the API key should expire. If omitted or in the past, the key expires immediately. Use null to clear a scheduled future expiration.
402+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
403+
404+
Returns:
405+
ApiKey
406+
407+
Raises:
408+
NotFoundError: If the resource is not found (404).
409+
ConflictError: If a conflict occurs (409).
410+
UnprocessableEntityError: If the request data is unprocessable (422).
411+
AuthenticationError: If the API key is invalid (401).
412+
RateLimitExceededError: If rate limited (429).
413+
ServerError: If the server returns a 5xx error.
414+
"""
415+
body: Dict[str, Any] = {
416+
k: v
417+
for k, v in {
418+
"expires_at": expires_at,
419+
}.items()
420+
if v is not None
421+
}
422+
return await self._client.request(
423+
method="post",
424+
path=("api_keys", str(id), "expire"),
425+
body=body,
426+
model=ApiKey,
427+
request_options=request_options,
428+
)

src/workos/api_keys/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .create_organization_api_key import (
99
CreateOrganizationApiKey as CreateOrganizationApiKey,
1010
)
11+
from .expire_api_key import ExpireApiKey as ExpireApiKey
1112
from .organization_api_key import OrganizationApiKey as OrganizationApiKey
1213
from .organization_api_key_owner import (
1314
OrganizationApiKeyOwner as OrganizationApiKeyOwner,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 datetime import datetime
7+
from typing import Any, Dict, Optional
8+
from workos._types import _raise_deserialize_error
9+
from workos._types import _format_datetime, _parse_datetime
10+
11+
12+
@dataclass(slots=True)
13+
class ExpireApiKey:
14+
"""Expire Api Key model."""
15+
16+
expires_at: Optional[datetime] = None
17+
"""When the API key should expire. If omitted or in the past, the key expires immediately. Use null to clear a scheduled future expiration."""
18+
19+
@classmethod
20+
def from_dict(cls, data: Dict[str, Any]) -> "ExpireApiKey":
21+
"""Deserialize from a dictionary."""
22+
try:
23+
return cls(
24+
expires_at=_parse_datetime(_v_expires_at)
25+
if (_v_expires_at := data.get("expires_at")) is not None
26+
else None,
27+
)
28+
except (KeyError, ValueError) as e:
29+
_raise_deserialize_error("ExpireApiKey", e)
30+
31+
def to_dict(self) -> Dict[str, Any]:
32+
"""Serialize to a dictionary."""
33+
result: Dict[str, Any] = {}
34+
if self.expires_at is not None:
35+
result["expires_at"] = _format_datetime(self.expires_at)
36+
else:
37+
result["expires_at"] = None
38+
return result

0 commit comments

Comments
 (0)