workos 6.2.0 → 7.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 +6 -9
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/release-please.yml +30 -2
- data/.github/workflows/release.yml +2 -6
- data/.last-synced-sha +1 -0
- data/.oagen-manifest.json +1750 -0
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/.standard.yml +1 -0
- data/CHANGELOG.md +41 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +93 -47
- data/README.md +161 -14
- data/Rakefile +8 -4
- data/docs/V7_MIGRATION_GUIDE.md +780 -0
- data/lib/workos/actions.rb +93 -0
- data/lib/workos/admin_portal/domain_verification_intent_options.rb +18 -0
- data/lib/workos/admin_portal/generate_link.rb +34 -0
- data/lib/workos/admin_portal/intent_options.rb +22 -0
- data/lib/workos/admin_portal/portal_link_response.rb +18 -0
- data/lib/workos/admin_portal/sso_intent_options.rb +22 -0
- data/lib/workos/admin_portal.rb +51 -0
- data/lib/workos/api_keys/api_key.rb +43 -0
- data/lib/workos/api_keys/api_key_created.rb +34 -0
- data/lib/workos/api_keys/api_key_created_data.rb +43 -0
- data/lib/workos/api_keys/api_key_created_data_owner.rb +22 -0
- data/lib/workos/api_keys/api_key_owner.rb +7 -0
- data/lib/workos/api_keys/api_key_revoked.rb +34 -0
- data/lib/workos/api_keys/api_key_revoked_data.rb +7 -0
- data/lib/workos/api_keys/api_key_revoked_data_owner.rb +7 -0
- data/lib/workos/api_keys/api_key_validation_response.rb +18 -0
- data/lib/workos/api_keys/api_key_with_value.rb +46 -0
- data/lib/workos/api_keys/api_key_with_value_owner.rb +7 -0
- data/lib/workos/api_keys/create_organization_api_key.rb +22 -0
- data/lib/workos/api_keys/validate_api_key.rb +18 -0
- data/lib/workos/api_keys.rb +128 -0
- data/lib/workos/audit_logs/audit_log_action.rb +36 -0
- data/lib/workos/audit_logs/audit_log_action_json.rb +31 -0
- data/lib/workos/audit_logs/audit_log_event.rb +37 -0
- data/lib/workos/audit_logs/audit_log_event_actor.rb +28 -0
- data/lib/workos/audit_logs/audit_log_event_context.rb +22 -0
- data/lib/workos/audit_logs/audit_log_event_create_response.rb +18 -0
- data/lib/workos/audit_logs/audit_log_event_ingestion.rb +22 -0
- data/lib/workos/audit_logs/audit_log_event_target.rb +7 -0
- data/lib/workos/audit_logs/audit_log_export.rb +39 -0
- data/lib/workos/audit_logs/audit_log_export_creation.rb +49 -0
- data/lib/workos/audit_logs/audit_log_export_json.rb +34 -0
- data/lib/workos/audit_logs/audit_log_schema.rb +25 -0
- data/lib/workos/audit_logs/audit_log_schema_actor.rb +18 -0
- data/lib/workos/audit_logs/audit_log_schema_json.rb +34 -0
- data/lib/workos/audit_logs/audit_log_schema_json_actor.rb +7 -0
- data/lib/workos/audit_logs/audit_log_schema_json_target.rb +22 -0
- data/lib/workos/audit_logs/audit_log_schema_target.rb +7 -0
- data/lib/workos/audit_logs.rb +252 -72
- data/lib/workos/authorization/add_role_permission.rb +18 -0
- data/lib/workos/authorization/assign_role.rb +28 -0
- data/lib/workos/authorization/authorization_check.rb +18 -0
- data/lib/workos/authorization/authorization_permission.rb +43 -0
- data/lib/workos/authorization/authorization_resource.rb +46 -0
- data/lib/workos/authorization/check_authorization.rb +28 -0
- data/lib/workos/authorization/create_authorization_permission.rb +28 -0
- data/lib/workos/authorization/create_authorization_resource.rb +40 -0
- data/lib/workos/authorization/create_organization_role.rb +28 -0
- data/lib/workos/authorization/create_role.rb +7 -0
- data/lib/workos/authorization/permission.rb +7 -0
- data/lib/workos/authorization/permission_created.rb +34 -0
- data/lib/workos/authorization/permission_created_data.rb +40 -0
- data/lib/workos/authorization/permission_deleted.rb +34 -0
- data/lib/workos/authorization/permission_deleted_data.rb +7 -0
- data/lib/workos/authorization/permission_updated.rb +34 -0
- data/lib/workos/authorization/permission_updated_data.rb +7 -0
- data/lib/workos/authorization/remove_role.rb +7 -0
- data/lib/workos/authorization/role.rb +46 -0
- data/lib/workos/authorization/role_assignment.rb +34 -0
- data/lib/workos/authorization/role_assignment_resource.rb +25 -0
- data/lib/workos/authorization/role_created.rb +34 -0
- data/lib/workos/authorization/role_created_data.rb +34 -0
- data/lib/workos/authorization/role_deleted.rb +34 -0
- data/lib/workos/authorization/role_deleted_data.rb +7 -0
- data/lib/workos/authorization/role_list.rb +22 -0
- data/lib/workos/authorization/role_updated.rb +34 -0
- data/lib/workos/authorization/role_updated_data.rb +7 -0
- data/lib/workos/authorization/set_role_permissions.rb +18 -0
- data/lib/workos/authorization/slim_role.rb +7 -0
- data/lib/workos/authorization/update_authorization_permission.rb +22 -0
- data/lib/workos/authorization/update_authorization_resource.rb +31 -0
- data/lib/workos/authorization/update_organization_role.rb +7 -0
- data/lib/workos/authorization/update_role.rb +7 -0
- data/lib/workos/authorization/user_organization_membership_base_list_data.rb +46 -0
- data/lib/workos/authorization.rb +1283 -0
- data/lib/workos/base_client.rb +350 -0
- data/lib/workos/client.rb +102 -159
- data/lib/workos/configuration.rb +56 -5
- data/lib/workos/connect/application_credentials_list_item.rb +34 -0
- data/lib/workos/connect/connect_application.rb +46 -0
- data/lib/workos/connect/create_application_secret.rb +13 -0
- data/lib/workos/connect/create_m2m_application.rb +31 -0
- data/lib/workos/connect/create_oauth_application.rb +40 -0
- data/lib/workos/connect/external_auth_complete_response.rb +18 -0
- data/lib/workos/connect/new_connect_application_secret.rb +37 -0
- data/lib/workos/connect/redirect_uri_input.rb +22 -0
- data/lib/workos/connect/update_oauth_application.rb +28 -0
- data/lib/workos/connect/user_consent_option.rb +28 -0
- data/lib/workos/connect/user_consent_option_choice.rb +22 -0
- data/lib/workos/connect/user_management_login_request.rb +25 -0
- data/lib/workos/connect/user_object.rb +31 -0
- data/lib/workos/connect.rb +329 -0
- data/lib/workos/directory_sync/directory.rb +49 -0
- data/lib/workos/directory_sync/directory_group.rb +43 -0
- data/lib/workos/directory_sync/directory_metadata.rb +22 -0
- data/lib/workos/directory_sync/directory_metadata_user.rb +22 -0
- data/lib/workos/directory_sync/directory_user.rb +103 -0
- data/lib/workos/directory_sync/directory_user_email.rb +25 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +114 -0
- data/lib/workos/directory_sync/directory_user_with_groups_email.rb +7 -0
- data/lib/workos/directory_sync/dsync_activated.rb +34 -0
- data/lib/workos/directory_sync/dsync_activated_data.rb +46 -0
- data/lib/workos/directory_sync/dsync_activated_data_domain.rb +25 -0
- data/lib/workos/directory_sync/dsync_deactivated.rb +34 -0
- data/lib/workos/directory_sync/dsync_deactivated_data.rb +46 -0
- data/lib/workos/directory_sync/dsync_deactivated_data_domain.rb +7 -0
- data/lib/workos/directory_sync/dsync_deleted.rb +34 -0
- data/lib/workos/directory_sync/dsync_deleted_data.rb +40 -0
- data/lib/workos/directory_sync/dsync_group_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_deleted.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_updated.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_updated_data.rb +46 -0
- data/lib/workos/directory_sync/dsync_group_user_added.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_user_added_data.rb +25 -0
- data/lib/workos/directory_sync/dsync_group_user_removed.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_user_removed_data.rb +7 -0
- data/lib/workos/directory_sync/dsync_user_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_user_deleted.rb +34 -0
- data/lib/workos/directory_sync/dsync_user_updated.rb +34 -0
- data/lib/workos/directory_sync/dsync_user_updated_data.rb +106 -0
- data/lib/workos/directory_sync/dsync_user_updated_data_email.rb +7 -0
- data/lib/workos/directory_sync.rb +230 -181
- data/lib/workos/encryptors/aes_gcm.rb +40 -33
- data/lib/workos/encryptors.rb +3 -3
- data/lib/workos/errors.rb +17 -75
- data/lib/workos/events/event_list_list_metadata.rb +18 -0
- data/lib/workos/events/event_schema.rb +34 -0
- data/lib/workos/events.rb +64 -38
- data/lib/workos/feature_flags/feature_flag.rb +49 -0
- data/lib/workos/feature_flags/feature_flag_owner.rb +25 -0
- data/lib/workos/feature_flags/flag.rb +7 -0
- data/lib/workos/feature_flags/flag_created.rb +34 -0
- data/lib/workos/feature_flags/flag_created_context.rb +22 -0
- data/lib/workos/feature_flags/flag_created_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_created_data.rb +52 -0
- data/lib/workos/feature_flags/flag_created_data_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_deleted.rb +34 -0
- data/lib/workos/feature_flags/flag_deleted_context.rb +22 -0
- data/lib/workos/feature_flags/flag_deleted_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_deleted_data.rb +7 -0
- data/lib/workos/feature_flags/flag_deleted_data_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated.rb +34 -0
- data/lib/workos/feature_flags/flag_rule_updated_context.rb +31 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_user.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_user.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_data.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_data.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_data_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_updated.rb +34 -0
- data/lib/workos/feature_flags/flag_updated_context.rb +25 -0
- data/lib/workos/feature_flags/flag_updated_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb +18 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +31 -0
- data/lib/workos/feature_flags/flag_updated_data.rb +7 -0
- data/lib/workos/feature_flags/flag_updated_data_owner.rb +7 -0
- data/lib/workos/feature_flags.rb +246 -0
- data/lib/workos/groups/create_group.rb +22 -0
- data/lib/workos/groups/create_group_membership.rb +18 -0
- data/lib/workos/groups/group.rb +37 -0
- data/lib/workos/groups/update_group.rb +7 -0
- data/lib/workos/groups.rb +256 -0
- data/lib/workos/hash_provider.rb +34 -8
- data/lib/workos/inflections.rb +64 -0
- data/lib/workos/multi_factor_auth/authentication_challenge.rb +37 -0
- data/lib/workos/multi_factor_auth/authentication_challenge_verify_response.rb +22 -0
- data/lib/workos/multi_factor_auth/authentication_challenges_verify_request.rb +18 -0
- data/lib/workos/multi_factor_auth/authentication_factor.rb +40 -0
- data/lib/workos/multi_factor_auth/authentication_factor_enrolled.rb +40 -0
- data/lib/workos/multi_factor_auth/authentication_factor_enrolled_sms.rb +18 -0
- data/lib/workos/multi_factor_auth/authentication_factor_enrolled_totp.rb +31 -0
- data/lib/workos/multi_factor_auth/authentication_factor_sms.rb +7 -0
- data/lib/workos/multi_factor_auth/authentication_factor_totp.rb +22 -0
- data/lib/workos/multi_factor_auth/authentication_factors_create_request.rb +31 -0
- data/lib/workos/multi_factor_auth/challenge_authentication_factor.rb +18 -0
- data/lib/workos/multi_factor_auth/enroll_user_authentication_factor.rb +28 -0
- data/lib/workos/multi_factor_auth/user_authentication_factor_enroll_response.rb +22 -0
- data/lib/workos/multi_factor_auth.rb +215 -0
- data/lib/workos/organization_domains/create_organization_domain.rb +22 -0
- data/lib/workos/organization_domains/organization_domain.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_created.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_created_data.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_deleted.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_deleted_data.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_stand_alone.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_updated.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_updated_data.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_verification_failed.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_verification_failed_data.rb +22 -0
- data/lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_verified.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_verified_data.rb +46 -0
- data/lib/workos/organization_domains.rb +94 -0
- data/lib/workos/organizations/audit_log_configuration.rb +28 -0
- data/lib/workos/organizations/audit_log_configuration_log_stream.rb +31 -0
- data/lib/workos/organizations/audit_logs_retention.rb +23 -0
- data/lib/workos/organizations/audit_logs_retention_json.rb +18 -0
- data/lib/workos/organizations/organization.rb +55 -0
- data/lib/workos/organizations/organization_created.rb +34 -0
- data/lib/workos/organizations/organization_created_data.rb +43 -0
- data/lib/workos/organizations/organization_created_data_domain.rb +46 -0
- data/lib/workos/organizations/organization_deleted.rb +34 -0
- data/lib/workos/organizations/organization_deleted_data.rb +43 -0
- data/lib/workos/organizations/organization_deleted_data_domain.rb +46 -0
- data/lib/workos/organizations/organization_domain_data.rb +22 -0
- data/lib/workos/organizations/organization_input.rb +34 -0
- data/lib/workos/organizations/organization_membership_created.rb +34 -0
- data/lib/workos/organizations/organization_membership_created_data.rb +49 -0
- data/lib/workos/organizations/organization_membership_deleted.rb +34 -0
- data/lib/workos/organizations/organization_membership_deleted_data.rb +49 -0
- data/lib/workos/organizations/organization_membership_updated.rb +34 -0
- data/lib/workos/organizations/organization_membership_updated_data.rb +49 -0
- data/lib/workos/organizations/organization_role_created.rb +34 -0
- data/lib/workos/organizations/organization_role_created_data.rb +43 -0
- data/lib/workos/organizations/organization_role_deleted.rb +34 -0
- data/lib/workos/organizations/organization_role_deleted_data.rb +7 -0
- data/lib/workos/organizations/organization_role_updated.rb +34 -0
- data/lib/workos/organizations/organization_role_updated_data.rb +7 -0
- data/lib/workos/organizations/organization_updated.rb +34 -0
- data/lib/workos/organizations/organization_updated_data.rb +43 -0
- data/lib/workos/organizations/organization_updated_data_domain.rb +46 -0
- data/lib/workos/organizations/update_audit_logs_retention.rb +18 -0
- data/lib/workos/organizations/update_organization.rb +46 -0
- data/lib/workos/organizations.rb +203 -271
- data/lib/workos/passwordless.rb +63 -58
- data/lib/workos/pipes/connected_account.rb +40 -0
- data/lib/workos/pipes/data_integration_access_token_response.rb +25 -0
- data/lib/workos/pipes/data_integration_access_token_response_access_token.rb +31 -0
- data/lib/workos/pipes/data_integration_authorize_url_response.rb +18 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_get_user_token_request.rb +22 -0
- data/lib/workos/pipes/data_integrations_list_response.rb +22 -0
- data/lib/workos/pipes/data_integrations_list_response_data.rb +52 -0
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +52 -0
- data/lib/workos/pipes.rb +149 -0
- data/lib/workos/pkce.rb +42 -0
- data/lib/workos/public_client.rb +27 -0
- data/lib/workos/radar/radar_list_entry_already_present_response.rb +18 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +37 -0
- data/lib/workos/radar/radar_standalone_delete_radar_list_entry_request.rb +18 -0
- data/lib/workos/radar/radar_standalone_response.rb +31 -0
- data/lib/workos/radar/radar_standalone_update_radar_attempt_request.rb +22 -0
- data/lib/workos/radar/radar_standalone_update_radar_list_request.rb +7 -0
- data/lib/workos/radar.rb +132 -0
- data/lib/workos/session.rb +108 -160
- data/lib/workos/session_manager.rb +196 -0
- data/lib/workos/shared/event_context.rb +34 -0
- data/lib/workos/shared/event_context_actor.rb +25 -0
- data/lib/workos/shared/event_context_google_analytics_session.rb +25 -0
- data/lib/workos/shared/group_created.rb +34 -0
- data/lib/workos/shared/group_deleted.rb +34 -0
- data/lib/workos/shared/group_member_added.rb +34 -0
- data/lib/workos/shared/group_member_added_data.rb +22 -0
- data/lib/workos/shared/group_member_removed.rb +34 -0
- data/lib/workos/shared/group_member_removed_data.rb +7 -0
- data/lib/workos/shared/group_updated.rb +34 -0
- data/lib/workos/shared/waitlist_user.rb +37 -0
- data/lib/workos/shared/waitlist_user_approved.rb +34 -0
- data/lib/workos/shared/waitlist_user_created.rb +34 -0
- data/lib/workos/shared/waitlist_user_denied.rb +34 -0
- data/lib/workos/sso/connection.rb +58 -0
- data/lib/workos/sso/connection_activated.rb +34 -0
- data/lib/workos/sso/connection_activated_data.rb +49 -0
- data/lib/workos/sso/connection_activated_data_domain.rb +25 -0
- data/lib/workos/sso/connection_deactivated.rb +34 -0
- data/lib/workos/sso/connection_deactivated_data.rb +49 -0
- data/lib/workos/sso/connection_deactivated_data_domain.rb +7 -0
- data/lib/workos/sso/connection_deleted.rb +34 -0
- data/lib/workos/sso/connection_deleted_data.rb +40 -0
- data/lib/workos/sso/connection_domain.rb +7 -0
- data/lib/workos/sso/connection_option.rb +18 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required.rb +34 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required_data.rb +25 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required_data_certificate.rb +25 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required_data_connection.rb +22 -0
- data/lib/workos/sso/connection_saml_certificate_renewed.rb +34 -0
- data/lib/workos/sso/connection_saml_certificate_renewed_data.rb +25 -0
- data/lib/workos/sso/connection_saml_certificate_renewed_data_certificate.rb +22 -0
- data/lib/workos/sso/connection_saml_certificate_renewed_data_connection.rb +7 -0
- data/lib/workos/sso/profile.rb +58 -0
- data/lib/workos/sso/sso_authorize_url_response.rb +18 -0
- data/lib/workos/sso/sso_logout_authorize_request.rb +18 -0
- data/lib/workos/sso/sso_logout_authorize_response.rb +22 -0
- data/lib/workos/sso/sso_token_response.rb +31 -0
- data/lib/workos/sso/sso_token_response_oauth_token.rb +7 -0
- data/lib/workos/sso/token_query.rb +28 -0
- data/lib/workos/sso.rb +231 -212
- data/lib/workos/types/api_response.rb +10 -0
- data/lib/workos/types/applications_order.rb +14 -0
- data/lib/workos/types/audit_log_configuration_log_stream_state.rb +15 -0
- data/lib/workos/types/audit_log_configuration_log_stream_type.rb +17 -0
- data/lib/workos/types/audit_log_configuration_state.rb +14 -0
- data/lib/workos/types/audit_log_export_json_state.rb +14 -0
- data/lib/workos/types/audit_log_export_state.rb +14 -0
- data/lib/workos/types/audit_logs_order.rb +9 -0
- data/lib/workos/types/authenticate_response_authentication_method.rb +33 -0
- data/lib/workos/types/authentication_factor_enrolled_type.rb +15 -0
- data/lib/workos/types/authentication_factor_type.rb +9 -0
- data/lib/workos/types/authentication_factors_create_request_type.rb +14 -0
- data/lib/workos/types/authentication_radar_risk_detected_data_action.rb +13 -0
- data/lib/workos/types/authorization_assignment.rb +13 -0
- data/lib/workos/types/authorization_order.rb +9 -0
- data/lib/workos/types/base_model.rb +35 -0
- data/lib/workos/types/connected_account_state.rb +14 -0
- data/lib/workos/types/connection_activated_data_connection_type.rb +61 -0
- data/lib/workos/types/connection_activated_data_state.rb +16 -0
- data/lib/workos/types/connection_activated_data_status.rb +13 -0
- data/lib/workos/types/connection_deactivated_data_connection_type.rb +9 -0
- data/lib/workos/types/connection_deactivated_data_state.rb +9 -0
- data/lib/workos/types/connection_deactivated_data_status.rb +9 -0
- data/lib/workos/types/connection_deleted_data_connection_type.rb +9 -0
- data/lib/workos/types/connection_deleted_data_state.rb +9 -0
- data/lib/workos/types/connection_saml_certificate_renewal_required_data_certificate_certificate_type.rb +14 -0
- data/lib/workos/types/connection_saml_certificate_renewed_data_certificate_certificate_type.rb +9 -0
- data/lib/workos/types/connection_state.rb +17 -0
- data/lib/workos/types/connection_status.rb +9 -0
- data/lib/workos/types/connection_type.rb +62 -0
- data/lib/workos/types/connections_connection_type.rb +59 -0
- data/lib/workos/types/connections_order.rb +9 -0
- data/lib/workos/types/create_user_invite_options_locale.rb +101 -0
- data/lib/workos/types/create_user_password_hash_type.rb +17 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +88 -0
- data/lib/workos/types/data_integration_access_token_response_error.rb +13 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_ownership.rb +13 -0
- data/lib/workos/types/directories_order.rb +9 -0
- data/lib/workos/types/directory_groups_order.rb +9 -0
- data/lib/workos/types/directory_state.rb +16 -0
- data/lib/workos/types/directory_type.rb +32 -0
- data/lib/workos/types/directory_user_state.rb +14 -0
- data/lib/workos/types/directory_user_with_groups_state.rb +9 -0
- data/lib/workos/types/directory_users_order.rb +9 -0
- data/lib/workos/types/dsync_activated_data_state.rb +16 -0
- data/lib/workos/types/dsync_activated_data_type.rb +34 -0
- data/lib/workos/types/dsync_deactivated_data_state.rb +9 -0
- data/lib/workos/types/dsync_deactivated_data_type.rb +9 -0
- data/lib/workos/types/dsync_deleted_data_state.rb +9 -0
- data/lib/workos/types/dsync_deleted_data_type.rb +9 -0
- data/lib/workos/types/dsync_user_updated_data_state.rb +9 -0
- data/lib/workos/types/event_context_actor_source.rb +14 -0
- data/lib/workos/types/events_order.rb +9 -0
- data/lib/workos/types/feature_flags_order.rb +9 -0
- data/lib/workos/types/flag_created_context_actor_source.rb +9 -0
- data/lib/workos/types/flag_deleted_context_actor_source.rb +9 -0
- data/lib/workos/types/flag_rule_updated_context_access_type.rb +14 -0
- data/lib/workos/types/flag_rule_updated_context_actor_source.rb +9 -0
- data/lib/workos/types/flag_rule_updated_context_previous_attribute_context_access_type.rb +9 -0
- data/lib/workos/types/flag_updated_context_actor_source.rb +9 -0
- data/lib/workos/types/generate_link_intent.rb +18 -0
- data/lib/workos/types/groups_order.rb +9 -0
- data/lib/workos/types/invitation_accepted_data_state.rb +15 -0
- data/lib/workos/types/invitation_created_data_state.rb +9 -0
- data/lib/workos/types/invitation_resent_data_state.rb +9 -0
- data/lib/workos/types/invitation_revoked_data_state.rb +9 -0
- data/lib/workos/types/invitation_state.rb +9 -0
- data/lib/workos/types/list_struct.rb +122 -6
- data/lib/workos/types/organization_created_data_domain_state.rb +16 -0
- data/lib/workos/types/organization_created_data_domain_verification_strategy.rb +13 -0
- data/lib/workos/types/organization_deleted_data_domain_state.rb +9 -0
- data/lib/workos/types/organization_deleted_data_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_created_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_created_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_data_state.rb +13 -0
- data/lib/workos/types/organization_domain_deleted_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_deleted_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_stand_alone_state.rb +9 -0
- data/lib/workos/types/organization_domain_stand_alone_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_state.rb +9 -0
- data/lib/workos/types/organization_domain_updated_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_updated_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_verification_failed_data_organization_domain_state.rb +9 -0
- data/lib/workos/types/organization_domain_verification_failed_data_organization_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_verification_failed_data_reason.rb +13 -0
- data/lib/workos/types/organization_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_verified_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_verified_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_membership_created_data_status.rb +14 -0
- data/lib/workos/types/organization_membership_deleted_data_status.rb +9 -0
- data/lib/workos/types/organization_membership_status.rb +9 -0
- data/lib/workos/types/organization_membership_updated_data_status.rb +9 -0
- data/lib/workos/types/organization_updated_data_domain_state.rb +9 -0
- data/lib/workos/types/organization_updated_data_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organizations_api_keys_order.rb +9 -0
- data/lib/workos/types/organizations_feature_flags_order.rb +9 -0
- data/lib/workos/types/organizations_order.rb +9 -0
- data/lib/workos/types/permissions_order.rb +9 -0
- data/lib/workos/types/profile_connection_type.rb +9 -0
- data/lib/workos/types/radar_action.rb +13 -0
- data/lib/workos/types/radar_standalone_assess_request_action.rb +19 -0
- data/lib/workos/types/radar_standalone_assess_request_auth_method.rb +19 -0
- data/lib/workos/types/radar_standalone_response_blocklist_type.rb +18 -0
- data/lib/workos/types/radar_standalone_response_control.rb +21 -0
- data/lib/workos/types/radar_standalone_response_verdict.rb +14 -0
- data/lib/workos/types/radar_type.rb +9 -0
- data/lib/workos/types/request_options.rb +33 -0
- data/lib/workos/types/resend_user_invite_options_locale.rb +9 -0
- data/lib/workos/types/role_type.rb +13 -0
- data/lib/workos/types/session_created_data_auth_method.rb +21 -0
- data/lib/workos/types/session_created_data_status.rb +14 -0
- data/lib/workos/types/session_revoked_data_auth_method.rb +9 -0
- data/lib/workos/types/session_revoked_data_status.rb +9 -0
- data/lib/workos/types/sso_provider.rb +24 -0
- data/lib/workos/types/update_user_password_hash_type.rb +9 -0
- data/lib/workos/types/update_webhook_endpoint_events.rb +9 -0
- data/lib/workos/types/update_webhook_endpoint_status.rb +13 -0
- data/lib/workos/types/user_identities_get_item_provider.rb +25 -0
- data/lib/workos/types/user_invite_state.rb +9 -0
- data/lib/workos/types/user_management_authentication_provider.rb +25 -0
- data/lib/workos/types/user_management_authentication_screen_hint.rb +13 -0
- data/lib/workos/types/user_management_invitations_order.rb +9 -0
- data/lib/workos/types/user_management_multi_factor_authentication_order.rb +9 -0
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +9 -0
- data/lib/workos/types/user_management_organization_membership_order.rb +9 -0
- data/lib/workos/types/user_management_organization_membership_statuses.rb +9 -0
- data/lib/workos/types/user_management_users_authorized_applications_order.rb +9 -0
- data/lib/workos/types/user_management_users_feature_flags_order.rb +9 -0
- data/lib/workos/types/user_management_users_order.rb +9 -0
- data/lib/workos/types/user_organization_membership_base_list_data_status.rb +9 -0
- data/lib/workos/types/user_organization_membership_status.rb +9 -0
- data/lib/workos/types/user_sessions_auth_method.rb +9 -0
- data/lib/workos/types/user_sessions_status.rb +9 -0
- data/lib/workos/types/vault_byok_key_verification_completed_data_key_provider.rb +14 -0
- data/lib/workos/types/vault_data_created_data_actor_source.rb +13 -0
- data/lib/workos/types/vault_data_deleted_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_data_read_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_data_updated_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_dek_decrypted_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_dek_read_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_kek_created_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_metadata_read_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_names_listed_data_actor_source.rb +9 -0
- data/lib/workos/types/waitlist_user_state.rb +14 -0
- data/lib/workos/types/webhook_endpoint_json_status.rb +9 -0
- data/lib/workos/types/webhook_endpoint_status.rb +13 -0
- data/lib/workos/types/webhooks_order.rb +9 -0
- data/lib/workos/types/widget_session_token_scopes.rb +17 -0
- data/lib/workos/user_management/action_authentication_denied.rb +34 -0
- data/lib/workos/user_management/action_authentication_denied_data.rb +43 -0
- data/lib/workos/user_management/action_user_registration_denied.rb +34 -0
- data/lib/workos/user_management/action_user_registration_denied_data.rb +40 -0
- data/lib/workos/user_management/authenticate_response.rb +40 -0
- data/lib/workos/user_management/authenticate_response_impersonator.rb +22 -0
- data/lib/workos/user_management/authenticate_response_oauth_token.rb +31 -0
- data/lib/workos/user_management/authentication_email_verification_failed.rb +34 -0
- data/lib/workos/user_management/authentication_email_verification_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_email_verification_failed_data_error.rb +22 -0
- data/lib/workos/user_management/authentication_email_verification_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_email_verification_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_magic_auth_failed.rb +34 -0
- data/lib/workos/user_management/authentication_magic_auth_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_magic_auth_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_magic_auth_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_magic_auth_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_mfa_failed.rb +34 -0
- data/lib/workos/user_management/authentication_mfa_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_mfa_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_mfa_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_mfa_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_oauth_failed.rb +34 -0
- data/lib/workos/user_management/authentication_oauth_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_oauth_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_oauth_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_passkey_failed.rb +34 -0
- data/lib/workos/user_management/authentication_passkey_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_passkey_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_passkey_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_passkey_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_password_failed.rb +34 -0
- data/lib/workos/user_management/authentication_password_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_password_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_password_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_password_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_radar_risk_detected.rb +34 -0
- data/lib/workos/user_management/authentication_radar_risk_detected_data.rb +40 -0
- data/lib/workos/user_management/authentication_sso_failed.rb +34 -0
- data/lib/workos/user_management/authentication_sso_failed_data.rb +40 -0
- data/lib/workos/user_management/authentication_sso_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_sso_failed_data_sso.rb +25 -0
- data/lib/workos/user_management/authentication_sso_started.rb +34 -0
- data/lib/workos/user_management/authentication_sso_started_data.rb +37 -0
- data/lib/workos/user_management/authentication_sso_started_data_sso.rb +7 -0
- data/lib/workos/user_management/authentication_sso_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_sso_succeeded_data.rb +37 -0
- data/lib/workos/user_management/authentication_sso_succeeded_data_sso.rb +7 -0
- data/lib/workos/user_management/authentication_sso_timed_out.rb +34 -0
- data/lib/workos/user_management/authentication_sso_timed_out_data.rb +40 -0
- data/lib/workos/user_management/authentication_sso_timed_out_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_sso_timed_out_data_sso.rb +7 -0
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/authorized_connect_application_list_data.rb +31 -0
- data/lib/workos/user_management/confirm_email_change.rb +7 -0
- data/lib/workos/user_management/cors_origin_response.rb +31 -0
- data/lib/workos/user_management/create_cors_origin.rb +18 -0
- data/lib/workos/user_management/create_magic_code_and_return.rb +22 -0
- data/lib/workos/user_management/create_password_reset.rb +22 -0
- data/lib/workos/user_management/create_password_reset_token.rb +18 -0
- data/lib/workos/user_management/create_redirect_uri.rb +18 -0
- data/lib/workos/user_management/create_user.rb +43 -0
- data/lib/workos/user_management/create_user_invite_options.rb +34 -0
- data/lib/workos/user_management/create_user_organization_membership.rb +28 -0
- data/lib/workos/user_management/device_authorization_response.rb +34 -0
- data/lib/workos/user_management/device_code_session_authenticate_request.rb +34 -0
- data/lib/workos/user_management/email_change.rb +31 -0
- data/lib/workos/user_management/email_change_confirmation.rb +22 -0
- data/lib/workos/user_management/email_change_confirmation_user.rb +55 -0
- data/lib/workos/user_management/email_verification.rb +40 -0
- data/lib/workos/user_management/email_verification_code_session_authenticate_request.rb +40 -0
- data/lib/workos/user_management/email_verification_created.rb +34 -0
- data/lib/workos/user_management/email_verification_created_data.rb +37 -0
- data/lib/workos/user_management/invitation.rb +61 -0
- data/lib/workos/user_management/invitation_accepted.rb +34 -0
- data/lib/workos/user_management/invitation_accepted_data.rb +55 -0
- data/lib/workos/user_management/invitation_created.rb +34 -0
- data/lib/workos/user_management/invitation_created_data.rb +55 -0
- data/lib/workos/user_management/invitation_resent.rb +34 -0
- data/lib/workos/user_management/invitation_resent_data.rb +55 -0
- data/lib/workos/user_management/invitation_revoked.rb +34 -0
- data/lib/workos/user_management/invitation_revoked_data.rb +55 -0
- data/lib/workos/user_management/jwks_response.rb +18 -0
- data/lib/workos/user_management/jwks_response_keys.rb +40 -0
- data/lib/workos/user_management/jwt_template_response.rb +28 -0
- data/lib/workos/user_management/magic_auth.rb +40 -0
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/magic_auth_created.rb +34 -0
- data/lib/workos/user_management/magic_auth_created_data.rb +37 -0
- data/lib/workos/user_management/mfa_totp_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/organization_membership.rb +49 -0
- data/lib/workos/user_management/organization_selection_session_authenticate_request.rb +40 -0
- data/lib/workos/user_management/password_reset.rb +40 -0
- data/lib/workos/user_management/password_reset_created.rb +34 -0
- data/lib/workos/user_management/password_reset_created_data.rb +34 -0
- data/lib/workos/user_management/password_reset_succeeded.rb +34 -0
- data/lib/workos/user_management/password_reset_succeeded_data.rb +7 -0
- data/lib/workos/user_management/password_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/redirect_uri.rb +34 -0
- data/lib/workos/user_management/refresh_token_session_authenticate_request.rb +40 -0
- data/lib/workos/user_management/resend_user_invite_options.rb +18 -0
- data/lib/workos/user_management/reset_password_response.rb +18 -0
- data/lib/workos/user_management/revoke_session.rb +22 -0
- data/lib/workos/user_management/send_email_change.rb +18 -0
- data/lib/workos/user_management/send_verification_email_response.rb +7 -0
- data/lib/workos/user_management/session_created.rb +34 -0
- data/lib/workos/user_management/session_created_data.rb +55 -0
- data/lib/workos/user_management/session_created_data_impersonator.rb +7 -0
- data/lib/workos/user_management/session_revoked.rb +34 -0
- data/lib/workos/user_management/session_revoked_data.rb +55 -0
- data/lib/workos/user_management/session_revoked_data_impersonator.rb +7 -0
- data/lib/workos/user_management/sso_device_authorization_request.rb +18 -0
- data/lib/workos/user_management/update_jwt_template.rb +18 -0
- data/lib/workos/user_management/update_user.rb +46 -0
- data/lib/workos/user_management/update_user_organization_membership.rb +22 -0
- data/lib/workos/user_management/user.rb +7 -0
- data/lib/workos/user_management/user_created.rb +34 -0
- data/lib/workos/user_management/user_deleted.rb +34 -0
- data/lib/workos/user_management/user_identities_get_item.rb +25 -0
- data/lib/workos/user_management/user_invite.rb +61 -0
- data/lib/workos/user_management/user_organization_membership.rb +49 -0
- data/lib/workos/user_management/user_sessions_impersonator.rb +7 -0
- data/lib/workos/user_management/user_sessions_list_item.rb +55 -0
- data/lib/workos/user_management/user_updated.rb +34 -0
- data/lib/workos/user_management/verify_email_address.rb +7 -0
- data/lib/workos/user_management/verify_email_response.rb +7 -0
- data/lib/workos/user_management.rb +1514 -1170
- data/lib/workos/user_management_organization_membership_groups.rb +60 -0
- data/lib/workos/util/signature.rb +55 -0
- data/lib/workos/util.rb +16 -0
- data/lib/workos/vault/vault_byok_key_verification_completed.rb +34 -0
- data/lib/workos/vault/vault_byok_key_verification_completed_data.rb +25 -0
- data/lib/workos/vault/vault_data_created.rb +34 -0
- data/lib/workos/vault/vault_data_created_data.rb +34 -0
- data/lib/workos/vault/vault_data_deleted.rb +34 -0
- data/lib/workos/vault/vault_data_deleted_data.rb +28 -0
- data/lib/workos/vault/vault_data_read.rb +34 -0
- data/lib/workos/vault/vault_data_read_data.rb +31 -0
- data/lib/workos/vault/vault_data_updated.rb +34 -0
- data/lib/workos/vault/vault_data_updated_data.rb +34 -0
- data/lib/workos/vault/vault_dek_decrypted.rb +34 -0
- data/lib/workos/vault/vault_dek_decrypted_data.rb +28 -0
- data/lib/workos/vault/vault_dek_read.rb +34 -0
- data/lib/workos/vault/vault_dek_read_data.rb +31 -0
- data/lib/workos/vault/vault_kek_created.rb +34 -0
- data/lib/workos/vault/vault_kek_created_data.rb +31 -0
- data/lib/workos/vault/vault_metadata_read.rb +34 -0
- data/lib/workos/vault/vault_metadata_read_data.rb +28 -0
- data/lib/workos/vault/vault_names_listed.rb +34 -0
- data/lib/workos/vault/vault_names_listed_data.rb +25 -0
- data/lib/workos/vault.rb +241 -0
- data/lib/workos/version.rb +2 -1
- data/lib/workos/webhook_event.rb +120 -0
- data/lib/workos/webhooks/create_webhook_endpoint.rb +22 -0
- data/lib/workos/webhooks/update_webhook_endpoint.rb +25 -0
- data/lib/workos/webhooks/webhook_endpoint.rb +45 -0
- data/lib/workos/webhooks/webhook_endpoint_json.rb +40 -0
- data/lib/workos/webhooks.rb +213 -159
- data/lib/workos/widgets/widget_session_token.rb +25 -0
- data/lib/workos/widgets/widget_session_token_response.rb +18 -0
- data/lib/workos/widgets.rb +34 -38
- data/lib/workos.rb +34 -96
- data/rbi/workos/action_authentication_denied.rbi +54 -0
- data/rbi/workos/action_authentication_denied_data.rbi +72 -0
- data/rbi/workos/action_user_registration_denied.rbi +54 -0
- data/rbi/workos/action_user_registration_denied_data.rbi +66 -0
- data/rbi/workos/actions.rbi +48 -0
- data/rbi/workos/add_role_permission.rbi +24 -0
- data/rbi/workos/admin_portal.rbi +26 -0
- data/rbi/workos/api_key.rbi +72 -0
- data/rbi/workos/api_key_created.rbi +54 -0
- data/rbi/workos/api_key_created_data.rbi +72 -0
- data/rbi/workos/api_key_created_data_owner.rbi +30 -0
- data/rbi/workos/api_key_owner.rbi +30 -0
- data/rbi/workos/api_key_revoked.rbi +54 -0
- data/rbi/workos/api_key_revoked_data.rbi +72 -0
- data/rbi/workos/api_key_revoked_data_owner.rbi +30 -0
- data/rbi/workos/api_key_validation_response.rbi +24 -0
- data/rbi/workos/api_key_with_value.rbi +78 -0
- data/rbi/workos/api_key_with_value_owner.rbi +30 -0
- data/rbi/workos/api_keys.rbi +51 -0
- data/rbi/workos/application_credentials_list_item.rbi +54 -0
- data/rbi/workos/assign_role.rbi +42 -0
- data/rbi/workos/audit_log_action.rbi +47 -0
- data/rbi/workos/audit_log_action_json.rbi +48 -0
- data/rbi/workos/audit_log_configuration.rbi +42 -0
- data/rbi/workos/audit_log_configuration_log_stream.rbi +48 -0
- data/rbi/workos/audit_log_event.rbi +60 -0
- data/rbi/workos/audit_log_event_actor.rbi +42 -0
- data/rbi/workos/audit_log_event_context.rbi +30 -0
- data/rbi/workos/audit_log_event_create_response.rbi +24 -0
- data/rbi/workos/audit_log_event_ingestion.rbi +30 -0
- data/rbi/workos/audit_log_event_target.rbi +42 -0
- data/rbi/workos/audit_log_export.rbi +53 -0
- data/rbi/workos/audit_log_export_creation.rbi +66 -0
- data/rbi/workos/audit_log_export_json.rbi +54 -0
- data/rbi/workos/audit_log_schema.rbi +36 -0
- data/rbi/workos/audit_log_schema_actor.rbi +24 -0
- data/rbi/workos/audit_log_schema_json.rbi +54 -0
- data/rbi/workos/audit_log_schema_json_actor.rbi +24 -0
- data/rbi/workos/audit_log_schema_json_target.rbi +30 -0
- data/rbi/workos/audit_log_schema_target.rbi +30 -0
- data/rbi/workos/audit_logs.rbi +96 -0
- data/rbi/workos/audit_logs_retention.rbi +23 -0
- data/rbi/workos/audit_logs_retention_json.rbi +24 -0
- data/rbi/workos/authenticate_response.rbi +66 -0
- data/rbi/workos/authenticate_response_impersonator.rbi +30 -0
- data/rbi/workos/authenticate_response_oauth_token.rbi +48 -0
- data/rbi/workos/authentication_challenge.rbi +60 -0
- data/rbi/workos/authentication_challenge_verify_response.rbi +30 -0
- data/rbi/workos/authentication_challenges_verify_request.rbi +24 -0
- data/rbi/workos/authentication_email_verification_failed.rbi +54 -0
- data/rbi/workos/authentication_email_verification_failed_data.rbi +60 -0
- data/rbi/workos/authentication_email_verification_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_email_verification_succeeded.rbi +54 -0
- data/rbi/workos/authentication_email_verification_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_factor.rbi +66 -0
- data/rbi/workos/authentication_factor_enrolled.rbi +66 -0
- data/rbi/workos/authentication_factor_enrolled_sms.rbi +24 -0
- data/rbi/workos/authentication_factor_enrolled_totp.rbi +48 -0
- data/rbi/workos/authentication_factor_sms.rbi +24 -0
- data/rbi/workos/authentication_factor_totp.rbi +30 -0
- data/rbi/workos/authentication_factors_create_request.rbi +48 -0
- data/rbi/workos/authentication_magic_auth_failed.rbi +54 -0
- data/rbi/workos/authentication_magic_auth_failed_data.rbi +60 -0
- data/rbi/workos/authentication_magic_auth_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_magic_auth_succeeded.rbi +54 -0
- data/rbi/workos/authentication_magic_auth_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_mfa_failed.rbi +54 -0
- data/rbi/workos/authentication_mfa_failed_data.rbi +60 -0
- data/rbi/workos/authentication_mfa_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_mfa_succeeded.rbi +54 -0
- data/rbi/workos/authentication_mfa_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_oauth_failed.rbi +54 -0
- data/rbi/workos/authentication_oauth_failed_data.rbi +60 -0
- data/rbi/workos/authentication_oauth_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_oauth_succeeded.rbi +54 -0
- data/rbi/workos/authentication_oauth_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_passkey_failed.rbi +54 -0
- data/rbi/workos/authentication_passkey_failed_data.rbi +60 -0
- data/rbi/workos/authentication_passkey_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_passkey_succeeded.rbi +54 -0
- data/rbi/workos/authentication_passkey_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_password_failed.rbi +54 -0
- data/rbi/workos/authentication_password_failed_data.rbi +60 -0
- data/rbi/workos/authentication_password_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_password_succeeded.rbi +54 -0
- data/rbi/workos/authentication_password_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_radar_risk_detected.rbi +54 -0
- data/rbi/workos/authentication_radar_risk_detected_data.rbi +66 -0
- data/rbi/workos/authentication_sso_failed.rbi +54 -0
- data/rbi/workos/authentication_sso_failed_data.rbi +66 -0
- data/rbi/workos/authentication_sso_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_sso_failed_data_sso.rbi +36 -0
- data/rbi/workos/authentication_sso_started.rbi +54 -0
- data/rbi/workos/authentication_sso_started_data.rbi +60 -0
- data/rbi/workos/authentication_sso_started_data_sso.rbi +36 -0
- data/rbi/workos/authentication_sso_succeeded.rbi +54 -0
- data/rbi/workos/authentication_sso_succeeded_data.rbi +60 -0
- data/rbi/workos/authentication_sso_succeeded_data_sso.rbi +36 -0
- data/rbi/workos/authentication_sso_timed_out.rbi +54 -0
- data/rbi/workos/authentication_sso_timed_out_data.rbi +66 -0
- data/rbi/workos/authentication_sso_timed_out_data_error.rbi +30 -0
- data/rbi/workos/authentication_sso_timed_out_data_sso.rbi +36 -0
- data/rbi/workos/authorization.rbi +415 -0
- data/rbi/workos/authorization_check.rbi +24 -0
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/authorization_permission.rbi +72 -0
- data/rbi/workos/authorization_resource.rbi +78 -0
- data/rbi/workos/authorized_connect_application_list_data.rbi +48 -0
- data/rbi/workos/base_client.rbi +132 -0
- data/rbi/workos/challenge_authentication_factor.rbi +24 -0
- data/rbi/workos/check_authorization.rbi +42 -0
- data/rbi/workos/client.rbi +67 -0
- data/rbi/workos/configuration.rbi +68 -0
- data/rbi/workos/confirm_email_change.rbi +24 -0
- data/rbi/workos/connect.rbi +102 -0
- data/rbi/workos/connect_application.rbi +78 -0
- data/rbi/workos/connected_account.rbi +66 -0
- data/rbi/workos/connection.rbi +84 -0
- data/rbi/workos/connection_activated.rbi +54 -0
- data/rbi/workos/connection_activated_data.rbi +84 -0
- data/rbi/workos/connection_activated_data_domain.rbi +36 -0
- data/rbi/workos/connection_deactivated.rbi +54 -0
- data/rbi/workos/connection_deactivated_data.rbi +84 -0
- data/rbi/workos/connection_deactivated_data_domain.rbi +36 -0
- data/rbi/workos/connection_deleted.rbi +54 -0
- data/rbi/workos/connection_deleted_data.rbi +66 -0
- data/rbi/workos/connection_domain.rbi +36 -0
- data/rbi/workos/connection_option.rbi +24 -0
- data/rbi/workos/connection_saml_certificate_renewal_required.rbi +54 -0
- data/rbi/workos/connection_saml_certificate_renewal_required_data.rbi +36 -0
- data/rbi/workos/connection_saml_certificate_renewal_required_data_certificate.rbi +36 -0
- data/rbi/workos/connection_saml_certificate_renewal_required_data_connection.rbi +30 -0
- data/rbi/workos/connection_saml_certificate_renewed.rbi +54 -0
- data/rbi/workos/connection_saml_certificate_renewed_data.rbi +36 -0
- data/rbi/workos/connection_saml_certificate_renewed_data_certificate.rbi +30 -0
- data/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi +30 -0
- data/rbi/workos/cors_origin_response.rbi +48 -0
- data/rbi/workos/create_application_secret.rbi +18 -0
- data/rbi/workos/create_authorization_permission.rbi +42 -0
- data/rbi/workos/create_authorization_resource.rbi +66 -0
- data/rbi/workos/create_cors_origin.rbi +24 -0
- data/rbi/workos/create_group.rbi +30 -0
- data/rbi/workos/create_group_membership.rbi +24 -0
- data/rbi/workos/create_m2m_application.rbi +48 -0
- data/rbi/workos/create_magic_code_and_return.rbi +30 -0
- data/rbi/workos/create_oauth_application.rbi +66 -0
- data/rbi/workos/create_organization_api_key.rbi +30 -0
- data/rbi/workos/create_organization_domain.rbi +30 -0
- data/rbi/workos/create_organization_role.rbi +42 -0
- data/rbi/workos/create_password_reset.rbi +30 -0
- data/rbi/workos/create_password_reset_token.rbi +24 -0
- data/rbi/workos/create_redirect_uri.rbi +24 -0
- data/rbi/workos/create_role.rbi +42 -0
- data/rbi/workos/create_user.rbi +72 -0
- data/rbi/workos/create_user_invite_options.rbi +54 -0
- data/rbi/workos/create_user_organization_membership.rbi +42 -0
- data/rbi/workos/create_webhook_endpoint.rbi +30 -0
- data/rbi/workos/data_integration_access_token_response.rbi +36 -0
- data/rbi/workos/data_integration_access_token_response_access_token.rbi +48 -0
- data/rbi/workos/data_integration_authorize_url_response.rbi +24 -0
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +36 -0
- data/rbi/workos/data_integrations_get_user_token_request.rbi +30 -0
- data/rbi/workos/data_integrations_list_response.rbi +30 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +90 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +72 -0
- data/rbi/workos/device_authorization_response.rbi +54 -0
- data/rbi/workos/device_code_session_authenticate_request.rbi +54 -0
- data/rbi/workos/directory.rbi +84 -0
- data/rbi/workos/directory_group.rbi +72 -0
- data/rbi/workos/directory_metadata.rbi +30 -0
- data/rbi/workos/directory_metadata_user.rbi +30 -0
- data/rbi/workos/directory_sync.rbi +85 -0
- data/rbi/workos/directory_user.rbi +126 -0
- data/rbi/workos/directory_user_email.rbi +36 -0
- data/rbi/workos/directory_user_with_groups.rbi +132 -0
- data/rbi/workos/directory_user_with_groups_email.rbi +36 -0
- data/rbi/workos/domain_verification_intent_options.rbi +24 -0
- data/rbi/workos/dsync_activated.rbi +54 -0
- data/rbi/workos/dsync_activated_data.rbi +78 -0
- data/rbi/workos/dsync_activated_data_domain.rbi +36 -0
- data/rbi/workos/dsync_deactivated.rbi +54 -0
- data/rbi/workos/dsync_deactivated_data.rbi +78 -0
- data/rbi/workos/dsync_deactivated_data_domain.rbi +36 -0
- data/rbi/workos/dsync_deleted.rbi +54 -0
- data/rbi/workos/dsync_deleted_data.rbi +66 -0
- data/rbi/workos/dsync_group_created.rbi +54 -0
- data/rbi/workos/dsync_group_deleted.rbi +54 -0
- data/rbi/workos/dsync_group_updated.rbi +54 -0
- data/rbi/workos/dsync_group_updated_data.rbi +78 -0
- data/rbi/workos/dsync_group_user_added.rbi +54 -0
- data/rbi/workos/dsync_group_user_added_data.rbi +36 -0
- data/rbi/workos/dsync_group_user_removed.rbi +54 -0
- data/rbi/workos/dsync_group_user_removed_data.rbi +36 -0
- data/rbi/workos/dsync_user_created.rbi +54 -0
- data/rbi/workos/dsync_user_deleted.rbi +54 -0
- data/rbi/workos/dsync_user_updated.rbi +54 -0
- data/rbi/workos/dsync_user_updated_data.rbi +132 -0
- data/rbi/workos/dsync_user_updated_data_email.rbi +36 -0
- data/rbi/workos/email_change.rbi +48 -0
- data/rbi/workos/email_change_confirmation.rbi +30 -0
- data/rbi/workos/email_change_confirmation_user.rbi +96 -0
- data/rbi/workos/email_verification.rbi +66 -0
- data/rbi/workos/email_verification_code_session_authenticate_request.rbi +66 -0
- data/rbi/workos/email_verification_created.rbi +54 -0
- data/rbi/workos/email_verification_created_data.rbi +60 -0
- data/rbi/workos/encryptors/aes_gcm.rbi +19 -0
- data/rbi/workos/enroll_user_authentication_factor.rbi +42 -0
- data/rbi/workos/errors.rbi +43 -0
- data/rbi/workos/event_context.rbi +54 -0
- data/rbi/workos/event_context_actor.rbi +36 -0
- data/rbi/workos/event_context_google_analytics_session.rbi +36 -0
- data/rbi/workos/event_list_list_metadata.rbi +24 -0
- data/rbi/workos/event_schema.rbi +54 -0
- data/rbi/workos/events.rbi +28 -0
- data/rbi/workos/external_auth_complete_response.rbi +24 -0
- data/rbi/workos/feature_flag.rbi +84 -0
- data/rbi/workos/feature_flag_owner.rbi +36 -0
- data/rbi/workos/feature_flags.rbi +90 -0
- data/rbi/workos/flag.rbi +84 -0
- data/rbi/workos/flag_created.rbi +54 -0
- data/rbi/workos/flag_created_context.rbi +30 -0
- data/rbi/workos/flag_created_context_actor.rbi +36 -0
- data/rbi/workos/flag_created_data.rbi +90 -0
- data/rbi/workos/flag_created_data_owner.rbi +36 -0
- data/rbi/workos/flag_deleted.rbi +54 -0
- data/rbi/workos/flag_deleted_context.rbi +30 -0
- data/rbi/workos/flag_deleted_context_actor.rbi +36 -0
- data/rbi/workos/flag_deleted_data.rbi +90 -0
- data/rbi/workos/flag_deleted_data_owner.rbi +36 -0
- data/rbi/workos/flag_owner.rbi +36 -0
- data/rbi/workos/flag_rule_updated.rbi +54 -0
- data/rbi/workos/flag_rule_updated_context.rbi +48 -0
- data/rbi/workos/flag_rule_updated_context_actor.rbi +36 -0
- data/rbi/workos/flag_rule_updated_context_configured_target.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_configured_target_user.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_data.rbi +30 -0
- data/rbi/workos/flag_rule_updated_data.rbi +90 -0
- data/rbi/workos/flag_rule_updated_data_owner.rbi +36 -0
- data/rbi/workos/flag_updated.rbi +54 -0
- data/rbi/workos/flag_updated_context.rbi +36 -0
- data/rbi/workos/flag_updated_context_actor.rbi +36 -0
- data/rbi/workos/flag_updated_context_previous_attribute.rbi +24 -0
- data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +48 -0
- data/rbi/workos/flag_updated_data.rbi +90 -0
- data/rbi/workos/flag_updated_data_owner.rbi +36 -0
- data/rbi/workos/generate_link.rbi +54 -0
- data/rbi/workos/group.rbi +60 -0
- data/rbi/workos/group_created.rbi +54 -0
- data/rbi/workos/group_deleted.rbi +54 -0
- data/rbi/workos/group_member_added.rbi +54 -0
- data/rbi/workos/group_member_added_data.rbi +30 -0
- data/rbi/workos/group_member_removed.rbi +54 -0
- data/rbi/workos/group_member_removed_data.rbi +30 -0
- data/rbi/workos/group_updated.rbi +54 -0
- data/rbi/workos/groups.rbi +97 -0
- data/rbi/workos/hash_provider.rbi +18 -0
- data/rbi/workos/intent_options.rbi +30 -0
- data/rbi/workos/invitation.rbi +108 -0
- data/rbi/workos/invitation_accepted.rbi +54 -0
- data/rbi/workos/invitation_accepted_data.rbi +96 -0
- data/rbi/workos/invitation_created.rbi +54 -0
- data/rbi/workos/invitation_created_data.rbi +96 -0
- data/rbi/workos/invitation_resent.rbi +54 -0
- data/rbi/workos/invitation_resent_data.rbi +96 -0
- data/rbi/workos/invitation_revoked.rbi +54 -0
- data/rbi/workos/invitation_revoked_data.rbi +96 -0
- data/rbi/workos/jwks_response.rbi +24 -0
- data/rbi/workos/jwks_response_keys.rbi +66 -0
- data/rbi/workos/jwt_template_response.rbi +42 -0
- data/rbi/workos/magic_auth.rbi +66 -0
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/magic_auth_created.rbi +54 -0
- data/rbi/workos/magic_auth_created_data.rbi +60 -0
- data/rbi/workos/mfa_totp_session_authenticate_request.rbi +72 -0
- data/rbi/workos/multi_factor_auth.rbi +83 -0
- data/rbi/workos/new_connect_application_secret.rbi +60 -0
- data/rbi/workos/organization.rbi +78 -0
- data/rbi/workos/organization_created.rbi +54 -0
- data/rbi/workos/organization_created_data.rbi +72 -0
- data/rbi/workos/organization_created_data_domain.rbi +78 -0
- data/rbi/workos/organization_deleted.rbi +54 -0
- data/rbi/workos/organization_deleted_data.rbi +72 -0
- data/rbi/workos/organization_deleted_data_domain.rbi +78 -0
- data/rbi/workos/organization_domain.rbi +78 -0
- data/rbi/workos/organization_domain_created.rbi +54 -0
- data/rbi/workos/organization_domain_created_data.rbi +78 -0
- data/rbi/workos/organization_domain_data.rbi +30 -0
- data/rbi/workos/organization_domain_deleted.rbi +54 -0
- data/rbi/workos/organization_domain_deleted_data.rbi +78 -0
- data/rbi/workos/organization_domain_stand_alone.rbi +78 -0
- data/rbi/workos/organization_domain_updated.rbi +54 -0
- data/rbi/workos/organization_domain_updated_data.rbi +78 -0
- data/rbi/workos/organization_domain_verification_failed.rbi +54 -0
- data/rbi/workos/organization_domain_verification_failed_data.rbi +30 -0
- data/rbi/workos/organization_domain_verification_failed_data_organization_domain.rbi +78 -0
- data/rbi/workos/organization_domain_verified.rbi +54 -0
- data/rbi/workos/organization_domain_verified_data.rbi +78 -0
- data/rbi/workos/organization_domains.rbi +46 -0
- data/rbi/workos/organization_input.rbi +54 -0
- data/rbi/workos/organization_membership.rbi +84 -0
- data/rbi/workos/organization_membership_created.rbi +54 -0
- data/rbi/workos/organization_membership_created_data.rbi +84 -0
- data/rbi/workos/organization_membership_deleted.rbi +54 -0
- data/rbi/workos/organization_membership_deleted_data.rbi +84 -0
- data/rbi/workos/organization_membership_updated.rbi +54 -0
- data/rbi/workos/organization_membership_updated_data.rbi +84 -0
- data/rbi/workos/organization_role_created.rbi +54 -0
- data/rbi/workos/organization_role_created_data.rbi +72 -0
- data/rbi/workos/organization_role_deleted.rbi +54 -0
- data/rbi/workos/organization_role_deleted_data.rbi +72 -0
- data/rbi/workos/organization_role_updated.rbi +54 -0
- data/rbi/workos/organization_role_updated_data.rbi +72 -0
- data/rbi/workos/organization_selection_session_authenticate_request.rbi +66 -0
- data/rbi/workos/organization_updated.rbi +54 -0
- data/rbi/workos/organization_updated_data.rbi +72 -0
- data/rbi/workos/organization_updated_data_domain.rbi +78 -0
- data/rbi/workos/organizations.rbi +86 -0
- data/rbi/workos/password_reset.rbi +66 -0
- data/rbi/workos/password_reset_created.rbi +54 -0
- data/rbi/workos/password_reset_created_data.rbi +54 -0
- data/rbi/workos/password_reset_succeeded.rbi +54 -0
- data/rbi/workos/password_reset_succeeded_data.rbi +54 -0
- data/rbi/workos/password_session_authenticate_request.rbi +72 -0
- data/rbi/workos/passwordless.rbi +47 -0
- data/rbi/workos/permission.rbi +72 -0
- data/rbi/workos/permission_created.rbi +54 -0
- data/rbi/workos/permission_created_data.rbi +66 -0
- data/rbi/workos/permission_deleted.rbi +54 -0
- data/rbi/workos/permission_deleted_data.rbi +66 -0
- data/rbi/workos/permission_updated.rbi +54 -0
- data/rbi/workos/permission_updated_data.rbi +66 -0
- data/rbi/workos/pipes.rbi +63 -0
- data/rbi/workos/portal_link_response.rbi +24 -0
- data/rbi/workos/profile.rbi +102 -0
- data/rbi/workos/public_client.rbi +12 -0
- data/rbi/workos/radar.rbi +57 -0
- data/rbi/workos/radar_list_entry_already_present_response.rbi +24 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +60 -0
- data/rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi +24 -0
- data/rbi/workos/radar_standalone_response.rbi +48 -0
- data/rbi/workos/radar_standalone_update_radar_attempt_request.rbi +30 -0
- data/rbi/workos/radar_standalone_update_radar_list_request.rbi +24 -0
- data/rbi/workos/redirect_uri.rbi +54 -0
- data/rbi/workos/redirect_uri_input.rbi +30 -0
- data/rbi/workos/refresh_token_session_authenticate_request.rbi +66 -0
- data/rbi/workos/remove_role.rbi +42 -0
- data/rbi/workos/resend_user_invite_options.rbi +24 -0
- data/rbi/workos/reset_password_response.rbi +24 -0
- data/rbi/workos/revoke_session.rbi +30 -0
- data/rbi/workos/role.rbi +78 -0
- data/rbi/workos/role_assignment.rbi +54 -0
- data/rbi/workos/role_assignment_resource.rbi +36 -0
- data/rbi/workos/role_created.rbi +54 -0
- data/rbi/workos/role_created_data.rbi +54 -0
- data/rbi/workos/role_deleted.rbi +54 -0
- data/rbi/workos/role_deleted_data.rbi +54 -0
- data/rbi/workos/role_list.rbi +30 -0
- data/rbi/workos/role_updated.rbi +54 -0
- data/rbi/workos/role_updated_data.rbi +54 -0
- data/rbi/workos/send_email_change.rbi +24 -0
- data/rbi/workos/send_verification_email_response.rbi +24 -0
- data/rbi/workos/session.rbi +43 -0
- data/rbi/workos/session_created.rbi +54 -0
- data/rbi/workos/session_created_data.rbi +96 -0
- data/rbi/workos/session_created_data_impersonator.rbi +30 -0
- data/rbi/workos/session_manager.rbi +154 -0
- data/rbi/workos/session_revoked.rbi +54 -0
- data/rbi/workos/session_revoked_data.rbi +96 -0
- data/rbi/workos/session_revoked_data_impersonator.rbi +30 -0
- data/rbi/workos/set_role_permissions.rbi +24 -0
- data/rbi/workos/slim_role.rbi +24 -0
- data/rbi/workos/sso.rbi +67 -0
- data/rbi/workos/sso_authorize_url_response.rbi +24 -0
- data/rbi/workos/sso_device_authorization_request.rbi +24 -0
- data/rbi/workos/sso_intent_options.rbi +30 -0
- data/rbi/workos/sso_logout_authorize_request.rbi +24 -0
- data/rbi/workos/sso_logout_authorize_response.rbi +30 -0
- data/rbi/workos/sso_token_response.rbi +48 -0
- data/rbi/workos/sso_token_response_oauth_token.rbi +48 -0
- data/rbi/workos/token_query.rbi +42 -0
- data/rbi/workos/types/api_response.rbi +29 -0
- data/rbi/workos/types/base_model.rbi +22 -0
- data/rbi/workos/types/list_struct.rbi +89 -0
- data/rbi/workos/types/request_options.rbi +12 -0
- data/rbi/workos/update_audit_logs_retention.rbi +24 -0
- data/rbi/workos/update_authorization_permission.rbi +30 -0
- data/rbi/workos/update_authorization_resource.rbi +48 -0
- data/rbi/workos/update_group.rbi +30 -0
- data/rbi/workos/update_jwt_template.rbi +24 -0
- data/rbi/workos/update_oauth_application.rbi +42 -0
- data/rbi/workos/update_organization.rbi +60 -0
- data/rbi/workos/update_organization_role.rbi +30 -0
- data/rbi/workos/update_role.rbi +30 -0
- data/rbi/workos/update_user.rbi +78 -0
- data/rbi/workos/update_user_organization_membership.rbi +30 -0
- data/rbi/workos/update_webhook_endpoint.rbi +36 -0
- data/rbi/workos/user.rbi +96 -0
- data/rbi/workos/user_authentication_factor_enroll_response.rbi +30 -0
- data/rbi/workos/user_consent_option.rbi +42 -0
- data/rbi/workos/user_consent_option_choice.rbi +30 -0
- data/rbi/workos/user_created.rbi +54 -0
- data/rbi/workos/user_deleted.rbi +54 -0
- data/rbi/workos/user_identities_get_item.rbi +36 -0
- data/rbi/workos/user_invite.rbi +108 -0
- data/rbi/workos/user_management.rbi +410 -0
- data/rbi/workos/user_management_login_request.rbi +36 -0
- data/rbi/workos/user_management_organization_membership_groups.rbi +25 -0
- data/rbi/workos/user_object.rbi +48 -0
- data/rbi/workos/user_organization_membership.rbi +84 -0
- data/rbi/workos/user_organization_membership_base_list_data.rbi +78 -0
- data/rbi/workos/user_sessions_impersonator.rbi +30 -0
- data/rbi/workos/user_sessions_list_item.rbi +96 -0
- data/rbi/workos/user_updated.rbi +54 -0
- data/rbi/workos/util.rbi +12 -0
- data/rbi/workos/validate_api_key.rbi +24 -0
- data/rbi/workos/vault.rbi +137 -0
- data/rbi/workos/vault_byok_key_verification_completed.rbi +54 -0
- data/rbi/workos/vault_byok_key_verification_completed_data.rbi +36 -0
- data/rbi/workos/vault_data_created.rbi +54 -0
- data/rbi/workos/vault_data_created_data.rbi +54 -0
- data/rbi/workos/vault_data_deleted.rbi +54 -0
- data/rbi/workos/vault_data_deleted_data.rbi +42 -0
- data/rbi/workos/vault_data_read.rbi +54 -0
- data/rbi/workos/vault_data_read_data.rbi +48 -0
- data/rbi/workos/vault_data_updated.rbi +54 -0
- data/rbi/workos/vault_data_updated_data.rbi +54 -0
- data/rbi/workos/vault_dek_decrypted.rbi +54 -0
- data/rbi/workos/vault_dek_decrypted_data.rbi +42 -0
- data/rbi/workos/vault_dek_read.rbi +54 -0
- data/rbi/workos/vault_dek_read_data.rbi +48 -0
- data/rbi/workos/vault_kek_created.rbi +54 -0
- data/rbi/workos/vault_kek_created_data.rbi +48 -0
- data/rbi/workos/vault_metadata_read.rbi +54 -0
- data/rbi/workos/vault_metadata_read_data.rbi +42 -0
- data/rbi/workos/vault_names_listed.rbi +54 -0
- data/rbi/workos/vault_names_listed_data.rbi +36 -0
- data/rbi/workos/verify_email_address.rbi +24 -0
- data/rbi/workos/verify_email_response.rbi +24 -0
- data/rbi/workos/waitlist_user.rbi +60 -0
- data/rbi/workos/waitlist_user_approved.rbi +54 -0
- data/rbi/workos/waitlist_user_created.rbi +54 -0
- data/rbi/workos/waitlist_user_denied.rbi +54 -0
- data/rbi/workos/webhook_endpoint.rbi +65 -0
- data/rbi/workos/webhook_endpoint_json.rbi +66 -0
- data/rbi/workos/webhooks.rbi +52 -0
- data/rbi/workos/widget_session_token.rbi +36 -0
- data/rbi/workos/widget_session_token_response.rbi +24 -0
- data/rbi/workos/widgets.rbi +23 -0
- data/renovate.json +34 -0
- data/script/ci +16 -0
- data/test/test_helper.rb +20 -0
- data/test/workos/test_actions.rb +78 -0
- data/test/workos/test_admin_portal.rb +33 -0
- data/test/workos/test_api_keys.rb +57 -0
- data/test/workos/test_audit_logs.rb +89 -0
- data/test/workos/test_authkit_helpers.rb +109 -0
- data/test/workos/test_authorization.rb +321 -0
- data/test/workos/test_base_client.rb +173 -0
- data/test/workos/test_connect.rb +127 -0
- data/test/workos/test_directory_sync.rb +81 -0
- data/test/workos/test_encryptors_aes_gcm.rb +54 -0
- data/test/workos/test_events.rb +33 -0
- data/test/workos/test_feature_flags.rb +89 -0
- data/test/workos/test_groups.rb +89 -0
- data/test/workos/test_list_struct.rb +39 -0
- data/test/workos/test_model_round_trip.rb +7142 -0
- data/test/workos/test_multi_factor_auth.rb +81 -0
- data/test/workos/test_organization_domains.rb +57 -0
- data/test/workos/test_organizations.rb +81 -0
- data/test/workos/test_passwordless.rb +59 -0
- data/test/workos/test_pipes.rb +65 -0
- data/test/workos/test_pkce.rb +40 -0
- data/test/workos/test_public_client.rb +38 -0
- data/test/workos/test_radar.rb +57 -0
- data/test/workos/test_session.rb +261 -0
- data/test/workos/test_sso.rb +73 -0
- data/test/workos/test_sso_helpers.rb +80 -0
- data/test/workos/test_sso_runtime.rb +45 -0
- data/test/workos/test_user_management.rb +473 -0
- data/test/workos/test_user_management_organization_membership_groups.rb +33 -0
- data/test/workos/test_vault.rb +151 -0
- data/test/workos/test_webhook_verify.rb +84 -0
- data/test/workos/test_webhooks.rb +57 -0
- data/test/workos/test_widgets.rb +33 -0
- data/workos.gemspec +22 -21
- metadata +1117 -508
- data/.rspec +0 -1
- data/.rubocop.yml +0 -34
- data/.rubocop_todo.yml +0 -94
- data/lib/workos/audit_log_export.rb +0 -32
- data/lib/workos/authentication_factor_and_challenge.rb +0 -28
- data/lib/workos/authentication_response.rb +0 -62
- data/lib/workos/cache.rb +0 -94
- data/lib/workos/challenge.rb +0 -36
- data/lib/workos/connection.rb +0 -42
- data/lib/workos/deprecated_hash_wrapper.rb +0 -76
- data/lib/workos/deprecation.rb +0 -16
- data/lib/workos/directory.rb +0 -38
- data/lib/workos/directory_group.rb +0 -41
- data/lib/workos/directory_user.rb +0 -93
- data/lib/workos/email_verification.rb +0 -37
- data/lib/workos/event.rb +0 -30
- data/lib/workos/factor.rb +0 -35
- data/lib/workos/feature_flag.rb +0 -34
- data/lib/workos/impersonator.rb +0 -23
- data/lib/workos/invitation.rb +0 -49
- data/lib/workos/magic_auth.rb +0 -37
- data/lib/workos/mfa.rb +0 -136
- data/lib/workos/oauth_tokens.rb +0 -29
- data/lib/workos/organization.rb +0 -47
- data/lib/workos/organization_membership.rb +0 -43
- data/lib/workos/password_reset.rb +0 -37
- data/lib/workos/portal.rb +0 -54
- data/lib/workos/profile.rb +0 -57
- data/lib/workos/profile_and_token.rb +0 -26
- data/lib/workos/refresh_authentication_response.rb +0 -51
- data/lib/workos/role.rb +0 -38
- data/lib/workos/types/intent.rb +0 -18
- data/lib/workos/types/passwordless_session_struct.rb +0 -18
- data/lib/workos/types/provider.rb +0 -16
- data/lib/workos/types/widget_scope.rb +0 -15
- data/lib/workos/types.rb +0 -12
- data/lib/workos/user.rb +0 -45
- data/lib/workos/user_and_token.rb +0 -26
- data/lib/workos/user_management/session.rb +0 -57
- data/lib/workos/user_response.rb +0 -22
- data/lib/workos/verify_challenge.rb +0 -25
- data/lib/workos/webhook.rb +0 -30
- data/spec/lib/workos/audit_logs_spec.rb +0 -150
- data/spec/lib/workos/cache_spec.rb +0 -94
- data/spec/lib/workos/client.rb +0 -67
- data/spec/lib/workos/configuration_spec.rb +0 -60
- data/spec/lib/workos/directory_sync_spec.rb +0 -483
- data/spec/lib/workos/directory_user_spec.rb +0 -61
- data/spec/lib/workos/encryptors/aes_gcm_spec.rb +0 -41
- data/spec/lib/workos/event_spec.rb +0 -109
- data/spec/lib/workos/mfa_spec.rb +0 -285
- data/spec/lib/workos/organizations_spec.rb +0 -569
- data/spec/lib/workos/passwordless_spec.rb +0 -76
- data/spec/lib/workos/portal_spec.rb +0 -116
- data/spec/lib/workos/role_spec.rb +0 -142
- data/spec/lib/workos/session_spec.rb +0 -475
- data/spec/lib/workos/sso_spec.rb +0 -756
- data/spec/lib/workos/user_management_spec.rb +0 -1999
- data/spec/lib/workos/webhooks_spec.rb +0 -235
- data/spec/lib/workos/widgets_spec.rb +0 -73
- data/spec/spec_helper.rb +0 -53
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event.yml +0 -59
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_custom_idempotency_key.yml +0 -60
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_invalid.yml +0 -59
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml +0 -77
- data/spec/support/fixtures/vcr_cassettes/audit_logs/get_export.yml +0 -73
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml +0 -65
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml +0 -67
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml +0 -68
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml +0 -131
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml +0 -134
- data/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml +0 -61
- data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +0 -66
- data/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml +0 -62
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml +0 -62
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +0 -87
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +0 -89
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +0 -85
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +0 -93
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +0 -85
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +0 -186
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +0 -88
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +0 -194
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +0 -186
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +0 -189
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml +0 -75
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_organization_id.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_expired.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_invalid.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/organization/create.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_domain_data.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_domains.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml +0 -155
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml +0 -154
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_external_id.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml +0 -79
- data/spec/support/fixtures/vcr_cassettes/organization/create_without_domains.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/organization/delete.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +0 -87
- data/spec/support/fixtures/vcr_cassettes/organization/list_organization_feature_flags.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/organization/update_with_external_id.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/update_with_external_id_null.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/update_with_stripe_customer_id.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml +0 -85
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml +0 -73
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml +0 -73
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_certificate_renewal.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_domain_verification.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml +0 -70
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +0 -89
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/profile.yml +0 -74
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_oauth_tokens.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/invalid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/unverified.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid_multiple_roles.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/create_user_with_external_id.yml +0 -77
- data/spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml +0 -64
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_user.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_statuses_option.yml +0 -64
- data/spec/support/fixtures/vcr_cassettes/user_management/list_sessions/valid.yml +0 -38
- data/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/reactivate_organization_membership.yml +0 -64
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/accepted.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/expired.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/revoked.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/valid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid_multiple_roles.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/locale.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user_external_id_null.yml +0 -77
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/widgets/get_token.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/widgets/get_token_invalid_organization_id.yml +0 -74
- data/spec/support/fixtures/vcr_cassettes/widgets/get_token_invalid_user_id.yml +0 -74
- data/spec/support/profile.txt +0 -1
- data/spec/support/shared_examples/client.rb +0 -29
- data/spec/support/webhook_payload.txt +0 -1
|
@@ -0,0 +1,1283 @@
|
|
|
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 Authorization
|
|
9
|
+
def initialize(client)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Check authorization
|
|
14
|
+
# @param organization_membership_id [String] The ID of the organization membership to check.
|
|
15
|
+
# @param permission_slug [String] The slug of the permission to check.
|
|
16
|
+
# @param resource_id [String, nil] The ID of the resource. Mutually exclusive with `resource_external_id` and `resource_type_slug`.
|
|
17
|
+
# @param resource_external_id [String, nil] The external ID of the resource. Required with `resource_type_slug`. Mutually exclusive with `resource_id`.
|
|
18
|
+
# @param resource_type_slug [String, nil] The slug of the resource type. Required with `resource_external_id`. Mutually exclusive with `resource_id`.
|
|
19
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
20
|
+
# @return [WorkOS::AuthorizationCheck]
|
|
21
|
+
def check(
|
|
22
|
+
organization_membership_id:,
|
|
23
|
+
permission_slug:,
|
|
24
|
+
resource_target:,
|
|
25
|
+
resource_id: nil,
|
|
26
|
+
resource_external_id: nil,
|
|
27
|
+
resource_type_slug: nil,
|
|
28
|
+
request_options: {}
|
|
29
|
+
)
|
|
30
|
+
body = {
|
|
31
|
+
"permission_slug" => permission_slug,
|
|
32
|
+
"resource_id" => resource_id,
|
|
33
|
+
"resource_external_id" => resource_external_id,
|
|
34
|
+
"resource_type_slug" => resource_type_slug
|
|
35
|
+
}.compact
|
|
36
|
+
case resource_target[:type]
|
|
37
|
+
when "by_id"
|
|
38
|
+
body["resource_id"] = resource_target[:resource_id]
|
|
39
|
+
when "by_external_id"
|
|
40
|
+
body["resource_external_id"] = resource_target[:resource_external_id]
|
|
41
|
+
body["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
42
|
+
end
|
|
43
|
+
response = @client.request(
|
|
44
|
+
method: :post,
|
|
45
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/check",
|
|
46
|
+
auth: true,
|
|
47
|
+
body: body,
|
|
48
|
+
request_options: request_options
|
|
49
|
+
)
|
|
50
|
+
result = WorkOS::AuthorizationCheck.new(response.body)
|
|
51
|
+
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"])
|
|
52
|
+
result
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List resources for organization membership
|
|
56
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
57
|
+
# @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"`.
|
|
58
|
+
# @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"`.
|
|
59
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
60
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
61
|
+
# @param permission_slug [String] The permission slug to filter by. Only child resources where the organization membership has this permission are returned.
|
|
62
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
63
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationResource>]
|
|
64
|
+
def list_resources_for_membership(
|
|
65
|
+
organization_membership_id:,
|
|
66
|
+
permission_slug:,
|
|
67
|
+
parent_resource:,
|
|
68
|
+
before: nil,
|
|
69
|
+
after: nil,
|
|
70
|
+
limit: nil,
|
|
71
|
+
order: "desc",
|
|
72
|
+
request_options: {}
|
|
73
|
+
)
|
|
74
|
+
params = {
|
|
75
|
+
"before" => before,
|
|
76
|
+
"after" => after,
|
|
77
|
+
"limit" => limit,
|
|
78
|
+
"order" => order,
|
|
79
|
+
"permission_slug" => permission_slug
|
|
80
|
+
}.compact
|
|
81
|
+
case parent_resource[:type]
|
|
82
|
+
when "by_id"
|
|
83
|
+
params["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
84
|
+
when "by_external_id"
|
|
85
|
+
params["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
86
|
+
params["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
87
|
+
end
|
|
88
|
+
response = @client.request(
|
|
89
|
+
method: :get,
|
|
90
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/resources",
|
|
91
|
+
auth: true,
|
|
92
|
+
params: params,
|
|
93
|
+
request_options: request_options
|
|
94
|
+
)
|
|
95
|
+
fetch_next = ->(cursor) {
|
|
96
|
+
list_resources_for_membership(
|
|
97
|
+
organization_membership_id: organization_membership_id,
|
|
98
|
+
before: before,
|
|
99
|
+
after: cursor,
|
|
100
|
+
limit: limit,
|
|
101
|
+
order: order,
|
|
102
|
+
permission_slug: permission_slug,
|
|
103
|
+
parent_resource: parent_resource,
|
|
104
|
+
request_options: request_options
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
WorkOS::Types::ListStruct.from_response(
|
|
108
|
+
response,
|
|
109
|
+
model: WorkOS::AuthorizationResource,
|
|
110
|
+
filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order, permission_slug: permission_slug, parent_resource: parent_resource},
|
|
111
|
+
fetch_next: fetch_next
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# List effective permissions for an organization membership on a resource
|
|
116
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
117
|
+
# @param resource_id [String] The ID of the authorization resource.
|
|
118
|
+
# @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"`.
|
|
119
|
+
# @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"`.
|
|
120
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
121
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
122
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
123
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
124
|
+
def list_effective_permissions(
|
|
125
|
+
organization_membership_id:,
|
|
126
|
+
resource_id:,
|
|
127
|
+
before: nil,
|
|
128
|
+
after: nil,
|
|
129
|
+
limit: nil,
|
|
130
|
+
order: "desc",
|
|
131
|
+
request_options: {}
|
|
132
|
+
)
|
|
133
|
+
params = {
|
|
134
|
+
"before" => before,
|
|
135
|
+
"after" => after,
|
|
136
|
+
"limit" => limit,
|
|
137
|
+
"order" => order
|
|
138
|
+
}.compact
|
|
139
|
+
response = @client.request(
|
|
140
|
+
method: :get,
|
|
141
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/resources/#{WorkOS::Util.encode_path(resource_id)}/permissions",
|
|
142
|
+
auth: true,
|
|
143
|
+
params: params,
|
|
144
|
+
request_options: request_options
|
|
145
|
+
)
|
|
146
|
+
fetch_next = ->(cursor) {
|
|
147
|
+
list_effective_permissions(
|
|
148
|
+
organization_membership_id: organization_membership_id,
|
|
149
|
+
resource_id: resource_id,
|
|
150
|
+
before: before,
|
|
151
|
+
after: cursor,
|
|
152
|
+
limit: limit,
|
|
153
|
+
order: order,
|
|
154
|
+
request_options: request_options
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
WorkOS::Types::ListStruct.from_response(
|
|
158
|
+
response,
|
|
159
|
+
model: WorkOS::AuthorizationPermission,
|
|
160
|
+
filters: {organization_membership_id: organization_membership_id, resource_id: resource_id, before: before, limit: limit, order: order},
|
|
161
|
+
fetch_next: fetch_next
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# List effective permissions for an organization membership on a resource by external ID
|
|
166
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
167
|
+
# @param resource_type_slug [String] The slug of the resource type.
|
|
168
|
+
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
169
|
+
# @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"`.
|
|
170
|
+
# @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"`.
|
|
171
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
172
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
173
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
174
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
175
|
+
def list_effective_permissions_by_external_id(
|
|
176
|
+
organization_membership_id:,
|
|
177
|
+
resource_type_slug:,
|
|
178
|
+
external_id:,
|
|
179
|
+
before: nil,
|
|
180
|
+
after: nil,
|
|
181
|
+
limit: nil,
|
|
182
|
+
order: "desc",
|
|
183
|
+
request_options: {}
|
|
184
|
+
)
|
|
185
|
+
params = {
|
|
186
|
+
"before" => before,
|
|
187
|
+
"after" => after,
|
|
188
|
+
"limit" => limit,
|
|
189
|
+
"order" => order
|
|
190
|
+
}.compact
|
|
191
|
+
response = @client.request(
|
|
192
|
+
method: :get,
|
|
193
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/permissions",
|
|
194
|
+
auth: true,
|
|
195
|
+
params: params,
|
|
196
|
+
request_options: request_options
|
|
197
|
+
)
|
|
198
|
+
fetch_next = ->(cursor) {
|
|
199
|
+
list_effective_permissions_by_external_id(
|
|
200
|
+
organization_membership_id: organization_membership_id,
|
|
201
|
+
resource_type_slug: resource_type_slug,
|
|
202
|
+
external_id: external_id,
|
|
203
|
+
before: before,
|
|
204
|
+
after: cursor,
|
|
205
|
+
limit: limit,
|
|
206
|
+
order: order,
|
|
207
|
+
request_options: request_options
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
WorkOS::Types::ListStruct.from_response(
|
|
211
|
+
response,
|
|
212
|
+
model: WorkOS::AuthorizationPermission,
|
|
213
|
+
filters: {organization_membership_id: organization_membership_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order},
|
|
214
|
+
fetch_next: fetch_next
|
|
215
|
+
)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# List role assignments
|
|
219
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
220
|
+
# @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"`.
|
|
221
|
+
# @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"`.
|
|
222
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
223
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
224
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
225
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::RoleAssignment>]
|
|
226
|
+
def list_role_assignments(
|
|
227
|
+
organization_membership_id:,
|
|
228
|
+
before: nil,
|
|
229
|
+
after: nil,
|
|
230
|
+
limit: nil,
|
|
231
|
+
order: "desc",
|
|
232
|
+
request_options: {}
|
|
233
|
+
)
|
|
234
|
+
params = {
|
|
235
|
+
"before" => before,
|
|
236
|
+
"after" => after,
|
|
237
|
+
"limit" => limit,
|
|
238
|
+
"order" => order
|
|
239
|
+
}.compact
|
|
240
|
+
response = @client.request(
|
|
241
|
+
method: :get,
|
|
242
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments",
|
|
243
|
+
auth: true,
|
|
244
|
+
params: params,
|
|
245
|
+
request_options: request_options
|
|
246
|
+
)
|
|
247
|
+
fetch_next = ->(cursor) {
|
|
248
|
+
list_role_assignments(
|
|
249
|
+
organization_membership_id: organization_membership_id,
|
|
250
|
+
before: before,
|
|
251
|
+
after: cursor,
|
|
252
|
+
limit: limit,
|
|
253
|
+
order: order,
|
|
254
|
+
request_options: request_options
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
WorkOS::Types::ListStruct.from_response(
|
|
258
|
+
response,
|
|
259
|
+
model: WorkOS::RoleAssignment,
|
|
260
|
+
filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order},
|
|
261
|
+
fetch_next: fetch_next
|
|
262
|
+
)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Assign a role
|
|
266
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
267
|
+
# @param role_slug [String] The slug of the role to assign.
|
|
268
|
+
# @param resource_id [String, nil] The ID of the resource. Mutually exclusive with `resource_external_id` and `resource_type_slug`.
|
|
269
|
+
# @param resource_external_id [String, nil] The external ID of the resource. Required with `resource_type_slug`. Mutually exclusive with `resource_id`.
|
|
270
|
+
# @param resource_type_slug [String, nil] The resource type slug. Required with `resource_external_id`. Mutually exclusive with `resource_id`.
|
|
271
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
272
|
+
# @return [WorkOS::RoleAssignment]
|
|
273
|
+
def assign_role(
|
|
274
|
+
organization_membership_id:,
|
|
275
|
+
role_slug:,
|
|
276
|
+
resource_target:,
|
|
277
|
+
resource_id: nil,
|
|
278
|
+
resource_external_id: nil,
|
|
279
|
+
resource_type_slug: nil,
|
|
280
|
+
request_options: {}
|
|
281
|
+
)
|
|
282
|
+
body = {
|
|
283
|
+
"role_slug" => role_slug,
|
|
284
|
+
"resource_id" => resource_id,
|
|
285
|
+
"resource_external_id" => resource_external_id,
|
|
286
|
+
"resource_type_slug" => resource_type_slug
|
|
287
|
+
}.compact
|
|
288
|
+
case resource_target[:type]
|
|
289
|
+
when "by_id"
|
|
290
|
+
body["resource_id"] = resource_target[:resource_id]
|
|
291
|
+
when "by_external_id"
|
|
292
|
+
body["resource_external_id"] = resource_target[:resource_external_id]
|
|
293
|
+
body["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
294
|
+
end
|
|
295
|
+
response = @client.request(
|
|
296
|
+
method: :post,
|
|
297
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments",
|
|
298
|
+
auth: true,
|
|
299
|
+
body: body,
|
|
300
|
+
request_options: request_options
|
|
301
|
+
)
|
|
302
|
+
result = WorkOS::RoleAssignment.new(response.body)
|
|
303
|
+
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"])
|
|
304
|
+
result
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
# Remove a role assignment
|
|
308
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
309
|
+
# @param role_slug [String] The slug of the role to remove.
|
|
310
|
+
# @param resource_id [String, nil] The ID of the resource. Mutually exclusive with `resource_external_id` and `resource_type_slug`.
|
|
311
|
+
# @param resource_external_id [String, nil] The external ID of the resource. Required with `resource_type_slug`. Mutually exclusive with `resource_id`.
|
|
312
|
+
# @param resource_type_slug [String, nil] The resource type slug. Required with `resource_external_id`. Mutually exclusive with `resource_id`.
|
|
313
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
314
|
+
# @return [void]
|
|
315
|
+
def remove_role(
|
|
316
|
+
organization_membership_id:,
|
|
317
|
+
role_slug:,
|
|
318
|
+
resource_target:,
|
|
319
|
+
resource_id: nil,
|
|
320
|
+
resource_external_id: nil,
|
|
321
|
+
resource_type_slug: nil,
|
|
322
|
+
request_options: {}
|
|
323
|
+
)
|
|
324
|
+
params = {}.compact
|
|
325
|
+
case resource_target[:type]
|
|
326
|
+
when "by_id"
|
|
327
|
+
params["resource_id"] = resource_target[:resource_id]
|
|
328
|
+
when "by_external_id"
|
|
329
|
+
params["resource_external_id"] = resource_target[:resource_external_id]
|
|
330
|
+
params["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
331
|
+
end
|
|
332
|
+
body = {
|
|
333
|
+
"role_slug" => role_slug,
|
|
334
|
+
"resource_id" => resource_id,
|
|
335
|
+
"resource_external_id" => resource_external_id,
|
|
336
|
+
"resource_type_slug" => resource_type_slug
|
|
337
|
+
}.compact
|
|
338
|
+
@client.request(
|
|
339
|
+
method: :delete,
|
|
340
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments",
|
|
341
|
+
auth: true,
|
|
342
|
+
params: params,
|
|
343
|
+
body: body,
|
|
344
|
+
request_options: request_options
|
|
345
|
+
)
|
|
346
|
+
nil
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Remove a role assignment by ID
|
|
350
|
+
# @param organization_membership_id [String] The ID of the organization membership.
|
|
351
|
+
# @param role_assignment_id [String] The ID of the role assignment to remove.
|
|
352
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
353
|
+
# @return [void]
|
|
354
|
+
def remove_role_assignment(
|
|
355
|
+
organization_membership_id:,
|
|
356
|
+
role_assignment_id:,
|
|
357
|
+
request_options: {}
|
|
358
|
+
)
|
|
359
|
+
@client.request(
|
|
360
|
+
method: :delete,
|
|
361
|
+
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}",
|
|
362
|
+
auth: true,
|
|
363
|
+
request_options: request_options
|
|
364
|
+
)
|
|
365
|
+
nil
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# List custom roles
|
|
369
|
+
# @param organization_id [String] The ID of the organization.
|
|
370
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
371
|
+
# @return [WorkOS::RoleList]
|
|
372
|
+
def list_organization_roles(
|
|
373
|
+
organization_id:,
|
|
374
|
+
request_options: {}
|
|
375
|
+
)
|
|
376
|
+
response = @client.request(
|
|
377
|
+
method: :get,
|
|
378
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles",
|
|
379
|
+
auth: true,
|
|
380
|
+
request_options: request_options
|
|
381
|
+
)
|
|
382
|
+
result = WorkOS::RoleList.new(response.body)
|
|
383
|
+
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"])
|
|
384
|
+
result
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Create a custom role
|
|
388
|
+
# @param organization_id [String] The ID of the organization.
|
|
389
|
+
# @param slug [String, nil] A unique identifier for the role within the organization. When provided, must begin with 'org-' and contain only lowercase letters, numbers, hyphens, and underscores. When omitted, a slug is auto-generated from the role name and a random suffix.
|
|
390
|
+
# @param name [String] A descriptive name for the role.
|
|
391
|
+
# @param description [String, nil] An optional description of the role's purpose.
|
|
392
|
+
# @param resource_type_slug [String, nil] The slug of the resource type the role is scoped to.
|
|
393
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
394
|
+
# @return [WorkOS::Role]
|
|
395
|
+
def create_organization_role(
|
|
396
|
+
organization_id:,
|
|
397
|
+
name:,
|
|
398
|
+
slug: nil,
|
|
399
|
+
description: nil,
|
|
400
|
+
resource_type_slug: nil,
|
|
401
|
+
request_options: {}
|
|
402
|
+
)
|
|
403
|
+
body = {
|
|
404
|
+
"slug" => slug,
|
|
405
|
+
"name" => name,
|
|
406
|
+
"description" => description,
|
|
407
|
+
"resource_type_slug" => resource_type_slug
|
|
408
|
+
}.compact
|
|
409
|
+
response = @client.request(
|
|
410
|
+
method: :post,
|
|
411
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles",
|
|
412
|
+
auth: true,
|
|
413
|
+
body: body,
|
|
414
|
+
request_options: request_options
|
|
415
|
+
)
|
|
416
|
+
result = WorkOS::Role.new(response.body)
|
|
417
|
+
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"])
|
|
418
|
+
result
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
# Get a custom role
|
|
422
|
+
# @param organization_id [String] The ID of the organization.
|
|
423
|
+
# @param slug [String] The slug of the role.
|
|
424
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
425
|
+
# @return [WorkOS::Role]
|
|
426
|
+
def get_organization_role(
|
|
427
|
+
organization_id:,
|
|
428
|
+
slug:,
|
|
429
|
+
request_options: {}
|
|
430
|
+
)
|
|
431
|
+
response = @client.request(
|
|
432
|
+
method: :get,
|
|
433
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}",
|
|
434
|
+
auth: true,
|
|
435
|
+
request_options: request_options
|
|
436
|
+
)
|
|
437
|
+
result = WorkOS::Role.new(response.body)
|
|
438
|
+
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"])
|
|
439
|
+
result
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
# Update a custom role
|
|
443
|
+
# @param organization_id [String] The ID of the organization.
|
|
444
|
+
# @param slug [String] The slug of the role.
|
|
445
|
+
# @param name [String, nil] A descriptive name for the role.
|
|
446
|
+
# @param description [String, nil] An optional description of the role's purpose.
|
|
447
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
448
|
+
# @return [WorkOS::Role]
|
|
449
|
+
def update_organization_role(
|
|
450
|
+
organization_id:,
|
|
451
|
+
slug:,
|
|
452
|
+
name: nil,
|
|
453
|
+
description: nil,
|
|
454
|
+
request_options: {}
|
|
455
|
+
)
|
|
456
|
+
body = {
|
|
457
|
+
"name" => name,
|
|
458
|
+
"description" => description
|
|
459
|
+
}.compact
|
|
460
|
+
response = @client.request(
|
|
461
|
+
method: :patch,
|
|
462
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}",
|
|
463
|
+
auth: true,
|
|
464
|
+
body: body,
|
|
465
|
+
request_options: request_options
|
|
466
|
+
)
|
|
467
|
+
result = WorkOS::Role.new(response.body)
|
|
468
|
+
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"])
|
|
469
|
+
result
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Delete a custom role
|
|
473
|
+
# @param organization_id [String] The ID of the organization.
|
|
474
|
+
# @param slug [String] The slug of the role.
|
|
475
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
476
|
+
# @return [void]
|
|
477
|
+
def delete_organization_role(
|
|
478
|
+
organization_id:,
|
|
479
|
+
slug:,
|
|
480
|
+
request_options: {}
|
|
481
|
+
)
|
|
482
|
+
@client.request(
|
|
483
|
+
method: :delete,
|
|
484
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}",
|
|
485
|
+
auth: true,
|
|
486
|
+
request_options: request_options
|
|
487
|
+
)
|
|
488
|
+
nil
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# Add a permission to a custom role
|
|
492
|
+
# @param organization_id [String] The ID of the organization.
|
|
493
|
+
# @param slug [String] The slug of the role.
|
|
494
|
+
# @param body_slug [String] The slug of the permission to add to the role.
|
|
495
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
496
|
+
# @return [WorkOS::Role]
|
|
497
|
+
def add_organization_role_permission(
|
|
498
|
+
organization_id:,
|
|
499
|
+
slug:,
|
|
500
|
+
body_slug:,
|
|
501
|
+
request_options: {}
|
|
502
|
+
)
|
|
503
|
+
body = {
|
|
504
|
+
"slug" => body_slug
|
|
505
|
+
}.compact
|
|
506
|
+
response = @client.request(
|
|
507
|
+
method: :post,
|
|
508
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}/permissions",
|
|
509
|
+
auth: true,
|
|
510
|
+
body: body,
|
|
511
|
+
request_options: request_options
|
|
512
|
+
)
|
|
513
|
+
result = WorkOS::Role.new(response.body)
|
|
514
|
+
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"])
|
|
515
|
+
result
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
# Set permissions for a custom role
|
|
519
|
+
# @param organization_id [String] The ID of the organization.
|
|
520
|
+
# @param slug [String] The slug of the role.
|
|
521
|
+
# @param permissions [Array<String>] The permission slugs to assign to the role.
|
|
522
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
523
|
+
# @return [WorkOS::Role]
|
|
524
|
+
def set_organization_role_permissions(
|
|
525
|
+
organization_id:,
|
|
526
|
+
slug:,
|
|
527
|
+
permissions:,
|
|
528
|
+
request_options: {}
|
|
529
|
+
)
|
|
530
|
+
body = {
|
|
531
|
+
"permissions" => permissions
|
|
532
|
+
}.compact
|
|
533
|
+
response = @client.request(
|
|
534
|
+
method: :put,
|
|
535
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}/permissions",
|
|
536
|
+
auth: true,
|
|
537
|
+
body: body,
|
|
538
|
+
request_options: request_options
|
|
539
|
+
)
|
|
540
|
+
result = WorkOS::Role.new(response.body)
|
|
541
|
+
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"])
|
|
542
|
+
result
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# Remove a permission from a custom role
|
|
546
|
+
# @param organization_id [String] The ID of the organization.
|
|
547
|
+
# @param slug [String] The slug of the role.
|
|
548
|
+
# @param permission_slug [String] The slug of the permission to remove.
|
|
549
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
550
|
+
# @return [WorkOS::Role]
|
|
551
|
+
def remove_organization_role_permission(
|
|
552
|
+
organization_id:,
|
|
553
|
+
slug:,
|
|
554
|
+
permission_slug:,
|
|
555
|
+
request_options: {}
|
|
556
|
+
)
|
|
557
|
+
response = @client.request(
|
|
558
|
+
method: :delete,
|
|
559
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}/permissions/#{WorkOS::Util.encode_path(permission_slug)}",
|
|
560
|
+
auth: true,
|
|
561
|
+
request_options: request_options
|
|
562
|
+
)
|
|
563
|
+
result = WorkOS::Role.new(response.body)
|
|
564
|
+
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"])
|
|
565
|
+
result
|
|
566
|
+
end
|
|
567
|
+
|
|
568
|
+
# Get a resource by external ID
|
|
569
|
+
# @param organization_id [String] The ID of the organization that owns the resource.
|
|
570
|
+
# @param resource_type_slug [String] The slug of the resource type.
|
|
571
|
+
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
572
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
573
|
+
# @return [WorkOS::AuthorizationResource]
|
|
574
|
+
def get_resource_by_external_id(
|
|
575
|
+
organization_id:,
|
|
576
|
+
resource_type_slug:,
|
|
577
|
+
external_id:,
|
|
578
|
+
request_options: {}
|
|
579
|
+
)
|
|
580
|
+
response = @client.request(
|
|
581
|
+
method: :get,
|
|
582
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}",
|
|
583
|
+
auth: true,
|
|
584
|
+
request_options: request_options
|
|
585
|
+
)
|
|
586
|
+
result = WorkOS::AuthorizationResource.new(response.body)
|
|
587
|
+
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"])
|
|
588
|
+
result
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
# Update a resource by external ID
|
|
592
|
+
# @param organization_id [String] The ID of the organization that owns the resource.
|
|
593
|
+
# @param resource_type_slug [String] The slug of the resource type.
|
|
594
|
+
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
595
|
+
# @param name [String, nil] A display name for the resource.
|
|
596
|
+
# @param description [String, nil] An optional description of the resource.
|
|
597
|
+
# @param parent_resource_id [String, nil] The ID of the parent resource. Mutually exclusive with `parent_resource_external_id` and `parent_resource_type_slug`.
|
|
598
|
+
# @param parent_resource_external_id [String, nil] The external ID of the parent resource. Required with `parent_resource_type_slug`. Mutually exclusive with `parent_resource_id`.
|
|
599
|
+
# @param parent_resource_type_slug [String, nil] The resource type slug of the parent resource. Required with `parent_resource_external_id`. Mutually exclusive with `parent_resource_id`.
|
|
600
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
601
|
+
# @return [WorkOS::AuthorizationResource]
|
|
602
|
+
def update_resource_by_external_id(
|
|
603
|
+
organization_id:,
|
|
604
|
+
resource_type_slug:,
|
|
605
|
+
external_id:,
|
|
606
|
+
name: nil,
|
|
607
|
+
description: nil,
|
|
608
|
+
parent_resource_id: nil,
|
|
609
|
+
parent_resource_external_id: nil,
|
|
610
|
+
parent_resource_type_slug: nil,
|
|
611
|
+
parent_resource: nil,
|
|
612
|
+
request_options: {}
|
|
613
|
+
)
|
|
614
|
+
body = {
|
|
615
|
+
"name" => name,
|
|
616
|
+
"description" => description,
|
|
617
|
+
"parent_resource_id" => parent_resource_id,
|
|
618
|
+
"parent_resource_external_id" => parent_resource_external_id,
|
|
619
|
+
"parent_resource_type_slug" => parent_resource_type_slug
|
|
620
|
+
}.compact
|
|
621
|
+
if parent_resource
|
|
622
|
+
case parent_resource[:type]
|
|
623
|
+
when "by_id"
|
|
624
|
+
body["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
625
|
+
when "by_external_id"
|
|
626
|
+
body["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
627
|
+
body["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
628
|
+
end
|
|
629
|
+
end
|
|
630
|
+
response = @client.request(
|
|
631
|
+
method: :patch,
|
|
632
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}",
|
|
633
|
+
auth: true,
|
|
634
|
+
body: body,
|
|
635
|
+
request_options: request_options
|
|
636
|
+
)
|
|
637
|
+
result = WorkOS::AuthorizationResource.new(response.body)
|
|
638
|
+
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"])
|
|
639
|
+
result
|
|
640
|
+
end
|
|
641
|
+
|
|
642
|
+
# Delete an authorization resource by external ID
|
|
643
|
+
# @param organization_id [String] The ID of the organization that owns the resource.
|
|
644
|
+
# @param resource_type_slug [String] The slug of the resource type.
|
|
645
|
+
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
646
|
+
# @param cascade_delete [Boolean, nil] If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail.
|
|
647
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
648
|
+
# @return [void]
|
|
649
|
+
def delete_resource_by_external_id(
|
|
650
|
+
organization_id:,
|
|
651
|
+
resource_type_slug:,
|
|
652
|
+
external_id:,
|
|
653
|
+
cascade_delete: nil,
|
|
654
|
+
request_options: {}
|
|
655
|
+
)
|
|
656
|
+
params = {
|
|
657
|
+
"cascade_delete" => cascade_delete
|
|
658
|
+
}.compact
|
|
659
|
+
@client.request(
|
|
660
|
+
method: :delete,
|
|
661
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}",
|
|
662
|
+
auth: true,
|
|
663
|
+
params: params,
|
|
664
|
+
request_options: request_options
|
|
665
|
+
)
|
|
666
|
+
nil
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# List memberships for a resource by external ID
|
|
670
|
+
# @param organization_id [String] The ID of the organization that owns the resource.
|
|
671
|
+
# @param resource_type_slug [String] The slug of the resource type this resource belongs to.
|
|
672
|
+
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
673
|
+
# @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"`.
|
|
674
|
+
# @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"`.
|
|
675
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
676
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
677
|
+
# @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned.
|
|
678
|
+
# @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use "direct" for direct assignments only, or "indirect" to include inherited assignments.
|
|
679
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
680
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembershipBaseListData>]
|
|
681
|
+
def list_memberships_for_resource_by_external_id(
|
|
682
|
+
organization_id:,
|
|
683
|
+
resource_type_slug:,
|
|
684
|
+
external_id:,
|
|
685
|
+
permission_slug:,
|
|
686
|
+
before: nil,
|
|
687
|
+
after: nil,
|
|
688
|
+
limit: nil,
|
|
689
|
+
order: "desc",
|
|
690
|
+
assignment: nil,
|
|
691
|
+
request_options: {}
|
|
692
|
+
)
|
|
693
|
+
params = {
|
|
694
|
+
"before" => before,
|
|
695
|
+
"after" => after,
|
|
696
|
+
"limit" => limit,
|
|
697
|
+
"order" => order,
|
|
698
|
+
"permission_slug" => permission_slug,
|
|
699
|
+
"assignment" => assignment
|
|
700
|
+
}.compact
|
|
701
|
+
response = @client.request(
|
|
702
|
+
method: :get,
|
|
703
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/organization_memberships",
|
|
704
|
+
auth: true,
|
|
705
|
+
params: params,
|
|
706
|
+
request_options: request_options
|
|
707
|
+
)
|
|
708
|
+
fetch_next = ->(cursor) {
|
|
709
|
+
list_memberships_for_resource_by_external_id(
|
|
710
|
+
organization_id: organization_id,
|
|
711
|
+
resource_type_slug: resource_type_slug,
|
|
712
|
+
external_id: external_id,
|
|
713
|
+
before: before,
|
|
714
|
+
after: cursor,
|
|
715
|
+
limit: limit,
|
|
716
|
+
order: order,
|
|
717
|
+
permission_slug: permission_slug,
|
|
718
|
+
assignment: assignment,
|
|
719
|
+
request_options: request_options
|
|
720
|
+
)
|
|
721
|
+
}
|
|
722
|
+
WorkOS::Types::ListStruct.from_response(
|
|
723
|
+
response,
|
|
724
|
+
model: WorkOS::UserOrganizationMembershipBaseListData,
|
|
725
|
+
filters: {organization_id: organization_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order, permission_slug: permission_slug, assignment: assignment},
|
|
726
|
+
fetch_next: fetch_next
|
|
727
|
+
)
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
# List resources
|
|
731
|
+
# @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"`.
|
|
732
|
+
# @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"`.
|
|
733
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
734
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
735
|
+
# @param organization_id [String, nil] Filter resources by organization ID.
|
|
736
|
+
# @param resource_type_slug [String, nil] Filter resources by resource type slug.
|
|
737
|
+
# @param resource_external_id [String, nil] Filter resources by external ID.
|
|
738
|
+
# @param search [String, nil] Search resources by name.
|
|
739
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
740
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationResource>]
|
|
741
|
+
def list_resources(
|
|
742
|
+
before: nil,
|
|
743
|
+
after: nil,
|
|
744
|
+
limit: nil,
|
|
745
|
+
order: "desc",
|
|
746
|
+
organization_id: nil,
|
|
747
|
+
resource_type_slug: nil,
|
|
748
|
+
resource_external_id: nil,
|
|
749
|
+
search: nil,
|
|
750
|
+
parent: nil,
|
|
751
|
+
request_options: {}
|
|
752
|
+
)
|
|
753
|
+
params = {
|
|
754
|
+
"before" => before,
|
|
755
|
+
"after" => after,
|
|
756
|
+
"limit" => limit,
|
|
757
|
+
"order" => order,
|
|
758
|
+
"organization_id" => organization_id,
|
|
759
|
+
"resource_type_slug" => resource_type_slug,
|
|
760
|
+
"resource_external_id" => resource_external_id,
|
|
761
|
+
"search" => search
|
|
762
|
+
}.compact
|
|
763
|
+
if parent
|
|
764
|
+
case parent[:type]
|
|
765
|
+
when "by_id"
|
|
766
|
+
params["parent_resource_id"] = parent[:parent_resource_id]
|
|
767
|
+
when "by_external_id"
|
|
768
|
+
params["parent_resource_type_slug"] = parent[:parent_resource_type_slug]
|
|
769
|
+
params["parent_external_id"] = parent[:parent_external_id]
|
|
770
|
+
end
|
|
771
|
+
end
|
|
772
|
+
response = @client.request(
|
|
773
|
+
method: :get,
|
|
774
|
+
path: "/authorization/resources",
|
|
775
|
+
auth: true,
|
|
776
|
+
params: params,
|
|
777
|
+
request_options: request_options
|
|
778
|
+
)
|
|
779
|
+
fetch_next = ->(cursor) {
|
|
780
|
+
list_resources(
|
|
781
|
+
before: before,
|
|
782
|
+
after: cursor,
|
|
783
|
+
limit: limit,
|
|
784
|
+
order: order,
|
|
785
|
+
organization_id: organization_id,
|
|
786
|
+
resource_type_slug: resource_type_slug,
|
|
787
|
+
resource_external_id: resource_external_id,
|
|
788
|
+
search: search,
|
|
789
|
+
parent: parent,
|
|
790
|
+
request_options: request_options
|
|
791
|
+
)
|
|
792
|
+
}
|
|
793
|
+
WorkOS::Types::ListStruct.from_response(
|
|
794
|
+
response,
|
|
795
|
+
model: WorkOS::AuthorizationResource,
|
|
796
|
+
filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id, search: search, parent: parent},
|
|
797
|
+
fetch_next: fetch_next
|
|
798
|
+
)
|
|
799
|
+
end
|
|
800
|
+
|
|
801
|
+
# Create an authorization resource
|
|
802
|
+
# @param external_id [String] An external identifier for the resource.
|
|
803
|
+
# @param name [String] A display name for the resource.
|
|
804
|
+
# @param description [String, nil] An optional description of the resource.
|
|
805
|
+
# @param resource_type_slug [String] The slug of the resource type.
|
|
806
|
+
# @param organization_id [String] The ID of the organization this resource belongs to.
|
|
807
|
+
# @param parent_resource_id [String, nil] The ID of the parent resource. Mutually exclusive with `parent_resource_external_id` and `parent_resource_type_slug`.
|
|
808
|
+
# @param parent_resource_external_id [String, nil] The external ID of the parent resource. Required with `parent_resource_type_slug`. Mutually exclusive with `parent_resource_id`.
|
|
809
|
+
# @param parent_resource_type_slug [String, nil] The resource type slug of the parent resource. Required with `parent_resource_external_id`. Mutually exclusive with `parent_resource_id`.
|
|
810
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
811
|
+
# @return [WorkOS::AuthorizationResource]
|
|
812
|
+
def create_resource(
|
|
813
|
+
external_id:,
|
|
814
|
+
name:,
|
|
815
|
+
resource_type_slug:,
|
|
816
|
+
organization_id:,
|
|
817
|
+
description: nil,
|
|
818
|
+
parent_resource_id: nil,
|
|
819
|
+
parent_resource_external_id: nil,
|
|
820
|
+
parent_resource_type_slug: nil,
|
|
821
|
+
parent_resource: nil,
|
|
822
|
+
request_options: {}
|
|
823
|
+
)
|
|
824
|
+
body = {
|
|
825
|
+
"external_id" => external_id,
|
|
826
|
+
"name" => name,
|
|
827
|
+
"description" => description,
|
|
828
|
+
"resource_type_slug" => resource_type_slug,
|
|
829
|
+
"organization_id" => organization_id,
|
|
830
|
+
"parent_resource_id" => parent_resource_id,
|
|
831
|
+
"parent_resource_external_id" => parent_resource_external_id,
|
|
832
|
+
"parent_resource_type_slug" => parent_resource_type_slug
|
|
833
|
+
}.compact
|
|
834
|
+
if parent_resource
|
|
835
|
+
case parent_resource[:type]
|
|
836
|
+
when "by_id"
|
|
837
|
+
body["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
838
|
+
when "by_external_id"
|
|
839
|
+
body["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
840
|
+
body["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
841
|
+
end
|
|
842
|
+
end
|
|
843
|
+
response = @client.request(
|
|
844
|
+
method: :post,
|
|
845
|
+
path: "/authorization/resources",
|
|
846
|
+
auth: true,
|
|
847
|
+
body: body,
|
|
848
|
+
request_options: request_options
|
|
849
|
+
)
|
|
850
|
+
result = WorkOS::AuthorizationResource.new(response.body)
|
|
851
|
+
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"])
|
|
852
|
+
result
|
|
853
|
+
end
|
|
854
|
+
|
|
855
|
+
# Get a resource
|
|
856
|
+
# @param resource_id [String] The ID of the authorization resource.
|
|
857
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
858
|
+
# @return [WorkOS::AuthorizationResource]
|
|
859
|
+
def get_resource(
|
|
860
|
+
resource_id:,
|
|
861
|
+
request_options: {}
|
|
862
|
+
)
|
|
863
|
+
response = @client.request(
|
|
864
|
+
method: :get,
|
|
865
|
+
path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}",
|
|
866
|
+
auth: true,
|
|
867
|
+
request_options: request_options
|
|
868
|
+
)
|
|
869
|
+
result = WorkOS::AuthorizationResource.new(response.body)
|
|
870
|
+
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"])
|
|
871
|
+
result
|
|
872
|
+
end
|
|
873
|
+
|
|
874
|
+
# Update a resource
|
|
875
|
+
# @param resource_id [String] The ID of the authorization resource.
|
|
876
|
+
# @param name [String, nil] A display name for the resource.
|
|
877
|
+
# @param description [String, nil] An optional description of the resource.
|
|
878
|
+
# @param parent_resource_id [String, nil] The ID of the parent resource. Mutually exclusive with `parent_resource_external_id` and `parent_resource_type_slug`.
|
|
879
|
+
# @param parent_resource_external_id [String, nil] The external ID of the parent resource. Required with `parent_resource_type_slug`. Mutually exclusive with `parent_resource_id`.
|
|
880
|
+
# @param parent_resource_type_slug [String, nil] The resource type slug of the parent resource. Required with `parent_resource_external_id`. Mutually exclusive with `parent_resource_id`.
|
|
881
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
882
|
+
# @return [WorkOS::AuthorizationResource]
|
|
883
|
+
def update_resource(
|
|
884
|
+
resource_id:,
|
|
885
|
+
name: nil,
|
|
886
|
+
description: nil,
|
|
887
|
+
parent_resource_id: nil,
|
|
888
|
+
parent_resource_external_id: nil,
|
|
889
|
+
parent_resource_type_slug: nil,
|
|
890
|
+
parent_resource: nil,
|
|
891
|
+
request_options: {}
|
|
892
|
+
)
|
|
893
|
+
body = {
|
|
894
|
+
"name" => name,
|
|
895
|
+
"description" => description,
|
|
896
|
+
"parent_resource_id" => parent_resource_id,
|
|
897
|
+
"parent_resource_external_id" => parent_resource_external_id,
|
|
898
|
+
"parent_resource_type_slug" => parent_resource_type_slug
|
|
899
|
+
}.compact
|
|
900
|
+
if parent_resource
|
|
901
|
+
case parent_resource[:type]
|
|
902
|
+
when "by_id"
|
|
903
|
+
body["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
904
|
+
when "by_external_id"
|
|
905
|
+
body["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
906
|
+
body["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
907
|
+
end
|
|
908
|
+
end
|
|
909
|
+
response = @client.request(
|
|
910
|
+
method: :patch,
|
|
911
|
+
path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}",
|
|
912
|
+
auth: true,
|
|
913
|
+
body: body,
|
|
914
|
+
request_options: request_options
|
|
915
|
+
)
|
|
916
|
+
result = WorkOS::AuthorizationResource.new(response.body)
|
|
917
|
+
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"])
|
|
918
|
+
result
|
|
919
|
+
end
|
|
920
|
+
|
|
921
|
+
# Delete an authorization resource
|
|
922
|
+
# @param resource_id [String] The ID of the authorization resource.
|
|
923
|
+
# @param cascade_delete [Boolean, nil] If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail.
|
|
924
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
925
|
+
# @return [void]
|
|
926
|
+
def delete_resource(
|
|
927
|
+
resource_id:,
|
|
928
|
+
cascade_delete: nil,
|
|
929
|
+
request_options: {}
|
|
930
|
+
)
|
|
931
|
+
params = {
|
|
932
|
+
"cascade_delete" => cascade_delete
|
|
933
|
+
}.compact
|
|
934
|
+
@client.request(
|
|
935
|
+
method: :delete,
|
|
936
|
+
path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}",
|
|
937
|
+
auth: true,
|
|
938
|
+
params: params,
|
|
939
|
+
request_options: request_options
|
|
940
|
+
)
|
|
941
|
+
nil
|
|
942
|
+
end
|
|
943
|
+
|
|
944
|
+
# List organization memberships for resource
|
|
945
|
+
# @param resource_id [String] The ID of the authorization resource.
|
|
946
|
+
# @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"`.
|
|
947
|
+
# @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"`.
|
|
948
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
949
|
+
# @param order [WorkOS::Types::AuthorizationOrder, 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). Defaults to descending.
|
|
950
|
+
# @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned.
|
|
951
|
+
# @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use `direct` for direct assignments only, or `indirect` to include inherited assignments.
|
|
952
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
953
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembershipBaseListData>]
|
|
954
|
+
def list_memberships_for_resource(
|
|
955
|
+
resource_id:,
|
|
956
|
+
permission_slug:,
|
|
957
|
+
before: nil,
|
|
958
|
+
after: nil,
|
|
959
|
+
limit: nil,
|
|
960
|
+
order: "desc",
|
|
961
|
+
assignment: nil,
|
|
962
|
+
request_options: {}
|
|
963
|
+
)
|
|
964
|
+
params = {
|
|
965
|
+
"before" => before,
|
|
966
|
+
"after" => after,
|
|
967
|
+
"limit" => limit,
|
|
968
|
+
"order" => order,
|
|
969
|
+
"permission_slug" => permission_slug,
|
|
970
|
+
"assignment" => assignment
|
|
971
|
+
}.compact
|
|
972
|
+
response = @client.request(
|
|
973
|
+
method: :get,
|
|
974
|
+
path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}/organization_memberships",
|
|
975
|
+
auth: true,
|
|
976
|
+
params: params,
|
|
977
|
+
request_options: request_options
|
|
978
|
+
)
|
|
979
|
+
fetch_next = ->(cursor) {
|
|
980
|
+
list_memberships_for_resource(
|
|
981
|
+
resource_id: resource_id,
|
|
982
|
+
before: before,
|
|
983
|
+
after: cursor,
|
|
984
|
+
limit: limit,
|
|
985
|
+
order: order,
|
|
986
|
+
permission_slug: permission_slug,
|
|
987
|
+
assignment: assignment,
|
|
988
|
+
request_options: request_options
|
|
989
|
+
)
|
|
990
|
+
}
|
|
991
|
+
WorkOS::Types::ListStruct.from_response(
|
|
992
|
+
response,
|
|
993
|
+
model: WorkOS::UserOrganizationMembershipBaseListData,
|
|
994
|
+
filters: {resource_id: resource_id, before: before, limit: limit, order: order, permission_slug: permission_slug, assignment: assignment},
|
|
995
|
+
fetch_next: fetch_next
|
|
996
|
+
)
|
|
997
|
+
end
|
|
998
|
+
|
|
999
|
+
# List environment roles
|
|
1000
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1001
|
+
# @return [WorkOS::RoleList]
|
|
1002
|
+
def list_environment_roles(request_options: {})
|
|
1003
|
+
response = @client.request(
|
|
1004
|
+
method: :get,
|
|
1005
|
+
path: "/authorization/roles",
|
|
1006
|
+
auth: true,
|
|
1007
|
+
request_options: request_options
|
|
1008
|
+
)
|
|
1009
|
+
result = WorkOS::RoleList.new(response.body)
|
|
1010
|
+
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"])
|
|
1011
|
+
result
|
|
1012
|
+
end
|
|
1013
|
+
|
|
1014
|
+
# Create an environment role
|
|
1015
|
+
# @param slug [String] A unique slug for the role.
|
|
1016
|
+
# @param name [String] A descriptive name for the role.
|
|
1017
|
+
# @param description [String, nil] An optional description of the role.
|
|
1018
|
+
# @param resource_type_slug [String, nil] The slug of the resource type the role is scoped to.
|
|
1019
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1020
|
+
# @return [WorkOS::Role]
|
|
1021
|
+
def create_environment_role(
|
|
1022
|
+
slug:,
|
|
1023
|
+
name:,
|
|
1024
|
+
description: nil,
|
|
1025
|
+
resource_type_slug: nil,
|
|
1026
|
+
request_options: {}
|
|
1027
|
+
)
|
|
1028
|
+
body = {
|
|
1029
|
+
"slug" => slug,
|
|
1030
|
+
"name" => name,
|
|
1031
|
+
"description" => description,
|
|
1032
|
+
"resource_type_slug" => resource_type_slug
|
|
1033
|
+
}.compact
|
|
1034
|
+
response = @client.request(
|
|
1035
|
+
method: :post,
|
|
1036
|
+
path: "/authorization/roles",
|
|
1037
|
+
auth: true,
|
|
1038
|
+
body: body,
|
|
1039
|
+
request_options: request_options
|
|
1040
|
+
)
|
|
1041
|
+
result = WorkOS::Role.new(response.body)
|
|
1042
|
+
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"])
|
|
1043
|
+
result
|
|
1044
|
+
end
|
|
1045
|
+
|
|
1046
|
+
# Get an environment role
|
|
1047
|
+
# @param slug [String] The slug of the environment role.
|
|
1048
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1049
|
+
# @return [WorkOS::Role]
|
|
1050
|
+
def get_environment_role(
|
|
1051
|
+
slug:,
|
|
1052
|
+
request_options: {}
|
|
1053
|
+
)
|
|
1054
|
+
response = @client.request(
|
|
1055
|
+
method: :get,
|
|
1056
|
+
path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}",
|
|
1057
|
+
auth: true,
|
|
1058
|
+
request_options: request_options
|
|
1059
|
+
)
|
|
1060
|
+
result = WorkOS::Role.new(response.body)
|
|
1061
|
+
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"])
|
|
1062
|
+
result
|
|
1063
|
+
end
|
|
1064
|
+
|
|
1065
|
+
# Update an environment role
|
|
1066
|
+
# @param slug [String] The slug of the environment role.
|
|
1067
|
+
# @param name [String, nil] A descriptive name for the role.
|
|
1068
|
+
# @param description [String, nil] An optional description of the role.
|
|
1069
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1070
|
+
# @return [WorkOS::Role]
|
|
1071
|
+
def update_environment_role(
|
|
1072
|
+
slug:,
|
|
1073
|
+
name: nil,
|
|
1074
|
+
description: nil,
|
|
1075
|
+
request_options: {}
|
|
1076
|
+
)
|
|
1077
|
+
body = {
|
|
1078
|
+
"name" => name,
|
|
1079
|
+
"description" => description
|
|
1080
|
+
}.compact
|
|
1081
|
+
response = @client.request(
|
|
1082
|
+
method: :patch,
|
|
1083
|
+
path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}",
|
|
1084
|
+
auth: true,
|
|
1085
|
+
body: body,
|
|
1086
|
+
request_options: request_options
|
|
1087
|
+
)
|
|
1088
|
+
result = WorkOS::Role.new(response.body)
|
|
1089
|
+
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"])
|
|
1090
|
+
result
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1093
|
+
# Add a permission to an environment role
|
|
1094
|
+
# @param slug [String] The slug of the environment role.
|
|
1095
|
+
# @param body_slug [String] The slug of the permission to add to the role.
|
|
1096
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1097
|
+
# @return [WorkOS::Role]
|
|
1098
|
+
def add_environment_role_permission(
|
|
1099
|
+
slug:,
|
|
1100
|
+
body_slug:,
|
|
1101
|
+
request_options: {}
|
|
1102
|
+
)
|
|
1103
|
+
body = {
|
|
1104
|
+
"slug" => body_slug
|
|
1105
|
+
}.compact
|
|
1106
|
+
response = @client.request(
|
|
1107
|
+
method: :post,
|
|
1108
|
+
path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}/permissions",
|
|
1109
|
+
auth: true,
|
|
1110
|
+
body: body,
|
|
1111
|
+
request_options: request_options
|
|
1112
|
+
)
|
|
1113
|
+
result = WorkOS::Role.new(response.body)
|
|
1114
|
+
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"])
|
|
1115
|
+
result
|
|
1116
|
+
end
|
|
1117
|
+
|
|
1118
|
+
# Set permissions for an environment role
|
|
1119
|
+
# @param slug [String] The slug of the environment role.
|
|
1120
|
+
# @param permissions [Array<String>] The permission slugs to assign to the role.
|
|
1121
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1122
|
+
# @return [WorkOS::Role]
|
|
1123
|
+
def set_environment_role_permissions(
|
|
1124
|
+
slug:,
|
|
1125
|
+
permissions:,
|
|
1126
|
+
request_options: {}
|
|
1127
|
+
)
|
|
1128
|
+
body = {
|
|
1129
|
+
"permissions" => permissions
|
|
1130
|
+
}.compact
|
|
1131
|
+
response = @client.request(
|
|
1132
|
+
method: :put,
|
|
1133
|
+
path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}/permissions",
|
|
1134
|
+
auth: true,
|
|
1135
|
+
body: body,
|
|
1136
|
+
request_options: request_options
|
|
1137
|
+
)
|
|
1138
|
+
result = WorkOS::Role.new(response.body)
|
|
1139
|
+
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"])
|
|
1140
|
+
result
|
|
1141
|
+
end
|
|
1142
|
+
|
|
1143
|
+
# List permissions
|
|
1144
|
+
# @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"`.
|
|
1145
|
+
# @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"`.
|
|
1146
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1147
|
+
# @param order [WorkOS::Types::PermissionsOrder, 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). Defaults to descending.
|
|
1148
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1149
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
1150
|
+
def list_permissions(
|
|
1151
|
+
before: nil,
|
|
1152
|
+
after: nil,
|
|
1153
|
+
limit: nil,
|
|
1154
|
+
order: "desc",
|
|
1155
|
+
request_options: {}
|
|
1156
|
+
)
|
|
1157
|
+
params = {
|
|
1158
|
+
"before" => before,
|
|
1159
|
+
"after" => after,
|
|
1160
|
+
"limit" => limit,
|
|
1161
|
+
"order" => order
|
|
1162
|
+
}.compact
|
|
1163
|
+
response = @client.request(
|
|
1164
|
+
method: :get,
|
|
1165
|
+
path: "/authorization/permissions",
|
|
1166
|
+
auth: true,
|
|
1167
|
+
params: params,
|
|
1168
|
+
request_options: request_options
|
|
1169
|
+
)
|
|
1170
|
+
fetch_next = ->(cursor) {
|
|
1171
|
+
list_permissions(
|
|
1172
|
+
before: before,
|
|
1173
|
+
after: cursor,
|
|
1174
|
+
limit: limit,
|
|
1175
|
+
order: order,
|
|
1176
|
+
request_options: request_options
|
|
1177
|
+
)
|
|
1178
|
+
}
|
|
1179
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1180
|
+
response,
|
|
1181
|
+
model: WorkOS::AuthorizationPermission,
|
|
1182
|
+
filters: {before: before, limit: limit, order: order},
|
|
1183
|
+
fetch_next: fetch_next
|
|
1184
|
+
)
|
|
1185
|
+
end
|
|
1186
|
+
|
|
1187
|
+
# Create a permission
|
|
1188
|
+
# @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
|
|
1189
|
+
# @param name [String] A descriptive name for the Permission.
|
|
1190
|
+
# @param description [String, nil] An optional description of the Permission.
|
|
1191
|
+
# @param resource_type_slug [String, nil] The slug of the resource type this permission is scoped to.
|
|
1192
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1193
|
+
# @return [WorkOS::Permission]
|
|
1194
|
+
def create_permission(
|
|
1195
|
+
slug:,
|
|
1196
|
+
name:,
|
|
1197
|
+
description: nil,
|
|
1198
|
+
resource_type_slug: nil,
|
|
1199
|
+
request_options: {}
|
|
1200
|
+
)
|
|
1201
|
+
body = {
|
|
1202
|
+
"slug" => slug,
|
|
1203
|
+
"name" => name,
|
|
1204
|
+
"description" => description,
|
|
1205
|
+
"resource_type_slug" => resource_type_slug
|
|
1206
|
+
}.compact
|
|
1207
|
+
response = @client.request(
|
|
1208
|
+
method: :post,
|
|
1209
|
+
path: "/authorization/permissions",
|
|
1210
|
+
auth: true,
|
|
1211
|
+
body: body,
|
|
1212
|
+
request_options: request_options
|
|
1213
|
+
)
|
|
1214
|
+
result = WorkOS::Permission.new(response.body)
|
|
1215
|
+
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"])
|
|
1216
|
+
result
|
|
1217
|
+
end
|
|
1218
|
+
|
|
1219
|
+
# Get a permission
|
|
1220
|
+
# @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
|
|
1221
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1222
|
+
# @return [WorkOS::AuthorizationPermission]
|
|
1223
|
+
def get_permission(
|
|
1224
|
+
slug:,
|
|
1225
|
+
request_options: {}
|
|
1226
|
+
)
|
|
1227
|
+
response = @client.request(
|
|
1228
|
+
method: :get,
|
|
1229
|
+
path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}",
|
|
1230
|
+
auth: true,
|
|
1231
|
+
request_options: request_options
|
|
1232
|
+
)
|
|
1233
|
+
result = WorkOS::AuthorizationPermission.new(response.body)
|
|
1234
|
+
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"])
|
|
1235
|
+
result
|
|
1236
|
+
end
|
|
1237
|
+
|
|
1238
|
+
# Update a permission
|
|
1239
|
+
# @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
|
|
1240
|
+
# @param name [String, nil] A descriptive name for the Permission.
|
|
1241
|
+
# @param description [String, nil] An optional description of the Permission.
|
|
1242
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1243
|
+
# @return [WorkOS::AuthorizationPermission]
|
|
1244
|
+
def update_permission(
|
|
1245
|
+
slug:,
|
|
1246
|
+
name: nil,
|
|
1247
|
+
description: nil,
|
|
1248
|
+
request_options: {}
|
|
1249
|
+
)
|
|
1250
|
+
body = {
|
|
1251
|
+
"name" => name,
|
|
1252
|
+
"description" => description
|
|
1253
|
+
}.compact
|
|
1254
|
+
response = @client.request(
|
|
1255
|
+
method: :patch,
|
|
1256
|
+
path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}",
|
|
1257
|
+
auth: true,
|
|
1258
|
+
body: body,
|
|
1259
|
+
request_options: request_options
|
|
1260
|
+
)
|
|
1261
|
+
result = WorkOS::AuthorizationPermission.new(response.body)
|
|
1262
|
+
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"])
|
|
1263
|
+
result
|
|
1264
|
+
end
|
|
1265
|
+
|
|
1266
|
+
# Delete a permission
|
|
1267
|
+
# @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
|
|
1268
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1269
|
+
# @return [void]
|
|
1270
|
+
def delete_permission(
|
|
1271
|
+
slug:,
|
|
1272
|
+
request_options: {}
|
|
1273
|
+
)
|
|
1274
|
+
@client.request(
|
|
1275
|
+
method: :delete,
|
|
1276
|
+
path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}",
|
|
1277
|
+
auth: true,
|
|
1278
|
+
request_options: request_options
|
|
1279
|
+
)
|
|
1280
|
+
nil
|
|
1281
|
+
end
|
|
1282
|
+
end
|
|
1283
|
+
end
|