From 78d6da92128ab9abc54e79785a68a9c638feeeed 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 1/2] chore(generated): regenerate shared files for Pipes --- .last-synced-sha | 2 +- lib/workos/pipes.rb | 27 +++- ...ata_integrations_get_user_token_request.rb | 7 +- .../data_integrations_list_response_data.rb | 7 +- ...a_integrations_vend_credentials_request.rb | 7 +- ...ta_integrations_get_user_token_request.rbi | 6 + .../data_integrations_list_response_data.rbi | 6 + ..._integrations_vend_credentials_request.rbi | 6 + rbi/workos/pipes.rbi | 15 ++- test/workos/test_pipes_model_round_trip.rb | 9 +- test/workos/test_shared_model_round_trip.rb | 122 +++++++++--------- 11 files changed, 132 insertions(+), 82 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/workos/pipes.rb b/lib/workos/pipes.rb index 67de81c0..7936f78b 100644 --- a/lib/workos/pipes.rb +++ b/lib/workos/pipes.rb @@ -283,17 +283,20 @@ def update_data_integration_client_credentials( # @param slug [String] The identifier of the integration. # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + # @param connected_account_id [String, nil] 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. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::DataIntegrationCredentialsResponse] def create_data_integration_credential( slug:, user_id:, organization_id: nil, + connected_account_id: nil, request_options: {} ) body = { "user_id" => user_id, - "organization_id" => organization_id + "organization_id" => organization_id, + "connected_account_id" => connected_account_id }.compact response = @client.request( method: :post, @@ -311,17 +314,20 @@ def create_data_integration_credential( # @param provider [String] The identifier of the integration. # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + # @param connected_account_id [String, nil] 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. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::DataIntegrationAccessTokenResponse] def get_access_token( provider:, user_id:, organization_id: WorkOS::OMIT, + connected_account_id: nil, request_options: {} ) body = { - "user_id" => user_id - } + "user_id" => user_id, + "connected_account_id" => connected_account_id + }.compact body["organization_id"] = organization_id unless organization_id.equal?(WorkOS::OMIT) response = @client.request( method: :post, @@ -339,16 +345,19 @@ def get_access_token( # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + # @param connected_account_id [String, nil] 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. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::ConnectedAccount] def get_user_connected_account( user_id:, slug:, organization_id: nil, + connected_account_id: nil, request_options: {} ) params = { - "organization_id" => organization_id + "organization_id" => organization_id, + "connected_account_id" => connected_account_id }.compact response = @client.request( method: :get, @@ -416,6 +425,7 @@ def create_user_connected_account( # @param scopes [Array, nil] The OAuth scopes granted for this connection. # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + # @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::ConnectedAccount] def update_user_connected_account( @@ -427,10 +437,12 @@ def update_user_connected_account( scopes: nil, state: nil, organization_id: nil, + connected_account_id: nil, request_options: {} ) params = { - "organization_id" => organization_id + "organization_id" => organization_id, + "connected_account_id" => connected_account_id }.compact body = { "access_token" => access_token, @@ -456,16 +468,19 @@ def update_user_connected_account( # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + # @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to delete. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [void] def delete_user_connected_account( user_id:, slug:, organization_id: nil, + connected_account_id: nil, request_options: {} ) params = { - "organization_id" => organization_id + "organization_id" => organization_id, + "connected_account_id" => connected_account_id }.compact @client.request( method: :delete, diff --git a/lib/workos/pipes/data_integrations_get_user_token_request.rb b/lib/workos/pipes/data_integrations_get_user_token_request.rb index 0aa4df76..02e2698b 100644 --- a/lib/workos/pipes/data_integrations_get_user_token_request.rb +++ b/lib/workos/pipes/data_integrations_get_user_token_request.rb @@ -6,17 +6,20 @@ module WorkOS class DataIntegrationsGetUserTokenRequest < WorkOS::Types::BaseModel HASH_ATTRS = { user_id: :user_id, - organization_id: :organization_id + organization_id: :organization_id, + connected_account_id: :connected_account_id }.freeze attr_accessor \ :user_id, - :organization_id + :organization_id, + :connected_account_id def initialize(json) hash = self.class.normalize(json) @user_id = hash[:user_id] @organization_id = hash[:organization_id] + @connected_account_id = hash[:connected_account_id] end end end diff --git a/lib/workos/pipes/data_integrations_list_response_data.rb b/lib/workos/pipes/data_integrations_list_response_data.rb index b2ac6128..1a25ca17 100644 --- a/lib/workos/pipes/data_integrations_list_response_data.rb +++ b/lib/workos/pipes/data_integrations_list_response_data.rb @@ -17,7 +17,8 @@ class DataIntegrationsListResponseData < WorkOS::Types::BaseModel ownership: :ownership, created_at: :created_at, updated_at: :updated_at, - connected_account: :connected_account + connected_account: :connected_account, + connected_accounts: :connected_accounts }.freeze attr_accessor \ @@ -33,7 +34,8 @@ class DataIntegrationsListResponseData < WorkOS::Types::BaseModel :ownership, :created_at, :updated_at, - :connected_account + :connected_account, + :connected_accounts def initialize(json) hash = self.class.normalize(json) @@ -50,6 +52,7 @@ def initialize(json) @created_at = hash[:created_at] @updated_at = hash[:updated_at] @connected_account = hash[:connected_account] ? WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(hash[:connected_account]) : nil + @connected_accounts = (hash[:connected_accounts] || []).map { |item| item ? WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(item) : nil } end end end diff --git a/lib/workos/pipes/data_integrations_vend_credentials_request.rb b/lib/workos/pipes/data_integrations_vend_credentials_request.rb index 7c132e90..f7ba7379 100644 --- a/lib/workos/pipes/data_integrations_vend_credentials_request.rb +++ b/lib/workos/pipes/data_integrations_vend_credentials_request.rb @@ -6,17 +6,20 @@ module WorkOS class DataIntegrationsVendCredentialsRequest < WorkOS::Types::BaseModel HASH_ATTRS = { user_id: :user_id, - organization_id: :organization_id + organization_id: :organization_id, + connected_account_id: :connected_account_id }.freeze attr_accessor \ :user_id, - :organization_id + :organization_id, + :connected_account_id def initialize(json) hash = self.class.normalize(json) @user_id = hash[:user_id] @organization_id = hash[:organization_id] + @connected_account_id = hash[:connected_account_id] end end end diff --git a/rbi/workos/data_integrations_get_user_token_request.rbi b/rbi/workos/data_integrations_get_user_token_request.rbi index bad71270..d366e5e6 100644 --- a/rbi/workos/data_integrations_get_user_token_request.rbi +++ b/rbi/workos/data_integrations_get_user_token_request.rbi @@ -21,6 +21,12 @@ module WorkOS sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def organization_id=(value); end + sig { returns(T.nilable(String)) } + def connected_account_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connected_account_id=(value); end + sig { returns(T::Hash[Symbol, T.untyped]) } def to_h; end diff --git a/rbi/workos/data_integrations_list_response_data.rbi b/rbi/workos/data_integrations_list_response_data.rbi index 4fd84d0f..81cccc10 100644 --- a/rbi/workos/data_integrations_list_response_data.rbi +++ b/rbi/workos/data_integrations_list_response_data.rbi @@ -87,6 +87,12 @@ module WorkOS sig { params(value: T.nilable(WorkOS::DataIntegrationsListResponseDataConnectedAccount)).returns(T.nilable(WorkOS::DataIntegrationsListResponseDataConnectedAccount)) } def connected_account=(value); end + sig { returns(T::Array[WorkOS::DataIntegrationsListResponseDataConnectedAccount]) } + def connected_accounts; end + + sig { params(value: T::Array[WorkOS::DataIntegrationsListResponseDataConnectedAccount]).returns(T::Array[WorkOS::DataIntegrationsListResponseDataConnectedAccount]) } + def connected_accounts=(value); end + sig { returns(T::Hash[Symbol, T.untyped]) } def to_h; end diff --git a/rbi/workos/data_integrations_vend_credentials_request.rbi b/rbi/workos/data_integrations_vend_credentials_request.rbi index b902d9a1..a6cfbaab 100644 --- a/rbi/workos/data_integrations_vend_credentials_request.rbi +++ b/rbi/workos/data_integrations_vend_credentials_request.rbi @@ -21,6 +21,12 @@ module WorkOS sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def organization_id=(value); end + sig { returns(T.nilable(String)) } + def connected_account_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connected_account_id=(value); end + sig { returns(T::Hash[Symbol, T.untyped]) } def to_h; end diff --git a/rbi/workos/pipes.rbi b/rbi/workos/pipes.rbi index 3c08799b..663c25ae 100644 --- a/rbi/workos/pipes.rbi +++ b/rbi/workos/pipes.rbi @@ -107,30 +107,33 @@ module WorkOS slug: String, user_id: String, organization_id: T.nilable(String), + connected_account_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegrationCredentialsResponse) end - def create_data_integration_credential(slug:, user_id:, organization_id:, request_options:); end + def create_data_integration_credential(slug:, user_id:, organization_id:, connected_account_id:, request_options:); end sig do params( provider: String, user_id: String, organization_id: T.nilable(String), + connected_account_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegrationAccessTokenResponse) end - def get_access_token(provider:, user_id:, organization_id:, request_options:); end + def get_access_token(provider:, user_id:, organization_id:, connected_account_id:, request_options:); end sig do params( user_id: String, slug: String, organization_id: T.nilable(String), + connected_account_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::ConnectedAccount) end - def get_user_connected_account(user_id:, slug:, organization_id:, request_options:); end + def get_user_connected_account(user_id:, slug:, organization_id:, connected_account_id:, request_options:); end sig do params( @@ -157,20 +160,22 @@ module WorkOS scopes: T.nilable(T::Array[String]), state: T.nilable(String), organization_id: T.nilable(String), + connected_account_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::ConnectedAccount) end - def update_user_connected_account(user_id:, slug:, access_token:, refresh_token:, expires_at:, scopes:, state:, organization_id:, request_options:); end + def update_user_connected_account(user_id:, slug:, access_token:, refresh_token:, expires_at:, scopes:, state:, organization_id:, connected_account_id:, request_options:); end sig do params( user_id: String, slug: String, organization_id: T.nilable(String), + connected_account_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] ).returns(NilClass) end - def delete_user_connected_account(user_id:, slug:, organization_id:, request_options:); end + def delete_user_connected_account(user_id:, slug:, organization_id:, connected_account_id:, request_options:); end sig do params( diff --git a/test/workos/test_pipes_model_round_trip.rb b/test/workos/test_pipes_model_round_trip.rb index fe48ee55..217396b6 100644 --- a/test/workos/test_pipes_model_round_trip.rb +++ b/test/workos/test_pipes_model_round_trip.rb @@ -240,7 +240,8 @@ def test_data_integrations_list_response_data_round_trip "ownership" => "stub", "created_at" => "stub", "updated_at" => "stub", - "connected_account" => nil + "connected_account" => nil, + "connected_accounts" => [] } model = WorkOS::DataIntegrationsListResponseData.new(fixture.to_json) json = model.to_h @@ -397,7 +398,8 @@ def test_data_integrations_upsert_client_credentials_request_round_trip def test_data_integrations_vend_credentials_request_round_trip fixture = { "user_id" => "stub", - "organization_id" => "stub" + "organization_id" => "stub", + "connected_account_id" => "stub" } model = WorkOS::DataIntegrationsVendCredentialsRequest.new(fixture.to_json) json = model.to_h @@ -409,7 +411,8 @@ def test_data_integrations_vend_credentials_request_round_trip def test_data_integrations_get_user_token_request_round_trip fixture = { "user_id" => "stub", - "organization_id" => nil + "organization_id" => nil, + "connected_account_id" => "stub" } model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json) json = model.to_h diff --git a/test/workos/test_shared_model_round_trip.rb b/test/workos/test_shared_model_round_trip.rb index 08fbae2c..e584120d 100644 --- a/test/workos/test_shared_model_round_trip.rb +++ b/test/workos/test_shared_model_round_trip.rb @@ -16,39 +16,6 @@ def test_error_response_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_object_summary_round_trip - fixture = { - "id" => "stub", - "name" => "stub", - "updated_at" => nil - } - model = WorkOS::ObjectSummary.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["name"], json[:name] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - - def test_object_version_round_trip - fixture = { - "created_at" => "stub", - "current_version" => true, - "etag" => "stub", - "id" => "stub", - "size" => 1 - } - model = WorkOS::ObjectVersion.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["current_version"], json[:current_version] - assert_equal fixture["etag"], json[:etag] - assert_equal fixture["id"], json[:id] - assert_equal fixture["size"], json[:size] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_connect_application_oauth_round_trip fixture = { "object" => "connect_application", @@ -197,24 +164,6 @@ def test_waitlist_user_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_schema_round_trip - fixture = { - "object" => "event", - "id" => "stub", - "event" => "stub", - "data" => {}, - "created_at" => "stub", - "context" => {} - } - model = WorkOS::EventSchema.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["event"], json[:event] - assert_equal fixture["created_at"], json[:created_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_agent_blueprint_created_round_trip fixture = { "object" => "event", @@ -1314,27 +1263,78 @@ def test_auth_method_mismatch_error_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_list_list_metadata_round_trip + def test_event_context_google_analytics_session_round_trip fixture = { - "after" => nil + "containerId" => "stub", + "sessionId" => "stub", + "sessionNumber" => "stub" } - model = WorkOS::EventListListMetadata.new(fixture.to_json) + model = WorkOS::EventContextGoogleAnalyticsSession.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json - assert_nil json[:after] + assert_equal fixture["containerId"], json[:containerId] fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_context_google_analytics_session_round_trip + def test_object_summary_round_trip fixture = { - "containerId" => "stub", - "sessionId" => "stub", - "sessionNumber" => "stub" + "id" => "stub", + "name" => "stub", + "updated_at" => nil } - model = WorkOS::EventContextGoogleAnalyticsSession.new(fixture.to_json) + model = WorkOS::ObjectSummary.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json - assert_equal fixture["containerId"], json[:containerId] + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_object_version_round_trip + fixture = { + "created_at" => "stub", + "current_version" => true, + "etag" => "stub", + "id" => "stub", + "size" => 1 + } + model = WorkOS::ObjectVersion.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["current_version"], json[:current_version] + assert_equal fixture["etag"], json[:etag] + assert_equal fixture["id"], json[:id] + assert_equal fixture["size"], json[:size] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_schema_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "stub", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::EventSchema.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["event"], json[:event] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_list_list_metadata_round_trip + fixture = { + "after" => nil + } + model = WorkOS::EventListListMetadata.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:after] fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end From 24dfd04a5ef2277128bdd02950cec2dc95978773 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:46 +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-46-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md diff --git a/.changelog-pending/2026-09-05T15-36-46-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md b/.changelog-pending/2026-09-05T15-36-46-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md new file mode 100644 index 00000000..0649a3b7 --- /dev/null +++ b/.changelog-pending/2026-09-05T15-36-46-b110a04e6629f048799bbf753bddc6c5f4d10c0f.md @@ -0,0 +1,18 @@ +* [#550](https://github.com/workos/workos-ruby/pull/550) 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`