workos 10.2.1 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.github/workflows/docs.yml +3 -3
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +3 -3
- data/.github/workflows/release.yml +2 -2
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +393 -4
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +328 -0
- data/Gemfile.lock +14 -14
- data/README.md +23 -0
- data/lib/workos/admin_portal.rb +2 -2
- data/lib/workos/agents/agent_blueprint.rb +43 -0
- data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
- data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
- data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
- data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
- data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
- data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
- data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
- data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
- data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
- data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
- data/lib/workos/agents/agent_instance.rb +40 -0
- data/lib/workos/agents/agent_instance_session.rb +40 -0
- data/lib/workos/agents/agent_token.rb +40 -0
- data/lib/workos/agents/agent_token_validation.rb +40 -0
- data/lib/workos/agents.rb +399 -0
- data/lib/workos/audit_logs.rb +23 -5
- data/lib/workos/authorization.rb +3 -3
- data/lib/workos/base_client.rb +6 -2
- data/lib/workos/client.rb +4 -0
- data/lib/workos/configuration.rb +3 -2
- data/lib/workos/inflections.rb +17 -0
- data/lib/workos/multi_factor_auth.rb +1 -1
- data/lib/workos/organizations/create_it_contact.rb +18 -0
- data/lib/workos/organizations/invite_it_contact.rb +18 -0
- data/lib/workos/organizations/it_contact.rb +31 -0
- data/lib/workos/organizations/it_contact_list.rb +25 -0
- data/lib/workos/organizations/organization_input.rb +10 -1
- data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
- data/lib/workos/organizations.rb +110 -1
- data/lib/workos/pipes/connected_account.rb +9 -0
- data/lib/workos/pipes/create_data_integration.rb +3 -0
- data/lib/workos/pipes/data_integration.rb +3 -0
- data/lib/workos/pipes/data_integration_installation.rb +9 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
- data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
- data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -1
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
- data/lib/workos/pipes.rb +324 -17
- data/lib/workos/platform_teams/create_team.rb +22 -0
- data/lib/workos/platform_teams/team.rb +37 -0
- data/lib/workos/platform_teams.rb +58 -0
- data/lib/workos/session_manager.rb +11 -6
- data/lib/workos/shared/account_selection_required_error.rb +22 -0
- data/lib/workos/shared/agent_blueprint_created.rb +34 -0
- data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
- data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
- data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
- data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
- data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
- data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
- data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
- data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
- data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
- data/lib/workos/shared/agent_instance_created.rb +34 -0
- data/lib/workos/shared/agent_instance_created_data.rb +40 -0
- data/lib/workos/shared/agent_instance_deleted.rb +34 -0
- data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
- data/lib/workos/shared/agent_instance_session_created.rb +34 -0
- data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
- data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
- data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
- data/lib/workos/shared/pipe_connected_account.rb +15 -0
- data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
- data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
- data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
- data/lib/workos/shared/resource_export_completed.rb +34 -0
- data/lib/workos/shared/resource_export_completed_data.rb +22 -0
- data/lib/workos/shared/resource_export_created.rb +34 -0
- data/lib/workos/shared/resource_export_created_data.rb +22 -0
- data/lib/workos/shared/resource_export_downloaded.rb +34 -0
- data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
- data/lib/workos/shared/resource_export_failed.rb +34 -0
- data/lib/workos/shared/resource_export_failed_data.rb +22 -0
- data/lib/workos/shared/waitlist_user.rb +8 -5
- data/lib/workos/sso/create_connection.rb +37 -0
- data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
- data/lib/workos/sso/create_connection_key_pair.rb +22 -0
- data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
- data/lib/workos/sso/create_connection_saml_options.rb +40 -0
- data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
- data/lib/workos/sso/create_saml_idp_signing_certificate.rb +18 -0
- data/lib/workos/sso/patch_connection.rb +34 -0
- data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
- data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
- data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
- data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
- data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
- data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
- data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
- data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
- data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
- data/lib/workos/sso/token_query.rb +11 -2
- data/lib/workos/sso.rb +305 -4
- data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
- data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
- data/lib/workos/types/agent_instance_deleted_data_type.rb +9 -0
- data/lib/workos/types/agent_instance_session_status.rb +14 -0
- data/lib/workos/types/agent_instance_type.rb +9 -0
- data/lib/workos/types/authenticate_response_authentication_method.rb +1 -4
- data/lib/workos/types/connected_account_connection_role.rb +13 -0
- data/lib/workos/types/connection_activated_data_connection_type.rb +1 -4
- data/lib/workos/types/connection_type.rb +1 -4
- data/lib/workos/types/connections_connection_type.rb +1 -4
- data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
- data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
- data/lib/workos/types/create_data_integration_ownership.rb +13 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +13 -1
- data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
- data/lib/workos/types/data_integration_ownership.rb +9 -0
- data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/invite_it_contact_intents.rb +16 -0
- data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
- data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
- data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
- data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
- data/lib/workos/types/pipes_ownership.rb +9 -0
- data/lib/workos/types/resource_export_completed_data_resource_type.rb +18 -0
- data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
- data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
- data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
- data/lib/workos/types/session_created_data_status.rb +1 -6
- data/lib/workos/types/session_revoked_data_status.rb +1 -1
- data/lib/workos/types/sso_grant_type.rb +13 -0
- data/lib/workos/types/team_production_state.rb +15 -0
- data/lib/workos/types/token_query_grant_type.rb +9 -0
- data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
- data/lib/workos/types/user_identities_get_item_provider.rb +1 -4
- data/lib/workos/types/user_management_waitlists_state.rb +14 -0
- data/lib/workos/types/user_sessions_status.rb +1 -1
- data/lib/workos/types/waitlist_entry_state.rb +9 -0
- data/lib/workos/types/waitlist_user_state.rb +1 -6
- data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
- data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
- data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
- data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
- data/lib/workos/user_management/create_password_reset_token.rb +1 -12
- data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
- data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/waitlist.rb +28 -0
- data/lib/workos/user_management/waitlist_entry.rb +43 -0
- data/lib/workos/user_management.rb +263 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +1 -0
- data/rbi/workos/account_selection_required_error.rbi +30 -0
- data/rbi/workos/agent_blueprint.rbi +72 -0
- data/rbi/workos/agent_blueprint_created.rbi +54 -0
- data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
- data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
- data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
- data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprint_updated.rbi +54 -0
- data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
- data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
- data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
- data/rbi/workos/agent_blueprints_token_validate_token_request.rbi +24 -0
- data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
- data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
- data/rbi/workos/agent_instance.rbi +66 -0
- data/rbi/workos/agent_instance_created.rbi +54 -0
- data/rbi/workos/agent_instance_created_data.rbi +66 -0
- data/rbi/workos/agent_instance_deleted.rbi +54 -0
- data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
- data/rbi/workos/agent_instance_session.rbi +66 -0
- data/rbi/workos/agent_instance_session_created.rbi +54 -0
- data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
- data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
- data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
- data/rbi/workos/agent_token.rbi +66 -0
- data/rbi/workos/agent_token_validation.rbi +66 -0
- data/rbi/workos/agents.rbi +134 -0
- data/rbi/workos/audit_logs.rbi +26 -2
- data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
- data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
- data/rbi/workos/authkit_oauth_resource.rbi +54 -0
- data/rbi/workos/client.rbi +3 -0
- data/rbi/workos/connected_account.rbi +18 -0
- data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
- data/rbi/workos/create_connection.rbi +60 -0
- data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
- data/rbi/workos/create_connection_key_pair.rbi +30 -0
- data/rbi/workos/create_connection_oidc_options.rbi +72 -0
- data/rbi/workos/create_connection_saml_options.rbi +66 -0
- data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
- data/rbi/workos/create_data_integration.rbi +6 -0
- data/rbi/workos/create_it_contact.rbi +24 -0
- data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
- data/rbi/workos/create_team.rbi +30 -0
- data/rbi/workos/create_waitlist_entry.rbi +36 -0
- data/rbi/workos/data_integration.rbi +6 -0
- data/rbi/workos/data_integration_installation.rbi +19 -1
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
- data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
- data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
- data/rbi/workos/invite_it_contact.rbi +24 -0
- data/rbi/workos/it_contact.rbi +48 -0
- data/rbi/workos/organizations.rbi +45 -0
- data/rbi/workos/patch_connection.rbi +54 -0
- data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
- data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
- data/rbi/workos/patch_connection_saml_options.rbi +48 -0
- data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
- data/rbi/workos/pipe_connected_account.rbi +30 -0
- data/rbi/workos/pipes.rbi +122 -11
- data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
- data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
- data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
- data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
- data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
- data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
- data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
- data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
- data/rbi/workos/platform_teams.rbi +30 -0
- data/rbi/workos/resource_export_completed.rbi +54 -0
- data/rbi/workos/resource_export_completed_data.rbi +30 -0
- data/rbi/workos/resource_export_created.rbi +54 -0
- data/rbi/workos/resource_export_created_data.rbi +30 -0
- data/rbi/workos/resource_export_downloaded.rbi +54 -0
- data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
- data/rbi/workos/resource_export_failed.rbi +54 -0
- data/rbi/workos/resource_export_failed_data.rbi +30 -0
- data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
- data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
- data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
- data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
- data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
- data/rbi/workos/sso.rbi +155 -2
- data/rbi/workos/team.rbi +60 -0
- data/rbi/workos/token_query.rbi +20 -2
- data/rbi/workos/update_audit_logs_retention.rbi +8 -2
- data/rbi/workos/user_management.rbi +92 -0
- data/rbi/workos/waitlist.rbi +42 -0
- data/rbi/workos/waitlist_entry.rbi +72 -0
- data/rbi/workos/waitlist_user.rbi +12 -6
- data/test/workos/test_agents.rb +105 -1
- data/test/workos/test_agents_model_round_trip.rb +245 -0
- data/test/workos/test_audit_logs.rb +11 -2
- data/test/workos/test_authorization.rb +6 -6
- data/test/workos/test_organizations.rb +41 -1
- data/test/workos/test_organizations_model_round_trip.rb +40 -1
- data/test/workos/test_pipes.rb +64 -0
- data/test/workos/test_pipes_model_round_trip.rb +35 -5
- data/test/workos/test_platform_teams.rb +41 -0
- data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
- data/test/workos/test_session.rb +63 -0
- data/test/workos/test_shared_model_round_trip.rb +610 -2
- data/test/workos/test_sso.rb +108 -2
- data/test/workos/test_sso_model_round_trip.rb +262 -2
- data/test/workos/test_user_management.rb +80 -0
- data/test/workos/test_user_management_model_round_trip.rb +110 -2
- metadata +194 -1
data/lib/workos/audit_logs.rb
CHANGED
|
@@ -6,6 +6,18 @@ require "json"
|
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
8
|
class AuditLogs
|
|
9
|
+
# Identifies the retention (period variant).
|
|
10
|
+
#
|
|
11
|
+
# @!attribute [r] retention_period
|
|
12
|
+
# @return [WorkOS::Types::UpdateAuditLogsRetentionRetentionPeriod]
|
|
13
|
+
RetentionPeriod = Data.define(:retention_period)
|
|
14
|
+
|
|
15
|
+
# Identifies the retention (period in days variant).
|
|
16
|
+
#
|
|
17
|
+
# @!attribute [r] retention_period_in_days
|
|
18
|
+
# @return [Integer]
|
|
19
|
+
RetentionPeriodInDays = Data.define(:retention_period_in_days)
|
|
20
|
+
|
|
9
21
|
def initialize(client)
|
|
10
22
|
@client = client
|
|
11
23
|
end
|
|
@@ -31,17 +43,23 @@ module WorkOS
|
|
|
31
43
|
|
|
32
44
|
# Set Retention
|
|
33
45
|
# @param id [String] Unique identifier of the Organization.
|
|
34
|
-
# @param
|
|
46
|
+
# @param retention [WorkOS::AuditLogs::RetentionPeriod, WorkOS::AuditLogs::RetentionPeriodInDays] Identifies the retention.
|
|
35
47
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
36
48
|
# @return [WorkOS::AuditLogsRetention]
|
|
37
49
|
def update_organization_audit_logs_retention(
|
|
38
50
|
id:,
|
|
39
|
-
|
|
51
|
+
retention:,
|
|
40
52
|
request_options: {}
|
|
41
53
|
)
|
|
42
|
-
body = {
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
body = {}
|
|
55
|
+
case retention
|
|
56
|
+
when WorkOS::AuditLogs::RetentionPeriod
|
|
57
|
+
body["retention_period"] = retention.retention_period
|
|
58
|
+
when WorkOS::AuditLogs::RetentionPeriodInDays
|
|
59
|
+
body["retention_period_in_days"] = retention.retention_period_in_days
|
|
60
|
+
else
|
|
61
|
+
raise ArgumentError, "expected retention to be one of: WorkOS::AuditLogs::RetentionPeriod, WorkOS::AuditLogs::RetentionPeriodInDays, got #{retention.class}"
|
|
62
|
+
end
|
|
45
63
|
response = @client.request(
|
|
46
64
|
method: :put,
|
|
47
65
|
path: "/organizations/#{WorkOS::Util.encode_path(id)}/audit_logs_retention",
|
data/lib/workos/authorization.rb
CHANGED
|
@@ -834,8 +834,8 @@ module WorkOS
|
|
|
834
834
|
when WorkOS::Authorization::ParentResourceById
|
|
835
835
|
body["parent_resource_id"] = parent_resource.parent_resource_id
|
|
836
836
|
when WorkOS::Authorization::ParentResourceByExternalId
|
|
837
|
-
body["parent_resource_external_id"] = parent_resource.parent_resource_external_id
|
|
838
837
|
body["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug
|
|
838
|
+
body["parent_resource_external_id"] = parent_resource.parent_resource_external_id
|
|
839
839
|
else
|
|
840
840
|
raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}"
|
|
841
841
|
end
|
|
@@ -1097,8 +1097,8 @@ module WorkOS
|
|
|
1097
1097
|
when WorkOS::Authorization::ParentResourceById
|
|
1098
1098
|
body["parent_resource_id"] = parent_resource.parent_resource_id
|
|
1099
1099
|
when WorkOS::Authorization::ParentResourceByExternalId
|
|
1100
|
-
body["parent_resource_external_id"] = parent_resource.parent_resource_external_id
|
|
1101
1100
|
body["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug
|
|
1101
|
+
body["parent_resource_external_id"] = parent_resource.parent_resource_external_id
|
|
1102
1102
|
else
|
|
1103
1103
|
raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}"
|
|
1104
1104
|
end
|
|
@@ -1157,8 +1157,8 @@ module WorkOS
|
|
|
1157
1157
|
when WorkOS::Authorization::ParentResourceById
|
|
1158
1158
|
body["parent_resource_id"] = parent_resource.parent_resource_id
|
|
1159
1159
|
when WorkOS::Authorization::ParentResourceByExternalId
|
|
1160
|
-
body["parent_resource_external_id"] = parent_resource.parent_resource_external_id
|
|
1161
1160
|
body["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug
|
|
1161
|
+
body["parent_resource_external_id"] = parent_resource.parent_resource_external_id
|
|
1162
1162
|
else
|
|
1163
1163
|
raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}"
|
|
1164
1164
|
end
|
data/lib/workos/base_client.rb
CHANGED
|
@@ -41,11 +41,14 @@ module WorkOS
|
|
|
41
41
|
"v#{WorkOS::VERSION}"
|
|
42
42
|
].join("; ").freeze
|
|
43
43
|
|
|
44
|
-
attr_reader :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level
|
|
44
|
+
attr_reader :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level, :jwt_issuer
|
|
45
45
|
|
|
46
|
+
# @param jwt_issuer [String, Array<String>, nil] Expected `iss` claim of
|
|
47
|
+
# session access tokens (one issuer or a list of accepted issuers).
|
|
48
|
+
# When nil, the issuer is not validated.
|
|
46
49
|
def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, client_id: nil,
|
|
47
50
|
timeout: DEFAULT_TIMEOUT, max_retries: DEFAULT_MAX_RETRIES,
|
|
48
|
-
logger: nil, log_level: nil, random: Random.new)
|
|
51
|
+
logger: nil, log_level: nil, jwt_issuer: nil, random: Random.new)
|
|
49
52
|
@api_key = api_key
|
|
50
53
|
@base_url = base_url
|
|
51
54
|
@client_id = client_id
|
|
@@ -53,6 +56,7 @@ module WorkOS
|
|
|
53
56
|
@max_retries = max_retries
|
|
54
57
|
@logger = logger
|
|
55
58
|
@log_level = log_level
|
|
59
|
+
@jwt_issuer = jwt_issuer
|
|
56
60
|
@random = random
|
|
57
61
|
end
|
|
58
62
|
|
data/lib/workos/client.rb
CHANGED
data/lib/workos/configuration.rb
CHANGED
|
@@ -12,7 +12,7 @@ module WorkOS
|
|
|
12
12
|
# config.log_level = :info
|
|
13
13
|
# end
|
|
14
14
|
class Configuration
|
|
15
|
-
attr_accessor :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level
|
|
15
|
+
attr_accessor :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level, :jwt_issuer
|
|
16
16
|
|
|
17
17
|
def initialize
|
|
18
18
|
@base_url = WorkOS::BaseClient::DEFAULT_BASE_URL
|
|
@@ -47,7 +47,8 @@ module WorkOS
|
|
|
47
47
|
timeout: configuration.timeout,
|
|
48
48
|
max_retries: configuration.max_retries,
|
|
49
49
|
logger: configuration.logger,
|
|
50
|
-
log_level: configuration.log_level
|
|
50
|
+
log_level: configuration.log_level,
|
|
51
|
+
jwt_issuer: configuration.jwt_issuer
|
|
51
52
|
)
|
|
52
53
|
end
|
|
53
54
|
|
data/lib/workos/inflections.rb
CHANGED
|
@@ -31,6 +31,7 @@ WORKOS_INFLECTIONS = {
|
|
|
31
31
|
"authentication_sso_timed_out_data" => "AuthenticationSSOTimedOutData",
|
|
32
32
|
"authentication_sso_timed_out_data_error" => "AuthenticationSSOTimedOutDataError",
|
|
33
33
|
"authentication_sso_timed_out_data_sso" => "AuthenticationSSOTimedOutDataSSO",
|
|
34
|
+
"authkit_oauth_resource" => "AuthkitOAuthResource",
|
|
34
35
|
"connect_application_m2m" => "ConnectApplicationM2M",
|
|
35
36
|
"connect_application_oauth" => "ConnectApplicationOAuth",
|
|
36
37
|
"connect_application_oauth_redirect_uris" => "ConnectApplicationOAuthRedirectUris",
|
|
@@ -45,15 +46,31 @@ WORKOS_INFLECTIONS = {
|
|
|
45
46
|
"connection_saml_certificate_renewed_data_certificate_certificate_type" => "ConnectionSAMLCertificateRenewedDataCertificateCertificateType",
|
|
46
47
|
"connection_saml_certificate_renewed_data_connection" => "ConnectionSAMLCertificateRenewedDataConnection",
|
|
47
48
|
"cors_origin_response" => "CORSOriginResponse",
|
|
49
|
+
"create_authkit_oauth_resource" => "CreateAuthkitOAuthResource",
|
|
50
|
+
"create_connection_oidc_options" => "CreateConnectionOIDCOptions",
|
|
51
|
+
"create_connection_oidc_options_id_token_signature_algorithm" => "CreateConnectionOIDCOptionsIdTokenSignatureAlgorithm",
|
|
52
|
+
"create_connection_oidc_options_token_authentication_method" => "CreateConnectionOIDCOptionsTokenAuthenticationMethod",
|
|
53
|
+
"create_connection_saml_options" => "CreateConnectionSAMLOptions",
|
|
48
54
|
"create_cors_origin" => "CreateCORSOrigin",
|
|
49
55
|
"create_m2m_application" => "CreateM2MApplication",
|
|
50
56
|
"create_oauth_application" => "CreateOAuthApplication",
|
|
57
|
+
"create_saml_idp_signing_certificate" => "CreateSAMLIdpSigningCertificate",
|
|
51
58
|
"jwt_template_response" => "JWTTemplateResponse",
|
|
52
59
|
"mfa_totp_session_authenticate_request" => "MFATotpSessionAuthenticateRequest",
|
|
60
|
+
"patch_connection_oidc_options" => "PatchConnectionOIDCOptions",
|
|
61
|
+
"patch_connection_oidc_options_id_token_signature_algorithm" => "PatchConnectionOIDCOptionsIdTokenSignatureAlgorithm",
|
|
62
|
+
"patch_connection_oidc_options_token_authentication_method" => "PatchConnectionOIDCOptionsTokenAuthenticationMethod",
|
|
63
|
+
"patch_connection_saml_options" => "PatchConnectionSAMLOptions",
|
|
53
64
|
"pkce" => "PKCE",
|
|
65
|
+
"saml_idp_signing_certificate" => "SAMLIdpSigningCertificate",
|
|
66
|
+
"saml_idp_signing_certificate_list" => "SAMLIdpSigningCertificateList",
|
|
67
|
+
"saml_sp_encryption_certificate" => "SAMLSpEncryptionCertificate",
|
|
68
|
+
"saml_sp_encryption_certificate_list" => "SAMLSpEncryptionCertificateList",
|
|
69
|
+
"saml_sp_signing_certificate" => "SAMLSpSigningCertificate",
|
|
54
70
|
"sso" => "SSO",
|
|
55
71
|
"sso_authorize_url_response" => "SSOAuthorizeUrlResponse",
|
|
56
72
|
"sso_device_authorization_request" => "SSODeviceAuthorizationRequest",
|
|
73
|
+
"sso_grant_type" => "SSOGrantType",
|
|
57
74
|
"sso_logout_authorize_request" => "SSOLogoutAuthorizeRequest",
|
|
58
75
|
"sso_logout_authorize_response" => "SSOLogoutAuthorizeResponse",
|
|
59
76
|
"sso_provider" => "SSOProvider",
|
|
@@ -108,7 +108,7 @@ module WorkOS
|
|
|
108
108
|
|
|
109
109
|
# Challenge Factor
|
|
110
110
|
# @param id [String] The unique ID of the Authentication Factor to be challenged.
|
|
111
|
-
# @param sms_template [String, nil] A custom template for the SMS message. Use the {{code}} placeholder to include the verification code.
|
|
111
|
+
# @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.
|
|
112
112
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
113
113
|
# @return [WorkOS::AuthenticationChallenge]
|
|
114
114
|
def challenge_factor(
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class CreateItContact < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
email: :email
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
attr_accessor :email
|
|
12
|
+
|
|
13
|
+
def initialize(json)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
15
|
+
@email = hash[:email]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class InviteItContact < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
intents: :intents
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
attr_accessor :intents
|
|
12
|
+
|
|
13
|
+
def initialize(json)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
15
|
+
@intents = hash[:intents] || []
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class ItContact < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
9
|
+
id: :id,
|
|
10
|
+
email: :email,
|
|
11
|
+
created_at: :created_at,
|
|
12
|
+
updated_at: :updated_at
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
15
|
+
attr_accessor \
|
|
16
|
+
:object,
|
|
17
|
+
:id,
|
|
18
|
+
:email,
|
|
19
|
+
:created_at,
|
|
20
|
+
:updated_at
|
|
21
|
+
|
|
22
|
+
def initialize(json)
|
|
23
|
+
hash = self.class.normalize(json)
|
|
24
|
+
@object = hash[:object]
|
|
25
|
+
@id = hash[:id]
|
|
26
|
+
@email = hash[:email]
|
|
27
|
+
@created_at = hash[:created_at]
|
|
28
|
+
@updated_at = hash[:updated_at]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class ItContactList < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
9
|
+
data: :data,
|
|
10
|
+
list_metadata: :list_metadata
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
attr_accessor \
|
|
14
|
+
:object,
|
|
15
|
+
:data,
|
|
16
|
+
:list_metadata
|
|
17
|
+
|
|
18
|
+
def initialize(json)
|
|
19
|
+
hash = self.class.normalize(json)
|
|
20
|
+
@object = hash[:object]
|
|
21
|
+
@data = (hash[:data] || []).map { |item| item ? WorkOS::ItContact.new(item) : nil }
|
|
22
|
+
@list_metadata = hash[:list_metadata] ? WorkOS::ItContactListListMetadata.new(hash[:list_metadata]) : nil
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -13,14 +13,23 @@ module WorkOS
|
|
|
13
13
|
external_id: :external_id
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
|
+
# @!attribute domains
|
|
17
|
+
# @deprecated The domains associated with the organization. Deprecated in favor of `domain_data`.
|
|
18
|
+
|
|
16
19
|
attr_accessor \
|
|
17
20
|
:name,
|
|
18
21
|
:allow_profiles_outside_organization,
|
|
19
|
-
:domains,
|
|
20
22
|
:domain_data,
|
|
21
23
|
:metadata,
|
|
22
24
|
:external_id
|
|
23
25
|
|
|
26
|
+
def domains
|
|
27
|
+
warn "[DEPRECATION] `domains` is deprecated and will be removed in a future version.", uplevel: 1
|
|
28
|
+
@domains
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
attr_writer :domains
|
|
32
|
+
|
|
24
33
|
def initialize(json)
|
|
25
34
|
hash = self.class.normalize(json)
|
|
26
35
|
@name = hash[:name]
|
|
@@ -5,13 +5,25 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class UpdateAuditLogsRetention < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
retention_period: :retention_period,
|
|
8
9
|
retention_period_in_days: :retention_period_in_days
|
|
9
10
|
}.freeze
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
# @!attribute retention_period_in_days
|
|
13
|
+
# @deprecated The number of days Audit Log events will be retained. Valid values are `30` through `330` in 30-day increments and `365` through `3650` in 365-day increments. Deprecated: use `retention_period` instead. Mutually exclusive with `retention_period`.
|
|
14
|
+
|
|
15
|
+
attr_accessor :retention_period
|
|
16
|
+
|
|
17
|
+
def retention_period_in_days
|
|
18
|
+
warn "[DEPRECATION] `retention_period_in_days` is deprecated and will be removed in a future version.", uplevel: 1
|
|
19
|
+
@retention_period_in_days
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
attr_writer :retention_period_in_days
|
|
12
23
|
|
|
13
24
|
def initialize(json)
|
|
14
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@retention_period = hash[:retention_period]
|
|
15
27
|
@retention_period_in_days = hash[:retention_period_in_days]
|
|
16
28
|
end
|
|
17
29
|
end
|
data/lib/workos/organizations.rb
CHANGED
|
@@ -65,7 +65,7 @@ module WorkOS
|
|
|
65
65
|
# Create an Organization
|
|
66
66
|
# @param name [String] The name of the organization.
|
|
67
67
|
# @param allow_profiles_outside_organization [Boolean, nil] Whether the organization allows profiles from outside the organization to sign in.
|
|
68
|
-
# @param domains [Array<String>, nil] The domains associated with the organization. Deprecated in favor of `domain_data`.
|
|
68
|
+
# @param domains [Array<String>, nil] (deprecated) The domains associated with the organization. Deprecated in favor of `domain_data`.
|
|
69
69
|
# @param domain_data [Array<WorkOS::OrganizationDomainData>, nil] The domains associated with the organization, including verification state.
|
|
70
70
|
# @param metadata [Hash{String => String}, nil] Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
|
71
71
|
# @param external_id [String, nil] An external identifier for the Organization.
|
|
@@ -263,5 +263,114 @@ module WorkOS
|
|
|
263
263
|
fetch_next: fetch_next
|
|
264
264
|
)
|
|
265
265
|
end
|
|
266
|
+
|
|
267
|
+
# List IT contacts
|
|
268
|
+
# @param organization_id [String] The ID of the organization.
|
|
269
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
270
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::ItContact>]
|
|
271
|
+
def list_it_contacts(
|
|
272
|
+
organization_id:,
|
|
273
|
+
request_options: {}
|
|
274
|
+
)
|
|
275
|
+
response = @client.request(
|
|
276
|
+
method: :get,
|
|
277
|
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts",
|
|
278
|
+
auth: true,
|
|
279
|
+
request_options: request_options
|
|
280
|
+
)
|
|
281
|
+
WorkOS::Types::ListStruct.from_response(
|
|
282
|
+
response,
|
|
283
|
+
model: WorkOS::ItContact,
|
|
284
|
+
filters: {organization_id: organization_id}
|
|
285
|
+
)
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Create an IT contact
|
|
289
|
+
# @param organization_id [String] The ID of the organization.
|
|
290
|
+
# @param email [String] The email address of the IT contact.
|
|
291
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
292
|
+
# @return [WorkOS::ItContact]
|
|
293
|
+
def create_it_contact(
|
|
294
|
+
organization_id:,
|
|
295
|
+
email:,
|
|
296
|
+
request_options: {}
|
|
297
|
+
)
|
|
298
|
+
body = {
|
|
299
|
+
"email" => email
|
|
300
|
+
}
|
|
301
|
+
response = @client.request(
|
|
302
|
+
method: :post,
|
|
303
|
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts",
|
|
304
|
+
auth: true,
|
|
305
|
+
body: body,
|
|
306
|
+
request_options: request_options
|
|
307
|
+
)
|
|
308
|
+
result = WorkOS::ItContact.new(response.body)
|
|
309
|
+
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"])
|
|
310
|
+
result
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Delete an IT contact
|
|
314
|
+
# @param organization_id [String] The ID of the organization.
|
|
315
|
+
# @param contact_id [String] The ID of the IT contact.
|
|
316
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
317
|
+
# @return [void]
|
|
318
|
+
def delete_it_contact(
|
|
319
|
+
organization_id:,
|
|
320
|
+
contact_id:,
|
|
321
|
+
request_options: {}
|
|
322
|
+
)
|
|
323
|
+
@client.request(
|
|
324
|
+
method: :delete,
|
|
325
|
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts/#{WorkOS::Util.encode_path(contact_id)}",
|
|
326
|
+
auth: true,
|
|
327
|
+
request_options: request_options
|
|
328
|
+
)
|
|
329
|
+
nil
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Invite an IT contact
|
|
333
|
+
# @param organization_id [String] The ID of the organization.
|
|
334
|
+
# @param contact_id [String] The ID of the IT contact.
|
|
335
|
+
# @param intents [Array<WorkOS::Types::InviteItContactIntents>] The Admin Portal features that the IT contact can configure.
|
|
336
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
337
|
+
# @return [void]
|
|
338
|
+
def invite_it_contact(
|
|
339
|
+
organization_id:,
|
|
340
|
+
contact_id:,
|
|
341
|
+
intents:,
|
|
342
|
+
request_options: {}
|
|
343
|
+
)
|
|
344
|
+
body = {
|
|
345
|
+
"intents" => intents
|
|
346
|
+
}
|
|
347
|
+
@client.request(
|
|
348
|
+
method: :post,
|
|
349
|
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts/#{WorkOS::Util.encode_path(contact_id)}/invite",
|
|
350
|
+
auth: true,
|
|
351
|
+
body: body,
|
|
352
|
+
request_options: request_options
|
|
353
|
+
)
|
|
354
|
+
nil
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# Revoke an IT contact's invitation
|
|
358
|
+
# @param organization_id [String] The ID of the organization.
|
|
359
|
+
# @param contact_id [String] The ID of the IT contact.
|
|
360
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
361
|
+
# @return [void]
|
|
362
|
+
def revoke_it_contact(
|
|
363
|
+
organization_id:,
|
|
364
|
+
contact_id:,
|
|
365
|
+
request_options: {}
|
|
366
|
+
)
|
|
367
|
+
@client.request(
|
|
368
|
+
method: :post,
|
|
369
|
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts/#{WorkOS::Util.encode_path(contact_id)}/revoke",
|
|
370
|
+
auth: true,
|
|
371
|
+
request_options: request_options
|
|
372
|
+
)
|
|
373
|
+
nil
|
|
374
|
+
end
|
|
266
375
|
end
|
|
267
376
|
end
|
|
@@ -7,6 +7,9 @@ module WorkOS
|
|
|
7
7
|
HASH_ATTRS = {
|
|
8
8
|
object: :object,
|
|
9
9
|
id: :id,
|
|
10
|
+
connection_role: :connection_role,
|
|
11
|
+
account_identifier: :account_identifier,
|
|
12
|
+
account_display_name: :account_display_name,
|
|
10
13
|
user_id: :user_id,
|
|
11
14
|
organization_id: :organization_id,
|
|
12
15
|
scopes: :scopes,
|
|
@@ -23,6 +26,9 @@ module WorkOS
|
|
|
23
26
|
attr_accessor \
|
|
24
27
|
:object,
|
|
25
28
|
:id,
|
|
29
|
+
:connection_role,
|
|
30
|
+
:account_identifier,
|
|
31
|
+
:account_display_name,
|
|
26
32
|
:user_id,
|
|
27
33
|
:organization_id,
|
|
28
34
|
:scopes,
|
|
@@ -39,6 +45,9 @@ module WorkOS
|
|
|
39
45
|
hash = self.class.normalize(json)
|
|
40
46
|
@object = hash[:object]
|
|
41
47
|
@id = hash[:id]
|
|
48
|
+
@connection_role = hash[:connection_role]
|
|
49
|
+
@account_identifier = hash[:account_identifier]
|
|
50
|
+
@account_display_name = hash[:account_display_name]
|
|
42
51
|
@user_id = hash[:user_id]
|
|
43
52
|
@organization_id = hash[:organization_id]
|
|
44
53
|
@scopes = hash[:scopes] || []
|
|
@@ -6,6 +6,7 @@ module WorkOS
|
|
|
6
6
|
class CreateDataIntegration < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
8
|
provider: :provider,
|
|
9
|
+
ownership: :ownership,
|
|
9
10
|
description: :description,
|
|
10
11
|
enabled: :enabled,
|
|
11
12
|
scopes: :scopes,
|
|
@@ -18,6 +19,7 @@ module WorkOS
|
|
|
18
19
|
|
|
19
20
|
attr_accessor \
|
|
20
21
|
:provider,
|
|
22
|
+
:ownership,
|
|
21
23
|
:description,
|
|
22
24
|
:enabled,
|
|
23
25
|
:scopes,
|
|
@@ -30,6 +32,7 @@ module WorkOS
|
|
|
30
32
|
def initialize(json)
|
|
31
33
|
hash = self.class.normalize(json)
|
|
32
34
|
@provider = hash[:provider]
|
|
35
|
+
@ownership = hash[:ownership]
|
|
33
36
|
@description = hash[:description]
|
|
34
37
|
@enabled = hash[:enabled]
|
|
35
38
|
@scopes = hash[:scopes] || []
|
|
@@ -9,6 +9,7 @@ module WorkOS
|
|
|
9
9
|
id: :id,
|
|
10
10
|
slug: :slug,
|
|
11
11
|
integration_type: :integration_type,
|
|
12
|
+
ownership: :ownership,
|
|
12
13
|
description: :description,
|
|
13
14
|
enabled: :enabled,
|
|
14
15
|
state: :state,
|
|
@@ -28,6 +29,7 @@ module WorkOS
|
|
|
28
29
|
:id,
|
|
29
30
|
:slug,
|
|
30
31
|
:integration_type,
|
|
32
|
+
:ownership,
|
|
31
33
|
:description,
|
|
32
34
|
:enabled,
|
|
33
35
|
:state,
|
|
@@ -47,6 +49,7 @@ module WorkOS
|
|
|
47
49
|
@id = hash[:id]
|
|
48
50
|
@slug = hash[:slug]
|
|
49
51
|
@integration_type = hash[:integration_type]
|
|
52
|
+
@ownership = hash[:ownership]
|
|
50
53
|
@description = hash[:description]
|
|
51
54
|
@enabled = hash[:enabled]
|
|
52
55
|
@state = hash[:state]
|
|
@@ -6,6 +6,9 @@ module WorkOS
|
|
|
6
6
|
class DataIntegrationInstallation < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
8
|
id: :id,
|
|
9
|
+
connection_role: :connection_role,
|
|
10
|
+
account_identifier: :account_identifier,
|
|
11
|
+
account_display_name: :account_display_name,
|
|
9
12
|
user_id: :user_id,
|
|
10
13
|
organization_id: :organization_id,
|
|
11
14
|
api_key_last_4: :api_key_last_4
|
|
@@ -13,6 +16,9 @@ module WorkOS
|
|
|
13
16
|
|
|
14
17
|
attr_accessor \
|
|
15
18
|
:id,
|
|
19
|
+
:connection_role,
|
|
20
|
+
:account_identifier,
|
|
21
|
+
:account_display_name,
|
|
16
22
|
:user_id,
|
|
17
23
|
:organization_id,
|
|
18
24
|
:api_key_last_4
|
|
@@ -20,6 +26,9 @@ module WorkOS
|
|
|
20
26
|
def initialize(json)
|
|
21
27
|
hash = self.class.normalize(json)
|
|
22
28
|
@id = hash[:id]
|
|
29
|
+
@connection_role = hash[:connection_role]
|
|
30
|
+
@account_identifier = hash[:account_identifier]
|
|
31
|
+
@account_display_name = hash[:account_display_name]
|
|
23
32
|
@user_id = hash[:user_id]
|
|
24
33
|
@organization_id = hash[:organization_id]
|
|
25
34
|
@api_key_last_4 = hash[:api_key_last_4]
|
|
@@ -7,6 +7,7 @@ module WorkOS
|
|
|
7
7
|
HASH_ATTRS = {
|
|
8
8
|
user_id: :user_id,
|
|
9
9
|
organization_id: :organization_id,
|
|
10
|
+
connection_owner: :connection_owner,
|
|
10
11
|
return_to: :return_to,
|
|
11
12
|
config: :config
|
|
12
13
|
}.freeze
|
|
@@ -14,6 +15,7 @@ module WorkOS
|
|
|
14
15
|
attr_accessor \
|
|
15
16
|
:user_id,
|
|
16
17
|
:organization_id,
|
|
18
|
+
:connection_owner,
|
|
17
19
|
:return_to,
|
|
18
20
|
:config
|
|
19
21
|
|
|
@@ -21,6 +23,7 @@ module WorkOS
|
|
|
21
23
|
hash = self.class.normalize(json)
|
|
22
24
|
@user_id = hash[:user_id]
|
|
23
25
|
@organization_id = hash[:organization_id]
|
|
26
|
+
@connection_owner = hash[:connection_owner]
|
|
24
27
|
@return_to = hash[:return_to]
|
|
25
28
|
@config = hash[:config] || {}
|
|
26
29
|
end
|
|
@@ -6,17 +6,26 @@ module WorkOS
|
|
|
6
6
|
class DataIntegrationsGetUserTokenRequest < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
8
|
user_id: :user_id,
|
|
9
|
-
organization_id: :organization_id
|
|
9
|
+
organization_id: :organization_id,
|
|
10
|
+
connected_account_id: :connected_account_id,
|
|
11
|
+
connection_owner: :connection_owner,
|
|
12
|
+
supports_multiple_connections: :supports_multiple_connections
|
|
10
13
|
}.freeze
|
|
11
14
|
|
|
12
15
|
attr_accessor \
|
|
13
16
|
:user_id,
|
|
14
|
-
:organization_id
|
|
17
|
+
:organization_id,
|
|
18
|
+
:connected_account_id,
|
|
19
|
+
:connection_owner,
|
|
20
|
+
:supports_multiple_connections
|
|
15
21
|
|
|
16
22
|
def initialize(json)
|
|
17
23
|
hash = self.class.normalize(json)
|
|
18
24
|
@user_id = hash[:user_id]
|
|
19
25
|
@organization_id = hash[:organization_id]
|
|
26
|
+
@connected_account_id = hash[:connected_account_id]
|
|
27
|
+
@connection_owner = hash[:connection_owner]
|
|
28
|
+
@supports_multiple_connections = hash[:supports_multiple_connections]
|
|
20
29
|
end
|
|
21
30
|
end
|
|
22
31
|
end
|
|
@@ -14,12 +14,17 @@ module WorkOS
|
|
|
14
14
|
credentials_type: :credentials_type,
|
|
15
15
|
scopes: :scopes,
|
|
16
16
|
auth_methods: :auth_methods,
|
|
17
|
+
connection_owner: :connection_owner,
|
|
17
18
|
ownership: :ownership,
|
|
18
19
|
created_at: :created_at,
|
|
19
20
|
updated_at: :updated_at,
|
|
20
|
-
connected_account: :connected_account
|
|
21
|
+
connected_account: :connected_account,
|
|
22
|
+
connected_accounts: :connected_accounts
|
|
21
23
|
}.freeze
|
|
22
24
|
|
|
25
|
+
# @!attribute ownership
|
|
26
|
+
# @deprecated Use `connection_owner` instead. Legacy spelling of the same value: `userland_user` corresponds to `connection_owner: "user"` and `organization` to `connection_owner: "organization"`.
|
|
27
|
+
|
|
23
28
|
attr_accessor \
|
|
24
29
|
:object,
|
|
25
30
|
:id,
|
|
@@ -30,10 +35,18 @@ module WorkOS
|
|
|
30
35
|
:credentials_type,
|
|
31
36
|
:scopes,
|
|
32
37
|
:auth_methods,
|
|
33
|
-
:
|
|
38
|
+
:connection_owner,
|
|
34
39
|
:created_at,
|
|
35
40
|
:updated_at,
|
|
36
|
-
:connected_account
|
|
41
|
+
:connected_account,
|
|
42
|
+
:connected_accounts
|
|
43
|
+
|
|
44
|
+
def ownership
|
|
45
|
+
warn "[DEPRECATION] `ownership` is deprecated and will be removed in a future version.", uplevel: 1
|
|
46
|
+
@ownership
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
attr_writer :ownership
|
|
37
50
|
|
|
38
51
|
def initialize(json)
|
|
39
52
|
hash = self.class.normalize(json)
|
|
@@ -46,10 +59,12 @@ module WorkOS
|
|
|
46
59
|
@credentials_type = hash[:credentials_type]
|
|
47
60
|
@scopes = hash[:scopes] || []
|
|
48
61
|
@auth_methods = hash[:auth_methods] || []
|
|
62
|
+
@connection_owner = hash[:connection_owner]
|
|
49
63
|
@ownership = hash[:ownership]
|
|
50
64
|
@created_at = hash[:created_at]
|
|
51
65
|
@updated_at = hash[:updated_at]
|
|
52
66
|
@connected_account = hash[:connected_account] ? WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(hash[:connected_account]) : nil
|
|
67
|
+
@connected_accounts = (hash[:connected_accounts] || []).map { |item| item ? WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(item) : nil }
|
|
53
68
|
end
|
|
54
69
|
end
|
|
55
70
|
end
|