diff --git a/.changelog-pending/2026-09-16T19-24-45-949c30cb87778129af801fadc33546518853d045.md b/.changelog-pending/2026-09-16T19-24-45-949c30cb87778129af801fadc33546518853d045.md new file mode 100644 index 00000000..6928ad91 --- /dev/null +++ b/.changelog-pending/2026-09-16T19-24-45-949c30cb87778129af801fadc33546518853d045.md @@ -0,0 +1,40 @@ +* [#556](https://github.com/workos/workos-ruby/pull/556) fix(generated): regenerate from spec (1 change) + + **Features** + * **[multi_factor_auth](https://workos.com/docs/reference/authkit/mfa)**: + * Changed errors for endpoint `POST /auth/factors/{id}/challenge` + * **[pipes](https://workos.com/docs/reference/pipes)**: + * Added `connection_owner` to `DataIntegrationsListResponseData` + * Added enum `DataIntegrationsListResponseDataConnectionOwner` + * Added `connection_role` to `DataIntegrationsListResponseDataConnectedAccount` + * Added `account_identifier` to `DataIntegrationsListResponseDataConnectedAccount` + * Added `account_display_name` to `DataIntegrationsListResponseDataConnectedAccount` + * Added enum `DataIntegrationsListResponseDataConnectedAccountConnectionRole` + * Added `connection_role` to `DataIntegrationInstallation` + * Added `account_identifier` to `DataIntegrationInstallation` + * Added `account_display_name` to `DataIntegrationInstallation` + * Added enum `DataIntegrationInstallationConnectionRole` + * Added `connection_owner` to `DataIntegrationsGetDataIntegrationAuthorizeUrlRequest` + * Added enum `DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner` + * **[connect](https://workos.com/docs/reference/workos-connect/standalone)**: + * Added `connection_role` to `ConnectedAccount` + * Added `account_identifier` to `ConnectedAccount` + * Added `account_display_name` to `ConnectedAccount` + * Added enum `ConnectedAccountConnectionRole` + * **[organizations](https://workos.com/docs/reference/organization)**: + * Added service `OrganizationsDataProviders` + * **[webhooks](https://workos.com/docs/reference/webhooks)**: + * Added `pipes.account_connection.add_failed` to `CreateWebhookEndpointEvents` + * Added `pipes.account_connection.connected` to `CreateWebhookEndpointEvents` + * Added `pipes.account_connection.connection_failed` to `CreateWebhookEndpointEvents` + * Added `pipes.account_connection.disconnected` to `CreateWebhookEndpointEvents` + * Added `pipes.account_connection.reauthorization_needed` to `CreateWebhookEndpointEvents` + * Added `pipes.account_connection.add_failed` to `UpdateWebhookEndpointEvents` + * Added `pipes.account_connection.connected` to `UpdateWebhookEndpointEvents` + * Added `pipes.account_connection.connection_failed` to `UpdateWebhookEndpointEvents` + * Added `pipes.account_connection.disconnected` to `UpdateWebhookEndpointEvents` + * Added `pipes.account_connection.reauthorization_needed` to `UpdateWebhookEndpointEvents` + + **Fixes** + * **[multi_factor_auth](https://workos.com/docs/reference/authkit/mfa)**: + * Changed errors for endpoint `POST /auth/factors/{id}/challenge` diff --git a/.last-synced-sha b/.last-synced-sha index 1c2b758d..b7efc9db 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -d3fa61120f8b9e73972b9dc5f4b5ea2bc0526636 +13ba15b32754d2d635b7799ab779867df2b611d6 diff --git a/.oagen-manifest.json b/.oagen-manifest.json index ad95f526..8a59d245 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -276,6 +276,11 @@ "lib/workos/organizations/organization_updated_data_domain.rb", "lib/workos/organizations/update_audit_logs_retention.rb", "lib/workos/organizations/update_organization.rb", + "lib/workos/organizations_data_providers.rb", + "lib/workos/organizations_data_providers/connected_account_input.rb", + "lib/workos/organizations_data_providers/data_integrations_list_response.rb", + "lib/workos/organizations_data_providers/data_integrations_list_response_data.rb", + "lib/workos/organizations_data_providers/data_integrations_list_response_data_connected_account.rb", "lib/workos/pipes.rb", "lib/workos/pipes/api_key_installation.rb", "lib/workos/pipes/connected_account.rb", @@ -374,6 +379,13 @@ "lib/workos/shared/group_member_removed_data.rb", "lib/workos/shared/group_updated.rb", "lib/workos/shared/pipe_connected_account.rb", + "lib/workos/shared/pipes_account_connection_add_failed.rb", + "lib/workos/shared/pipes_account_connection_add_failed_data.rb", + "lib/workos/shared/pipes_account_connection_connected.rb", + "lib/workos/shared/pipes_account_connection_connection_failed.rb", + "lib/workos/shared/pipes_account_connection_connection_failed_data.rb", + "lib/workos/shared/pipes_account_connection_disconnected.rb", + "lib/workos/shared/pipes_account_connection_reauthorization_needed.rb", "lib/workos/shared/pipes_connected_account_connected.rb", "lib/workos/shared/pipes_connected_account_connection_failed.rb", "lib/workos/shared/pipes_connected_account_connection_failed_data.rb", @@ -460,6 +472,7 @@ "lib/workos/types/authorization_assignment.rb", "lib/workos/types/claim_view_response_status.rb", "lib/workos/types/connected_account_auth_method.rb", + "lib/workos/types/connected_account_connection_role.rb", "lib/workos/types/connected_account_input_state.rb", "lib/workos/types/connected_account_state.rb", "lib/workos/types/connection_activated_data_connection_type.rb", @@ -492,12 +505,16 @@ "lib/workos/types/data_integration_credentials_input_type.rb", "lib/workos/types/data_integration_credentials_response_error.rb", "lib/workos/types/data_integration_custom_provider_authenticate_via.rb", + "lib/workos/types/data_integration_installation_connection_role.rb", "lib/workos/types/data_integration_ownership.rb", "lib/workos/types/data_integration_state.rb", + "lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb", "lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb", "lib/workos/types/data_integrations_list_response_data_auth_methods.rb", "lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb", + "lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb", "lib/workos/types/data_integrations_list_response_data_connected_account_state.rb", + "lib/workos/types/data_integrations_list_response_data_connection_owner.rb", "lib/workos/types/data_integrations_list_response_data_ownership.rb", "lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb", "lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb", @@ -552,6 +569,8 @@ "lib/workos/types/pagination_order.rb", "lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb", "lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb", + "lib/workos/types/pipe_connected_account_auth_method.rb", + "lib/workos/types/pipe_connected_account_connection_role.rb", "lib/workos/types/pipe_connected_account_state.rb", "lib/workos/types/pipes_ownership.rb", "lib/workos/types/profile_connection_type.rb", @@ -1250,6 +1269,7 @@ "rbi/workos/organization_updated_data.rbi", "rbi/workos/organization_updated_data_domain.rbi", "rbi/workos/organizations.rbi", + "rbi/workos/organizations_data_providers.rbi", "rbi/workos/password_reset.rbi", "rbi/workos/password_reset_created.rbi", "rbi/workos/password_reset_created_data.rbi", @@ -1270,6 +1290,13 @@ "rbi/workos/permission_updated_data.rbi", "rbi/workos/pipe_connected_account.rbi", "rbi/workos/pipes.rbi", + "rbi/workos/pipes_account_connection_add_failed.rbi", + "rbi/workos/pipes_account_connection_add_failed_data.rbi", + "rbi/workos/pipes_account_connection_connected.rbi", + "rbi/workos/pipes_account_connection_connection_failed.rbi", + "rbi/workos/pipes_account_connection_connection_failed_data.rbi", + "rbi/workos/pipes_account_connection_disconnected.rbi", + "rbi/workos/pipes_account_connection_reauthorization_needed.rbi", "rbi/workos/pipes_connected_account_connected.rbi", "rbi/workos/pipes_connected_account_connection_failed.rbi", "rbi/workos/pipes_connected_account_connection_failed_data.rbi", @@ -1453,6 +1480,8 @@ "test/workos/test_organization_membership_model_round_trip.rb", "test/workos/test_organization_membership_service.rb", "test/workos/test_organizations.rb", + "test/workos/test_organizations_data_providers.rb", + "test/workos/test_organizations_data_providers_model_round_trip.rb", "test/workos/test_organizations_model_round_trip.rb", "test/workos/test_pipes.rb", "test/workos/test_pipes_model_round_trip.rb", @@ -2546,6 +2575,26 @@ "DELETE /user_management/authkit_oauth_resources/{id}": { "sdkMethod": "delete_authkit_oauth_resource", "service": "user_management" + }, + "GET /organizations/{organization_id}/connected_accounts/{slug}": { + "sdkMethod": "get_organization_connected_account", + "service": "organizations_data_providers" + }, + "POST /organizations/{organization_id}/connected_accounts/{slug}": { + "sdkMethod": "create_organization_connected_account", + "service": "organizations_data_providers" + }, + "PUT /organizations/{organization_id}/connected_accounts/{slug}": { + "sdkMethod": "update_organization_connected_account", + "service": "organizations_data_providers" + }, + "DELETE /organizations/{organization_id}/connected_accounts/{slug}": { + "sdkMethod": "delete_organization_connected_account", + "service": "organizations_data_providers" + }, + "GET /organizations/{organization_id}/data_providers": { + "sdkMethod": "list_organization_data_providers", + "service": "organizations_data_providers" } } } diff --git a/lib/workos.rb b/lib/workos.rb index 87a178ce..c6bd5965 100644 --- a/lib/workos.rb +++ b/lib/workos.rb @@ -35,6 +35,7 @@ def OMIT.inspect loader.collapse("#{__dir__}/workos/organization_domains") loader.collapse("#{__dir__}/workos/organization_membership") loader.collapse("#{__dir__}/workos/organizations") +loader.collapse("#{__dir__}/workos/organizations_data_providers") loader.collapse("#{__dir__}/workos/pipes") loader.collapse("#{__dir__}/workos/pipes_provider") loader.collapse("#{__dir__}/workos/platform_teams") diff --git a/lib/workos/client.rb b/lib/workos/client.rb index b376b47b..b981740f 100644 --- a/lib/workos/client.rb +++ b/lib/workos/client.rb @@ -64,6 +64,10 @@ def groups @groups ||= WorkOS::Groups.new(self) end + def organizations_data_providers + @organizations_data_providers ||= WorkOS::OrganizationsDataProviders.new(self) + end + def platform_teams @platform_teams ||= WorkOS::PlatformTeams.new(self) end diff --git a/lib/workos/multi_factor_auth.rb b/lib/workos/multi_factor_auth.rb index fb38831f..62026f07 100644 --- a/lib/workos/multi_factor_auth.rb +++ b/lib/workos/multi_factor_auth.rb @@ -108,7 +108,7 @@ def delete_factor( # Challenge Factor # @param id [String] The unique ID of the Authentication Factor to be challenged. - # @param sms_template [String, nil] A custom template for the SMS message. Use the {{code}} placeholder to include the verification code. + # @param sms_template [String, nil] A custom template for the SMS message. Use the {{code}} placeholder to include the verification code. Must not contain URLs or domain names. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::AuthenticationChallenge] def challenge_factor( diff --git a/lib/workos/organizations_data_providers.rb b/lib/workos/organizations_data_providers.rb new file mode 100644 index 00000000..a2eb2762 --- /dev/null +++ b/lib/workos/organizations_data_providers.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class OrganizationsDataProviders + def initialize(client) + @client = client + end + + # Get an organization connected account + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier. + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered. + # @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 organization has several for this provider. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ConnectedAccount] + def get_organization_connected_account( + organization_id:, + slug:, + supports_multiple_connections: nil, + connected_account_id: nil, + request_options: {} + ) + params = { + "supports_multiple_connections" => supports_multiple_connections, + "connected_account_id" => connected_account_id + }.compact + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", + auth: true, + params: params, + request_options: request_options + ) + result = WorkOS::ConnectedAccount.new(response.body) + result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) + result + end + + # Import an organization connected account + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier. + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param access_token [String, nil] The OAuth access token for the connected account. + # @param refresh_token [String, nil] The OAuth refresh token for the connected account. + # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. + # @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 request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ConnectedAccount] + def create_organization_connected_account( + organization_id:, + slug:, + access_token: nil, + refresh_token: nil, + expires_at: nil, + scopes: nil, + state: nil, + request_options: {} + ) + body = { + "access_token" => access_token, + "refresh_token" => refresh_token, + "expires_at" => expires_at, + "scopes" => scopes, + "state" => state + }.compact + response = @client.request( + method: :post, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ConnectedAccount.new(response.body) + result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) + result + end + + # Update an organization connected account + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier. + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param access_token [String, nil] The OAuth access token for the connected account. + # @param refresh_token [String, nil] The OAuth refresh token for the connected account. + # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. + # @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 supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered. + # @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_organization_connected_account( + organization_id:, + slug:, + access_token: nil, + refresh_token: nil, + expires_at: nil, + scopes: nil, + state: nil, + supports_multiple_connections: nil, + connected_account_id: nil, + request_options: {} + ) + params = { + "supports_multiple_connections" => supports_multiple_connections, + "connected_account_id" => connected_account_id + }.compact + body = { + "access_token" => access_token, + "refresh_token" => refresh_token, + "expires_at" => expires_at, + "scopes" => scopes, + "state" => state + }.compact + response = @client.request( + method: :put, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", + auth: true, + params: params, + body: body, + request_options: request_options + ) + result = WorkOS::ConnectedAccount.new(response.body) + result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) + result + end + + # Delete an organization connected account + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier. + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered. + # @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_organization_connected_account( + organization_id:, + slug:, + supports_multiple_connections: nil, + connected_account_id: nil, + request_options: {} + ) + params = { + "supports_multiple_connections" => supports_multiple_connections, + "connected_account_id" => connected_account_id + }.compact + @client.request( + method: :delete, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", + auth: true, + params: params, + request_options: request_options + ) + nil + end + + # List providers for an organization + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier to list providers and connected accounts for. + # @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DataIntegrationsListResponse] + def list_organization_data_providers( + organization_id:, + supports_multiple_connections: nil, + request_options: {} + ) + params = { + "supports_multiple_connections" => supports_multiple_connections + }.compact + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_providers", + auth: true, + params: params, + request_options: request_options + ) + result = WorkOS::DataIntegrationsListResponse.new(response.body) + result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) + result + end + end +end diff --git a/lib/workos/organizations_data_providers/connected_account_input.rb b/lib/workos/organizations_data_providers/connected_account_input.rb new file mode 100644 index 00000000..83533cff --- /dev/null +++ b/lib/workos/organizations_data_providers/connected_account_input.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectedAccountInput < WorkOS::Types::BaseModel + HASH_ATTRS = { + access_token: :access_token, + refresh_token: :refresh_token, + expires_at: :expires_at, + scopes: :scopes, + state: :state + }.freeze + + attr_accessor \ + :access_token, + :refresh_token, + :expires_at, + :scopes, + :state + + def initialize(json) + hash = self.class.normalize(json) + @access_token = hash[:access_token] + @refresh_token = hash[:refresh_token] + @expires_at = hash[:expires_at] + @scopes = hash[:scopes] || [] + @state = hash[:state] + end + end +end diff --git a/lib/workos/organizations_data_providers/data_integrations_list_response.rb b/lib/workos/organizations_data_providers/data_integrations_list_response.rb new file mode 100644 index 00000000..35837685 --- /dev/null +++ b/lib/workos/organizations_data_providers/data_integrations_list_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsListResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + data: :data + }.freeze + + attr_accessor \ + :object, + :data + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @data = (hash[:data] || []).map { |item| item ? WorkOS::DataIntegrationsListResponseData.new(item) : nil } + end + end +end diff --git a/lib/workos/organizations_data_providers/data_integrations_list_response_data.rb b/lib/workos/organizations_data_providers/data_integrations_list_response_data.rb new file mode 100644 index 00000000..731696cf --- /dev/null +++ b/lib/workos/organizations_data_providers/data_integrations_list_response_data.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsListResponseData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + name: :name, + description: :description, + slug: :slug, + integration_type: :integration_type, + credentials_type: :credentials_type, + scopes: :scopes, + auth_methods: :auth_methods, + connection_owner: :connection_owner, + ownership: :ownership, + created_at: :created_at, + updated_at: :updated_at, + connected_account: :connected_account, + connected_accounts: :connected_accounts + }.freeze + + # @!attribute ownership + # @deprecated Use `connection_owner` instead. Legacy spelling of the same value: `userland_user` corresponds to `connection_owner: "user"` and `organization` to `connection_owner: "organization"`. + + attr_accessor \ + :object, + :id, + :name, + :description, + :slug, + :integration_type, + :credentials_type, + :scopes, + :auth_methods, + :connection_owner, + :created_at, + :updated_at, + :connected_account, + :connected_accounts + + def ownership + warn "[DEPRECATION] `ownership` is deprecated and will be removed in a future version.", uplevel: 1 + @ownership + end + + attr_writer :ownership + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @description = hash[:description] + @slug = hash[:slug] + @integration_type = hash[:integration_type] + @credentials_type = hash[:credentials_type] + @scopes = hash[:scopes] || [] + @auth_methods = hash[:auth_methods] || [] + @connection_owner = hash[:connection_owner] + @ownership = hash[:ownership] + @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/organizations_data_providers/data_integrations_list_response_data_connected_account.rb b/lib/workos/organizations_data_providers/data_integrations_list_response_data_connected_account.rb new file mode 100644 index 00000000..df078128 --- /dev/null +++ b/lib/workos/organizations_data_providers/data_integrations_list_response_data_connected_account.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsListResponseDataConnectedAccount < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + connection_role: :connection_role, + account_identifier: :account_identifier, + account_display_name: :account_display_name, + user_id: :user_id, + organization_id: :organization_id, + scopes: :scopes, + auth_method: :auth_method, + api_key_last_4: :api_key_last_4, + client_id: :client_id, + client_secret_last_4: :client_secret_last_4, + config: :config, + state: :state, + created_at: :created_at, + updated_at: :updated_at, + userlandUserId: :userland_user_id + }.freeze + + # @!attribute userland_user_id + # @deprecated Use `user_id` instead. + + attr_accessor \ + :object, + :id, + :connection_role, + :account_identifier, + :account_display_name, + :user_id, + :organization_id, + :scopes, + :auth_method, + :api_key_last_4, + :client_id, + :client_secret_last_4, + :config, + :state, + :created_at, + :updated_at + + def userland_user_id + warn "[DEPRECATION] `userland_user_id` is deprecated and will be removed in a future version.", uplevel: 1 + @userland_user_id + end + + attr_writer :userland_user_id + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @connection_role = hash[:connection_role] + @account_identifier = hash[:account_identifier] + @account_display_name = hash[:account_display_name] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @scopes = hash[:scopes] || [] + @auth_method = hash[:auth_method] + @api_key_last_4 = hash[:api_key_last_4] + @client_id = hash[:client_id] + @client_secret_last_4 = hash[:client_secret_last_4] + @config = hash[:config] || {} + @state = hash[:state] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @userland_user_id = hash[:userlandUserId] + end + end +end diff --git a/lib/workos/pipes.rb b/lib/workos/pipes.rb index 3df70a56..75103802 100644 --- a/lib/workos/pipes.rb +++ b/lib/workos/pipes.rb @@ -223,8 +223,9 @@ def update_data_integration_api_key( # Get authorization URL # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). - # @param user_id [String] The ID of the user to authorize. - # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization. + # @param user_id [String] The ID of the user to authorize. When `connection_owner` is `organization`, this is the user authorizing on behalf of the organization; they must be an active member of the organization and do not become the owner of the resulting connected account. + # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization. Required when `connection_owner` is `organization`. + # @param connection_owner [WorkOS::Types::DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner, nil] Who will own the connected account. `user` (the default) connects the user's own account. `organization` connects the organization's shared account and requires `organization_id`. # @param return_to [String, nil] The URL to redirect the user to after authorization. # @param config [Hash{String => String}, nil] Connect-time config values for the provider-declared `installation`-scope fields (e.g. a Zendesk `subdomain`), keyed by the config field. Only fields the provider declares may be supplied, and required fields must be provided unless already pinned on the integration. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) @@ -233,6 +234,7 @@ def authorize_data_integration( slug:, user_id:, organization_id: nil, + connection_owner: nil, return_to: nil, config: nil, request_options: {} @@ -240,6 +242,7 @@ def authorize_data_integration( body = { "user_id" => user_id, "organization_id" => organization_id, + "connection_owner" => connection_owner, "return_to" => return_to, "config" => config }.compact diff --git a/lib/workos/pipes/connected_account.rb b/lib/workos/pipes/connected_account.rb index f9006405..789684be 100644 --- a/lib/workos/pipes/connected_account.rb +++ b/lib/workos/pipes/connected_account.rb @@ -7,6 +7,9 @@ class ConnectedAccount < WorkOS::Types::BaseModel HASH_ATTRS = { object: :object, id: :id, + connection_role: :connection_role, + account_identifier: :account_identifier, + account_display_name: :account_display_name, user_id: :user_id, organization_id: :organization_id, scopes: :scopes, @@ -23,6 +26,9 @@ class ConnectedAccount < WorkOS::Types::BaseModel attr_accessor \ :object, :id, + :connection_role, + :account_identifier, + :account_display_name, :user_id, :organization_id, :scopes, @@ -39,6 +45,9 @@ def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] + @connection_role = hash[:connection_role] + @account_identifier = hash[:account_identifier] + @account_display_name = hash[:account_display_name] @user_id = hash[:user_id] @organization_id = hash[:organization_id] @scopes = hash[:scopes] || [] diff --git a/lib/workos/pipes/data_integration_installation.rb b/lib/workos/pipes/data_integration_installation.rb index 48f48789..32d00c3f 100644 --- a/lib/workos/pipes/data_integration_installation.rb +++ b/lib/workos/pipes/data_integration_installation.rb @@ -6,6 +6,9 @@ module WorkOS class DataIntegrationInstallation < WorkOS::Types::BaseModel HASH_ATTRS = { id: :id, + connection_role: :connection_role, + account_identifier: :account_identifier, + account_display_name: :account_display_name, user_id: :user_id, organization_id: :organization_id, api_key_last_4: :api_key_last_4 @@ -13,6 +16,9 @@ class DataIntegrationInstallation < WorkOS::Types::BaseModel attr_accessor \ :id, + :connection_role, + :account_identifier, + :account_display_name, :user_id, :organization_id, :api_key_last_4 @@ -20,6 +26,9 @@ class DataIntegrationInstallation < WorkOS::Types::BaseModel def initialize(json) hash = self.class.normalize(json) @id = hash[:id] + @connection_role = hash[:connection_role] + @account_identifier = hash[:account_identifier] + @account_display_name = hash[:account_display_name] @user_id = hash[:user_id] @organization_id = hash[:organization_id] @api_key_last_4 = hash[:api_key_last_4] diff --git a/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb b/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb index 3fb576f5..7572fe04 100644 --- a/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +++ b/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb @@ -7,6 +7,7 @@ class DataIntegrationsGetDataIntegrationAuthorizeUrlRequest < WorkOS::Types::Bas HASH_ATTRS = { user_id: :user_id, organization_id: :organization_id, + connection_owner: :connection_owner, return_to: :return_to, config: :config }.freeze @@ -14,6 +15,7 @@ class DataIntegrationsGetDataIntegrationAuthorizeUrlRequest < WorkOS::Types::Bas attr_accessor \ :user_id, :organization_id, + :connection_owner, :return_to, :config @@ -21,6 +23,7 @@ def initialize(json) hash = self.class.normalize(json) @user_id = hash[:user_id] @organization_id = hash[:organization_id] + @connection_owner = hash[:connection_owner] @return_to = hash[:return_to] @config = hash[:config] || {} end diff --git a/lib/workos/shared/pipe_connected_account.rb b/lib/workos/shared/pipe_connected_account.rb index 9401b2a9..fbe1a629 100644 --- a/lib/workos/shared/pipe_connected_account.rb +++ b/lib/workos/shared/pipe_connected_account.rb @@ -7,11 +7,16 @@ class PipeConnectedAccount < WorkOS::Types::BaseModel HASH_ATTRS = { object: :object, id: :id, + connection_role: :connection_role, + account_identifier: :account_identifier, + account_display_name: :account_display_name, data_integration_id: :data_integration_id, provider_slug: :provider_slug, user_id: :user_id, organization_id: :organization_id, scopes: :scopes, + auth_method: :auth_method, + api_key_last_4: :api_key_last_4, state: :state, created_at: :created_at, updated_at: :updated_at @@ -20,11 +25,16 @@ class PipeConnectedAccount < WorkOS::Types::BaseModel attr_accessor \ :object, :id, + :connection_role, + :account_identifier, + :account_display_name, :data_integration_id, :provider_slug, :user_id, :organization_id, :scopes, + :auth_method, + :api_key_last_4, :state, :created_at, :updated_at @@ -33,11 +43,16 @@ def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] + @connection_role = hash[:connection_role] + @account_identifier = hash[:account_identifier] + @account_display_name = hash[:account_display_name] @data_integration_id = hash[:data_integration_id] @provider_slug = hash[:provider_slug] @user_id = hash[:user_id] @organization_id = hash[:organization_id] @scopes = hash[:scopes] || [] + @auth_method = hash[:auth_method] + @api_key_last_4 = hash[:api_key_last_4] @state = hash[:state] @created_at = hash[:created_at] @updated_at = hash[:updated_at] diff --git a/lib/workos/shared/pipes_account_connection_add_failed.rb b/lib/workos/shared/pipes_account_connection_add_failed.rb new file mode 100644 index 00000000..36e0b80f --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_add_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PipesAccountConnectionAddFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context + }.freeze + + attr_accessor \ + :object, + :id, + :event, + :data, + :created_at, + :context + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PipesAccountConnectionAddFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/shared/pipes_account_connection_add_failed_data.rb b/lib/workos/shared/pipes_account_connection_add_failed_data.rb new file mode 100644 index 00000000..011b981d --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_add_failed_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PipesAccountConnectionAddFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + data_integration_id: :data_integration_id, + provider_slug: :provider_slug, + user_id: :user_id, + organization_id: :organization_id, + account_identifier: :account_identifier, + error_code: :error_code, + error_reason: :error_reason, + provider_error: :provider_error, + provider_error_description: :provider_error_description, + created_at: :created_at + }.freeze + + attr_accessor \ + :object, + :data_integration_id, + :provider_slug, + :user_id, + :organization_id, + :account_identifier, + :error_code, + :error_reason, + :provider_error, + :provider_error_description, + :created_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @data_integration_id = hash[:data_integration_id] + @provider_slug = hash[:provider_slug] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @account_identifier = hash[:account_identifier] + @error_code = hash[:error_code] + @error_reason = hash[:error_reason] + @provider_error = hash[:provider_error] + @provider_error_description = hash[:provider_error_description] + @created_at = hash[:created_at] + end + end +end diff --git a/lib/workos/shared/pipes_account_connection_connected.rb b/lib/workos/shared/pipes_account_connection_connected.rb new file mode 100644 index 00000000..a3c5d552 --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_connected.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PipesAccountConnectionConnected < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context + }.freeze + + attr_accessor \ + :object, + :id, + :event, + :data, + :created_at, + :context + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PipeConnectedAccount.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/shared/pipes_account_connection_connection_failed.rb b/lib/workos/shared/pipes_account_connection_connection_failed.rb new file mode 100644 index 00000000..d6a4f0b9 --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_connection_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PipesAccountConnectionConnectionFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context + }.freeze + + attr_accessor \ + :object, + :id, + :event, + :data, + :created_at, + :context + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PipesAccountConnectionConnectionFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/shared/pipes_account_connection_connection_failed_data.rb b/lib/workos/shared/pipes_account_connection_connection_failed_data.rb new file mode 100644 index 00000000..f794492e --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_connection_failed_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + PipesAccountConnectionConnectionFailedData = PipesAccountConnectionAddFailedData +end diff --git a/lib/workos/shared/pipes_account_connection_disconnected.rb b/lib/workos/shared/pipes_account_connection_disconnected.rb new file mode 100644 index 00000000..af47f139 --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_disconnected.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PipesAccountConnectionDisconnected < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context + }.freeze + + attr_accessor \ + :object, + :id, + :event, + :data, + :created_at, + :context + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PipeConnectedAccount.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb b/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb new file mode 100644 index 00000000..21529900 --- /dev/null +++ b/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PipesAccountConnectionReauthorizationNeeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context + }.freeze + + attr_accessor \ + :object, + :id, + :event, + :data, + :created_at, + :context + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PipeConnectedAccount.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/shared/pipes_connected_account_connection_failed_data.rb b/lib/workos/shared/pipes_connected_account_connection_failed_data.rb index e86e8aa7..b93ac4ce 100644 --- a/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +++ b/lib/workos/shared/pipes_connected_account_connection_failed_data.rb @@ -3,44 +3,5 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - class PipesConnectedAccountConnectionFailedData < WorkOS::Types::BaseModel - HASH_ATTRS = { - object: :object, - data_integration_id: :data_integration_id, - provider_slug: :provider_slug, - user_id: :user_id, - organization_id: :organization_id, - error_code: :error_code, - error_reason: :error_reason, - provider_error: :provider_error, - provider_error_description: :provider_error_description, - created_at: :created_at - }.freeze - - attr_accessor \ - :object, - :data_integration_id, - :provider_slug, - :user_id, - :organization_id, - :error_code, - :error_reason, - :provider_error, - :provider_error_description, - :created_at - - def initialize(json) - hash = self.class.normalize(json) - @object = hash[:object] - @data_integration_id = hash[:data_integration_id] - @provider_slug = hash[:provider_slug] - @user_id = hash[:user_id] - @organization_id = hash[:organization_id] - @error_code = hash[:error_code] - @error_reason = hash[:error_reason] - @provider_error = hash[:provider_error] - @provider_error_description = hash[:provider_error_description] - @created_at = hash[:created_at] - end - end + PipesConnectedAccountConnectionFailedData = PipesAccountConnectionAddFailedData end diff --git a/lib/workos/types/connected_account_connection_role.rb b/lib/workos/types/connected_account_connection_role.rb new file mode 100644 index 00000000..620dd3ca --- /dev/null +++ b/lib/workos/types/connected_account_connection_role.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectedAccountConnectionRole + COMPATIBILITY = "compatibility" + STANDARD = "standard" + ALL = [COMPATIBILITY, STANDARD].freeze + end + end +end diff --git a/lib/workos/types/create_webhook_endpoint_events.rb b/lib/workos/types/create_webhook_endpoint_events.rb index d2a661c9..7e397ac1 100644 --- a/lib/workos/types/create_webhook_endpoint_events.rb +++ b/lib/workos/types/create_webhook_endpoint_events.rb @@ -96,6 +96,11 @@ class CreateWebhookEndpointEvents PERMISSION_CREATED = "permission.created" PERMISSION_DELETED = "permission.deleted" PERMISSION_UPDATED = "permission.updated" + PIPES_ACCOUNT_CONNECTION_ADD_FAILED = "pipes.account_connection.add_failed" + PIPES_ACCOUNT_CONNECTION_CONNECTED = "pipes.account_connection.connected" + PIPES_ACCOUNT_CONNECTION_CONNECTION_FAILED = "pipes.account_connection.connection_failed" + PIPES_ACCOUNT_CONNECTION_DISCONNECTED = "pipes.account_connection.disconnected" + PIPES_ACCOUNT_CONNECTION_REAUTHORIZATION_NEEDED = "pipes.account_connection.reauthorization_needed" PIPES_CONNECTED_ACCOUNT_CONNECTED = "pipes.connected_account.connected" PIPES_CONNECTED_ACCOUNT_CONNECTION_FAILED = "pipes.connected_account.connection_failed" PIPES_CONNECTED_ACCOUNT_DISCONNECTED = "pipes.connected_account.disconnected" @@ -105,7 +110,7 @@ class CreateWebhookEndpointEvents WAITLIST_USER_APPROVED = "waitlist_user.approved" WAITLIST_USER_CREATED = "waitlist_user.created" WAITLIST_USER_DENIED = "waitlist_user.denied" - ALL = [AGENT_BLUEPRINT_CREATED, AGENT_BLUEPRINT_DELETED, AGENT_BLUEPRINT_UPDATED, AGENT_INSTANCE_CREATED, AGENT_INSTANCE_DELETED, AGENT_INSTANCE_SESSION_CREATED, AGENT_INSTANCE_SESSION_REVOKED, AGENT_REGISTRATION_CREATED, AGENT_REGISTRATION_CLAIM_ATTEMPT_CREATED, AGENT_REGISTRATION_CLAIM_COMPLETED, AGENT_REGISTRATION_CREDENTIAL_ISSUED, AGENT_REGISTRATION_DELETED, AGENT_REGISTRATION_REFRESHED, AGENT_REGISTRATION_EXPIRED, AGENT_REGISTRATION_ORGANIZATION_SWITCHED, AGENT_REGISTRATION_REVOKED, AUTHENTICATION_EMAIL_VERIFICATION_SUCCEEDED, AUTHENTICATION_MAGIC_AUTH_FAILED, AUTHENTICATION_MAGIC_AUTH_SUCCEEDED, AUTHENTICATION_MFA_SUCCEEDED, AUTHENTICATION_OAUTH_FAILED, AUTHENTICATION_OAUTH_SUCCEEDED, AUTHENTICATION_PASSWORD_FAILED, AUTHENTICATION_PASSWORD_SUCCEEDED, AUTHENTICATION_PASSKEY_FAILED, AUTHENTICATION_PASSKEY_SUCCEEDED, AUTHENTICATION_SSO_FAILED, AUTHENTICATION_SSO_STARTED, AUTHENTICATION_SSO_SUCCEEDED, AUTHENTICATION_SSO_TIMED_OUT, RADAR_CHALLENGE_CREATED, AUTHENTICATION_RADAR_RISK_DETECTED, AUTHENTICATION_REAUTHENTICATION_SUCCEEDED, API_KEY_CREATED, API_KEY_REVOKED, API_KEY_UPDATED, CONNECTION_ACTIVATED, CONNECTION_DEACTIVATED, CONNECTION_SAML_CERTIFICATE_RENEWAL_REQUIRED, CONNECTION_SAML_CERTIFICATE_RENEWED, CONNECTION_DELETED, DSYNC_ACTIVATED, DSYNC_DELETED, DSYNC_GROUP_CREATED, DSYNC_GROUP_DELETED, DSYNC_GROUP_UPDATED, DSYNC_GROUP_USER_ADDED, DSYNC_GROUP_USER_REMOVED, DSYNC_USER_CREATED, DSYNC_USER_DELETED, DSYNC_USER_UPDATED, EMAIL_VERIFICATION_CREATED, GROUP_CREATED, GROUP_DELETED, GROUP_MEMBER_ADDED, GROUP_MEMBER_REMOVED, GROUP_UPDATED, FLAG_CREATED, FLAG_DELETED, FLAG_UPDATED, FLAG_RULE_UPDATED, INVITATION_ACCEPTED, INVITATION_CREATED, INVITATION_RESENT, INVITATION_REVOKED, MAGIC_AUTH_CREATED, ORGANIZATION_CREATED, ORGANIZATION_DELETED, ORGANIZATION_UPDATED, ORGANIZATION_DOMAIN_CREATED, ORGANIZATION_DOMAIN_DELETED, ORGANIZATION_DOMAIN_UPDATED, ORGANIZATION_DOMAIN_VERIFIED, ORGANIZATION_DOMAIN_VERIFICATION_FAILED, PASSWORD_RESET_CREATED, PASSWORD_RESET_SUCCEEDED, USER_CREATED, USER_UPDATED, USER_DELETED, ORGANIZATION_MEMBERSHIP_CREATED, ORGANIZATION_MEMBERSHIP_DELETED, ORGANIZATION_MEMBERSHIP_UPDATED, ROLE_CREATED, ROLE_DELETED, ROLE_UPDATED, ORGANIZATION_ROLE_CREATED, ORGANIZATION_ROLE_DELETED, ORGANIZATION_ROLE_UPDATED, PERMISSION_CREATED, PERMISSION_DELETED, PERMISSION_UPDATED, PIPES_CONNECTED_ACCOUNT_CONNECTED, PIPES_CONNECTED_ACCOUNT_CONNECTION_FAILED, PIPES_CONNECTED_ACCOUNT_DISCONNECTED, PIPES_CONNECTED_ACCOUNT_REAUTHORIZATION_NEEDED, SESSION_CREATED, SESSION_REVOKED, WAITLIST_USER_APPROVED, WAITLIST_USER_CREATED, WAITLIST_USER_DENIED].freeze + ALL = [AGENT_BLUEPRINT_CREATED, AGENT_BLUEPRINT_DELETED, AGENT_BLUEPRINT_UPDATED, AGENT_INSTANCE_CREATED, AGENT_INSTANCE_DELETED, AGENT_INSTANCE_SESSION_CREATED, AGENT_INSTANCE_SESSION_REVOKED, AGENT_REGISTRATION_CREATED, AGENT_REGISTRATION_CLAIM_ATTEMPT_CREATED, AGENT_REGISTRATION_CLAIM_COMPLETED, AGENT_REGISTRATION_CREDENTIAL_ISSUED, AGENT_REGISTRATION_DELETED, AGENT_REGISTRATION_REFRESHED, AGENT_REGISTRATION_EXPIRED, AGENT_REGISTRATION_ORGANIZATION_SWITCHED, AGENT_REGISTRATION_REVOKED, AUTHENTICATION_EMAIL_VERIFICATION_SUCCEEDED, AUTHENTICATION_MAGIC_AUTH_FAILED, AUTHENTICATION_MAGIC_AUTH_SUCCEEDED, AUTHENTICATION_MFA_SUCCEEDED, AUTHENTICATION_OAUTH_FAILED, AUTHENTICATION_OAUTH_SUCCEEDED, AUTHENTICATION_PASSWORD_FAILED, AUTHENTICATION_PASSWORD_SUCCEEDED, AUTHENTICATION_PASSKEY_FAILED, AUTHENTICATION_PASSKEY_SUCCEEDED, AUTHENTICATION_SSO_FAILED, AUTHENTICATION_SSO_STARTED, AUTHENTICATION_SSO_SUCCEEDED, AUTHENTICATION_SSO_TIMED_OUT, RADAR_CHALLENGE_CREATED, AUTHENTICATION_RADAR_RISK_DETECTED, AUTHENTICATION_REAUTHENTICATION_SUCCEEDED, API_KEY_CREATED, API_KEY_REVOKED, API_KEY_UPDATED, CONNECTION_ACTIVATED, CONNECTION_DEACTIVATED, CONNECTION_SAML_CERTIFICATE_RENEWAL_REQUIRED, CONNECTION_SAML_CERTIFICATE_RENEWED, CONNECTION_DELETED, DSYNC_ACTIVATED, DSYNC_DELETED, DSYNC_GROUP_CREATED, DSYNC_GROUP_DELETED, DSYNC_GROUP_UPDATED, DSYNC_GROUP_USER_ADDED, DSYNC_GROUP_USER_REMOVED, DSYNC_USER_CREATED, DSYNC_USER_DELETED, DSYNC_USER_UPDATED, EMAIL_VERIFICATION_CREATED, GROUP_CREATED, GROUP_DELETED, GROUP_MEMBER_ADDED, GROUP_MEMBER_REMOVED, GROUP_UPDATED, FLAG_CREATED, FLAG_DELETED, FLAG_UPDATED, FLAG_RULE_UPDATED, INVITATION_ACCEPTED, INVITATION_CREATED, INVITATION_RESENT, INVITATION_REVOKED, MAGIC_AUTH_CREATED, ORGANIZATION_CREATED, ORGANIZATION_DELETED, ORGANIZATION_UPDATED, ORGANIZATION_DOMAIN_CREATED, ORGANIZATION_DOMAIN_DELETED, ORGANIZATION_DOMAIN_UPDATED, ORGANIZATION_DOMAIN_VERIFIED, ORGANIZATION_DOMAIN_VERIFICATION_FAILED, PASSWORD_RESET_CREATED, PASSWORD_RESET_SUCCEEDED, USER_CREATED, USER_UPDATED, USER_DELETED, ORGANIZATION_MEMBERSHIP_CREATED, ORGANIZATION_MEMBERSHIP_DELETED, ORGANIZATION_MEMBERSHIP_UPDATED, ROLE_CREATED, ROLE_DELETED, ROLE_UPDATED, ORGANIZATION_ROLE_CREATED, ORGANIZATION_ROLE_DELETED, ORGANIZATION_ROLE_UPDATED, PERMISSION_CREATED, PERMISSION_DELETED, PERMISSION_UPDATED, PIPES_ACCOUNT_CONNECTION_ADD_FAILED, PIPES_ACCOUNT_CONNECTION_CONNECTED, PIPES_ACCOUNT_CONNECTION_CONNECTION_FAILED, PIPES_ACCOUNT_CONNECTION_DISCONNECTED, PIPES_ACCOUNT_CONNECTION_REAUTHORIZATION_NEEDED, PIPES_CONNECTED_ACCOUNT_CONNECTED, PIPES_CONNECTED_ACCOUNT_CONNECTION_FAILED, PIPES_CONNECTED_ACCOUNT_DISCONNECTED, PIPES_CONNECTED_ACCOUNT_REAUTHORIZATION_NEEDED, SESSION_CREATED, SESSION_REVOKED, WAITLIST_USER_APPROVED, WAITLIST_USER_CREATED, WAITLIST_USER_DENIED].freeze end end end diff --git a/lib/workos/types/data_integration_installation_connection_role.rb b/lib/workos/types/data_integration_installation_connection_role.rb new file mode 100644 index 00000000..2e263d91 --- /dev/null +++ b/lib/workos/types/data_integration_installation_connection_role.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationInstallationConnectionRole = ConnectedAccountConnectionRole + end +end diff --git a/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb b/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb new file mode 100644 index 00000000..f401560c --- /dev/null +++ b/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner = CreateDataIntegrationOwnership + end +end diff --git a/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb b/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb new file mode 100644 index 00000000..9b768a2e --- /dev/null +++ b/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationsListResponseDataConnectedAccountConnectionRole = ConnectedAccountConnectionRole + end +end diff --git a/lib/workos/types/data_integrations_list_response_data_connection_owner.rb b/lib/workos/types/data_integrations_list_response_data_connection_owner.rb new file mode 100644 index 00000000..60ec2fd2 --- /dev/null +++ b/lib/workos/types/data_integrations_list_response_data_connection_owner.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationsListResponseDataConnectionOwner = CreateDataIntegrationOwnership + end +end diff --git a/lib/workos/types/pipe_connected_account_auth_method.rb b/lib/workos/types/pipe_connected_account_auth_method.rb new file mode 100644 index 00000000..c4dd0722 --- /dev/null +++ b/lib/workos/types/pipe_connected_account_auth_method.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + PipeConnectedAccountAuthMethod = ConnectedAccountAuthMethod + end +end diff --git a/lib/workos/types/pipe_connected_account_connection_role.rb b/lib/workos/types/pipe_connected_account_connection_role.rb new file mode 100644 index 00000000..8ecc0127 --- /dev/null +++ b/lib/workos/types/pipe_connected_account_connection_role.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + PipeConnectedAccountConnectionRole = ConnectedAccountConnectionRole + end +end diff --git a/lib/workos/types/resource_export_completed_data_resource_type.rb b/lib/workos/types/resource_export_completed_data_resource_type.rb index 1c5d1a31..9ef4684b 100644 --- a/lib/workos/types/resource_export_completed_data_resource_type.rb +++ b/lib/workos/types/resource_export_completed_data_resource_type.rb @@ -11,7 +11,8 @@ class ResourceExportCompletedDataResourceType SESSIONS = "sessions" AUDIT_LOG_EVENTS = "auditLogEvents" CONNECTIONS = "connections" - ALL = [USERS, ORGANIZATIONS, EVENTS, SESSIONS, AUDIT_LOG_EVENTS, CONNECTIONS].freeze + DIRECTORY_USERS = "directoryUsers" + ALL = [USERS, ORGANIZATIONS, EVENTS, SESSIONS, AUDIT_LOG_EVENTS, CONNECTIONS, DIRECTORY_USERS].freeze end end end diff --git a/lib/workos/user_management.rb b/lib/workos/user_management.rb index 57629f5f..4b5ac1f9 100644 --- a/lib/workos/user_management.rb +++ b/lib/workos/user_management.rb @@ -750,7 +750,7 @@ def list_authkit_oauth_resources( end # Create an MCP resource indicator - # @param uri [String] The resource URI. May be a wildcard pattern with a single `*` in the leftmost hostname label, where enabled for the environment. + # @param uri [String] The resource URI. May be a wildcard pattern with a single `*`, either in the leftmost hostname label or as the final path segment, where enabled for the environment. # @param default [Boolean, nil] Whether the resource being created becomes the environment default, clearing any previous default. Applies at creation only — this API has no update endpoint yet, so changing the default on an existing resource is done from the dashboard. A wildcard pattern cannot be the default. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::AuthkitOAuthResource] diff --git a/rbi/workos/client.rbi b/rbi/workos/client.rbi index 08ac7602..7327001b 100644 --- a/rbi/workos/client.rbi +++ b/rbi/workos/client.rbi @@ -54,6 +54,9 @@ module WorkOS sig { returns(WorkOS::Groups) } def groups; end + sig { returns(WorkOS::OrganizationsDataProviders) } + def organizations_data_providers; end + sig { returns(WorkOS::PlatformTeams) } def platform_teams; end diff --git a/rbi/workos/connected_account.rbi b/rbi/workos/connected_account.rbi index eabee6c7..b6612b62 100644 --- a/rbi/workos/connected_account.rbi +++ b/rbi/workos/connected_account.rbi @@ -21,6 +21,24 @@ module WorkOS sig { params(value: String).returns(String) } def id=(value); end + sig { returns(String) } + def connection_role; end + + sig { params(value: String).returns(String) } + def connection_role=(value); end + + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + + sig { returns(T.nilable(String)) } + def account_display_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_display_name=(value); end + sig { returns(T.nilable(String)) } def user_id; end diff --git a/rbi/workos/data_integration_installation.rbi b/rbi/workos/data_integration_installation.rbi index 48f35dd3..82ecee83 100644 --- a/rbi/workos/data_integration_installation.rbi +++ b/rbi/workos/data_integration_installation.rbi @@ -15,6 +15,24 @@ module WorkOS sig { params(value: String).returns(String) } def id=(value); end + sig { returns(String) } + def connection_role; end + + sig { params(value: String).returns(String) } + def connection_role=(value); end + + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + + sig { returns(T.nilable(String)) } + def account_display_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_display_name=(value); end + sig { returns(T.nilable(String)) } def user_id; end diff --git a/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi b/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi index fda7994c..f77b92d5 100644 --- a/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +++ b/rbi/workos/data_integrations_get_data_integration_authorize_url_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 connection_owner; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connection_owner=(value); end + sig { returns(T.nilable(String)) } def return_to; end diff --git a/rbi/workos/data_integrations_list_response_data.rbi b/rbi/workos/data_integrations_list_response_data.rbi index 81cccc10..5e4b6c33 100644 --- a/rbi/workos/data_integrations_list_response_data.rbi +++ b/rbi/workos/data_integrations_list_response_data.rbi @@ -63,6 +63,12 @@ module WorkOS sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } def auth_methods=(value); end + sig { returns(String) } + def connection_owner; end + + sig { params(value: String).returns(String) } + def connection_owner=(value); end + sig { returns(String) } def ownership; end diff --git a/rbi/workos/data_integrations_list_response_data_connected_account.rbi b/rbi/workos/data_integrations_list_response_data_connected_account.rbi index d5fba2ed..bc3a622e 100644 --- a/rbi/workos/data_integrations_list_response_data_connected_account.rbi +++ b/rbi/workos/data_integrations_list_response_data_connected_account.rbi @@ -21,6 +21,24 @@ module WorkOS sig { params(value: String).returns(String) } def id=(value); end + sig { returns(String) } + def connection_role; end + + sig { params(value: String).returns(String) } + def connection_role=(value); end + + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + + sig { returns(T.nilable(String)) } + def account_display_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_display_name=(value); end + sig { returns(T.nilable(String)) } def user_id; end diff --git a/rbi/workos/organizations_data_providers.rbi b/rbi/workos/organizations_data_providers.rbi new file mode 100644 index 00000000..6f2717dd --- /dev/null +++ b/rbi/workos/organizations_data_providers.rbi @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationsDataProviders + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_id: String, + slug: String, + supports_multiple_connections: T.nilable(T::Boolean), + connected_account_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectedAccount) + end + def get_organization_connected_account(organization_id:, slug:, supports_multiple_connections:, connected_account_id:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + access_token: T.nilable(String), + refresh_token: T.nilable(String), + expires_at: T.nilable(String), + scopes: T.nilable(T::Array[String]), + state: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectedAccount) + end + def create_organization_connected_account(organization_id:, slug:, access_token:, refresh_token:, expires_at:, scopes:, state:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + access_token: T.nilable(String), + refresh_token: T.nilable(String), + expires_at: T.nilable(String), + scopes: T.nilable(T::Array[String]), + state: T.nilable(String), + supports_multiple_connections: T.nilable(T::Boolean), + connected_account_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectedAccount) + end + def update_organization_connected_account(organization_id:, slug:, access_token:, refresh_token:, expires_at:, scopes:, state:, supports_multiple_connections:, connected_account_id:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + supports_multiple_connections: T.nilable(T::Boolean), + connected_account_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_organization_connected_account(organization_id:, slug:, supports_multiple_connections:, connected_account_id:, request_options:); end + + sig do + params( + organization_id: String, + supports_multiple_connections: T.nilable(T::Boolean), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DataIntegrationsListResponse) + end + def list_organization_data_providers(organization_id:, supports_multiple_connections:, request_options:); end + + end +end diff --git a/rbi/workos/pipe_connected_account.rbi b/rbi/workos/pipe_connected_account.rbi index 33c03666..5aa131f6 100644 --- a/rbi/workos/pipe_connected_account.rbi +++ b/rbi/workos/pipe_connected_account.rbi @@ -21,6 +21,24 @@ module WorkOS sig { params(value: String).returns(String) } def id=(value); end + sig { returns(T.nilable(String)) } + def connection_role; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connection_role=(value); end + + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + + sig { returns(T.nilable(String)) } + def account_display_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_display_name=(value); end + sig { returns(String) } def data_integration_id; end @@ -51,6 +69,18 @@ module WorkOS sig { params(value: T::Array[String]).returns(T::Array[String]) } def scopes=(value); end + sig { returns(T.nilable(String)) } + def auth_method; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def auth_method=(value); end + + sig { returns(T.nilable(String)) } + def api_key_last_4; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def api_key_last_4=(value); end + sig { returns(String) } def state; end diff --git a/rbi/workos/pipes.rbi b/rbi/workos/pipes.rbi index 133a7523..a3c2337f 100644 --- a/rbi/workos/pipes.rbi +++ b/rbi/workos/pipes.rbi @@ -86,12 +86,13 @@ module WorkOS slug: String, user_id: String, organization_id: T.nilable(String), + connection_owner: T.nilable(String), return_to: T.nilable(String), config: T.nilable(T::Hash[String, String]), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegrationAuthorizeUrlResponse) end - def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, config:, request_options:); end + def authorize_data_integration(slug:, user_id:, organization_id:, connection_owner:, return_to:, config:, request_options:); end sig do params( diff --git a/rbi/workos/pipes_account_connection_add_failed.rbi b/rbi/workos/pipes_account_connection_add_failed.rbi new file mode 100644 index 00000000..0ccb16c0 --- /dev/null +++ b/rbi/workos/pipes_account_connection_add_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionAddFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PipesAccountConnectionAddFailedData) } + def data; end + + sig { params(value: WorkOS::PipesAccountConnectionAddFailedData).returns(WorkOS::PipesAccountConnectionAddFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_account_connection_add_failed_data.rbi b/rbi/workos/pipes_account_connection_add_failed_data.rbi new file mode 100644 index 00000000..773f0eff --- /dev/null +++ b/rbi/workos/pipes_account_connection_add_failed_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionAddFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def data_integration_id; end + + sig { params(value: String).returns(String) } + def data_integration_id=(value); end + + sig { returns(String) } + def provider_slug; end + + sig { params(value: String).returns(String) } + def provider_slug=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + + sig { returns(String) } + def error_code; end + + sig { params(value: String).returns(String) } + def error_code=(value); end + + sig { returns(T.nilable(String)) } + def error_reason; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def error_reason=(value); end + + sig { returns(T.nilable(String)) } + def provider_error; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def provider_error=(value); end + + sig { returns(T.nilable(String)) } + def provider_error_description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def provider_error_description=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_account_connection_connected.rbi b/rbi/workos/pipes_account_connection_connected.rbi new file mode 100644 index 00000000..3cf052be --- /dev/null +++ b/rbi/workos/pipes_account_connection_connected.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionConnected + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PipeConnectedAccount) } + def data; end + + sig { params(value: WorkOS::PipeConnectedAccount).returns(WorkOS::PipeConnectedAccount) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_account_connection_connection_failed.rbi b/rbi/workos/pipes_account_connection_connection_failed.rbi new file mode 100644 index 00000000..4091680c --- /dev/null +++ b/rbi/workos/pipes_account_connection_connection_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionConnectionFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PipesAccountConnectionConnectionFailedData) } + def data; end + + sig { params(value: WorkOS::PipesAccountConnectionConnectionFailedData).returns(WorkOS::PipesAccountConnectionConnectionFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_account_connection_connection_failed_data.rbi b/rbi/workos/pipes_account_connection_connection_failed_data.rbi new file mode 100644 index 00000000..178c2eeb --- /dev/null +++ b/rbi/workos/pipes_account_connection_connection_failed_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionConnectionFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def data_integration_id; end + + sig { params(value: String).returns(String) } + def data_integration_id=(value); end + + sig { returns(String) } + def provider_slug; end + + sig { params(value: String).returns(String) } + def provider_slug=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + + sig { returns(String) } + def error_code; end + + sig { params(value: String).returns(String) } + def error_code=(value); end + + sig { returns(T.nilable(String)) } + def error_reason; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def error_reason=(value); end + + sig { returns(T.nilable(String)) } + def provider_error; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def provider_error=(value); end + + sig { returns(T.nilable(String)) } + def provider_error_description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def provider_error_description=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_account_connection_disconnected.rbi b/rbi/workos/pipes_account_connection_disconnected.rbi new file mode 100644 index 00000000..e9da4acc --- /dev/null +++ b/rbi/workos/pipes_account_connection_disconnected.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionDisconnected + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PipeConnectedAccount) } + def data; end + + sig { params(value: WorkOS::PipeConnectedAccount).returns(WorkOS::PipeConnectedAccount) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_account_connection_reauthorization_needed.rbi b/rbi/workos/pipes_account_connection_reauthorization_needed.rbi new file mode 100644 index 00000000..6d6a4bdd --- /dev/null +++ b/rbi/workos/pipes_account_connection_reauthorization_needed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesAccountConnectionReauthorizationNeeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PipeConnectedAccount) } + def data; end + + sig { params(value: WorkOS::PipeConnectedAccount).returns(WorkOS::PipeConnectedAccount) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes_connected_account_connection_failed_data.rbi b/rbi/workos/pipes_connected_account_connection_failed_data.rbi index 440db494..59ffd0ef 100644 --- a/rbi/workos/pipes_connected_account_connection_failed_data.rbi +++ b/rbi/workos/pipes_connected_account_connection_failed_data.rbi @@ -39,6 +39,12 @@ module WorkOS sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def organization_id=(value); end + sig { returns(T.nilable(String)) } + def account_identifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def account_identifier=(value); end + sig { returns(String) } def error_code; end diff --git a/test/workos/test_organizations_data_providers.rb b/test/workos/test_organizations_data_providers.rb new file mode 100644 index 00000000..a092d58e --- /dev/null +++ b/test/workos/test_organizations_data_providers.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class OrganizationsDataProvidersTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_get_organization_connected_account_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations_data_providers.get_organization_connected_account(organization_id: "stub", slug: "stub") + refute_nil result + end + + def test_create_organization_connected_account_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations_data_providers.create_organization_connected_account(organization_id: "stub", slug: "stub") + refute_nil result + end + + def test_update_organization_connected_account_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations_data_providers.update_organization_connected_account(organization_id: "stub", slug: "stub") + refute_nil result + end + + def test_delete_organization_connected_account_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations_data_providers.delete_organization_connected_account(organization_id: "stub", slug: "stub") + assert_nil result + end + + def test_list_organization_data_providers_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/data_providers(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations_data_providers.list_organization_data_providers(organization_id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :get_organization_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :create_organization_connected_account, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :update_organization_connected_account, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :delete_organization_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :list_organization_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_providers(\?|\z)}, args: {organization_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.organizations_data_providers.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_organizations_data_providers_model_round_trip.rb b/test/workos/test_organizations_data_providers_model_round_trip.rb new file mode 100644 index 00000000..d4e0bd7e --- /dev/null +++ b/test/workos/test_organizations_data_providers_model_round_trip.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class OrganizationsDataProvidersModelRoundTripTest < Minitest::Test + def test_connected_account_input_round_trip + fixture = { + "access_token" => "stub", + "refresh_token" => "stub", + "expires_at" => "stub", + "scopes" => [], + "state" => "stub" + } + model = WorkOS::ConnectedAccountInput.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_round_trip + fixture = { + "object" => "list", + "data" => [] + } + model = WorkOS::DataIntegrationsListResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_data_round_trip + fixture = { + "object" => "data_provider", + "id" => "stub", + "name" => "stub", + "description" => nil, + "slug" => "stub", + "integration_type" => "stub", + "credentials_type" => "stub", + "scopes" => nil, + "auth_methods" => [], + "connection_owner" => "stub", + "ownership" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "connected_account" => nil, + "connected_accounts" => [] + } + model = WorkOS::DataIntegrationsListResponseData.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] + assert_nil json[:description] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["integration_type"], json[:integration_type] + assert_equal fixture["credentials_type"], json[:credentials_type] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_data_connected_account_round_trip + fixture = { + "object" => "connected_account", + "id" => "stub", + "connection_role" => "stub", + "account_identifier" => nil, + "account_display_name" => nil, + "user_id" => nil, + "organization_id" => nil, + "scopes" => [], + "auth_method" => "stub", + "api_key_last_4" => nil, + "client_id" => nil, + "client_secret_last_4" => nil, + "config" => {}, + "state" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "userlandUserId" => nil + } + model = WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:account_identifier] + assert_nil json[:account_display_name] + assert_nil json[:user_id] + assert_nil json[:organization_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_nil json[:userlandUserId] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end +end diff --git a/test/workos/test_pipes_model_round_trip.rb b/test/workos/test_pipes_model_round_trip.rb index b28a7584..166010e8 100644 --- a/test/workos/test_pipes_model_round_trip.rb +++ b/test/workos/test_pipes_model_round_trip.rb @@ -107,20 +107,6 @@ def test_update_data_integration_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_connected_account_input_round_trip - fixture = { - "access_token" => "stub", - "refresh_token" => "stub", - "expires_at" => "stub", - "scopes" => [], - "state" => "stub" - } - model = WorkOS::ConnectedAccountInput.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_data_integration_round_trip fixture = { "object" => "data_integration", @@ -194,6 +180,9 @@ def test_connected_account_round_trip fixture = { "object" => "connected_account", "id" => "stub", + "connection_role" => "stub", + "account_identifier" => nil, + "account_display_name" => nil, "user_id" => nil, "organization_id" => nil, "scopes" => [], @@ -210,6 +199,8 @@ def test_connected_account_round_trip json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] + assert_nil json[:account_identifier] + assert_nil json[:account_display_name] assert_nil json[:user_id] assert_nil json[:organization_id] assert_equal fixture["created_at"], json[:created_at] @@ -217,48 +208,6 @@ def test_connected_account_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_data_integrations_list_response_round_trip - fixture = { - "object" => "list", - "data" => [] - } - model = WorkOS::DataIntegrationsListResponse.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - - def test_data_integrations_list_response_data_round_trip - fixture = { - "object" => "data_provider", - "id" => "stub", - "name" => "stub", - "description" => nil, - "slug" => "stub", - "integration_type" => "stub", - "credentials_type" => "stub", - "scopes" => nil, - "auth_methods" => [], - "ownership" => "stub", - "created_at" => "stub", - "updated_at" => "stub", - "connected_account" => nil, - "connected_accounts" => [] - } - model = WorkOS::DataIntegrationsListResponseData.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] - assert_nil json[:description] - assert_equal fixture["slug"], json[:slug] - assert_equal fixture["integration_type"], json[:integration_type] - assert_equal fixture["credentials_type"], json[:credentials_type] - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["updated_at"], json[:updated_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_data_integration_credentials_response_credential_round_trip fixture = { "object" => "credential", @@ -309,6 +258,9 @@ def test_data_integration_credential_round_trip def test_data_integration_installation_round_trip fixture = { "id" => "stub", + "connection_role" => "stub", + "account_identifier" => nil, + "account_display_name" => nil, "user_id" => nil, "organization_id" => nil, "api_key_last_4" => nil @@ -317,6 +269,8 @@ def test_data_integration_installation_round_trip json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] + assert_nil json[:account_identifier] + assert_nil json[:account_display_name] assert_nil json[:user_id] assert_nil json[:organization_id] assert_nil json[:api_key_last_4] @@ -372,6 +326,7 @@ def test_data_integrations_get_data_integration_authorize_url_request_round_trip fixture = { "user_id" => "stub", "organization_id" => "stub", + "connection_owner" => "stub", "return_to" => "stub", "config" => {} } @@ -431,6 +386,62 @@ def test_data_integrations_get_user_token_request_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_connected_account_input_round_trip + fixture = { + "access_token" => "stub", + "refresh_token" => "stub", + "expires_at" => "stub", + "scopes" => [], + "state" => "stub" + } + model = WorkOS::ConnectedAccountInput.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_round_trip + fixture = { + "object" => "list", + "data" => [] + } + model = WorkOS::DataIntegrationsListResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_data_round_trip + fixture = { + "object" => "data_provider", + "id" => "stub", + "name" => "stub", + "description" => nil, + "slug" => "stub", + "integration_type" => "stub", + "credentials_type" => "stub", + "scopes" => nil, + "auth_methods" => [], + "ownership" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "connected_account" => nil, + "connected_accounts" => [] + } + model = WorkOS::DataIntegrationsListResponseData.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] + assert_nil json[:description] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["integration_type"], json[:integration_type] + assert_equal fixture["credentials_type"], json[:credentials_type] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_data_integrations_list_response_data_connected_account_round_trip fixture = { "object" => "connected_account", diff --git a/test/workos/test_shared_model_round_trip.rb b/test/workos/test_shared_model_round_trip.rb index d7276943..ad62fabd 100644 --- a/test/workos/test_shared_model_round_trip.rb +++ b/test/workos/test_shared_model_round_trip.rb @@ -152,11 +152,16 @@ def test_pipe_connected_account_round_trip fixture = { "object" => "connected_account", "id" => "stub", + "connection_role" => "stub", + "account_identifier" => nil, + "account_display_name" => nil, "data_integration_id" => "stub", "provider_slug" => "stub", "user_id" => nil, "organization_id" => nil, "scopes" => [], + "auth_method" => "stub", + "api_key_last_4" => nil, "state" => "stub", "created_at" => "stub", "updated_at" => "stub" @@ -1006,6 +1011,149 @@ def test_group_updated_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_pipes_account_connection_add_failed_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "pipes.account_connection.add_failed", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::PipesAccountConnectionAddFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + 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_pipes_account_connection_add_failed_data_round_trip + fixture = { + "object" => "connection_failed", + "data_integration_id" => "stub", + "provider_slug" => "stub", + "user_id" => nil, + "organization_id" => nil, + "account_identifier" => nil, + "error_code" => "stub", + "error_reason" => nil, + "provider_error" => nil, + "provider_error_description" => nil, + "created_at" => "stub" + } + model = WorkOS::PipesAccountConnectionAddFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["data_integration_id"], json[:data_integration_id] + assert_equal fixture["provider_slug"], json[:provider_slug] + assert_nil json[:user_id] + assert_nil json[:organization_id] + assert_equal fixture["error_code"], json[:error_code] + assert_nil json[:error_reason] + assert_nil json[:provider_error] + assert_nil json[:provider_error_description] + 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_pipes_account_connection_connected_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "pipes.account_connection.connected", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::PipesAccountConnectionConnected.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + 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_pipes_account_connection_connection_failed_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "pipes.account_connection.connection_failed", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::PipesAccountConnectionConnectionFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + 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_pipes_account_connection_connection_failed_data_round_trip + fixture = { + "object" => "connection_failed", + "data_integration_id" => "stub", + "provider_slug" => "stub", + "user_id" => nil, + "organization_id" => nil, + "account_identifier" => nil, + "error_code" => "stub", + "error_reason" => nil, + "provider_error" => nil, + "provider_error_description" => nil, + "created_at" => "stub" + } + model = WorkOS::PipesAccountConnectionConnectionFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["data_integration_id"], json[:data_integration_id] + assert_equal fixture["provider_slug"], json[:provider_slug] + assert_nil json[:user_id] + assert_nil json[:organization_id] + assert_equal fixture["error_code"], json[:error_code] + assert_nil json[:error_reason] + assert_nil json[:provider_error] + assert_nil json[:provider_error_description] + 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_pipes_account_connection_disconnected_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "pipes.account_connection.disconnected", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::PipesAccountConnectionDisconnected.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + 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_pipes_account_connection_reauthorization_needed_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "pipes.account_connection.reauthorization_needed", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::PipesAccountConnectionReauthorizationNeeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + 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_pipes_connected_account_connected_round_trip fixture = { "object" => "event", @@ -1047,6 +1195,7 @@ def test_pipes_connected_account_connection_failed_data_round_trip "provider_slug" => "stub", "user_id" => nil, "organization_id" => nil, + "account_identifier" => nil, "error_code" => "stub", "error_reason" => nil, "provider_error" => nil,