workos 8.0.1 → 9.1.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 +2 -2
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +199 -4
- data/.github/workflows/release.yml +2 -2
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +154 -43
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +92 -0
- data/Gemfile.lock +6 -6
- data/lib/workos/api_keys/api_key.rb +3 -0
- data/lib/workos/api_keys/api_key_created.rb +5 -5
- data/lib/workos/api_keys/api_key_created_data.rb +3 -0
- 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 +3 -0
- data/lib/workos/api_keys/organization_api_key_with_value.rb +3 -0
- data/lib/workos/api_keys.rb +29 -1
- 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/{types/radar_type.rb → audit_logs/audit_log_schema_actor_input.rb} +1 -3
- 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 +16 -16
- 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/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.rb +38 -22
- data/lib/workos/base_client.rb +19 -2
- data/lib/workos/client.rb +6 -6
- data/lib/workos/connect/connect_application.rb +12 -0
- data/lib/workos/{audit_logs/audit_log_schema_json_target.rb → connect/connect_application_redirect_uri.rb} +7 -7
- data/lib/workos/connect/user_object.rb +3 -0
- data/lib/workos/connect.rb +1 -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/{audit_logs/audit_log_schema_json_actor.rb → directory_sync/dsync_token_revoked_data.rb} +1 -1
- 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.rb +2 -2
- data/lib/workos/events.rb +1 -1
- 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/groups.rb +2 -2
- data/lib/workos/inflections.rb +3 -1
- 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/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 +1 -1
- data/lib/workos/radar/radar_standalone_assess_request.rb +2 -8
- data/lib/workos/radar.rb +6 -12
- 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/{directory_sync/dsync_deactivated_data.rb → shared/pipe_connected_account.rb} +15 -15
- 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/types/audit_log_configuration_log_stream_type.rb +2 -1
- data/lib/workos/types/create_webhook_endpoint_events.rb +5 -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/user_management_authentication_screen_hint.rb +1 -5
- 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/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/create_user.rb +3 -0
- data/lib/workos/user_management/create_user_api_key.rb +5 -2
- 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_created.rb +5 -5
- 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/revoke_session.rb +2 -6
- 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 +3 -0
- data/lib/workos/user_management/user_api_key_updated_data_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_with_value.rb +3 -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 +16 -223
- 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 +5 -5
- 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 +8 -9
- data/lib/workos.rb +1 -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/api_key.rbi +6 -0
- data/rbi/workos/api_key_created.rbi +6 -6
- data/rbi/workos/api_key_created_data.rbi +6 -0
- data/rbi/workos/api_key_revoked.rbi +6 -6
- data/rbi/workos/api_key_revoked_data.rbi +6 -0
- 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_updated_data_owner.rbi +30 -0
- data/rbi/workos/{audit_logs_retention_json.rbi → api_key_updated_data_previous_attribute.rbi} +5 -5
- data/rbi/workos/api_keys.rbi +11 -1
- 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/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 +9 -5
- data/rbi/workos/client.rbi +6 -3
- 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/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_key_request.rbi +24 -0
- data/rbi/workos/create_data_key_response.rbi +42 -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 +6 -0
- data/rbi/workos/create_user_api_key.rbi +6 -0
- data/rbi/workos/decrypt_request.rbi +24 -0
- data/rbi/workos/decrypt_response.rbi +30 -0
- data/rbi/workos/delete_object_response.rbi +30 -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/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/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/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_created.rbi +6 -6
- 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 +6 -0
- data/rbi/workos/organization_api_key_with_value.rbi +6 -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_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/permission_created.rbi +6 -6
- data/rbi/workos/permission_deleted.rbi +6 -6
- data/rbi/workos/permission_updated.rbi +6 -6
- data/rbi/workos/{webhook_endpoint_json.rbi → pipe_connected_account.rbi} +23 -11
- 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/radar.rbi +1 -3
- data/rbi/workos/radar_standalone_assess_request.rbi +0 -12
- data/rbi/workos/rekey_request.rbi +30 -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/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_object_request.rbi +30 -0
- data/rbi/workos/update_user.rbi +6 -0
- data/rbi/workos/user.rbi +6 -0
- data/rbi/workos/user_api_key.rbi +6 -0
- data/rbi/workos/{dsync_deactivated_data_domain.rbi → user_api_key_updated_data_owner.rbi} +5 -5
- data/rbi/workos/user_api_key_with_value.rbi +6 -0
- data/rbi/workos/user_created.rbi +6 -6
- data/rbi/workos/user_deleted.rbi +6 -6
- data/rbi/workos/user_management.rbi +7 -94
- data/rbi/workos/user_object.rbi +6 -0
- data/rbi/workos/user_updated.rbi +6 -6
- data/rbi/workos/vault.rbi +70 -95
- data/rbi/workos/vault_byok_key_deleted.rbi +6 -6
- 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/test/workos/test_api_keys.rb +9 -1
- data/test/workos/test_base_client.rb +64 -0
- data/test/workos/test_model_round_trip.rb +740 -261
- data/test/workos/test_organization_membership_service.rb +107 -0
- data/test/workos/test_user_management.rb +0 -74
- data/test/workos/test_vault.rb +91 -88
- metadata +87 -54
- 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/dsync_deactivated_data_state.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_type.rb +0 -9
- data/lib/workos/types/webhook_endpoint_json_status.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/{authorization → groups}/user_organization_membership_base_list_data.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/create_user_organization_membership.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/organization_membership.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/update_user_organization_membership.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/user_organization_membership.rb +0 -0
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class FlagRuleUpdated < 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::FlagRuleUpdatedData.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::FlagRuleUpdatedContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -3,20 +3,5 @@
|
|
|
3
3
|
# This file is auto-generated by oagen. Do not edit.
|
|
4
4
|
|
|
5
5
|
module WorkOS
|
|
6
|
-
|
|
7
|
-
HASH_ATTRS = {
|
|
8
|
-
id: :id,
|
|
9
|
-
name: :name
|
|
10
|
-
}.freeze
|
|
11
|
-
|
|
12
|
-
attr_accessor \
|
|
13
|
-
:id,
|
|
14
|
-
:name
|
|
15
|
-
|
|
16
|
-
def initialize(json)
|
|
17
|
-
hash = self.class.normalize(json)
|
|
18
|
-
@id = hash[:id]
|
|
19
|
-
@name = hash[:name]
|
|
20
|
-
end
|
|
21
|
-
end
|
|
6
|
+
FlagRuleUpdatedContextConfiguredTargetOrganization = Actor
|
|
22
7
|
end
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
# This file is auto-generated by oagen. Do not edit.
|
|
4
4
|
|
|
5
5
|
module WorkOS
|
|
6
|
-
FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization =
|
|
6
|
+
FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization = Actor
|
|
7
7
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class FlagUpdated < 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::FlagUpdatedData.new(hash[:data]) : nil
|
|
29
30
|
@created_at = hash[:created_at]
|
|
30
31
|
@context = hash[:context] ? WorkOS::FlagUpdatedContext.new(hash[:context]) : nil
|
|
31
|
-
@object = hash[:object]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
data/lib/workos/groups.rb
CHANGED
|
@@ -15,7 +15,7 @@ module WorkOS
|
|
|
15
15
|
# @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"`.
|
|
16
16
|
# @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"`.
|
|
17
17
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
18
|
-
# @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).
|
|
18
|
+
# @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).
|
|
19
19
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
20
20
|
# @return [WorkOS::Types::ListStruct<WorkOS::Group>]
|
|
21
21
|
def list_organization_groups(
|
|
@@ -161,7 +161,7 @@ module WorkOS
|
|
|
161
161
|
# @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"`.
|
|
162
162
|
# @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"`.
|
|
163
163
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
164
|
-
# @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).
|
|
164
|
+
# @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).
|
|
165
165
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
166
166
|
# @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembershipBaseListData>]
|
|
167
167
|
def list_group_organization_memberships(
|
data/lib/workos/inflections.rb
CHANGED
|
@@ -31,6 +31,9 @@ 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
|
+
"connect_application_m2m" => "ConnectApplicationM2M",
|
|
35
|
+
"connect_application_oauth" => "ConnectApplicationOAuth",
|
|
36
|
+
"connect_application_oauth_redirect_uris" => "ConnectApplicationOAuthRedirectUris",
|
|
34
37
|
"connection_saml_certificate_renewal_required" => "ConnectionSAMLCertificateRenewalRequired",
|
|
35
38
|
"connection_saml_certificate_renewal_required_data" => "ConnectionSAMLCertificateRenewalRequiredData",
|
|
36
39
|
"connection_saml_certificate_renewal_required_data_certificate" => "ConnectionSAMLCertificateRenewalRequiredDataCertificate",
|
|
@@ -46,7 +49,6 @@ WORKOS_INFLECTIONS = {
|
|
|
46
49
|
"create_m2m_application" => "CreateM2MApplication",
|
|
47
50
|
"create_oauth_application" => "CreateOAuthApplication",
|
|
48
51
|
"jwt_template_response" => "JWTTemplateResponse",
|
|
49
|
-
"m2m" => "M2M",
|
|
50
52
|
"mfa_totp_session_authenticate_request" => "MFATotpSessionAuthenticateRequest",
|
|
51
53
|
"pkce" => "PKCE",
|
|
52
54
|
"sso" => "SSO",
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class OrganizationDomainCreated < 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::OrganizationDomainCreatedData.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 OrganizationDomainDeleted < 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::OrganizationDomainDeletedData.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 OrganizationDomainUpdated < 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::OrganizationDomainUpdatedData.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 OrganizationDomainVerificationFailed < 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::OrganizationDomainVerificationFailedData.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 OrganizationDomainVerified < 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::OrganizationDomainVerifiedData.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
|
|
@@ -0,0 +1,273 @@
|
|
|
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 OrganizationMembershipService
|
|
9
|
+
# Identifies the role (single variant).
|
|
10
|
+
#
|
|
11
|
+
# @!attribute [r] role_slug
|
|
12
|
+
# @return [String]
|
|
13
|
+
RoleSingle = Data.define(:role_slug)
|
|
14
|
+
|
|
15
|
+
# Identifies the role (multiple variant).
|
|
16
|
+
#
|
|
17
|
+
# @!attribute [r] role_slugs
|
|
18
|
+
# @return [Array<String>]
|
|
19
|
+
RoleMultiple = Data.define(:role_slugs)
|
|
20
|
+
|
|
21
|
+
def initialize(client)
|
|
22
|
+
@client = client
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# List organization memberships
|
|
26
|
+
# @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"`.
|
|
27
|
+
# @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"`.
|
|
28
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
29
|
+
# @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).
|
|
30
|
+
# @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to.
|
|
31
|
+
# @param statuses [Array<WorkOS::Types::UserManagementOrganizationMembershipStatuses>, nil] Filter by the status of the organization membership. Array including any of `active`, `inactive`, or `pending`.
|
|
32
|
+
# @param user_id [String, nil] The ID of the [user](https://workos.com/docs/reference/authkit/user).
|
|
33
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
34
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembership>]
|
|
35
|
+
def list_organization_memberships(
|
|
36
|
+
before: nil,
|
|
37
|
+
after: nil,
|
|
38
|
+
limit: 10,
|
|
39
|
+
order: "desc",
|
|
40
|
+
organization_id: nil,
|
|
41
|
+
statuses: nil,
|
|
42
|
+
user_id: nil,
|
|
43
|
+
request_options: {}
|
|
44
|
+
)
|
|
45
|
+
params = {
|
|
46
|
+
"before" => before,
|
|
47
|
+
"after" => after,
|
|
48
|
+
"limit" => limit,
|
|
49
|
+
"order" => order,
|
|
50
|
+
"organization_id" => organization_id,
|
|
51
|
+
"statuses" => statuses,
|
|
52
|
+
"user_id" => user_id
|
|
53
|
+
}.compact
|
|
54
|
+
response = @client.request(
|
|
55
|
+
method: :get,
|
|
56
|
+
path: "/user_management/organization_memberships",
|
|
57
|
+
auth: true,
|
|
58
|
+
params: params,
|
|
59
|
+
request_options: request_options
|
|
60
|
+
)
|
|
61
|
+
fetch_next = ->(cursor) {
|
|
62
|
+
list_organization_memberships(
|
|
63
|
+
before: before,
|
|
64
|
+
after: cursor,
|
|
65
|
+
limit: limit,
|
|
66
|
+
order: order,
|
|
67
|
+
organization_id: organization_id,
|
|
68
|
+
statuses: statuses,
|
|
69
|
+
user_id: user_id,
|
|
70
|
+
request_options: request_options
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
WorkOS::Types::ListStruct.from_response(
|
|
74
|
+
response,
|
|
75
|
+
model: WorkOS::UserOrganizationMembership,
|
|
76
|
+
filters: {before: before, limit: limit, order: order, organization_id: organization_id, statuses: statuses, user_id: user_id},
|
|
77
|
+
fetch_next: fetch_next
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Create an organization membership
|
|
82
|
+
# @param user_id [String] The ID of the [user](https://workos.com/docs/reference/authkit/user).
|
|
83
|
+
# @param organization_id [String] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to.
|
|
84
|
+
# @param role [WorkOS::OrganizationMembershipService::RoleSingle, WorkOS::OrganizationMembershipService::RoleMultiple, nil] Identifies the role.
|
|
85
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
86
|
+
# @return [WorkOS::OrganizationMembership]
|
|
87
|
+
def create_organization_membership(
|
|
88
|
+
user_id:,
|
|
89
|
+
organization_id:,
|
|
90
|
+
role: nil,
|
|
91
|
+
request_options: {}
|
|
92
|
+
)
|
|
93
|
+
body = {
|
|
94
|
+
"user_id" => user_id,
|
|
95
|
+
"organization_id" => organization_id
|
|
96
|
+
}
|
|
97
|
+
if role
|
|
98
|
+
case role
|
|
99
|
+
when WorkOS::OrganizationMembershipService::RoleSingle
|
|
100
|
+
body["role_slug"] = role.role_slug
|
|
101
|
+
when WorkOS::OrganizationMembershipService::RoleMultiple
|
|
102
|
+
body["role_slugs"] = role.role_slugs
|
|
103
|
+
else
|
|
104
|
+
raise ArgumentError, "expected role to be one of: WorkOS::OrganizationMembershipService::RoleSingle, WorkOS::OrganizationMembershipService::RoleMultiple, got #{role.class}"
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
response = @client.request(
|
|
108
|
+
method: :post,
|
|
109
|
+
path: "/user_management/organization_memberships",
|
|
110
|
+
auth: true,
|
|
111
|
+
body: body,
|
|
112
|
+
request_options: request_options
|
|
113
|
+
)
|
|
114
|
+
result = WorkOS::OrganizationMembership.new(response.body)
|
|
115
|
+
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"])
|
|
116
|
+
result
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Get an organization membership
|
|
120
|
+
# @param id [String] The unique ID of the organization membership.
|
|
121
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
122
|
+
# @return [WorkOS::UserOrganizationMembership]
|
|
123
|
+
def get_organization_membership(
|
|
124
|
+
id:,
|
|
125
|
+
request_options: {}
|
|
126
|
+
)
|
|
127
|
+
response = @client.request(
|
|
128
|
+
method: :get,
|
|
129
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
130
|
+
auth: true,
|
|
131
|
+
request_options: request_options
|
|
132
|
+
)
|
|
133
|
+
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
134
|
+
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"])
|
|
135
|
+
result
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Update an organization membership
|
|
139
|
+
# @param id [String] The unique ID of the organization membership.
|
|
140
|
+
# @param role [WorkOS::OrganizationMembershipService::RoleSingle, WorkOS::OrganizationMembershipService::RoleMultiple, nil] Identifies the role.
|
|
141
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
142
|
+
# @return [WorkOS::UserOrganizationMembership]
|
|
143
|
+
def update_organization_membership(
|
|
144
|
+
id:,
|
|
145
|
+
role: nil,
|
|
146
|
+
request_options: {}
|
|
147
|
+
)
|
|
148
|
+
body = {}
|
|
149
|
+
if role
|
|
150
|
+
case role
|
|
151
|
+
when WorkOS::OrganizationMembershipService::RoleSingle
|
|
152
|
+
body["role_slug"] = role.role_slug
|
|
153
|
+
when WorkOS::OrganizationMembershipService::RoleMultiple
|
|
154
|
+
body["role_slugs"] = role.role_slugs
|
|
155
|
+
else
|
|
156
|
+
raise ArgumentError, "expected role to be one of: WorkOS::OrganizationMembershipService::RoleSingle, WorkOS::OrganizationMembershipService::RoleMultiple, got #{role.class}"
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
response = @client.request(
|
|
160
|
+
method: :put,
|
|
161
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
162
|
+
auth: true,
|
|
163
|
+
body: body,
|
|
164
|
+
request_options: request_options
|
|
165
|
+
)
|
|
166
|
+
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
167
|
+
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"])
|
|
168
|
+
result
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Delete an organization membership
|
|
172
|
+
# @param id [String] The unique ID of the organization membership.
|
|
173
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
174
|
+
# @return [void]
|
|
175
|
+
def delete_organization_membership(
|
|
176
|
+
id:,
|
|
177
|
+
request_options: {}
|
|
178
|
+
)
|
|
179
|
+
@client.request(
|
|
180
|
+
method: :delete,
|
|
181
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
182
|
+
auth: true,
|
|
183
|
+
request_options: request_options
|
|
184
|
+
)
|
|
185
|
+
nil
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Deactivate an organization membership
|
|
189
|
+
# @param id [String] The unique ID of the organization membership.
|
|
190
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
191
|
+
# @return [WorkOS::OrganizationMembership]
|
|
192
|
+
def deactivate_organization_membership(
|
|
193
|
+
id:,
|
|
194
|
+
request_options: {}
|
|
195
|
+
)
|
|
196
|
+
response = @client.request(
|
|
197
|
+
method: :put,
|
|
198
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/deactivate",
|
|
199
|
+
auth: true,
|
|
200
|
+
request_options: request_options
|
|
201
|
+
)
|
|
202
|
+
result = WorkOS::OrganizationMembership.new(response.body)
|
|
203
|
+
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"])
|
|
204
|
+
result
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Reactivate an organization membership
|
|
208
|
+
# @param id [String] The unique ID of the organization membership.
|
|
209
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
210
|
+
# @return [WorkOS::UserOrganizationMembership]
|
|
211
|
+
def reactivate_organization_membership(
|
|
212
|
+
id:,
|
|
213
|
+
request_options: {}
|
|
214
|
+
)
|
|
215
|
+
response = @client.request(
|
|
216
|
+
method: :put,
|
|
217
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/reactivate",
|
|
218
|
+
auth: true,
|
|
219
|
+
request_options: request_options
|
|
220
|
+
)
|
|
221
|
+
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
222
|
+
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"])
|
|
223
|
+
result
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# List groups
|
|
227
|
+
# @param om_id [String] Unique identifier of the Organization Membership.
|
|
228
|
+
# @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"`.
|
|
229
|
+
# @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"`.
|
|
230
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
231
|
+
# @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).
|
|
232
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
233
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::Group>]
|
|
234
|
+
def list_organization_membership_groups(
|
|
235
|
+
om_id:,
|
|
236
|
+
before: nil,
|
|
237
|
+
after: nil,
|
|
238
|
+
limit: 10,
|
|
239
|
+
order: "desc",
|
|
240
|
+
request_options: {}
|
|
241
|
+
)
|
|
242
|
+
params = {
|
|
243
|
+
"before" => before,
|
|
244
|
+
"after" => after,
|
|
245
|
+
"limit" => limit,
|
|
246
|
+
"order" => order
|
|
247
|
+
}.compact
|
|
248
|
+
response = @client.request(
|
|
249
|
+
method: :get,
|
|
250
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(om_id)}/groups",
|
|
251
|
+
auth: true,
|
|
252
|
+
params: params,
|
|
253
|
+
request_options: request_options
|
|
254
|
+
)
|
|
255
|
+
fetch_next = ->(cursor) {
|
|
256
|
+
list_organization_membership_groups(
|
|
257
|
+
om_id: om_id,
|
|
258
|
+
before: before,
|
|
259
|
+
after: cursor,
|
|
260
|
+
limit: limit,
|
|
261
|
+
order: order,
|
|
262
|
+
request_options: request_options
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
WorkOS::Types::ListStruct.from_response(
|
|
266
|
+
response,
|
|
267
|
+
model: WorkOS::Group,
|
|
268
|
+
filters: {om_id: om_id, before: before, limit: limit, order: order},
|
|
269
|
+
fetch_next: fetch_next
|
|
270
|
+
)
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated by oagen. Do not edit.
|
|
4
4
|
|
|
5
|
-
require "json"
|
|
6
|
-
|
|
7
5
|
module WorkOS
|
|
8
|
-
class AuditLogsRetention
|
|
9
|
-
include HashProvider
|
|
10
|
-
|
|
6
|
+
class AuditLogsRetention < WorkOS::Types::BaseModel
|
|
11
7
|
HASH_ATTRS = {
|
|
12
8
|
retention_period_in_days: :retention_period_in_days
|
|
13
9
|
}.freeze
|
|
@@ -15,8 +11,7 @@ module WorkOS
|
|
|
15
11
|
attr_accessor :retention_period_in_days
|
|
16
12
|
|
|
17
13
|
def initialize(json)
|
|
18
|
-
hash =
|
|
19
|
-
hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
20
15
|
@retention_period_in_days = hash[:retention_period_in_days]
|
|
21
16
|
end
|
|
22
17
|
end
|
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class OrganizationCreated < 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::OrganizationCreatedData.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
|