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,21 @@
* [#786](https://github.com/workos/workos-python/pull/786) feat(generated): regenerate from spec (6 changes)

**Features**
* **[agents](https://workos.com/docs/reference/agents)**:
* Added endpoint `GET /agents/registrations`
* **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**:
* Added model `InvalidOrganizationMembershipErrorBody`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Added `organization_id` to `UserManagementLoginRequest`
* Added endpoint `GET /user_management/users/identities/{provider}/{idp_id}`
* **[organizations](https://workos.com/docs/reference/organization)**:
* Added `invalid_organization_membership` to `ErrorBodyCode`
* Added `radar_email_challenge` to `ErrorBodyCode`
* **[radar](https://workos.com/docs/reference/radar)**:
* Added model `RadarEmailChallengeErrorBody`

**Fixes**
* **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
* Changed errors for endpoint `POST /authkit/oauth2/complete`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* 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 @@
23bb5055bdec0b3d2efcc7d73eb162b57e1e7b43
13e6a96ea6038a2789da23e8f1e908103d043195
13 changes: 13 additions & 0 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
"src/workos/common/models/invalid_metadata_error_body.py",
"src/workos/common/models/invalid_one_time_code_error_body.py",
"src/workos/common/models/invalid_organization_id_error_body.py",
"src/workos/common/models/invalid_organization_membership_error_body.py",
"src/workos/common/models/invalid_password_hash_error_body.py",
"src/workos/common/models/invalid_pending_authentication_token_error_body.py",
"src/workos/common/models/invalid_profile_oauth_error_body.py",
Expand Down Expand Up @@ -762,6 +763,7 @@
"src/workos/common/models/radar_detection_stale_account_details.py",
"src/workos/common/models/radar_detection_unrecognized_device_details.py",
"src/workos/common/models/radar_detection_verdict.py",
"src/workos/common/models/radar_email_challenge_error_body.py",
"src/workos/common/models/radar_list_entry_already_present_response.py",
"src/workos/common/models/radar_sign_up_challenge_error_body.py",
"src/workos/common/models/radar_sms_challenge_error_body.py",
Expand Down Expand Up @@ -1708,6 +1710,7 @@
"tests/fixtures/invalid_metadata_error_body.json",
"tests/fixtures/invalid_one_time_code_error_body.json",
"tests/fixtures/invalid_organization_id_error_body.json",
"tests/fixtures/invalid_organization_membership_error_body.json",
"tests/fixtures/invalid_password_hash_error_body.json",
"tests/fixtures/invalid_pending_authentication_token_error_body.json",
"tests/fixtures/invalid_profile_oauth_error_body.json",
Expand Down Expand Up @@ -1746,6 +1749,7 @@
"tests/fixtures/list_agent_blueprint.json",
"tests/fixtures/list_agent_instance.json",
"tests/fixtures/list_agent_instance_session.json",
"tests/fixtures/list_agent_registration.json",
"tests/fixtures/list_audit_log_action.json",
"tests/fixtures/list_audit_log_schema.json",
"tests/fixtures/list_authentication_factor.json",
Expand Down Expand Up @@ -1922,6 +1926,7 @@
"tests/fixtures/radar_detection_stale_account_details.json",
"tests/fixtures/radar_detection_unrecognized_device_details.json",
"tests/fixtures/radar_email_challenge_code_session_authenticate_request.json",
"tests/fixtures/radar_email_challenge_error_body.json",
"tests/fixtures/radar_list_entry_already_present_response.json",
"tests/fixtures/radar_sign_up_challenge_error_body.json",
"tests/fixtures/radar_sms_challenge_code_session_authenticate_request.json",
Expand Down Expand Up @@ -3276,6 +3281,14 @@
"GET /directory_users/{id}": {
"sdkMethod": "get_user",
"service": "directory_sync"
},
"GET /agents/registrations": {
"sdkMethod": "list_registrations",
"service": "agents"
},
"GET /user_management/users/identities/{provider}/{idp_id}": {
"sdkMethod": "get_identity",
"service": "user_management"
}
}
}
104 changes: 104 additions & 0 deletions src/workos/agents/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,58 @@ def create_validate(
request_options=request_options,
)

def list_registrations(
self,
*,
limit: int | None = None,
before: str | None = None,
after: str | None = None,
order: PaginationOrder | str | None = "desc",
user_id: str | None = None,
organization_id: str | None = None,
request_options: RequestOptions | None = None,
) -> SyncPage[AgentRegistration]:
"""List agent registrations

List the agent registrations in the environment of the API key used to authenticate the request, optionally filtered by organization or user.

Args:
limit: Upper limit on the number of objects to return, between `1` and `100`. Defaults to `10`.
before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `\"obj_123\"`, your subsequent call can include `before=\"obj_123\"` to fetch a new batch of objects before `\"obj_123\"`.
after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `\"obj_123\"`, your subsequent call can include `after=\"obj_123\"` to fetch a new batch of objects after `\"obj_123\"`.
order: Order the results by the creation time. Supported values are `\"asc\"` (ascending), `\"desc\"` (descending), and `\"normal\"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to `desc`.
user_id: Only return registrations whose agent identity is bound to this user.
organization_id: Only return registrations belonging to this organization.
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
SyncPage[AgentRegistration]

Raises:
AuthenticationError: If the API key is invalid (401).
RateLimitExceededError: If rate limited (429).
ServerError: If the server returns a 5xx error.
"""
params = {
k: v
for k, v in {
"limit": limit,
"before": before,
"after": after,
"order": enum_value(order) if order is not None else None,
"user_id": user_id,
"organization_id": organization_id,
}.items()
if v is not None
}
return self._client.request_page(
method="get",
path=("agents", "registrations"),
model=AgentRegistration,
params=params,
request_options=request_options,
)

def get_registration(
self,
id: str,
Expand Down Expand Up @@ -1177,6 +1229,58 @@ async def create_validate(
request_options=request_options,
)

async def list_registrations(
self,
*,
limit: int | None = None,
before: str | None = None,
after: str | None = None,
order: PaginationOrder | str | None = "desc",
user_id: str | None = None,
organization_id: str | None = None,
request_options: RequestOptions | None = None,
) -> AsyncPage[AgentRegistration]:
"""List agent registrations

List the agent registrations in the environment of the API key used to authenticate the request, optionally filtered by organization or user.

Args:
limit: Upper limit on the number of objects to return, between `1` and `100`. Defaults to `10`.
before: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `\"obj_123\"`, your subsequent call can include `before=\"obj_123\"` to fetch a new batch of objects before `\"obj_123\"`.
after: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `\"obj_123\"`, your subsequent call can include `after=\"obj_123\"` to fetch a new batch of objects after `\"obj_123\"`.
order: Order the results by the creation time. Supported values are `\"asc\"` (ascending), `\"desc\"` (descending), and `\"normal\"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to `desc`.
user_id: Only return registrations whose agent identity is bound to this user.
organization_id: Only return registrations belonging to this organization.
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
AsyncPage[AgentRegistration]

Raises:
AuthenticationError: If the API key is invalid (401).
RateLimitExceededError: If rate limited (429).
ServerError: If the server returns a 5xx error.
"""
params = {
k: v
for k, v in {
"limit": limit,
"before": before,
"after": after,
"order": enum_value(order) if order is not None else None,
"user_id": user_id,
"organization_id": organization_id,
}.items()
if v is not None
}
return await self._client.request_page(
method="get",
path=("agents", "registrations"),
model=AgentRegistration,
params=params,
request_options=request_options,
)

async def get_registration(
self,
id: str,
Expand Down
Loading