From 150ab715aa720eb37145740cb78b323ea528d9e1 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:56 +0000 Subject: [PATCH 1/2] chore(generated): regenerate shared files for Pipes --- .last-synced-sha | 2 +- .../DataIntegrationsGetUserTokenRequest.php | 4 +++ lib/Resource/DataIntegrationsListResponse.php | 2 +- .../DataIntegrationsListResponseData.php | 7 +++++ ...DataIntegrationsVendCredentialsRequest.php | 4 +++ lib/Service/Pipes.php | 14 ++++++++++ ...a_integrations_get_user_token_request.json | 3 +- .../data_integrations_list_response.json | 28 ++++++++++++++++++- .../data_integrations_list_response_data.json | 28 ++++++++++++++++++- ...integrations_vend_credentials_request.json | 3 +- 10 files changed, 89 insertions(+), 6 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/lib/Resource/DataIntegrationsGetUserTokenRequest.php b/lib/Resource/DataIntegrationsGetUserTokenRequest.php index 97e2bb2a..f9a0ec8f 100644 --- a/lib/Resource/DataIntegrationsGetUserTokenRequest.php +++ b/lib/Resource/DataIntegrationsGetUserTokenRequest.php @@ -15,6 +15,8 @@ public function __construct( public string $userId, /** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */ public ?string $organizationId = null, + /** 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. */ + public ?string $connectedAccountId = null, ) { } @@ -23,6 +25,7 @@ public static function fromArray(array $data): self return new self( userId: $data['user_id'], organizationId: $data['organization_id'] ?? null, + connectedAccountId: $data['connected_account_id'] ?? null, ); } @@ -31,6 +34,7 @@ public function toArray(): array return [ 'user_id' => $this->userId, 'organization_id' => $this->organizationId, + 'connected_account_id' => $this->connectedAccountId, ]; } } diff --git a/lib/Resource/DataIntegrationsListResponse.php b/lib/Resource/DataIntegrationsListResponse.php index 62fede85..c8e411d1 100644 --- a/lib/Resource/DataIntegrationsListResponse.php +++ b/lib/Resource/DataIntegrationsListResponse.php @@ -14,7 +14,7 @@ public function __construct( /** Indicates this is a list response. */ public string $object, /** - * 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. * @var array<\WorkOS\Resource\DataIntegrationsListResponseData> */ public array $data, diff --git a/lib/Resource/DataIntegrationsListResponseData.php b/lib/Resource/DataIntegrationsListResponseData.php index 50165343..b7957cdd 100644 --- a/lib/Resource/DataIntegrationsListResponseData.php +++ b/lib/Resource/DataIntegrationsListResponseData.php @@ -38,6 +38,11 @@ public function __construct( public string $updatedAt, /** The user's [connected account](https://workos.com/docs/reference/pipes/connected-account) for this provider, or `null` if the user has not connected. */ public ?DataIntegrationsListResponseDataConnectedAccount $connectedAccount, + /** + * The user's connected accounts for this provider in the requested ownership context. + * @var array<\WorkOS\Resource\DataIntegrationsListResponseDataConnectedAccount> + */ + public array $connectedAccounts, /** * The authentication methods supported by this provider (`oauth`, `api_key`, `client_credentials`, or a combination). Defaults to `["oauth"]` if absent. * @var array<\WorkOS\Resource\DataIntegrationAuthMethods>|null @@ -61,6 +66,7 @@ public static function fromArray(array $data): self createdAt: $data['created_at'], updatedAt: $data['updated_at'], connectedAccount: isset($data['connected_account']) ? DataIntegrationsListResponseDataConnectedAccount::fromArray($data['connected_account']) : null, + connectedAccounts: array_map(fn ($item) => DataIntegrationsListResponseDataConnectedAccount::fromArray($item), $data['connected_accounts']), authMethods: isset($data['auth_methods']) ? array_map(fn ($item) => DataIntegrationAuthMethods::from($item), $data['auth_methods']) : null, ); } @@ -80,6 +86,7 @@ public function toArray(): array 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, 'connected_account' => $this->connectedAccount?->toArray(), + 'connected_accounts' => array_map(fn ($item) => $item->toArray(), $this->connectedAccounts), 'auth_methods' => $this->authMethods !== null ? array_map(fn ($item) => $item->value, $this->authMethods) : null, ]; } diff --git a/lib/Resource/DataIntegrationsVendCredentialsRequest.php b/lib/Resource/DataIntegrationsVendCredentialsRequest.php index 61b6098c..f6fe9d98 100644 --- a/lib/Resource/DataIntegrationsVendCredentialsRequest.php +++ b/lib/Resource/DataIntegrationsVendCredentialsRequest.php @@ -15,6 +15,8 @@ public function __construct( public string $userId, /** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */ public ?string $organizationId = null, + /** 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. */ + public ?string $connectedAccountId = null, ) { } @@ -23,6 +25,7 @@ public static function fromArray(array $data): self return new self( userId: $data['user_id'], organizationId: $data['organization_id'] ?? null, + connectedAccountId: $data['connected_account_id'] ?? null, ); } @@ -31,6 +34,7 @@ public function toArray(): array return [ 'user_id' => $this->userId, 'organization_id' => $this->organizationId, + 'connected_account_id' => $this->connectedAccountId, ]; } } diff --git a/lib/Service/Pipes.php b/lib/Service/Pipes.php index 25d8a2dd..3a220352 100644 --- a/lib/Service/Pipes.php +++ b/lib/Service/Pipes.php @@ -293,6 +293,7 @@ public function updateDataIntegrationClientCredentials( * @param string $slug The identifier of the integration. * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + * @param string|null $connectedAccountId 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. * @return \WorkOS\Resource\DataIntegrationCredentialsResponse * @throws \WorkOS\Exception\WorkOSException */ @@ -300,11 +301,13 @@ public function createDataIntegrationCredential( string $slug, string $userId, ?string $organizationId = null, + ?string $connectedAccountId = null, ?\WorkOS\RequestOptions $options = null, ): \WorkOS\Resource\DataIntegrationCredentialsResponse { $body = array_filter([ 'user_id' => $userId, 'organization_id' => $organizationId, + 'connected_account_id' => $connectedAccountId, ], fn ($v) => $v !== null); $response = $this->client->request( method: 'POST', @@ -322,6 +325,7 @@ public function createDataIntegrationCredential( * @param string $provider The identifier of the integration. * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + * @param string|null $connectedAccountId 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. * @return \WorkOS\Resource\DataIntegrationAccessTokenResponse * @throws \WorkOS\Exception\WorkOSException */ @@ -329,11 +333,13 @@ public function getAccessToken( string $provider, string $userId, ?string $organizationId = null, + ?string $connectedAccountId = null, ?\WorkOS\RequestOptions $options = null, ): \WorkOS\Resource\DataIntegrationAccessTokenResponse { $body = array_filter([ 'user_id' => $userId, 'organization_id' => $organizationId, + 'connected_account_id' => $connectedAccountId, ], fn ($v) => $v !== null); $response = $this->client->request( method: 'POST', @@ -351,6 +357,7 @@ public function getAccessToken( * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. * @param string $slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`). * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + * @param string|null $connectedAccountId 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. * @return \WorkOS\Resource\ConnectedAccount * @throws \WorkOS\Exception\WorkOSException */ @@ -358,10 +365,12 @@ public function getUserConnectedAccount( string $userId, string $slug, ?string $organizationId = null, + ?string $connectedAccountId = null, ?\WorkOS\RequestOptions $options = null, ): \WorkOS\Resource\ConnectedAccount { $query = array_filter([ 'organization_id' => $organizationId, + 'connected_account_id' => $connectedAccountId, ], fn ($v) => $v !== null); $response = $this->client->request( method: 'GET', @@ -426,6 +435,7 @@ public function createUserConnectedAccount( * @param array|null $scopes The OAuth scopes granted for this connection. * @param \WorkOS\Resource\PipeConnectedAccountState|null $state Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update. * @return \WorkOS\Resource\ConnectedAccount * @throws \WorkOS\Exception\WorkOSException */ @@ -438,6 +448,7 @@ public function updateUserConnectedAccount( ?array $scopes = null, ?\WorkOS\Resource\PipeConnectedAccountState $state = null, ?string $organizationId = null, + ?string $connectedAccountId = null, ?\WorkOS\RequestOptions $options = null, ): \WorkOS\Resource\ConnectedAccount { $body = array_filter([ @@ -463,6 +474,7 @@ public function updateUserConnectedAccount( * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. * @param string $slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`). * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to delete. * @return void * @throws \WorkOS\Exception\WorkOSException */ @@ -470,10 +482,12 @@ public function deleteUserConnectedAccount( string $userId, string $slug, ?string $organizationId = null, + ?string $connectedAccountId = null, ?\WorkOS\RequestOptions $options = null, ): void { $query = array_filter([ 'organization_id' => $organizationId, + 'connected_account_id' => $connectedAccountId, ], fn ($v) => $v !== null); $this->client->request( method: 'DELETE', 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 2b08f083..d8ef6129 100644 --- a/tests/Fixtures/data_integrations_list_response.json +++ b/tests/Fixtures/data_integrations_list_response.json @@ -46,7 +46,33 @@ "organizationId": "test_organizationId", "createdAt": "test_createdAt", "updatedAt": "test_updatedAt" - } + }, + "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", + "organizationId": "test_organizationId", + "createdAt": "test_createdAt", + "updatedAt": "test_updatedAt" + } + ] } ] } diff --git a/tests/Fixtures/data_integrations_list_response_data.json b/tests/Fixtures/data_integrations_list_response_data.json index 9dfc7b33..dba0ffb0 100644 --- a/tests/Fixtures/data_integrations_list_response_data.json +++ b/tests/Fixtures/data_integrations_list_response_data.json @@ -43,5 +43,31 @@ "organizationId": "test_organizationId", "createdAt": "test_createdAt", "updatedAt": "test_updatedAt" - } + }, + "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", + "organizationId": "test_organizationId", + "createdAt": "test_createdAt", + "updatedAt": "test_updatedAt" + } + ] } 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" } From b1a224e65732ecc6f83bafcb6d6a6792b71c9248 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:37:00 +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-37-00-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md diff --git a/.changelog-pending/2026-09-05T15-37-00-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md b/.changelog-pending/2026-09-05T15-37-00-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md new file mode 100644 index 00000000..6f692852 --- /dev/null +++ b/.changelog-pending/2026-09-05T15-37-00-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md @@ -0,0 +1,18 @@ +* [#438](https://github.com/workos/workos-php/pull/438) 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`