workos 7.1.2 → 9.5.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 +49 -0
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +164 -10
- data/.github/workflows/release.yml +2 -2
- data/.gitignore +2 -0
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +403 -84
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/.yardopts +6 -0
- data/CHANGELOG.md +331 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -4
- data/README.md +19 -0
- data/docs/V7_MIGRATION_GUIDE.md +21 -0
- data/lib/workos/actions.rb +1 -1
- data/lib/workos/admin_portal/generate_link.rb +0 -3
- data/lib/workos/admin_portal.rb +0 -3
- data/lib/workos/api_keys/api_key.rb +4 -1
- data/lib/workos/api_keys/api_key_created.rb +5 -5
- data/lib/workos/api_keys/api_key_created_data.rb +4 -1
- data/lib/workos/api_keys/api_key_revoked.rb +5 -5
- data/lib/workos/{audit_logs/audit_log_export_json.rb → api_keys/api_key_updated.rb} +10 -10
- data/lib/workos/api_keys/api_key_updated_data.rb +49 -0
- data/lib/workos/{directory_sync/dsync_deactivated_data_domain.rb → api_keys/api_key_updated_data_owner.rb} +1 -1
- data/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb +18 -0
- data/lib/workos/api_keys/create_organization_api_key.rb +5 -2
- data/lib/workos/api_keys/expire_api_key.rb +18 -0
- data/lib/workos/api_keys/organization_api_key.rb +46 -0
- data/lib/workos/{types/events_order.rb → api_keys/organization_api_key_owner.rb} +1 -3
- data/lib/workos/api_keys/organization_api_key_with_value.rb +49 -0
- data/lib/workos/{types/audit_logs_order.rb → api_keys/organization_api_key_with_value_owner.rb} +1 -3
- data/lib/workos/api_keys.rb +75 -47
- data/lib/workos/audit_logs/audit_log_action.rb +2 -7
- data/lib/workos/audit_logs/audit_log_export.rb +2 -7
- data/lib/workos/audit_logs/audit_log_schema.rb +11 -2
- data/lib/workos/audit_logs/audit_log_schema_actor_input.rb +7 -0
- data/lib/workos/audit_logs/audit_log_schema_input.rb +25 -0
- data/lib/workos/audit_logs/audit_log_schema_target.rb +16 -1
- data/lib/workos/audit_logs/audit_log_schema_target_input.rb +7 -0
- data/lib/workos/audit_logs.rb +20 -20
- data/lib/workos/{audit_logs/audit_log_schema_json_actor.rb → authorization/create_group_role_assignment.rb} +1 -1
- data/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb +7 -0
- data/lib/workos/authorization/{role_assignment.rb → group_role_assignment.rb} +5 -2
- data/lib/workos/authorization/group_role_assignment_list.rb +25 -0
- data/lib/workos/authorization/{role_assignment_resource.rb → group_role_assignment_resource.rb} +1 -1
- data/lib/workos/authorization/permission_created.rb +5 -5
- data/lib/workos/authorization/permission_deleted.rb +5 -5
- data/lib/workos/authorization/permission_updated.rb +5 -5
- data/lib/workos/{api_keys/api_key_with_value_owner.rb → authorization/replace_group_role_assignment_entry.rb} +1 -1
- data/lib/workos/authorization/replace_group_role_assignments.rb +18 -0
- data/lib/workos/authorization/role_created.rb +5 -5
- data/lib/workos/authorization/role_deleted.rb +5 -5
- data/lib/workos/authorization/role_updated.rb +5 -5
- data/lib/workos/authorization/user_role_assignment.rb +40 -0
- data/lib/workos/authorization/user_role_assignment_resource.rb +7 -0
- data/lib/workos/{audit_logs/audit_log_schema_json_target.rb → authorization/user_role_assignment_source.rb} +4 -4
- data/lib/workos/authorization.rb +326 -30
- data/lib/workos/base_client.rb +90 -7
- data/lib/workos/client.rb +18 -10
- data/lib/workos/client_api/client_api_token.rb +22 -0
- data/lib/workos/client_api/client_api_token_response.rb +18 -0
- data/lib/workos/client_api.rb +39 -0
- data/lib/workos/connect/connect_application.rb +12 -0
- data/lib/workos/connect/connect_application_redirect_uri.rb +22 -0
- data/lib/workos/connect/user_object.rb +3 -0
- data/lib/workos/connect.rb +2 -2
- data/lib/workos/directory_sync/directory_user.rb +3 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +4 -1
- data/lib/workos/directory_sync/dsync_activated.rb +5 -5
- data/lib/workos/directory_sync/dsync_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_created.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_updated.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_user_added.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_user_removed.rb +5 -5
- data/lib/workos/directory_sync/dsync_token_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_created_data.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_revoked.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_revoked_data.rb +7 -0
- data/lib/workos/directory_sync/dsync_user_created.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_updated.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_updated_data.rb +3 -0
- data/lib/workos/directory_sync.rb +6 -6
- data/lib/workos/encryptors/aes_gcm.rb +19 -5
- data/lib/workos/events.rb +2 -2
- data/lib/workos/feature_flags/flag_created.rb +5 -5
- data/lib/workos/feature_flags/flag_deleted.rb +5 -5
- data/lib/workos/feature_flags/flag_rule_updated.rb +5 -5
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb +1 -16
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb +1 -1
- data/lib/workos/feature_flags/flag_updated.rb +5 -5
- data/lib/workos/feature_flags.rb +6 -6
- data/lib/workos/{authorization → groups}/user_organization_membership_base_list_data.rb +5 -2
- data/lib/workos/groups.rb +4 -4
- data/lib/workos/inflections.rb +3 -1
- data/lib/workos/multi_factor_auth.rb +2 -2
- data/lib/workos/organization_domains/organization_domain_created.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_deleted.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_updated.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_verification_failed.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_verified.rb +5 -5
- data/lib/workos/{user_management → organization_membership}/organization_membership.rb +8 -2
- data/lib/workos/{user_management → organization_membership}/user_organization_membership.rb +8 -2
- data/lib/workos/organization_membership_service.rb +273 -0
- data/lib/workos/organizations/audit_logs_retention.rb +2 -7
- data/lib/workos/organizations/organization_created.rb +5 -5
- data/lib/workos/organizations/organization_deleted.rb +5 -5
- data/lib/workos/organizations/organization_membership_created.rb +5 -5
- data/lib/workos/organizations/organization_membership_deleted.rb +5 -5
- data/lib/workos/organizations/organization_membership_updated.rb +5 -5
- data/lib/workos/organizations/organization_role_created.rb +5 -5
- data/lib/workos/organizations/organization_role_deleted.rb +5 -5
- data/lib/workos/organizations/organization_role_updated.rb +5 -5
- data/lib/workos/organizations/organization_updated.rb +5 -5
- data/lib/workos/organizations.rb +2 -2
- data/lib/workos/pipes/connected_account.rb +6 -0
- data/lib/workos/pipes/connected_account_dto.rb +31 -0
- data/lib/workos/pipes/create_data_integration.rb +34 -0
- data/lib/workos/pipes/custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/data_integration.rb +55 -0
- data/lib/workos/pipes/data_integration_credential.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
- data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
- data/lib/workos/pipes/data_integrations_list_response_data.rb +3 -0
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
- data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/update_data_integration.rb +31 -0
- data/lib/workos/pipes.rb +309 -5
- data/lib/workos/pipes_provider/configure_data_integration_body.rb +28 -0
- data/lib/workos/pipes_provider/data_integration_configuration_list_response.rb +22 -0
- data/lib/workos/{directory_sync/dsync_deactivated_data.rb → pipes_provider/data_integration_configuration_response.rb} +13 -13
- data/lib/workos/pipes_provider/data_integration_credentials.rb +31 -0
- data/lib/workos/pipes_provider.rb +68 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +3 -6
- data/lib/workos/radar.rb +7 -10
- data/lib/workos/session.rb +28 -7
- data/lib/workos/session_manager.rb +24 -1
- data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
- data/lib/workos/shared/connect_application_m2m.rb +46 -0
- data/lib/workos/shared/connect_application_oauth.rb +58 -0
- data/lib/workos/shared/connect_application_oauth_redirect_uris.rb +22 -0
- data/lib/workos/shared/error_response.rb +18 -0
- data/lib/workos/shared/group_created.rb +5 -5
- data/lib/workos/shared/group_deleted.rb +5 -5
- data/lib/workos/shared/group_member_added.rb +5 -5
- data/lib/workos/shared/group_member_removed.rb +5 -5
- data/lib/workos/shared/group_updated.rb +5 -5
- data/lib/workos/shared/pipe_connected_account.rb +46 -0
- data/lib/workos/{directory_sync/dsync_deactivated.rb → shared/pipes_connected_account_connected.rb} +7 -7
- data/lib/workos/shared/pipes_connected_account_disconnected.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_reauthorization_needed.rb +34 -0
- data/lib/workos/shared/waitlist_user_approved.rb +5 -5
- data/lib/workos/shared/waitlist_user_created.rb +5 -5
- data/lib/workos/shared/waitlist_user_denied.rb +5 -5
- data/lib/workos/sso/connection_activated.rb +5 -5
- data/lib/workos/sso/connection_deactivated.rb +5 -5
- data/lib/workos/sso/connection_deleted.rb +5 -5
- data/lib/workos/sso/connection_saml_certificate_renewal_required.rb +5 -5
- data/lib/workos/sso/connection_saml_certificate_renewed.rb +5 -5
- data/lib/workos/sso/profile.rb +3 -0
- data/lib/workos/sso.rb +2 -2
- data/lib/workos/types/audit_log_configuration_log_stream_type.rb +2 -1
- data/lib/workos/types/audit_log_export_state.rb +2 -1
- data/lib/workos/types/connected_account_auth_method.rb +13 -0
- data/lib/workos/types/connected_account_state.rb +1 -2
- data/lib/workos/types/create_webhook_endpoint_events.rb +12 -1
- data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
- data/lib/workos/types/data_integration_access_token_response_error.rb +2 -2
- data/lib/workos/types/data_integration_credential_type.rb +13 -0
- data/lib/workos/types/data_integration_credentials_credentials_type.rb +14 -0
- data/lib/workos/types/{directories_order.rb → data_integration_credentials_response_error.rb} +1 -1
- data/lib/workos/types/{authorization_order.rb → data_integration_credentials_type.rb} +1 -1
- data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
- data/lib/workos/types/data_integration_state.rb +14 -0
- data/lib/workos/types/{connections_order.rb → data_integrations_list_response_data_auth_methods.rb} +1 -1
- data/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
- data/lib/workos/types/event_context_actor_source.rb +2 -1
- data/lib/workos/types/{applications_order.rb → pagination_order.rb} +1 -1
- data/lib/workos/types/pipe_connected_account_state.rb +13 -0
- data/lib/workos/types/{radar_action.rb → radar_list_action.rb} +1 -1
- data/lib/workos/types/radar_list_type.rb +18 -0
- data/lib/workos/types/radar_standalone_assess_request_action.rb +1 -7
- data/lib/workos/types/radar_standalone_response_blocklist_type.rb +1 -10
- data/lib/workos/types/radar_standalone_response_control.rb +1 -4
- data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
- data/lib/workos/types/user_management_authentication_screen_hint.rb +1 -5
- data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
- data/lib/workos/types/{vault_byok_key_verification_completed_data_key_provider.rb → vault_byok_key_provider.rb} +1 -1
- data/{rbi/workos/types/request_options.rbi → lib/workos/types/vault_order.rb} +4 -3
- data/lib/workos/types/webhook_endpoint_status.rb +1 -5
- data/lib/workos/types/widget_session_token_scopes.rb +2 -1
- data/lib/workos/user_management/action_authentication_denied.rb +6 -6
- data/lib/workos/user_management/action_user_registration_denied.rb +6 -6
- data/lib/workos/user_management/authentication_email_verification_failed.rb +5 -5
- data/lib/workos/user_management/authentication_email_verification_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_magic_auth_failed.rb +5 -5
- data/lib/workos/user_management/authentication_magic_auth_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_mfa_failed.rb +5 -5
- data/lib/workos/user_management/authentication_mfa_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_oauth_failed.rb +5 -5
- data/lib/workos/user_management/authentication_oauth_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_passkey_failed.rb +5 -5
- data/lib/workos/user_management/authentication_passkey_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_password_failed.rb +5 -5
- data/lib/workos/user_management/authentication_password_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_radar_risk_detected.rb +5 -5
- data/lib/workos/user_management/authentication_sso_failed.rb +5 -5
- data/lib/workos/user_management/authentication_sso_started.rb +5 -5
- data/lib/workos/user_management/authentication_sso_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_sso_timed_out.rb +5 -5
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
- data/lib/workos/user_management/create_user.rb +12 -0
- data/lib/workos/user_management/create_user_api_key.rb +28 -0
- data/lib/workos/user_management/email_change_confirmation_user.rb +3 -0
- data/lib/workos/user_management/email_verification_created.rb +5 -5
- data/lib/workos/user_management/invitation_accepted.rb +5 -5
- data/lib/workos/user_management/invitation_created.rb +5 -5
- data/lib/workos/user_management/invitation_resent.rb +5 -5
- data/lib/workos/user_management/invitation_revoked.rb +5 -5
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/magic_auth_created.rb +5 -5
- data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +43 -0
- data/lib/workos/user_management/password_reset_created.rb +5 -5
- data/lib/workos/user_management/password_reset_succeeded.rb +5 -5
- data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
- data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
- data/lib/workos/user_management/revoke_session.rb +2 -6
- data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
- data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
- data/lib/workos/user_management/session_created.rb +5 -5
- data/lib/workos/user_management/session_revoked.rb +5 -5
- data/lib/workos/user_management/update_user.rb +3 -0
- data/lib/workos/user_management/user_api_key.rb +46 -0
- data/lib/workos/user_management/user_api_key_created_data_owner.rb +25 -0
- data/lib/workos/user_management/user_api_key_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_revoked_data_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_updated_data_owner.rb +7 -0
- data/lib/workos/{api_keys/api_key_with_value.rb → user_management/user_api_key_with_value.rb} +5 -2
- data/lib/workos/user_management/user_api_key_with_value_owner.rb +7 -0
- data/lib/workos/user_management/user_create_response.rb +61 -0
- data/lib/workos/user_management/user_created.rb +5 -5
- data/lib/workos/user_management/user_deleted.rb +5 -5
- data/lib/workos/user_management/user_updated.rb +5 -5
- data/lib/workos/user_management.rb +351 -202
- data/lib/workos/vault/actor.rb +22 -0
- data/lib/workos/vault/create_data_key_request.rb +18 -0
- data/lib/workos/vault/create_data_key_response.rb +28 -0
- data/lib/workos/vault/create_object_request.rb +25 -0
- data/lib/workos/vault/decrypt_request.rb +18 -0
- data/lib/workos/vault/decrypt_response.rb +22 -0
- data/lib/workos/vault/delete_object_response.rb +22 -0
- data/lib/workos/vault/object_metadata.rb +37 -0
- data/lib/workos/{audit_logs/audit_log_action_json.rb → vault/object_summary.rb} +4 -10
- data/lib/workos/vault/object_version.rb +31 -0
- data/lib/workos/vault/object_without_value.rb +25 -0
- data/lib/workos/vault/rekey_request.rb +22 -0
- data/lib/workos/vault/update_object_request.rb +22 -0
- data/lib/workos/vault/vault_byok_key_deleted.rb +34 -0
- data/lib/workos/vault/vault_byok_key_deleted_data.rb +22 -0
- data/lib/workos/vault/vault_byok_key_verification_completed.rb +5 -5
- data/lib/workos/vault/vault_data_created.rb +5 -5
- data/lib/workos/vault/vault_data_deleted.rb +5 -5
- data/lib/workos/vault/vault_data_read.rb +5 -5
- data/lib/workos/vault/vault_data_updated.rb +5 -5
- data/lib/workos/vault/vault_dek_decrypted.rb +5 -5
- data/lib/workos/vault/vault_dek_read.rb +5 -5
- data/lib/workos/vault/vault_kek_created.rb +5 -5
- data/lib/workos/vault/vault_metadata_read.rb +5 -5
- data/lib/workos/vault/vault_names_listed.rb +5 -5
- data/lib/workos/vault/vault_object.rb +28 -0
- data/lib/workos/vault/version_list_response.rb +22 -0
- data/lib/workos/vault.rb +273 -139
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks/webhook_endpoint.rb +2 -7
- data/lib/workos/webhooks.rb +10 -11
- data/lib/workos/widgets/widget_session_token_response.rb +1 -12
- data/lib/workos.rb +3 -0
- data/rbi/workos/action_authentication_denied.rbi +10 -10
- data/rbi/workos/action_user_registration_denied.rbi +10 -10
- data/rbi/workos/actor.rbi +30 -0
- data/rbi/workos/admin_portal.rbi +1 -2
- data/rbi/workos/api_key.rbi +8 -2
- data/rbi/workos/api_key_created.rbi +6 -6
- data/rbi/workos/api_key_created_data.rbi +8 -2
- data/rbi/workos/api_key_revoked.rbi +6 -6
- data/rbi/workos/api_key_revoked_data.rbi +8 -2
- data/rbi/workos/{dsync_deactivated.rbi → api_key_updated.rbi} +9 -9
- data/rbi/workos/api_key_updated_data.rbi +84 -0
- data/rbi/workos/{api_key_with_value_owner.rbi → api_key_updated_data_owner.rbi} +1 -1
- data/rbi/workos/{audit_logs_retention_json.rbi → api_key_updated_data_previous_attribute.rbi} +5 -5
- data/rbi/workos/api_keys.rbi +27 -17
- data/rbi/workos/audit_log_action.rbi +1 -0
- data/rbi/workos/audit_log_export.rbi +1 -0
- data/rbi/workos/audit_log_schema.rbi +18 -0
- data/rbi/workos/{audit_log_schema_json_actor.rbi → audit_log_schema_actor_input.rbi} +1 -1
- data/rbi/workos/audit_log_schema_input.rbi +36 -0
- data/rbi/workos/{audit_log_schema_json_target.rbi → audit_log_schema_target_input.rbi} +1 -1
- data/rbi/workos/audit_logs.rbi +9 -9
- data/rbi/workos/audit_logs_retention.rbi +1 -0
- data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
- data/rbi/workos/authentication_email_verification_failed.rbi +6 -6
- data/rbi/workos/authentication_email_verification_succeeded.rbi +6 -6
- data/rbi/workos/authentication_magic_auth_failed.rbi +6 -6
- data/rbi/workos/authentication_magic_auth_succeeded.rbi +6 -6
- data/rbi/workos/authentication_mfa_failed.rbi +6 -6
- data/rbi/workos/authentication_mfa_succeeded.rbi +6 -6
- data/rbi/workos/authentication_oauth_failed.rbi +6 -6
- data/rbi/workos/authentication_oauth_succeeded.rbi +6 -6
- data/rbi/workos/authentication_passkey_failed.rbi +6 -6
- data/rbi/workos/authentication_passkey_succeeded.rbi +6 -6
- data/rbi/workos/authentication_password_failed.rbi +6 -6
- data/rbi/workos/authentication_password_succeeded.rbi +6 -6
- data/rbi/workos/authentication_radar_risk_detected.rbi +6 -6
- data/rbi/workos/authentication_sso_failed.rbi +6 -6
- data/rbi/workos/authentication_sso_started.rbi +6 -6
- data/rbi/workos/authentication_sso_succeeded.rbi +6 -6
- data/rbi/workos/authentication_sso_timed_out.rbi +6 -6
- data/rbi/workos/authorization.rbi +97 -4
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +8 -2
- data/rbi/workos/client.rbi +15 -6
- data/rbi/workos/client_api.rbi +22 -0
- data/rbi/workos/client_api_token.rbi +30 -0
- data/rbi/workos/client_api_token_response.rbi +24 -0
- data/rbi/workos/configure_data_integration_body.rbi +42 -0
- data/rbi/workos/connect_application.rbi +0 -12
- data/rbi/workos/{dsync_deactivated_data.rbi → connect_application_m2m.rbi} +19 -19
- data/rbi/workos/connect_application_oauth.rbi +102 -0
- data/rbi/workos/connect_application_oauth_redirect_uris.rbi +30 -0
- data/rbi/workos/connected_account.rbi +12 -0
- data/rbi/workos/connected_account_dto.rbi +48 -0
- data/rbi/workos/connection_activated.rbi +6 -6
- data/rbi/workos/connection_deactivated.rbi +6 -6
- data/rbi/workos/connection_deleted.rbi +6 -6
- data/rbi/workos/connection_saml_certificate_renewal_required.rbi +6 -6
- data/rbi/workos/connection_saml_certificate_renewed.rbi +6 -6
- data/rbi/workos/create_data_integration.rbi +54 -0
- data/rbi/workos/create_data_key_request.rbi +24 -0
- data/rbi/workos/create_data_key_response.rbi +42 -0
- data/rbi/workos/create_group_role_assignment.rbi +42 -0
- data/rbi/workos/create_magic_code_and_return.rbi +24 -0
- data/rbi/workos/create_object_request.rbi +36 -0
- data/rbi/workos/create_organization_api_key.rbi +6 -0
- data/rbi/workos/create_user.rbi +24 -0
- data/rbi/workos/create_user_api_key.rbi +42 -0
- data/rbi/workos/custom_provider_definition.rbi +84 -0
- data/rbi/workos/data_integration.rbi +96 -0
- data/rbi/workos/data_integration_configuration_list_response.rbi +30 -0
- data/rbi/workos/data_integration_configuration_response.rbi +78 -0
- data/rbi/workos/data_integration_credential.rbi +36 -0
- data/rbi/workos/data_integration_credentials.rbi +48 -0
- data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
- data/rbi/workos/data_integration_custom_provider.rbi +84 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +6 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
- data/rbi/workos/decrypt_request.rbi +24 -0
- data/rbi/workos/decrypt_response.rbi +30 -0
- data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +42 -0
- data/rbi/workos/delete_object_response.rbi +30 -0
- data/rbi/workos/directory_user.rbi +6 -0
- data/rbi/workos/directory_user_with_groups.rbi +6 -0
- data/rbi/workos/dsync_activated.rbi +6 -6
- data/rbi/workos/dsync_deleted.rbi +6 -6
- data/rbi/workos/dsync_group_created.rbi +6 -6
- data/rbi/workos/dsync_group_deleted.rbi +6 -6
- data/rbi/workos/dsync_group_updated.rbi +6 -6
- data/rbi/workos/dsync_group_user_added.rbi +6 -6
- data/rbi/workos/dsync_group_user_removed.rbi +6 -6
- data/rbi/workos/dsync_token_created.rbi +54 -0
- data/rbi/workos/{audit_log_export_json.rbi → dsync_token_created_data.rbi} +9 -9
- data/rbi/workos/dsync_token_revoked.rbi +54 -0
- data/rbi/workos/{audit_log_action_json.rbi → dsync_token_revoked_data.rbi} +17 -11
- data/rbi/workos/dsync_user_created.rbi +6 -6
- data/rbi/workos/dsync_user_deleted.rbi +6 -6
- data/rbi/workos/dsync_user_updated.rbi +6 -6
- data/rbi/workos/dsync_user_updated_data.rbi +6 -0
- data/rbi/workos/email_change_confirmation_user.rbi +6 -0
- data/rbi/workos/email_verification_created.rbi +6 -6
- data/rbi/workos/error_response.rbi +24 -0
- data/rbi/workos/expire_api_key.rbi +24 -0
- data/rbi/workos/flag_created.rbi +6 -6
- data/rbi/workos/flag_deleted.rbi +6 -6
- data/rbi/workos/flag_rule_updated.rbi +6 -6
- data/rbi/workos/flag_updated.rbi +6 -6
- data/rbi/workos/generate_link.rbi +0 -6
- data/rbi/workos/group_created.rbi +6 -6
- data/rbi/workos/group_deleted.rbi +6 -6
- data/rbi/workos/group_member_added.rbi +6 -6
- data/rbi/workos/group_member_removed.rbi +6 -6
- data/rbi/workos/{role_assignment.rbi → group_role_assignment.rbi} +9 -3
- data/rbi/workos/group_role_assignment_resource.rbi +36 -0
- data/rbi/workos/group_updated.rbi +6 -6
- data/rbi/workos/invitation_accepted.rbi +6 -6
- data/rbi/workos/invitation_created.rbi +6 -6
- data/rbi/workos/invitation_resent.rbi +6 -6
- data/rbi/workos/invitation_revoked.rbi +6 -6
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/magic_auth_created.rbi +6 -6
- data/rbi/workos/{webhook_endpoint_json.rbi → magic_auth_send_magic_auth_code_and_return_response.rbi} +19 -13
- data/rbi/workos/object_metadata.rbi +60 -0
- data/rbi/workos/object_summary.rbi +36 -0
- data/rbi/workos/object_version.rbi +48 -0
- data/rbi/workos/object_without_value.rbi +36 -0
- data/rbi/workos/organization_api_key.rbi +78 -0
- data/rbi/workos/organization_api_key_owner.rbi +30 -0
- data/rbi/workos/organization_api_key_with_value.rbi +84 -0
- data/rbi/workos/organization_api_key_with_value_owner.rbi +30 -0
- data/rbi/workos/organization_created.rbi +6 -6
- data/rbi/workos/organization_deleted.rbi +6 -6
- data/rbi/workos/organization_domain_created.rbi +6 -6
- data/rbi/workos/organization_domain_deleted.rbi +6 -6
- data/rbi/workos/organization_domain_updated.rbi +6 -6
- data/rbi/workos/organization_domain_verification_failed.rbi +6 -6
- data/rbi/workos/organization_domain_verified.rbi +6 -6
- data/rbi/workos/organization_membership.rbi +12 -0
- data/rbi/workos/organization_membership_created.rbi +6 -6
- data/rbi/workos/organization_membership_deleted.rbi +6 -6
- data/rbi/workos/organization_membership_service.rbi +114 -0
- data/rbi/workos/organization_membership_updated.rbi +6 -6
- data/rbi/workos/organization_role_created.rbi +6 -6
- data/rbi/workos/organization_role_deleted.rbi +6 -6
- data/rbi/workos/organization_role_updated.rbi +6 -6
- data/rbi/workos/organization_updated.rbi +6 -6
- data/rbi/workos/password_reset_created.rbi +6 -6
- data/rbi/workos/password_reset_succeeded.rbi +6 -6
- data/rbi/workos/password_session_authenticate_request.rbi +12 -0
- data/rbi/workos/permission_created.rbi +6 -6
- data/rbi/workos/permission_deleted.rbi +6 -6
- data/rbi/workos/permission_updated.rbi +6 -6
- data/rbi/workos/pipe_connected_account.rbi +78 -0
- data/rbi/workos/pipes.rbi +105 -1
- data/rbi/workos/pipes_connected_account_connected.rbi +54 -0
- data/rbi/workos/pipes_connected_account_disconnected.rbi +54 -0
- data/rbi/workos/pipes_connected_account_reauthorization_needed.rbi +54 -0
- data/rbi/workos/pipes_provider.rbi +34 -0
- data/rbi/workos/profile.rbi +6 -0
- data/rbi/workos/radar.rbi +2 -3
- data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +2 -8
- data/rbi/workos/refresh_token_session_authenticate_request.rbi +2 -2
- data/rbi/workos/rekey_request.rbi +30 -0
- data/rbi/workos/replace_group_role_assignment_entry.rbi +42 -0
- data/rbi/workos/replace_group_role_assignments.rbi +24 -0
- data/rbi/workos/revoke_session.rbi +0 -6
- data/rbi/workos/role_created.rbi +6 -6
- data/rbi/workos/role_deleted.rbi +6 -6
- data/rbi/workos/role_updated.rbi +6 -6
- data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
- data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
- data/rbi/workos/session_created.rbi +6 -6
- data/rbi/workos/session_manager.rbi +1 -1
- data/rbi/workos/session_revoked.rbi +6 -6
- data/rbi/workos/update_custom_provider_definition.rbi +84 -0
- data/rbi/workos/update_data_integration.rbi +48 -0
- data/rbi/workos/update_object_request.rbi +30 -0
- data/rbi/workos/update_user.rbi +6 -0
- data/rbi/workos/user.rbi +6 -0
- data/rbi/workos/{api_key_with_value.rbi → user_api_key.rbi} +9 -9
- data/rbi/workos/user_api_key_created_data_owner.rbi +36 -0
- data/rbi/workos/{dsync_deactivated_data_domain.rbi → user_api_key_owner.rbi} +5 -5
- data/rbi/workos/user_api_key_revoked_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_updated_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_with_value.rbi +84 -0
- data/rbi/workos/user_api_key_with_value_owner.rbi +36 -0
- data/rbi/workos/user_create_response.rbi +108 -0
- data/rbi/workos/user_created.rbi +6 -6
- data/rbi/workos/user_deleted.rbi +6 -6
- data/rbi/workos/user_management.rbi +72 -86
- data/rbi/workos/user_object.rbi +6 -0
- data/rbi/workos/user_organization_membership.rbi +12 -0
- data/rbi/workos/user_organization_membership_base_list_data.rbi +6 -0
- data/rbi/workos/user_role_assignment.rbi +66 -0
- data/rbi/workos/{role_assignment_resource.rbi → user_role_assignment_resource.rbi} +1 -1
- data/rbi/workos/user_role_assignment_source.rbi +30 -0
- data/rbi/workos/user_updated.rbi +6 -6
- data/rbi/workos/vault.rbi +70 -95
- data/rbi/workos/vault_byok_key_deleted.rbi +54 -0
- data/rbi/workos/vault_byok_key_deleted_data.rbi +30 -0
- data/rbi/workos/vault_byok_key_verification_completed.rbi +6 -6
- data/rbi/workos/vault_data_created.rbi +6 -6
- data/rbi/workos/vault_data_deleted.rbi +6 -6
- data/rbi/workos/vault_data_read.rbi +6 -6
- data/rbi/workos/vault_data_updated.rbi +6 -6
- data/rbi/workos/vault_dek_decrypted.rbi +6 -6
- data/rbi/workos/vault_dek_read.rbi +6 -6
- data/rbi/workos/vault_kek_created.rbi +6 -6
- data/rbi/workos/vault_metadata_read.rbi +6 -6
- data/rbi/workos/vault_names_listed.rbi +6 -6
- data/rbi/workos/vault_object.rbi +42 -0
- data/rbi/workos/waitlist_user_approved.rbi +6 -6
- data/rbi/workos/waitlist_user_created.rbi +6 -6
- data/rbi/workos/waitlist_user_denied.rbi +6 -6
- data/rbi/workos/webhook_endpoint.rbi +1 -0
- data/rbi/workos/webhooks.rbi +2 -2
- data/renovate.json +1 -61
- data/script/docs +16 -0
- data/script/docs-serve +12 -0
- data/script/llms-txt +37 -0
- data/test/workos/test_actions.rb +9 -0
- data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
- data/test/workos/test_api_keys.rb +20 -12
- data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
- data/test/workos/test_authorization.rb +64 -0
- data/test/workos/test_authorization_model_round_trip.rb +456 -0
- data/test/workos/test_base_client.rb +108 -0
- data/test/workos/test_client_api.rb +33 -0
- data/test/workos/test_connect_model_round_trip.rb +30 -0
- data/test/workos/test_encryptors_aes_gcm.rb +16 -1
- data/test/workos/test_groups_model_round_trip.rb +33 -0
- data/test/workos/test_model_round_trip.rb +2 -7138
- data/test/workos/test_organization_membership_service.rb +107 -0
- data/test/workos/test_organizations_model_round_trip.rb +29 -0
- data/test/workos/test_pipes.rb +75 -3
- data/test/workos/test_pipes_model_round_trip.rb +389 -0
- data/test/workos/test_pipes_provider.rb +41 -0
- data/test/workos/test_radar_model_round_trip.rb +85 -0
- data/test/workos/test_session.rb +43 -4
- data/test/workos/test_shared_model_round_trip.rb +92 -0
- data/test/workos/test_user_management.rb +77 -73
- data/test/workos/test_user_management_model_round_trip.rb +1087 -0
- data/test/workos/test_vault.rb +91 -88
- data/test/workos/test_webhook_verify.rb +11 -0
- data/test/workos/test_webhooks_model_round_trip.rb +53 -0
- metadata +220 -85
- data/lib/workos/audit_logs/audit_log_schema_json.rb +0 -34
- data/lib/workos/organizations/audit_logs_retention_json.rb +0 -18
- data/lib/workos/types/audit_log_export_json_state.rb +0 -14
- data/lib/workos/types/directory_groups_order.rb +0 -9
- data/lib/workos/types/directory_users_order.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_state.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_type.rb +0 -9
- data/lib/workos/types/feature_flags_order.rb +0 -9
- data/lib/workos/types/groups_order.rb +0 -9
- data/lib/workos/types/organizations_api_keys_order.rb +0 -9
- data/lib/workos/types/organizations_feature_flags_order.rb +0 -9
- data/lib/workos/types/organizations_order.rb +0 -9
- data/lib/workos/types/permissions_order.rb +0 -9
- data/lib/workos/types/radar_type.rb +0 -9
- data/lib/workos/types/user_management_invitations_order.rb +0 -9
- data/lib/workos/types/user_management_multi_factor_authentication_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_order.rb +0 -9
- data/lib/workos/types/user_management_users_authorized_applications_order.rb +0 -9
- data/lib/workos/types/user_management_users_feature_flags_order.rb +0 -9
- data/lib/workos/types/user_management_users_order.rb +0 -9
- data/lib/workos/types/webhook_endpoint_json_status.rb +0 -9
- data/lib/workos/types/webhooks_order.rb +0 -9
- data/lib/workos/user_management_organization_membership_groups.rb +0 -60
- data/lib/workos/webhooks/webhook_endpoint_json.rb +0 -40
- data/rbi/workos/actions.rbi +0 -48
- data/rbi/workos/audit_log_schema_json.rbi +0 -54
- data/rbi/workos/base_client.rbi +0 -132
- data/rbi/workos/configuration.rbi +0 -68
- data/rbi/workos/encryptors/aes_gcm.rbi +0 -19
- data/rbi/workos/errors.rbi +0 -43
- data/rbi/workos/hash_provider.rbi +0 -18
- data/rbi/workos/passwordless.rbi +0 -47
- data/rbi/workos/public_client.rbi +0 -12
- data/rbi/workos/session.rbi +0 -43
- data/rbi/workos/types/api_response.rbi +0 -29
- data/rbi/workos/types/base_model.rbi +0 -22
- data/rbi/workos/types/list_struct.rbi +0 -89
- data/rbi/workos/user_management_organization_membership_groups.rbi +0 -25
- data/rbi/workos/util.rbi +0 -12
- data/test/workos/test_user_management_organization_membership_groups.rb +0 -33
- /data/lib/workos/{user_management → organization_membership}/create_user_organization_membership.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/update_user_organization_membership.rb +0 -0
data/lib/workos/base_client.rb
CHANGED
|
@@ -134,7 +134,8 @@ module WorkOS
|
|
|
134
134
|
attempt = 0
|
|
135
135
|
|
|
136
136
|
loop do
|
|
137
|
-
|
|
137
|
+
loggable_path = redact_path(request.path)
|
|
138
|
+
log(:debug, "request start", method: request.method, path: loggable_path, attempt: attempt + 1)
|
|
138
139
|
http = connection_for(base, timeout)
|
|
139
140
|
response = http.request(request)
|
|
140
141
|
return response if response.is_a?(Net::HTTPSuccess)
|
|
@@ -142,11 +143,11 @@ module WorkOS
|
|
|
142
143
|
if attempt < retries && retryable?(response)
|
|
143
144
|
attempt += 1
|
|
144
145
|
inject_retry_idempotency_key(request)
|
|
145
|
-
log(:info, "request retry", method: request.method, path:
|
|
146
|
+
log(:info, "request retry", method: request.method, path: loggable_path, attempt: attempt + 1, status: response.code.to_i)
|
|
146
147
|
sleep(retry_delay(response, attempt))
|
|
147
148
|
next
|
|
148
149
|
end
|
|
149
|
-
log(:warn, "request error", method: request.method, path:
|
|
150
|
+
log(:warn, "request error", method: request.method, path: loggable_path, status: response.code.to_i, request_id: response["x-request-id"] || response["X-Request-Id"])
|
|
150
151
|
handle_error_response(response)
|
|
151
152
|
rescue Net::OpenTimeout, Net::ReadTimeout,
|
|
152
153
|
Errno::ECONNRESET, Errno::ECONNREFUSED,
|
|
@@ -155,17 +156,17 @@ module WorkOS
|
|
|
155
156
|
if attempt < retries
|
|
156
157
|
attempt += 1
|
|
157
158
|
inject_retry_idempotency_key(request)
|
|
158
|
-
log(:info, "request retry", method: request.method, path:
|
|
159
|
+
log(:info, "request retry", method: request.method, path: loggable_path, attempt: attempt + 1, error: e.class.name)
|
|
159
160
|
sleep(retry_delay(nil, attempt))
|
|
160
161
|
next
|
|
161
162
|
end
|
|
162
|
-
log(:warn, "connection error", method: request.method, path:
|
|
163
|
+
log(:warn, "connection error", method: request.method, path: loggable_path, error: e.class.name, message: e.message)
|
|
163
164
|
raise WorkOS::APIConnectionError.new(message: e.message)
|
|
164
165
|
end
|
|
165
166
|
end
|
|
166
167
|
|
|
167
168
|
# Close all persistent connections cached by this client on the current
|
|
168
|
-
#
|
|
169
|
+
# thread.
|
|
169
170
|
#
|
|
170
171
|
# Call this before forking (e.g. in a Puma `on_worker_boot` block) to
|
|
171
172
|
# avoid sharing `Net::HTTP` sockets across processes.
|
|
@@ -179,6 +180,71 @@ module WorkOS
|
|
|
179
180
|
|
|
180
181
|
private
|
|
181
182
|
|
|
183
|
+
# Redact path segments that carry bearer-equivalent tokens (e.g.
|
|
184
|
+
# `/user_management/invitations/by_token/<token>`,
|
|
185
|
+
# `/user_management/magic_auth/<token>`, password-reset / email-
|
|
186
|
+
# verification token paths) before the path is written to a logger.
|
|
187
|
+
# The WorkOS API exposes a small number of "by_token" endpoints whose
|
|
188
|
+
# path segments are themselves authentication material; redacting them
|
|
189
|
+
# here means the SDK never emits the token in its own log/retry/error
|
|
190
|
+
# messages even when the host application configures verbose logging.
|
|
191
|
+
REDACTED_TOKEN_PREFIXES = %w[
|
|
192
|
+
/user_management/invitations/by_token
|
|
193
|
+
/user_management/magic_auth
|
|
194
|
+
/user_management/password_reset
|
|
195
|
+
/user_management/email_verification
|
|
196
|
+
].freeze
|
|
197
|
+
private_constant :REDACTED_TOKEN_PREFIXES
|
|
198
|
+
|
|
199
|
+
# Query-string keys whose values are bearer-equivalent or otherwise
|
|
200
|
+
# sensitive and should never appear in SDK log lines. Defense-in-depth
|
|
201
|
+
# for any path that flows through execute_request with a sensitive
|
|
202
|
+
# query parameter (most WorkOS-issued tokens are path segments or POST
|
|
203
|
+
# bodies, but a few flows — e.g. authorize/logout redirects — surface
|
|
204
|
+
# them in the query string).
|
|
205
|
+
REDACTED_QUERY_KEYS = %w[
|
|
206
|
+
token
|
|
207
|
+
code
|
|
208
|
+
code_challenge
|
|
209
|
+
code_verifier
|
|
210
|
+
session_id
|
|
211
|
+
refresh_token
|
|
212
|
+
access_token
|
|
213
|
+
].freeze
|
|
214
|
+
private_constant :REDACTED_QUERY_KEYS
|
|
215
|
+
|
|
216
|
+
def redact_path(path)
|
|
217
|
+
return path if path.nil? || path.empty?
|
|
218
|
+
|
|
219
|
+
# Strip query string for the prefix match; reattach (scrubbed) after.
|
|
220
|
+
path_only, query = path.split("?", 2)
|
|
221
|
+
REDACTED_TOKEN_PREFIXES.each do |prefix|
|
|
222
|
+
next unless path_only.start_with?("#{prefix}/")
|
|
223
|
+
|
|
224
|
+
# Replace every segment after the matched prefix with "[REDACTED]".
|
|
225
|
+
remainder = path_only[(prefix.length + 1)..]
|
|
226
|
+
next if remainder.nil? || remainder.empty?
|
|
227
|
+
|
|
228
|
+
redacted = remainder.split("/").map { "[REDACTED]" }.join("/")
|
|
229
|
+
path_only = "#{prefix}/#{redacted}"
|
|
230
|
+
break
|
|
231
|
+
end
|
|
232
|
+
query ? "#{path_only}?#{redact_query(query)}" : path_only
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
def redact_query(query)
|
|
236
|
+
return query if query.nil? || query.empty?
|
|
237
|
+
|
|
238
|
+
query.split("&").map { |pair|
|
|
239
|
+
key, value = pair.split("=", 2)
|
|
240
|
+
if value && !value.empty? && REDACTED_QUERY_KEYS.include?(key)
|
|
241
|
+
"#{key}=[REDACTED]"
|
|
242
|
+
else
|
|
243
|
+
pair
|
|
244
|
+
end
|
|
245
|
+
}.join("&")
|
|
246
|
+
end
|
|
247
|
+
|
|
182
248
|
def append_query(path, params)
|
|
183
249
|
return path unless params.is_a?(Hash) && !params.empty?
|
|
184
250
|
|
|
@@ -236,8 +302,25 @@ module WorkOS
|
|
|
236
302
|
"#{uri.scheme}:#{uri.host}:#{uri.port}:#{timeout}"
|
|
237
303
|
end
|
|
238
304
|
|
|
305
|
+
# Per-fiber connection cache (non-inherited).
|
|
306
|
+
#
|
|
307
|
+
# Uses Thread.current[] (Ruby fiber-local storage) rather than
|
|
308
|
+
# Fiber[] (inheritable fiber storage). Fiber[] is inherited *by
|
|
309
|
+
# reference* by every child fiber and every child thread, so a live
|
|
310
|
+
# Net::HTTP socket cached in a parent fiber would be shared across
|
|
311
|
+
# worker threads spawned afterward (e.g. Solid Queue, Puma). Net::HTTP
|
|
312
|
+
# sockets are not thread-safe; concurrent use corrupts the stream and
|
|
313
|
+
# surfaces as FrozenError on the SSLContext, Errno::EBADF, "stream
|
|
314
|
+
# closed in another thread" (IOError), and Net::HTTPBadResponse.
|
|
315
|
+
# Thread.current[] is not inherited across threads, so each thread
|
|
316
|
+
# gets its own isolated cache.
|
|
317
|
+
#
|
|
318
|
+
# Note: Thread.current[] is fiber-local in Ruby — each Fiber within a
|
|
319
|
+
# thread has its own slot. In fiber-based servers (Async, Falcon) this
|
|
320
|
+
# means one connection cache per fiber rather than per OS thread, which
|
|
321
|
+
# is the desired behavior: each concurrent request gets its own sockets.
|
|
239
322
|
def thread_connections
|
|
240
|
-
|
|
323
|
+
Thread.current[:workos_connections] ||= {}
|
|
241
324
|
end
|
|
242
325
|
|
|
243
326
|
def build_request(klass, path, auth:, request_options:)
|
data/lib/workos/client.rb
CHANGED
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class Client < BaseClient
|
|
7
|
-
def api_keys
|
|
8
|
-
@api_keys ||= WorkOS::ApiKeys.new(self)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
7
|
def multi_factor_auth
|
|
12
8
|
@multi_factor_auth ||= WorkOS::MultiFactorAuth.new(self)
|
|
13
9
|
end
|
|
@@ -20,6 +16,10 @@ module WorkOS
|
|
|
20
16
|
@authorization ||= WorkOS::Authorization.new(self)
|
|
21
17
|
end
|
|
22
18
|
|
|
19
|
+
def client_api
|
|
20
|
+
@client_api ||= WorkOS::ClientApi.new(self)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
23
|
def sso
|
|
24
24
|
@sso ||= WorkOS::SSO.new(self)
|
|
25
25
|
end
|
|
@@ -48,6 +48,14 @@ module WorkOS
|
|
|
48
48
|
@organizations ||= WorkOS::Organizations.new(self)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def api_keys
|
|
52
|
+
@api_keys ||= WorkOS::ApiKeys.new(self)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def pipes_provider
|
|
56
|
+
@pipes_provider ||= WorkOS::PipesProvider.new(self)
|
|
57
|
+
end
|
|
58
|
+
|
|
51
59
|
def groups
|
|
52
60
|
@groups ||= WorkOS::Groups.new(self)
|
|
53
61
|
end
|
|
@@ -64,8 +72,12 @@ module WorkOS
|
|
|
64
72
|
@user_management ||= WorkOS::UserManagement.new(self)
|
|
65
73
|
end
|
|
66
74
|
|
|
67
|
-
def
|
|
68
|
-
@
|
|
75
|
+
def organization_membership
|
|
76
|
+
@organization_membership ||= WorkOS::OrganizationMembershipService.new(self)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def vault
|
|
80
|
+
@vault ||= WorkOS::Vault.new(self)
|
|
69
81
|
end
|
|
70
82
|
|
|
71
83
|
def webhooks
|
|
@@ -86,10 +98,6 @@ module WorkOS
|
|
|
86
98
|
@passwordless ||= WorkOS::Passwordless.new(self)
|
|
87
99
|
end
|
|
88
100
|
|
|
89
|
-
def vault
|
|
90
|
-
@vault ||= WorkOS::Vault.new(self)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
101
|
def actions
|
|
94
102
|
@actions ||= WorkOS::Actions
|
|
95
103
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class ClientApiToken < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
organization_id: :organization_id,
|
|
9
|
+
user_id: :user_id
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor \
|
|
13
|
+
:organization_id,
|
|
14
|
+
:user_id
|
|
15
|
+
|
|
16
|
+
def initialize(json)
|
|
17
|
+
hash = self.class.normalize(json)
|
|
18
|
+
@organization_id = hash[:organization_id]
|
|
19
|
+
@user_id = hash[:user_id]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
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 ClientApiTokenResponse < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
token: :token
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
attr_accessor :token
|
|
12
|
+
|
|
13
|
+
def initialize(json)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
15
|
+
@token = hash[:token]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "json"
|
|
6
|
+
|
|
7
|
+
module WorkOS
|
|
8
|
+
class ClientApi
|
|
9
|
+
def initialize(client)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Generate a Client API token
|
|
14
|
+
# @param organization_id [String] The ID of the organization to scope the Client API token to.
|
|
15
|
+
# @param user_id [String] The ID of the user to issue the Client API token for.
|
|
16
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
17
|
+
# @return [WorkOS::ClientApiTokenResponse]
|
|
18
|
+
def create_token(
|
|
19
|
+
organization_id:,
|
|
20
|
+
user_id:,
|
|
21
|
+
request_options: {}
|
|
22
|
+
)
|
|
23
|
+
body = {
|
|
24
|
+
"organization_id" => organization_id,
|
|
25
|
+
"user_id" => user_id
|
|
26
|
+
}
|
|
27
|
+
response = @client.request(
|
|
28
|
+
method: :post,
|
|
29
|
+
path: "/client/token",
|
|
30
|
+
auth: true,
|
|
31
|
+
body: body,
|
|
32
|
+
request_options: request_options
|
|
33
|
+
)
|
|
34
|
+
result = WorkOS::ClientApiTokenResponse.new(response.body)
|
|
35
|
+
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"])
|
|
36
|
+
result
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -14,6 +14,10 @@ module WorkOS
|
|
|
14
14
|
created_at: :created_at,
|
|
15
15
|
updated_at: :updated_at,
|
|
16
16
|
application_type: :application_type,
|
|
17
|
+
redirect_uris: :redirect_uris,
|
|
18
|
+
uses_pkce: :uses_pkce,
|
|
19
|
+
is_first_party: :is_first_party,
|
|
20
|
+
was_dynamically_registered: :was_dynamically_registered,
|
|
17
21
|
organization_id: :organization_id
|
|
18
22
|
}.freeze
|
|
19
23
|
|
|
@@ -27,6 +31,10 @@ module WorkOS
|
|
|
27
31
|
:created_at,
|
|
28
32
|
:updated_at,
|
|
29
33
|
:application_type,
|
|
34
|
+
:redirect_uris,
|
|
35
|
+
:uses_pkce,
|
|
36
|
+
:is_first_party,
|
|
37
|
+
:was_dynamically_registered,
|
|
30
38
|
:organization_id
|
|
31
39
|
|
|
32
40
|
def initialize(json)
|
|
@@ -40,6 +48,10 @@ module WorkOS
|
|
|
40
48
|
@created_at = hash[:created_at]
|
|
41
49
|
@updated_at = hash[:updated_at]
|
|
42
50
|
@application_type = hash[:application_type]
|
|
51
|
+
@redirect_uris = (hash[:redirect_uris] || []).map { |item| item ? WorkOS::ConnectApplicationRedirectUri.new(item) : nil }
|
|
52
|
+
@uses_pkce = hash[:uses_pkce]
|
|
53
|
+
@is_first_party = hash[:is_first_party]
|
|
54
|
+
@was_dynamically_registered = hash[:was_dynamically_registered]
|
|
43
55
|
@organization_id = hash[:organization_id]
|
|
44
56
|
end
|
|
45
57
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class ConnectApplicationRedirectUri < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
uri: :uri,
|
|
9
|
+
default: :default
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor \
|
|
13
|
+
:uri,
|
|
14
|
+
:default
|
|
15
|
+
|
|
16
|
+
def initialize(json)
|
|
17
|
+
hash = self.class.normalize(json)
|
|
18
|
+
@uri = hash[:uri]
|
|
19
|
+
@default = hash[:default]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -9,6 +9,7 @@ module WorkOS
|
|
|
9
9
|
email: :email,
|
|
10
10
|
first_name: :first_name,
|
|
11
11
|
last_name: :last_name,
|
|
12
|
+
name: :name,
|
|
12
13
|
metadata: :metadata
|
|
13
14
|
}.freeze
|
|
14
15
|
|
|
@@ -17,6 +18,7 @@ module WorkOS
|
|
|
17
18
|
:email,
|
|
18
19
|
:first_name,
|
|
19
20
|
:last_name,
|
|
21
|
+
:name,
|
|
20
22
|
:metadata
|
|
21
23
|
|
|
22
24
|
def initialize(json)
|
|
@@ -25,6 +27,7 @@ module WorkOS
|
|
|
25
27
|
@email = hash[:email]
|
|
26
28
|
@first_name = hash[:first_name]
|
|
27
29
|
@last_name = hash[:last_name]
|
|
30
|
+
@name = hash[:name]
|
|
28
31
|
@metadata = hash[:metadata] || {}
|
|
29
32
|
end
|
|
30
33
|
end
|
data/lib/workos/connect.rb
CHANGED
|
@@ -43,14 +43,14 @@ module WorkOS
|
|
|
43
43
|
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
44
44
|
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
45
45
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
46
|
-
# @param order [WorkOS::Types::
|
|
46
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
47
47
|
# @param organization_id [String, nil] Filter Connect Applications by organization ID.
|
|
48
48
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
49
49
|
# @return [WorkOS::Types::ListStruct<WorkOS::ConnectApplication>]
|
|
50
50
|
def list_applications(
|
|
51
51
|
before: nil,
|
|
52
52
|
after: nil,
|
|
53
|
-
limit:
|
|
53
|
+
limit: 10,
|
|
54
54
|
order: "desc",
|
|
55
55
|
organization_id: nil,
|
|
56
56
|
request_options: {}
|
|
@@ -13,6 +13,7 @@ module WorkOS
|
|
|
13
13
|
email: :email,
|
|
14
14
|
first_name: :first_name,
|
|
15
15
|
last_name: :last_name,
|
|
16
|
+
name: :name,
|
|
16
17
|
emails: :emails,
|
|
17
18
|
job_title: :job_title,
|
|
18
19
|
username: :username,
|
|
@@ -43,6 +44,7 @@ module WorkOS
|
|
|
43
44
|
:email,
|
|
44
45
|
:first_name,
|
|
45
46
|
:last_name,
|
|
47
|
+
:name,
|
|
46
48
|
:state,
|
|
47
49
|
:custom_attributes,
|
|
48
50
|
:role,
|
|
@@ -88,6 +90,7 @@ module WorkOS
|
|
|
88
90
|
@email = hash[:email]
|
|
89
91
|
@first_name = hash[:first_name]
|
|
90
92
|
@last_name = hash[:last_name]
|
|
93
|
+
@name = hash[:name]
|
|
91
94
|
@emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserEmail.new(item) : nil }
|
|
92
95
|
@job_title = hash[:job_title]
|
|
93
96
|
@username = hash[:username]
|
|
@@ -13,6 +13,7 @@ module WorkOS
|
|
|
13
13
|
email: :email,
|
|
14
14
|
first_name: :first_name,
|
|
15
15
|
last_name: :last_name,
|
|
16
|
+
name: :name,
|
|
16
17
|
emails: :emails,
|
|
17
18
|
job_title: :job_title,
|
|
18
19
|
username: :username,
|
|
@@ -35,7 +36,7 @@ module WorkOS
|
|
|
35
36
|
# @!attribute raw_attributes
|
|
36
37
|
# @deprecated The raw attributes received from the directory provider.
|
|
37
38
|
# @!attribute groups
|
|
38
|
-
# @deprecated The directory groups the user belongs to. Use the List Directory Groups endpoint with a user filter
|
|
39
|
+
# @deprecated The directory groups the user belongs to. Deprecated: starting May 1, 2026, this field returns an empty array by default for newly created teams. Existing teams currently depending on this field should migrate to the new access pattern for better throughput performance — the field is unbounded by user, so users with many group memberships produce large, slow response payloads. Use the List Directory Groups endpoint with a `user` filter to fetch a user's group memberships.
|
|
39
40
|
|
|
40
41
|
attr_accessor \
|
|
41
42
|
:object,
|
|
@@ -46,6 +47,7 @@ module WorkOS
|
|
|
46
47
|
:email,
|
|
47
48
|
:first_name,
|
|
48
49
|
:last_name,
|
|
50
|
+
:name,
|
|
49
51
|
:state,
|
|
50
52
|
:custom_attributes,
|
|
51
53
|
:role,
|
|
@@ -98,6 +100,7 @@ module WorkOS
|
|
|
98
100
|
@email = hash[:email]
|
|
99
101
|
@first_name = hash[:first_name]
|
|
100
102
|
@last_name = hash[:last_name]
|
|
103
|
+
@name = hash[:name]
|
|
101
104
|
@emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserWithGroupsEmail.new(item) : nil }
|
|
102
105
|
@job_title = hash[:job_title]
|
|
103
106
|
@username = hash[:username]
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class DsyncActivated < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
8
9
|
id: :id,
|
|
9
10
|
event: :event,
|
|
10
11
|
data: :data,
|
|
11
12
|
created_at: :created_at,
|
|
12
|
-
context: :context
|
|
13
|
-
object: :object
|
|
13
|
+
context: :context
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
17
|
+
:object,
|
|
17
18
|
:id,
|
|
18
19
|
:event,
|
|
19
20
|
:data,
|
|
20
21
|
:created_at,
|
|
21
|
-
:context
|
|
22
|
-
:object
|
|
22
|
+
:context
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@object = hash[:object]
|
|
26
27
|
@id = hash[:id]
|
|
27
28
|
@event = hash[:event]
|
|
28
29
|
@data = hash[:data] ? WorkOS::DsyncActivatedData.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class DsyncDeleted < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
8
9
|
id: :id,
|
|
9
10
|
event: :event,
|
|
10
11
|
data: :data,
|
|
11
12
|
created_at: :created_at,
|
|
12
|
-
context: :context
|
|
13
|
-
object: :object
|
|
13
|
+
context: :context
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
17
|
+
:object,
|
|
17
18
|
:id,
|
|
18
19
|
:event,
|
|
19
20
|
:data,
|
|
20
21
|
:created_at,
|
|
21
|
-
:context
|
|
22
|
-
:object
|
|
22
|
+
:context
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@object = hash[:object]
|
|
26
27
|
@id = hash[:id]
|
|
27
28
|
@event = hash[:event]
|
|
28
29
|
@data = hash[:data] ? WorkOS::DsyncDeletedData.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class DsyncGroupCreated < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
8
9
|
id: :id,
|
|
9
10
|
event: :event,
|
|
10
11
|
data: :data,
|
|
11
12
|
created_at: :created_at,
|
|
12
|
-
context: :context
|
|
13
|
-
object: :object
|
|
13
|
+
context: :context
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
17
|
+
:object,
|
|
17
18
|
:id,
|
|
18
19
|
:event,
|
|
19
20
|
:data,
|
|
20
21
|
:created_at,
|
|
21
|
-
:context
|
|
22
|
-
:object
|
|
22
|
+
:context
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@object = hash[:object]
|
|
26
27
|
@id = hash[:id]
|
|
27
28
|
@event = hash[:event]
|
|
28
29
|
@data = hash[:data] ? WorkOS::DirectoryGroup.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class DsyncGroupDeleted < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
8
9
|
id: :id,
|
|
9
10
|
event: :event,
|
|
10
11
|
data: :data,
|
|
11
12
|
created_at: :created_at,
|
|
12
|
-
context: :context
|
|
13
|
-
object: :object
|
|
13
|
+
context: :context
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
17
|
+
:object,
|
|
17
18
|
:id,
|
|
18
19
|
:event,
|
|
19
20
|
:data,
|
|
20
21
|
:created_at,
|
|
21
|
-
:context
|
|
22
|
-
:object
|
|
22
|
+
:context
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@object = hash[:object]
|
|
26
27
|
@id = hash[:id]
|
|
27
28
|
@event = hash[:event]
|
|
28
29
|
@data = hash[:data] ? WorkOS::DirectoryGroup.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class DsyncGroupUpdated < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
8
9
|
id: :id,
|
|
9
10
|
event: :event,
|
|
10
11
|
data: :data,
|
|
11
12
|
created_at: :created_at,
|
|
12
|
-
context: :context
|
|
13
|
-
object: :object
|
|
13
|
+
context: :context
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
17
|
+
:object,
|
|
17
18
|
:id,
|
|
18
19
|
:event,
|
|
19
20
|
:data,
|
|
20
21
|
:created_at,
|
|
21
|
-
:context
|
|
22
|
-
:object
|
|
22
|
+
:context
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@object = hash[:object]
|
|
26
27
|
@id = hash[:id]
|
|
27
28
|
@event = hash[:event]
|
|
28
29
|
@data = hash[:data] ? WorkOS::DsyncGroupUpdatedData.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class DsyncGroupUserAdded < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
+
object: :object,
|
|
8
9
|
id: :id,
|
|
9
10
|
event: :event,
|
|
10
11
|
data: :data,
|
|
11
12
|
created_at: :created_at,
|
|
12
|
-
context: :context
|
|
13
|
-
object: :object
|
|
13
|
+
context: :context
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
17
|
+
:object,
|
|
17
18
|
:id,
|
|
18
19
|
:event,
|
|
19
20
|
:data,
|
|
20
21
|
:created_at,
|
|
21
|
-
:context
|
|
22
|
-
:object
|
|
22
|
+
:context
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
26
|
+
@object = hash[:object]
|
|
26
27
|
@id = hash[:id]
|
|
27
28
|
@event = hash[:event]
|
|
28
29
|
@data = hash[:data] ? WorkOS::DsyncGroupUserAddedData.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|