From 8649907804addf279607c33da05a6cc46f3945b7 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 15:36:34 +0000 Subject: [PATCH 1/2] chore(generated): regenerate shared files for Pipes --- .last-synced-sha | 2 +- src/workos/pipes/_resource.py | 64 ++++++++++++- ...ata_integrations_get_user_token_request.py | 5 + .../models/data_integrations_list_response.py | 2 +- .../data_integrations_list_response_data.py | 11 +++ ...a_integrations_vend_credentials_request.py | 5 + ...a_integrations_get_user_token_request.json | 3 +- .../data_integrations_list_response.json | 25 ++++- .../data_integrations_list_response_data.json | 25 ++++- ...integrations_vend_credentials_request.json | 3 +- tests/test_pipes.py | 54 +++++++++-- tests/test_pipes_models_round_trip.py | 93 +++++++++++++++++++ 12 files changed, 278 insertions(+), 14 deletions(-) diff --git a/.last-synced-sha b/.last-synced-sha index d20a1099..2f412fd3 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -edb560e2be3f54b668ea8d11fa5a060c87ab5087 +6fba233c50a5b651b2df7b859b75bfe715bc825a diff --git a/src/workos/pipes/_resource.py b/src/workos/pipes/_resource.py index 4e2ea734..950eb8c8 100644 --- a/src/workos/pipes/_resource.py +++ b/src/workos/pipes/_resource.py @@ -219,6 +219,7 @@ def update_data_integration( AuthenticationError: If the API key is invalid (401). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -303,6 +304,7 @@ def update_data_integration_api_key( AuthenticationError: If the API key is invalid (401). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -407,6 +409,7 @@ def update_data_integration_client_credentials( AuthenticationError: If the API key is invalid (401). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -436,6 +439,7 @@ def create_data_integration_credential( *, user_id: str, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> DataIntegrationCredentialsResponse: """Vend credentials for a connected account @@ -446,6 +450,7 @@ def create_data_integration_credential( slug: The identifier of the integration. user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -455,6 +460,7 @@ def create_data_integration_credential( BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -464,6 +470,7 @@ def create_data_integration_credential( for k, v in { "user_id": user_id, "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -481,6 +488,7 @@ def get_access_token( *, user_id: str, organization_id: str | None | NotGiven = NOT_GIVEN, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> DataIntegrationAccessTokenResponse: """Get an access token for a connected account @@ -491,6 +499,7 @@ def get_access_token( provider: The identifier of the integration. user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -500,12 +509,18 @@ def get_access_token( BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ body: dict[str, Any] = { - "user_id": user_id, + k: v + for k, v in { + "user_id": user_id, + "connected_account_id": connected_account_id, + }.items() + if v is not None } if not isinstance(organization_id, NotGiven): body["organization_id"] = organization_id @@ -523,6 +538,7 @@ def get_user_connected_account( slug: str, *, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> ConnectedAccount: """Get a connected account @@ -533,14 +549,17 @@ def get_user_connected_account( user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. slug: The slug identifier of the provider (e.g., `github`, `slack`, `notion`). organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: ConnectedAccount Raises: + BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ @@ -548,6 +567,7 @@ def get_user_connected_account( k: v for k, v in { "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -648,6 +668,7 @@ def update_user_connected_account( scopes: list[str] | None = None, state: ConnectedAccountInputState | str | None = None, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> ConnectedAccount: """Update a connected account @@ -663,14 +684,17 @@ def update_user_connected_account( scopes: The OAuth scopes granted for this connection. state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: ConnectedAccount Raises: + BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ @@ -689,6 +713,7 @@ def update_user_connected_account( k: v for k, v in { "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -713,6 +738,7 @@ def delete_user_connected_account( slug: str, *, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> None: """Delete a connected account @@ -723,11 +749,14 @@ def delete_user_connected_account( user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. slug: The slug identifier of the provider (e.g., `github`, `slack`, `notion`). organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to delete. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Raises: + BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ @@ -735,6 +764,7 @@ def delete_user_connected_account( k: v for k, v in { "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -980,6 +1010,7 @@ async def update_data_integration( AuthenticationError: If the API key is invalid (401). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -1064,6 +1095,7 @@ async def update_data_integration_api_key( AuthenticationError: If the API key is invalid (401). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -1168,6 +1200,7 @@ async def update_data_integration_client_credentials( AuthenticationError: If the API key is invalid (401). AuthorizationError: If the request is forbidden (403). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -1197,6 +1230,7 @@ async def create_data_integration_credential( *, user_id: str, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> DataIntegrationCredentialsResponse: """Vend credentials for a connected account @@ -1207,6 +1241,7 @@ async def create_data_integration_credential( slug: The identifier of the integration. user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -1216,6 +1251,7 @@ async def create_data_integration_credential( BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. @@ -1225,6 +1261,7 @@ async def create_data_integration_credential( for k, v in { "user_id": user_id, "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -1242,6 +1279,7 @@ async def get_access_token( *, user_id: str, organization_id: str | None | NotGiven = NOT_GIVEN, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> DataIntegrationAccessTokenResponse: """Get an access token for a connected account @@ -1252,6 +1290,7 @@ async def get_access_token( provider: The identifier of the integration. user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: @@ -1261,12 +1300,18 @@ async def get_access_token( BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). UnprocessableEntityError: If the request data is unprocessable (422). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ body: dict[str, Any] = { - "user_id": user_id, + k: v + for k, v in { + "user_id": user_id, + "connected_account_id": connected_account_id, + }.items() + if v is not None } if not isinstance(organization_id, NotGiven): body["organization_id"] = organization_id @@ -1284,6 +1329,7 @@ async def get_user_connected_account( slug: str, *, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> ConnectedAccount: """Get a connected account @@ -1294,14 +1340,17 @@ async def get_user_connected_account( user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. slug: The slug identifier of the provider (e.g., `github`, `slack`, `notion`). organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: ConnectedAccount Raises: + BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ @@ -1309,6 +1358,7 @@ async def get_user_connected_account( k: v for k, v in { "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -1409,6 +1459,7 @@ async def update_user_connected_account( scopes: list[str] | None = None, state: ConnectedAccountInputState | str | None = None, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> ConnectedAccount: """Update a connected account @@ -1424,14 +1475,17 @@ async def update_user_connected_account( scopes: The OAuth scopes granted for this connection. state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Returns: ConnectedAccount Raises: + BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ @@ -1450,6 +1504,7 @@ async def update_user_connected_account( k: v for k, v in { "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } @@ -1474,6 +1529,7 @@ async def delete_user_connected_account( slug: str, *, organization_id: str | None = None, + connected_account_id: str | None = None, request_options: RequestOptions | None = None, ) -> None: """Delete a connected account @@ -1484,11 +1540,14 @@ async def delete_user_connected_account( user_id: A [User](https://workos.com/docs/reference/authkit/user) identifier. slug: The slug identifier of the provider (e.g., `github`, `slack`, `notion`). organization_id: An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to delete. request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override. Raises: + BadRequestError: If the request is malformed (400). AuthenticationError: If the API key is invalid (401). NotFoundError: If the resource is not found (404). + ConflictError: If a conflict occurs (409). RateLimitExceededError: If rate limited (429). ServerError: If the server returns a 5xx error. """ @@ -1496,6 +1555,7 @@ async def delete_user_connected_account( k: v for k, v in { "organization_id": organization_id, + "connected_account_id": connected_account_id, }.items() if v is not None } diff --git a/src/workos/pipes/models/data_integrations_get_user_token_request.py b/src/workos/pipes/models/data_integrations_get_user_token_request.py index 1fc0ef92..7c93c3b1 100644 --- a/src/workos/pipes/models/data_integrations_get_user_token_request.py +++ b/src/workos/pipes/models/data_integrations_get_user_token_request.py @@ -16,6 +16,8 @@ class DataIntegrationsGetUserTokenRequest: """A [User](https://workos.com/docs/reference/authkit/user) identifier.""" organization_id: str | None = None """An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization.""" + connected_account_id: str | None = None + """A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider.""" @classmethod def from_dict(cls, data: dict[str, Any]) -> DataIntegrationsGetUserTokenRequest: @@ -24,6 +26,7 @@ def from_dict(cls, data: dict[str, Any]) -> DataIntegrationsGetUserTokenRequest: return cls( user_id=data["user_id"], organization_id=data.get("organization_id"), + connected_account_id=data.get("connected_account_id"), ) except (KeyError, ValueError) as e: _raise_deserialize_error("DataIntegrationsGetUserTokenRequest", e) @@ -36,4 +39,6 @@ def to_dict(self) -> dict[str, Any]: result["organization_id"] = self.organization_id else: result["organization_id"] = None + if self.connected_account_id is not None: + result["connected_account_id"] = self.connected_account_id return result diff --git a/src/workos/pipes/models/data_integrations_list_response.py b/src/workos/pipes/models/data_integrations_list_response.py index 4aa62cb7..a8482582 100644 --- a/src/workos/pipes/models/data_integrations_list_response.py +++ b/src/workos/pipes/models/data_integrations_list_response.py @@ -17,7 +17,7 @@ class DataIntegrationsListResponse: object: Literal["list"] """Indicates this is a list response.""" data: list[DataIntegrationsListResponseData] - """A list of [providers](https://workos.com/docs/reference/pipes/provider), each including a [`connected_account`](https://workos.com/docs/reference/pipes/connected-account) field with the user's connection status.""" + """A list of [providers](https://workos.com/docs/reference/pipes/provider), each including the legacy `connected_account` field and the additive `connected_accounts` collection.""" @classmethod def from_dict(cls, data: dict[str, Any]) -> DataIntegrationsListResponse: diff --git a/src/workos/pipes/models/data_integrations_list_response_data.py b/src/workos/pipes/models/data_integrations_list_response_data.py index a4f173e0..d4cbac8e 100644 --- a/src/workos/pipes/models/data_integrations_list_response_data.py +++ b/src/workos/pipes/models/data_integrations_list_response_data.py @@ -47,6 +47,8 @@ class DataIntegrationsListResponseData: """The timestamp when the provider was last updated.""" connected_account: DataIntegrationsListResponseDataConnectedAccount | None """The user's [connected account](https://workos.com/docs/reference/pipes/connected-account) for this provider, or `null` if the user has not connected.""" + connected_accounts: list[DataIntegrationsListResponseDataConnectedAccount] + """The user's connected accounts for this provider in the requested ownership context.""" auth_methods: list[DataIntegrationsListResponseDataAuthMethods] | None = None """The authentication methods supported by this provider (`oauth`, `api_key`, `client_credentials`, or a combination). Defaults to `["oauth"]` if absent.""" @@ -71,6 +73,12 @@ def from_dict(cls, data: dict[str, Any]) -> DataIntegrationsListResponseData: ) if (_v_connected_account := data["connected_account"]) is not None else None, + connected_accounts=[ + DataIntegrationsListResponseDataConnectedAccount.from_dict( + cast(dict[str, Any], item) + ) + for item in cast(list[Any], data["connected_accounts"]) + ], auth_methods=[ DataIntegrationsListResponseDataAuthMethods(item) for item in cast(list[Any], _v_auth_methods) @@ -107,6 +115,9 @@ def to_dict(self) -> dict[str, Any]: result["connected_account"] = self.connected_account.to_dict() else: result["connected_account"] = None + result["connected_accounts"] = [ + item.to_dict() for item in self.connected_accounts + ] if self.auth_methods is not None: result["auth_methods"] = [ item.value if isinstance(item, Enum) else item diff --git a/src/workos/pipes/models/data_integrations_vend_credentials_request.py b/src/workos/pipes/models/data_integrations_vend_credentials_request.py index 703af7f1..941de6e3 100644 --- a/src/workos/pipes/models/data_integrations_vend_credentials_request.py +++ b/src/workos/pipes/models/data_integrations_vend_credentials_request.py @@ -16,6 +16,8 @@ class DataIntegrationsVendCredentialsRequest: """A [User](https://workos.com/docs/reference/authkit/user) identifier.""" organization_id: str | None = None """An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization.""" + connected_account_id: str | None = None + """A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider.""" @classmethod def from_dict(cls, data: dict[str, Any]) -> DataIntegrationsVendCredentialsRequest: @@ -24,6 +26,7 @@ def from_dict(cls, data: dict[str, Any]) -> DataIntegrationsVendCredentialsReque return cls( user_id=data["user_id"], organization_id=data.get("organization_id"), + connected_account_id=data.get("connected_account_id"), ) except (KeyError, ValueError) as e: _raise_deserialize_error("DataIntegrationsVendCredentialsRequest", e) @@ -34,4 +37,6 @@ def to_dict(self) -> dict[str, Any]: result["user_id"] = self.user_id if self.organization_id is not None: result["organization_id"] = self.organization_id + if self.connected_account_id is not None: + result["connected_account_id"] = self.connected_account_id return result diff --git a/tests/fixtures/data_integrations_get_user_token_request.json b/tests/fixtures/data_integrations_get_user_token_request.json index ef8c4438..66f0412e 100644 --- a/tests/fixtures/data_integrations_get_user_token_request.json +++ b/tests/fixtures/data_integrations_get_user_token_request.json @@ -1,4 +1,5 @@ { "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", - "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT" + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "connected_account_id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT" } diff --git a/tests/fixtures/data_integrations_list_response.json b/tests/fixtures/data_integrations_list_response.json index 00951fba..365f599f 100644 --- a/tests/fixtures/data_integrations_list_response.json +++ b/tests/fixtures/data_integrations_list_response.json @@ -39,7 +39,30 @@ "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z", "userlandUserId": "test_userlandUserId" - } + }, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": null, + "scopes": [ + "repo", + "user:email" + ], + "auth_method": "oauth", + "api_key_last_4": null, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId" + } + ] } ] } diff --git a/tests/fixtures/data_integrations_list_response_data.json b/tests/fixtures/data_integrations_list_response_data.json index ccb24ea7..f3997ed1 100644 --- a/tests/fixtures/data_integrations_list_response_data.json +++ b/tests/fixtures/data_integrations_list_response_data.json @@ -36,5 +36,28 @@ "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z", "userlandUserId": "test_userlandUserId" - } + }, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": null, + "scopes": [ + "repo", + "user:email" + ], + "auth_method": "oauth", + "api_key_last_4": null, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId" + } + ] } diff --git a/tests/fixtures/data_integrations_vend_credentials_request.json b/tests/fixtures/data_integrations_vend_credentials_request.json index ef8c4438..66f0412e 100644 --- a/tests/fixtures/data_integrations_vend_credentials_request.json +++ b/tests/fixtures/data_integrations_vend_credentials_request.json @@ -1,4 +1,5 @@ { "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", - "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT" + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "connected_account_id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT" } diff --git a/tests/test_pipes.py b/tests/test_pipes.py index b05bc08e..f2b19494 100644 --- a/tests/test_pipes.py +++ b/tests/test_pipes.py @@ -209,10 +209,17 @@ def test_get_user_connected_account(self, workos, httpx_mock): def test_get_user_connected_account_encodes_query_params(self, workos, httpx_mock): httpx_mock.add_response(json=load_fixture("connected_account.json")) workos.pipes.get_user_connected_account( - "test_user_id", "test_slug", organization_id="value organization_id/test" + "test_user_id", + "test_slug", + organization_id="value organization_id/test", + connected_account_id="value connected_account_id/test", ) request = httpx_mock.get_request() assert request.url.params["organization_id"] == "value organization_id/test" + assert ( + request.url.params["connected_account_id"] + == "value connected_account_id/test" + ) def test_create_user_connected_account(self, workos, httpx_mock): httpx_mock.add_response( @@ -257,10 +264,17 @@ def test_update_user_connected_account_encodes_query_params( ): httpx_mock.add_response(json=load_fixture("connected_account.json")) workos.pipes.update_user_connected_account( - "test_user_id", "test_slug", organization_id="value organization_id/test" + "test_user_id", + "test_slug", + organization_id="value organization_id/test", + connected_account_id="value connected_account_id/test", ) request = httpx_mock.get_request() assert request.url.params["organization_id"] == "value organization_id/test" + assert ( + request.url.params["connected_account_id"] + == "value connected_account_id/test" + ) def test_delete_user_connected_account(self, workos, httpx_mock): httpx_mock.add_response(status_code=204) @@ -277,10 +291,17 @@ def test_delete_user_connected_account_encodes_query_params( ): httpx_mock.add_response(status_code=204) workos.pipes.delete_user_connected_account( - "test_user_id", "test_slug", organization_id="value organization_id/test" + "test_user_id", + "test_slug", + organization_id="value organization_id/test", + connected_account_id="value connected_account_id/test", ) request = httpx_mock.get_request() assert request.url.params["organization_id"] == "value organization_id/test" + assert ( + request.url.params["connected_account_id"] + == "value connected_account_id/test" + ) def test_list_user_data_providers(self, workos, httpx_mock): httpx_mock.add_response( @@ -559,10 +580,17 @@ async def test_get_user_connected_account_encodes_query_params( ): httpx_mock.add_response(json=load_fixture("connected_account.json")) await async_workos.pipes.get_user_connected_account( - "test_user_id", "test_slug", organization_id="value organization_id/test" + "test_user_id", + "test_slug", + organization_id="value organization_id/test", + connected_account_id="value connected_account_id/test", ) request = httpx_mock.get_request() assert request.url.params["organization_id"] == "value organization_id/test" + assert ( + request.url.params["connected_account_id"] + == "value connected_account_id/test" + ) @pytest.mark.asyncio async def test_create_user_connected_account(self, async_workos, httpx_mock): @@ -611,10 +639,17 @@ async def test_update_user_connected_account_encodes_query_params( ): httpx_mock.add_response(json=load_fixture("connected_account.json")) await async_workos.pipes.update_user_connected_account( - "test_user_id", "test_slug", organization_id="value organization_id/test" + "test_user_id", + "test_slug", + organization_id="value organization_id/test", + connected_account_id="value connected_account_id/test", ) request = httpx_mock.get_request() assert request.url.params["organization_id"] == "value organization_id/test" + assert ( + request.url.params["connected_account_id"] + == "value connected_account_id/test" + ) @pytest.mark.asyncio async def test_delete_user_connected_account(self, async_workos, httpx_mock): @@ -635,10 +670,17 @@ async def test_delete_user_connected_account_encodes_query_params( ): httpx_mock.add_response(status_code=204) await async_workos.pipes.delete_user_connected_account( - "test_user_id", "test_slug", organization_id="value organization_id/test" + "test_user_id", + "test_slug", + organization_id="value organization_id/test", + connected_account_id="value connected_account_id/test", ) request = httpx_mock.get_request() assert request.url.params["organization_id"] == "value organization_id/test" + assert ( + request.url.params["connected_account_id"] + == "value connected_account_id/test" + ) @pytest.mark.asyncio async def test_list_user_data_providers(self, async_workos, httpx_mock): diff --git a/tests/test_pipes_models_round_trip.py b/tests/test_pipes_models_round_trip.py index 23055c51..be400f2a 100644 --- a/tests/test_pipes_models_round_trip.py +++ b/tests/test_pipes_models_round_trip.py @@ -556,6 +556,26 @@ def test_data_integrations_list_response_minimal_payload(self): "updated_at": "2024-01-16T14:20:00.000Z", "userlandUserId": "test_userlandUserId", }, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": None, + "scopes": ["repo", "user:email"], + "auth_method": "oauth", + "api_key_last_4": None, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId", + } + ], } ], } @@ -586,6 +606,24 @@ def test_data_integrations_list_response_data_minimal_payload(self): "created_at": "2024-01-15T10:30:00.000Z", "updated_at": "2024-01-15T10:30:00.000Z", "connected_account": None, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": None, + "scopes": ["repo", "user:email"], + "auth_method": "oauth", + "api_key_last_4": None, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": {"instance_url": "https://example.my.salesforce.com"}, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId", + } + ], } instance = DataIntegrationsListResponseData.from_dict(data) serialized = instance.to_dict() @@ -601,6 +639,7 @@ def test_data_integrations_list_response_data_minimal_payload(self): assert serialized["created_at"] == data["created_at"] assert serialized["updated_at"] == data["updated_at"] assert serialized["connected_account"] == data["connected_account"] + assert serialized["connected_accounts"] == data["connected_accounts"] def test_data_integrations_list_response_data_omits_absent_optional_non_nullable_fields( self, @@ -633,6 +672,24 @@ def test_data_integrations_list_response_data_omits_absent_optional_non_nullable "updated_at": "2024-01-16T14:20:00.000Z", "userlandUserId": "test_userlandUserId", }, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": None, + "scopes": ["repo", "user:email"], + "auth_method": "oauth", + "api_key_last_4": None, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": {"instance_url": "https://example.my.salesforce.com"}, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId", + } + ], } instance = DataIntegrationsListResponseData.from_dict(data) serialized = instance.to_dict() @@ -653,6 +710,24 @@ def test_data_integrations_list_response_data_preserves_nullable_fields(self): "created_at": "2024-01-15T10:30:00.000Z", "updated_at": "2024-01-15T10:30:00.000Z", "connected_account": None, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": None, + "scopes": ["repo", "user:email"], + "auth_method": "oauth", + "api_key_last_4": None, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": {"instance_url": "https://example.my.salesforce.com"}, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId", + } + ], } instance = DataIntegrationsListResponseData.from_dict(data) serialized = instance.to_dict() @@ -690,6 +765,24 @@ def test_data_integrations_list_response_data_round_trips_unknown_enum_values(se "updated_at": "2024-01-16T14:20:00.000Z", "userlandUserId": "test_userlandUserId", }, + "connected_accounts": [ + { + "object": "connected_account", + "id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT", + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": None, + "scopes": ["repo", "user:email"], + "auth_method": "oauth", + "api_key_last_4": None, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": {"instance_url": "https://example.my.salesforce.com"}, + "state": "connected", + "created_at": "2024-01-16T14:20:00.000Z", + "updated_at": "2024-01-16T14:20:00.000Z", + "userlandUserId": "test_userlandUserId", + } + ], } instance = DataIntegrationsListResponseData.from_dict(data) assert instance.to_dict() == data From 25b10f0b0034f299525f4b99a1958e1d1d0fb6ca Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 15:36:39 +0000 Subject: [PATCH 2/2] chore(generated): add release notes fragment --- ...b110a04e6629f048799bbf753bddc6c5f4d10c0f.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .changelog-pending/2026-09-05T15-36-39-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md diff --git a/.changelog-pending/2026-09-05T15-36-39-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md b/.changelog-pending/2026-09-05T15-36-39-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md new file mode 100644 index 00000000..d39ec0d6 --- /dev/null +++ b/.changelog-pending/2026-09-05T15-36-39-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md @@ -0,0 +1,18 @@ +* [#723](https://github.com/workos/workos-python/pull/723) fix(generated): regenerate from spec + + **Features** + * **[pipes](https://workos.com/docs/reference/pipes)**: + * Added `connected_account_id` to `DataIntegrationsVendCredentialsRequest` + * Added `connected_account_id` to `DataIntegrationsGetUserTokenRequest` + * Added parameter `UserManagementDataProviders.getUserDataInstallation.connected_account_id` + * Changed errors for endpoint `GET /user_management/users/{user_id}/connected_accounts/{slug}` + * Added parameter `UserManagementDataProviders.updateUserDataInstallation.connected_account_id` + * Changed errors for endpoint `PUT /user_management/users/{user_id}/connected_accounts/{slug}` + * Added parameter `UserManagementDataProviders.deleteUserDataInstallation.connected_account_id` + * Changed errors for endpoint `DELETE /user_management/users/{user_id}/connected_accounts/{slug}` + * Added `connected_accounts` to `DataIntegrationsListResponseData` + * Changed errors for endpoint `PUT /data-integrations/{slug}` + * Changed errors for endpoint `PUT /data-integrations/{slug}/api-key` + * Changed errors for endpoint `PUT /data-integrations/{slug}/client-credentials` + * Changed errors for endpoint `POST /data-integrations/{slug}/credentials` + * Changed errors for endpoint `POST /data-integrations/{provider}/token`