Skip to content

Commit a74e691

Browse files
feat(generated)!: SDK surface change: Parameter type changed for "expires_at" on "ApiKeys.create_api_key_expire" (+8 more) (#695)
Co-authored-by: workos-sdk-automation[bot] <255426317+workos-sdk-automation[bot]@users.noreply.github.com>
1 parent 3b9a2cb commit a74e691

186 files changed

Lines changed: 22153 additions & 533 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: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
* [#695](https://github.com/workos/workos-python/pull/695) feat(generated)!: regenerate from spec (9 changes)
2+
3+
**Features**
4+
* **agents**:
5+
* Added model `ClaimViewResponse`
6+
* Added model `ClaimViewResponseOrganization`
7+
* Added model `AgentAdminLinkClaimAttemptToExternalUserRequest`
8+
* Added model `AgentAdminLinkClaimAttemptToExternalUserRequestUser`
9+
* Added enum `ClaimViewResponseStatus`
10+
* Added endpoint `PATCH /agents/claims/attempts`
11+
* Added model `AgentRegistration`
12+
* Added model `AgentCredentialValidation`
13+
* Added model `AgentRegistrationAgentIdentity`
14+
* Added model `AgentRegistrationClaim`
15+
* Added model `AgentAdminValidateCredentialRequest`
16+
* Added model `AgentRegistrationClaimClaimCompletion`
17+
* Added enum `AgentRegistrationStatus`
18+
* Added enum `AgentRegistrationKind`
19+
* Added enum `AgentAdminValidateCredentialRequestType`
20+
* Added service `Agents`
21+
* **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**:
22+
* Added `agent_registration_id` to `ApiKeyValidationResponse`
23+
* **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
24+
* Added enum `ApplicationsRegistrationTypes`
25+
* Added parameter `Applications.list.registration_types`
26+
* **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
27+
* Added parameter `DirectoryUsers.list.idp_id`
28+
* Added parameter `DirectoryUsers.list.email`
29+
* **[organizations](https://workos.com/docs/reference/organization)**:
30+
* Added model `OrganizationAuthorizedConnectApplicationList`
31+
* Added model `OrganizationAuthorizedConnectApplicationListData`
32+
* Added model `OrganizationAuthorizedConnectApplicationListListMetadata`
33+
* Added service `OrganizationsAuthorizedApplications`
34+
* **[pipes](https://workos.com/docs/reference/pipes)**:
35+
* Added model `DataIntegrationInstallation`
36+
* Added `auth_methods` to `CreateDataIntegration`
37+
* Added `api_key` to `CreateDataIntegration`
38+
* Added `api_key` to `UpdateDataIntegration`
39+
* Added `auth_methods` to `DataIntegration`
40+
* Added `installation` to `DataIntegration`
41+
* Added enum `CreateDataIntegrationAuthMethods`
42+
* Added enum `DataIntegrationAuthMethods`
43+
* Added model `DataIntegrationCredentialsResponse`
44+
* Added model `DataIntegrationCredentialsResponseCredential`
45+
* Added model `DataIntegrationsUpsertApiKeyRequest`
46+
* Added model `DataIntegrationsVendCredentialsRequest`
47+
* Added enum `DataIntegrationCredentialsResponseError`
48+
* Added endpoint `PUT /data-integrations/{slug}/api-key`
49+
* Added endpoint `POST /data-integrations/{slug}/credentials`
50+
* **[sso](https://workos.com/docs/reference/sso)**:
51+
* Added parameter `SSO.authorize.prompt`
52+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
53+
* Added `ssha256` to `CreateUserPasswordHashType`
54+
* Added `ssha256` to `UpdateUserPasswordHashType`
55+
* Added endpoint `GET /user_management/radar_challenges/{id}`
56+
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
57+
* Added `agent.registration.revoked` to `CreateWebhookEndpointEvents`
58+
* Added `agent.registration.revoked` to `UpdateWebhookEndpointEvents`
59+
* Added `agent.registration.deleted` to `CreateWebhookEndpointEvents`
60+
* Added `agent.registration.deleted` to `UpdateWebhookEndpointEvents`
61+
* Added `radar.challenge_created` to `CreateWebhookEndpointEvents`
62+
* Added `radar.challenge_created` to `UpdateWebhookEndpointEvents`
63+
* Added `agent.registration.expired` to `CreateWebhookEndpointEvents`
64+
* Added `agent.registration.expired` to `UpdateWebhookEndpointEvents`
65+
* **[widgets](https://workos.com/docs/reference/widgets)**:
66+
* Made `WidgetSessionToken.organization_id` optional

.last-synced-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
56a015eaa3c5fb42a7dd77526c43953a971f4907
1+
f40851a620a1ba0badec95e80faac475382c8dd0

.oagen-manifest.json

Lines changed: 137 additions & 1 deletion
Large diffs are not rendered by default.

src/workos/_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
WorkOSClient as _SyncBase,
99
AsyncWorkOSClient as _AsyncBase,
1010
)
11+
from .agents._resource import Agents, AsyncAgents
1112
from .multi_factor_auth._resource import MultiFactorAuth, AsyncMultiFactorAuth
1213
from .connect._resource import Connect, AsyncConnect
1314
from .authorization._resource import Authorization, AsyncAuthorization
@@ -44,6 +45,11 @@
4445
class WorkOSClient(_SyncBase):
4546
"""Synchronous WorkOS API client with service accessors."""
4647

48+
@functools.cached_property
49+
def agents(self) -> Agents:
50+
"""Agents API resources."""
51+
return Agents(self)
52+
4753
@functools.cached_property
4854
def multi_factor_auth(self) -> MultiFactorAuth:
4955
"""Multi Factor Auth API resources."""
@@ -182,6 +188,11 @@ def pkce(self) -> PKCE:
182188
class AsyncWorkOSClient(_AsyncBase):
183189
"""Asynchronous WorkOS API client with service accessors."""
184190

191+
@functools.cached_property
192+
def agents(self) -> AsyncAgents:
193+
"""Agents API resources."""
194+
return AsyncAgents(self)
195+
185196
@functools.cached_property
186197
def multi_factor_auth(self) -> AsyncMultiFactorAuth:
187198
"""Multi Factor Auth API resources."""

src/workos/agents/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is auto-generated by oagen. Do not edit.
2+
3+
from ._resource import Agents as Agents, AsyncAgents as AsyncAgents
4+
from .models import *

src/workos/agents/_resource.py

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
# This file is auto-generated by oagen. Do not edit.
2+
3+
from __future__ import annotations
4+
5+
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Union
6+
7+
if TYPE_CHECKING:
8+
from .._client import AsyncWorkOSClient, WorkOSClient
9+
10+
from .._types import RequestOptions, enum_value
11+
from .models import (
12+
AgentAdminLinkClaimAttemptToExternalUserRequestUser,
13+
AgentCredentialValidation,
14+
AgentRegistration,
15+
ClaimViewResponse,
16+
)
17+
from workos.common.models.agent_admin_validate_credential_request_type import (
18+
AgentAdminValidateCredentialRequestType,
19+
)
20+
21+
22+
class Agents:
23+
"""Agents API resources."""
24+
25+
def __init__(self, client: "WorkOSClient") -> None:
26+
self._client = client
27+
28+
def update_attempts(
29+
self,
30+
*,
31+
type: Literal["link_external_user"],
32+
claim_attempt_token: str,
33+
user: AgentAdminLinkClaimAttemptToExternalUserRequestUser,
34+
organization_id: Optional[str] = None,
35+
request_options: Optional[RequestOptions] = None,
36+
) -> ClaimViewResponse:
37+
"""Link a claim attempt to an external user
38+
39+
Link an external user to a claim attempt and retrieve the code needed for the agent to complete the claim. The user is looked up by external ID; if no user exists, one is created. When the user belongs to multiple organizations, an explicit organization must be provided.
40+
41+
Args:
42+
type: The operation to perform on the claim attempt. Currently only `link_external_user` is supported.
43+
claim_attempt_token: The token identifying the claim attempt.
44+
user: The user to attach to the claim attempt, identified by email and external ID.
45+
organization_id: The organization to place the agent in. Required when the user belongs to more than one organization.
46+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
47+
48+
Returns:
49+
ClaimViewResponse
50+
51+
Raises:
52+
BadRequestError: If the request is malformed (400).
53+
AuthorizationError: If the request is forbidden (403).
54+
ConflictError: If a conflict occurs (409).
55+
AuthenticationError: If the API key is invalid (401).
56+
RateLimitExceededError: If rate limited (429).
57+
ServerError: If the server returns a 5xx error.
58+
"""
59+
body: Dict[str, Any] = {
60+
k: v
61+
for k, v in {
62+
"type": type,
63+
"claim_attempt_token": claim_attempt_token,
64+
"user": user.to_dict(),
65+
"organization_id": organization_id,
66+
}.items()
67+
if v is not None
68+
}
69+
return self._client.request(
70+
method="patch",
71+
path=("agents", "claims", "attempts"),
72+
body=body,
73+
model=ClaimViewResponse,
74+
request_options=request_options,
75+
)
76+
77+
def create_validate(
78+
self,
79+
*,
80+
type: Union[AgentAdminValidateCredentialRequestType, str],
81+
credential: str,
82+
audience: Optional[str] = None,
83+
request_options: Optional[RequestOptions] = None,
84+
) -> AgentCredentialValidation:
85+
"""Validate an agent credential
86+
87+
Validate an agent credential — an API key or access token — against the environment of the API key used to authenticate the request. This is a read-only check: it never consumes or mutates the credential.
88+
89+
Args:
90+
type: The kind of credential being validated — an agent API key or an agent access token.
91+
credential: The credential value to validate: the API key value for `api_key`, or the access token (JWT) for `access_token`.
92+
audience: When provided, the access token's `aud` claim is verified against this value. Tokens issued for a different resource are rejected.
93+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
94+
95+
Returns:
96+
AgentCredentialValidation
97+
98+
Raises:
99+
BadRequestError: If the request is malformed (400).
100+
AuthenticationError: If the API key is invalid (401).
101+
RateLimitExceededError: If rate limited (429).
102+
ServerError: If the server returns a 5xx error.
103+
"""
104+
body: Dict[str, Any] = {
105+
k: v
106+
for k, v in {
107+
"type": enum_value(type),
108+
"credential": credential,
109+
"audience": audience,
110+
}.items()
111+
if v is not None
112+
}
113+
return self._client.request(
114+
method="post",
115+
path=("agents", "credentials", "validate"),
116+
body=body,
117+
model=AgentCredentialValidation,
118+
request_options=request_options,
119+
)
120+
121+
def get_registration(
122+
self,
123+
id: str,
124+
*,
125+
request_options: Optional[RequestOptions] = None,
126+
) -> AgentRegistration:
127+
"""Get an agent registration
128+
129+
Retrieve the details of an agent registration by ID. The registration is scoped to the environment of the API key used to authenticate the request.
130+
131+
Args:
132+
id: The unique ID of the agent registration.
133+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
134+
135+
Returns:
136+
AgentRegistration
137+
138+
Raises:
139+
NotFoundError: If the resource is not found (404).
140+
AuthenticationError: If the API key is invalid (401).
141+
RateLimitExceededError: If rate limited (429).
142+
ServerError: If the server returns a 5xx error.
143+
"""
144+
return self._client.request(
145+
method="get",
146+
path=("agents", "registrations", str(id)),
147+
model=AgentRegistration,
148+
request_options=request_options,
149+
)
150+
151+
152+
class AsyncAgents:
153+
"""Agents API resources (async)."""
154+
155+
def __init__(self, client: "AsyncWorkOSClient") -> None:
156+
self._client = client
157+
158+
async def update_attempts(
159+
self,
160+
*,
161+
type: Literal["link_external_user"],
162+
claim_attempt_token: str,
163+
user: AgentAdminLinkClaimAttemptToExternalUserRequestUser,
164+
organization_id: Optional[str] = None,
165+
request_options: Optional[RequestOptions] = None,
166+
) -> ClaimViewResponse:
167+
"""Link a claim attempt to an external user
168+
169+
Link an external user to a claim attempt and retrieve the code needed for the agent to complete the claim. The user is looked up by external ID; if no user exists, one is created. When the user belongs to multiple organizations, an explicit organization must be provided.
170+
171+
Args:
172+
type: The operation to perform on the claim attempt. Currently only `link_external_user` is supported.
173+
claim_attempt_token: The token identifying the claim attempt.
174+
user: The user to attach to the claim attempt, identified by email and external ID.
175+
organization_id: The organization to place the agent in. Required when the user belongs to more than one organization.
176+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
177+
178+
Returns:
179+
ClaimViewResponse
180+
181+
Raises:
182+
BadRequestError: If the request is malformed (400).
183+
AuthorizationError: If the request is forbidden (403).
184+
ConflictError: If a conflict occurs (409).
185+
AuthenticationError: If the API key is invalid (401).
186+
RateLimitExceededError: If rate limited (429).
187+
ServerError: If the server returns a 5xx error.
188+
"""
189+
body: Dict[str, Any] = {
190+
k: v
191+
for k, v in {
192+
"type": type,
193+
"claim_attempt_token": claim_attempt_token,
194+
"user": user.to_dict(),
195+
"organization_id": organization_id,
196+
}.items()
197+
if v is not None
198+
}
199+
return await self._client.request(
200+
method="patch",
201+
path=("agents", "claims", "attempts"),
202+
body=body,
203+
model=ClaimViewResponse,
204+
request_options=request_options,
205+
)
206+
207+
async def create_validate(
208+
self,
209+
*,
210+
type: Union[AgentAdminValidateCredentialRequestType, str],
211+
credential: str,
212+
audience: Optional[str] = None,
213+
request_options: Optional[RequestOptions] = None,
214+
) -> AgentCredentialValidation:
215+
"""Validate an agent credential
216+
217+
Validate an agent credential — an API key or access token — against the environment of the API key used to authenticate the request. This is a read-only check: it never consumes or mutates the credential.
218+
219+
Args:
220+
type: The kind of credential being validated — an agent API key or an agent access token.
221+
credential: The credential value to validate: the API key value for `api_key`, or the access token (JWT) for `access_token`.
222+
audience: When provided, the access token's `aud` claim is verified against this value. Tokens issued for a different resource are rejected.
223+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
224+
225+
Returns:
226+
AgentCredentialValidation
227+
228+
Raises:
229+
BadRequestError: If the request is malformed (400).
230+
AuthenticationError: If the API key is invalid (401).
231+
RateLimitExceededError: If rate limited (429).
232+
ServerError: If the server returns a 5xx error.
233+
"""
234+
body: Dict[str, Any] = {
235+
k: v
236+
for k, v in {
237+
"type": enum_value(type),
238+
"credential": credential,
239+
"audience": audience,
240+
}.items()
241+
if v is not None
242+
}
243+
return await self._client.request(
244+
method="post",
245+
path=("agents", "credentials", "validate"),
246+
body=body,
247+
model=AgentCredentialValidation,
248+
request_options=request_options,
249+
)
250+
251+
async def get_registration(
252+
self,
253+
id: str,
254+
*,
255+
request_options: Optional[RequestOptions] = None,
256+
) -> AgentRegistration:
257+
"""Get an agent registration
258+
259+
Retrieve the details of an agent registration by ID. The registration is scoped to the environment of the API key used to authenticate the request.
260+
261+
Args:
262+
id: The unique ID of the agent registration.
263+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
264+
265+
Returns:
266+
AgentRegistration
267+
268+
Raises:
269+
NotFoundError: If the resource is not found (404).
270+
AuthenticationError: If the API key is invalid (401).
271+
RateLimitExceededError: If rate limited (429).
272+
ServerError: If the server returns a 5xx error.
273+
"""
274+
return await self._client.request(
275+
method="get",
276+
path=("agents", "registrations", str(id)),
277+
model=AgentRegistration,
278+
request_options=request_options,
279+
)

0 commit comments

Comments
 (0)