Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,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`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3fa61120f8b9e73972b9dc5f4b5ea2bc0526636
13ba15b32754d2d635b7799ab779867df2b611d6
49 changes: 49 additions & 0 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
}
1 change: 1 addition & 0 deletions lib/workos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions lib/workos/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/workos/multi_factor_auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
183 changes: 183 additions & 0 deletions lib/workos/organizations_data_providers.rb
Original file line number Diff line number Diff line change
@@ -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<String>, 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<String>, 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
Loading