workos 7.1.2 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.github/workflows/docs.yml +49 -0
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +164 -10
- data/.github/workflows/release.yml +2 -2
- data/.gitignore +2 -0
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +403 -84
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/.yardopts +6 -0
- data/CHANGELOG.md +331 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -4
- data/README.md +19 -0
- data/docs/V7_MIGRATION_GUIDE.md +21 -0
- data/lib/workos/actions.rb +1 -1
- data/lib/workos/admin_portal/generate_link.rb +0 -3
- data/lib/workos/admin_portal.rb +0 -3
- data/lib/workos/api_keys/api_key.rb +4 -1
- data/lib/workos/api_keys/api_key_created.rb +5 -5
- data/lib/workos/api_keys/api_key_created_data.rb +4 -1
- data/lib/workos/api_keys/api_key_revoked.rb +5 -5
- data/lib/workos/{audit_logs/audit_log_export_json.rb → api_keys/api_key_updated.rb} +10 -10
- data/lib/workos/api_keys/api_key_updated_data.rb +49 -0
- data/lib/workos/{directory_sync/dsync_deactivated_data_domain.rb → api_keys/api_key_updated_data_owner.rb} +1 -1
- data/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb +18 -0
- data/lib/workos/api_keys/create_organization_api_key.rb +5 -2
- data/lib/workos/api_keys/expire_api_key.rb +18 -0
- data/lib/workos/api_keys/organization_api_key.rb +46 -0
- data/lib/workos/{types/events_order.rb → api_keys/organization_api_key_owner.rb} +1 -3
- data/lib/workos/api_keys/organization_api_key_with_value.rb +49 -0
- data/lib/workos/{types/audit_logs_order.rb → api_keys/organization_api_key_with_value_owner.rb} +1 -3
- data/lib/workos/api_keys.rb +75 -47
- data/lib/workos/audit_logs/audit_log_action.rb +2 -7
- data/lib/workos/audit_logs/audit_log_export.rb +2 -7
- data/lib/workos/audit_logs/audit_log_schema.rb +11 -2
- data/lib/workos/audit_logs/audit_log_schema_actor_input.rb +7 -0
- data/lib/workos/audit_logs/audit_log_schema_input.rb +25 -0
- data/lib/workos/audit_logs/audit_log_schema_target.rb +16 -1
- data/lib/workos/audit_logs/audit_log_schema_target_input.rb +7 -0
- data/lib/workos/audit_logs.rb +20 -20
- data/lib/workos/{audit_logs/audit_log_schema_json_actor.rb → authorization/create_group_role_assignment.rb} +1 -1
- data/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb +7 -0
- data/lib/workos/authorization/{role_assignment.rb → group_role_assignment.rb} +5 -2
- data/lib/workos/authorization/group_role_assignment_list.rb +25 -0
- data/lib/workos/authorization/{role_assignment_resource.rb → group_role_assignment_resource.rb} +1 -1
- data/lib/workos/authorization/permission_created.rb +5 -5
- data/lib/workos/authorization/permission_deleted.rb +5 -5
- data/lib/workos/authorization/permission_updated.rb +5 -5
- data/lib/workos/{api_keys/api_key_with_value_owner.rb → authorization/replace_group_role_assignment_entry.rb} +1 -1
- data/lib/workos/authorization/replace_group_role_assignments.rb +18 -0
- data/lib/workos/authorization/role_created.rb +5 -5
- data/lib/workos/authorization/role_deleted.rb +5 -5
- data/lib/workos/authorization/role_updated.rb +5 -5
- data/lib/workos/authorization/user_role_assignment.rb +40 -0
- data/lib/workos/authorization/user_role_assignment_resource.rb +7 -0
- data/lib/workos/{audit_logs/audit_log_schema_json_target.rb → authorization/user_role_assignment_source.rb} +4 -4
- data/lib/workos/authorization.rb +326 -30
- data/lib/workos/base_client.rb +90 -7
- data/lib/workos/client.rb +18 -10
- data/lib/workos/client_api/client_api_token.rb +22 -0
- data/lib/workos/client_api/client_api_token_response.rb +18 -0
- data/lib/workos/client_api.rb +39 -0
- data/lib/workos/connect/connect_application.rb +12 -0
- data/lib/workos/connect/connect_application_redirect_uri.rb +22 -0
- data/lib/workos/connect/user_object.rb +3 -0
- data/lib/workos/connect.rb +2 -2
- data/lib/workos/directory_sync/directory_user.rb +3 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +4 -1
- data/lib/workos/directory_sync/dsync_activated.rb +5 -5
- data/lib/workos/directory_sync/dsync_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_created.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_updated.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_user_added.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_user_removed.rb +5 -5
- data/lib/workos/directory_sync/dsync_token_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_created_data.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_revoked.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_revoked_data.rb +7 -0
- data/lib/workos/directory_sync/dsync_user_created.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_updated.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_updated_data.rb +3 -0
- data/lib/workos/directory_sync.rb +6 -6
- data/lib/workos/encryptors/aes_gcm.rb +19 -5
- data/lib/workos/events.rb +2 -2
- data/lib/workos/feature_flags/flag_created.rb +5 -5
- data/lib/workos/feature_flags/flag_deleted.rb +5 -5
- data/lib/workos/feature_flags/flag_rule_updated.rb +5 -5
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb +1 -16
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb +1 -1
- data/lib/workos/feature_flags/flag_updated.rb +5 -5
- data/lib/workos/feature_flags.rb +6 -6
- data/lib/workos/{authorization → groups}/user_organization_membership_base_list_data.rb +5 -2
- data/lib/workos/groups.rb +4 -4
- data/lib/workos/inflections.rb +3 -1
- data/lib/workos/multi_factor_auth.rb +2 -2
- data/lib/workos/organization_domains/organization_domain_created.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_deleted.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_updated.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_verification_failed.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_verified.rb +5 -5
- data/lib/workos/{user_management → organization_membership}/organization_membership.rb +8 -2
- data/lib/workos/{user_management → organization_membership}/user_organization_membership.rb +8 -2
- data/lib/workos/organization_membership_service.rb +273 -0
- data/lib/workos/organizations/audit_logs_retention.rb +2 -7
- data/lib/workos/organizations/organization_created.rb +5 -5
- data/lib/workos/organizations/organization_deleted.rb +5 -5
- data/lib/workos/organizations/organization_membership_created.rb +5 -5
- data/lib/workos/organizations/organization_membership_deleted.rb +5 -5
- data/lib/workos/organizations/organization_membership_updated.rb +5 -5
- data/lib/workos/organizations/organization_role_created.rb +5 -5
- data/lib/workos/organizations/organization_role_deleted.rb +5 -5
- data/lib/workos/organizations/organization_role_updated.rb +5 -5
- data/lib/workos/organizations/organization_updated.rb +5 -5
- data/lib/workos/organizations.rb +2 -2
- data/lib/workos/pipes/connected_account.rb +6 -0
- data/lib/workos/pipes/connected_account_dto.rb +31 -0
- data/lib/workos/pipes/create_data_integration.rb +34 -0
- data/lib/workos/pipes/custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/data_integration.rb +55 -0
- data/lib/workos/pipes/data_integration_credential.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
- data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
- data/lib/workos/pipes/data_integrations_list_response_data.rb +3 -0
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
- data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/update_data_integration.rb +31 -0
- data/lib/workos/pipes.rb +309 -5
- data/lib/workos/pipes_provider/configure_data_integration_body.rb +28 -0
- data/lib/workos/pipes_provider/data_integration_configuration_list_response.rb +22 -0
- data/lib/workos/{directory_sync/dsync_deactivated_data.rb → pipes_provider/data_integration_configuration_response.rb} +13 -13
- data/lib/workos/pipes_provider/data_integration_credentials.rb +31 -0
- data/lib/workos/pipes_provider.rb +68 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +3 -6
- data/lib/workos/radar.rb +7 -10
- data/lib/workos/session.rb +28 -7
- data/lib/workos/session_manager.rb +24 -1
- data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
- data/lib/workos/shared/connect_application_m2m.rb +46 -0
- data/lib/workos/shared/connect_application_oauth.rb +58 -0
- data/lib/workos/shared/connect_application_oauth_redirect_uris.rb +22 -0
- data/lib/workos/shared/error_response.rb +18 -0
- data/lib/workos/shared/group_created.rb +5 -5
- data/lib/workos/shared/group_deleted.rb +5 -5
- data/lib/workos/shared/group_member_added.rb +5 -5
- data/lib/workos/shared/group_member_removed.rb +5 -5
- data/lib/workos/shared/group_updated.rb +5 -5
- data/lib/workos/shared/pipe_connected_account.rb +46 -0
- data/lib/workos/{directory_sync/dsync_deactivated.rb → shared/pipes_connected_account_connected.rb} +7 -7
- data/lib/workos/shared/pipes_connected_account_disconnected.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_reauthorization_needed.rb +34 -0
- data/lib/workos/shared/waitlist_user_approved.rb +5 -5
- data/lib/workos/shared/waitlist_user_created.rb +5 -5
- data/lib/workos/shared/waitlist_user_denied.rb +5 -5
- data/lib/workos/sso/connection_activated.rb +5 -5
- data/lib/workos/sso/connection_deactivated.rb +5 -5
- data/lib/workos/sso/connection_deleted.rb +5 -5
- data/lib/workos/sso/connection_saml_certificate_renewal_required.rb +5 -5
- data/lib/workos/sso/connection_saml_certificate_renewed.rb +5 -5
- data/lib/workos/sso/profile.rb +3 -0
- data/lib/workos/sso.rb +2 -2
- data/lib/workos/types/audit_log_configuration_log_stream_type.rb +2 -1
- data/lib/workos/types/audit_log_export_state.rb +2 -1
- data/lib/workos/types/connected_account_auth_method.rb +13 -0
- data/lib/workos/types/connected_account_state.rb +1 -2
- data/lib/workos/types/create_webhook_endpoint_events.rb +12 -1
- data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
- data/lib/workos/types/data_integration_access_token_response_error.rb +2 -2
- data/lib/workos/types/data_integration_credential_type.rb +13 -0
- data/lib/workos/types/data_integration_credentials_credentials_type.rb +14 -0
- data/lib/workos/types/{directories_order.rb → data_integration_credentials_response_error.rb} +1 -1
- data/lib/workos/types/{authorization_order.rb → data_integration_credentials_type.rb} +1 -1
- data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
- data/lib/workos/types/data_integration_state.rb +14 -0
- data/lib/workos/types/{connections_order.rb → data_integrations_list_response_data_auth_methods.rb} +1 -1
- data/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
- data/lib/workos/types/event_context_actor_source.rb +2 -1
- data/lib/workos/types/{applications_order.rb → pagination_order.rb} +1 -1
- data/lib/workos/types/pipe_connected_account_state.rb +13 -0
- data/lib/workos/types/{radar_action.rb → radar_list_action.rb} +1 -1
- data/lib/workos/types/radar_list_type.rb +18 -0
- data/lib/workos/types/radar_standalone_assess_request_action.rb +1 -7
- data/lib/workos/types/radar_standalone_response_blocklist_type.rb +1 -10
- data/lib/workos/types/radar_standalone_response_control.rb +1 -4
- data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
- data/lib/workos/types/user_management_authentication_screen_hint.rb +1 -5
- data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
- data/lib/workos/types/{vault_byok_key_verification_completed_data_key_provider.rb → vault_byok_key_provider.rb} +1 -1
- data/{rbi/workos/types/request_options.rbi → lib/workos/types/vault_order.rb} +4 -3
- data/lib/workos/types/webhook_endpoint_status.rb +1 -5
- data/lib/workos/types/widget_session_token_scopes.rb +2 -1
- data/lib/workos/user_management/action_authentication_denied.rb +6 -6
- data/lib/workos/user_management/action_user_registration_denied.rb +6 -6
- data/lib/workos/user_management/authentication_email_verification_failed.rb +5 -5
- data/lib/workos/user_management/authentication_email_verification_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_magic_auth_failed.rb +5 -5
- data/lib/workos/user_management/authentication_magic_auth_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_mfa_failed.rb +5 -5
- data/lib/workos/user_management/authentication_mfa_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_oauth_failed.rb +5 -5
- data/lib/workos/user_management/authentication_oauth_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_passkey_failed.rb +5 -5
- data/lib/workos/user_management/authentication_passkey_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_password_failed.rb +5 -5
- data/lib/workos/user_management/authentication_password_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_radar_risk_detected.rb +5 -5
- data/lib/workos/user_management/authentication_sso_failed.rb +5 -5
- data/lib/workos/user_management/authentication_sso_started.rb +5 -5
- data/lib/workos/user_management/authentication_sso_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_sso_timed_out.rb +5 -5
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
- data/lib/workos/user_management/create_user.rb +12 -0
- data/lib/workos/user_management/create_user_api_key.rb +28 -0
- data/lib/workos/user_management/email_change_confirmation_user.rb +3 -0
- data/lib/workos/user_management/email_verification_created.rb +5 -5
- data/lib/workos/user_management/invitation_accepted.rb +5 -5
- data/lib/workos/user_management/invitation_created.rb +5 -5
- data/lib/workos/user_management/invitation_resent.rb +5 -5
- data/lib/workos/user_management/invitation_revoked.rb +5 -5
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/magic_auth_created.rb +5 -5
- data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +43 -0
- data/lib/workos/user_management/password_reset_created.rb +5 -5
- data/lib/workos/user_management/password_reset_succeeded.rb +5 -5
- data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
- data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
- data/lib/workos/user_management/revoke_session.rb +2 -6
- data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
- data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
- data/lib/workos/user_management/session_created.rb +5 -5
- data/lib/workos/user_management/session_revoked.rb +5 -5
- data/lib/workos/user_management/update_user.rb +3 -0
- data/lib/workos/user_management/user_api_key.rb +46 -0
- data/lib/workos/user_management/user_api_key_created_data_owner.rb +25 -0
- data/lib/workos/user_management/user_api_key_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_revoked_data_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_updated_data_owner.rb +7 -0
- data/lib/workos/{api_keys/api_key_with_value.rb → user_management/user_api_key_with_value.rb} +5 -2
- data/lib/workos/user_management/user_api_key_with_value_owner.rb +7 -0
- data/lib/workos/user_management/user_create_response.rb +61 -0
- data/lib/workos/user_management/user_created.rb +5 -5
- data/lib/workos/user_management/user_deleted.rb +5 -5
- data/lib/workos/user_management/user_updated.rb +5 -5
- data/lib/workos/user_management.rb +351 -202
- data/lib/workos/vault/actor.rb +22 -0
- data/lib/workos/vault/create_data_key_request.rb +18 -0
- data/lib/workos/vault/create_data_key_response.rb +28 -0
- data/lib/workos/vault/create_object_request.rb +25 -0
- data/lib/workos/vault/decrypt_request.rb +18 -0
- data/lib/workos/vault/decrypt_response.rb +22 -0
- data/lib/workos/vault/delete_object_response.rb +22 -0
- data/lib/workos/vault/object_metadata.rb +37 -0
- data/lib/workos/{audit_logs/audit_log_action_json.rb → vault/object_summary.rb} +4 -10
- data/lib/workos/vault/object_version.rb +31 -0
- data/lib/workos/vault/object_without_value.rb +25 -0
- data/lib/workos/vault/rekey_request.rb +22 -0
- data/lib/workos/vault/update_object_request.rb +22 -0
- data/lib/workos/vault/vault_byok_key_deleted.rb +34 -0
- data/lib/workos/vault/vault_byok_key_deleted_data.rb +22 -0
- data/lib/workos/vault/vault_byok_key_verification_completed.rb +5 -5
- data/lib/workos/vault/vault_data_created.rb +5 -5
- data/lib/workos/vault/vault_data_deleted.rb +5 -5
- data/lib/workos/vault/vault_data_read.rb +5 -5
- data/lib/workos/vault/vault_data_updated.rb +5 -5
- data/lib/workos/vault/vault_dek_decrypted.rb +5 -5
- data/lib/workos/vault/vault_dek_read.rb +5 -5
- data/lib/workos/vault/vault_kek_created.rb +5 -5
- data/lib/workos/vault/vault_metadata_read.rb +5 -5
- data/lib/workos/vault/vault_names_listed.rb +5 -5
- data/lib/workos/vault/vault_object.rb +28 -0
- data/lib/workos/vault/version_list_response.rb +22 -0
- data/lib/workos/vault.rb +273 -139
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks/webhook_endpoint.rb +2 -7
- data/lib/workos/webhooks.rb +10 -11
- data/lib/workos/widgets/widget_session_token_response.rb +1 -12
- data/lib/workos.rb +3 -0
- data/rbi/workos/action_authentication_denied.rbi +10 -10
- data/rbi/workos/action_user_registration_denied.rbi +10 -10
- data/rbi/workos/actor.rbi +30 -0
- data/rbi/workos/admin_portal.rbi +1 -2
- data/rbi/workos/api_key.rbi +8 -2
- data/rbi/workos/api_key_created.rbi +6 -6
- data/rbi/workos/api_key_created_data.rbi +8 -2
- data/rbi/workos/api_key_revoked.rbi +6 -6
- data/rbi/workos/api_key_revoked_data.rbi +8 -2
- data/rbi/workos/{dsync_deactivated.rbi → api_key_updated.rbi} +9 -9
- data/rbi/workos/api_key_updated_data.rbi +84 -0
- data/rbi/workos/{api_key_with_value_owner.rbi → api_key_updated_data_owner.rbi} +1 -1
- data/rbi/workos/{audit_logs_retention_json.rbi → api_key_updated_data_previous_attribute.rbi} +5 -5
- data/rbi/workos/api_keys.rbi +27 -17
- data/rbi/workos/audit_log_action.rbi +1 -0
- data/rbi/workos/audit_log_export.rbi +1 -0
- data/rbi/workos/audit_log_schema.rbi +18 -0
- data/rbi/workos/{audit_log_schema_json_actor.rbi → audit_log_schema_actor_input.rbi} +1 -1
- data/rbi/workos/audit_log_schema_input.rbi +36 -0
- data/rbi/workos/{audit_log_schema_json_target.rbi → audit_log_schema_target_input.rbi} +1 -1
- data/rbi/workos/audit_logs.rbi +9 -9
- data/rbi/workos/audit_logs_retention.rbi +1 -0
- data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
- data/rbi/workos/authentication_email_verification_failed.rbi +6 -6
- data/rbi/workos/authentication_email_verification_succeeded.rbi +6 -6
- data/rbi/workos/authentication_magic_auth_failed.rbi +6 -6
- data/rbi/workos/authentication_magic_auth_succeeded.rbi +6 -6
- data/rbi/workos/authentication_mfa_failed.rbi +6 -6
- data/rbi/workos/authentication_mfa_succeeded.rbi +6 -6
- data/rbi/workos/authentication_oauth_failed.rbi +6 -6
- data/rbi/workos/authentication_oauth_succeeded.rbi +6 -6
- data/rbi/workos/authentication_passkey_failed.rbi +6 -6
- data/rbi/workos/authentication_passkey_succeeded.rbi +6 -6
- data/rbi/workos/authentication_password_failed.rbi +6 -6
- data/rbi/workos/authentication_password_succeeded.rbi +6 -6
- data/rbi/workos/authentication_radar_risk_detected.rbi +6 -6
- data/rbi/workos/authentication_sso_failed.rbi +6 -6
- data/rbi/workos/authentication_sso_started.rbi +6 -6
- data/rbi/workos/authentication_sso_succeeded.rbi +6 -6
- data/rbi/workos/authentication_sso_timed_out.rbi +6 -6
- data/rbi/workos/authorization.rbi +97 -4
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +8 -2
- data/rbi/workos/client.rbi +15 -6
- data/rbi/workos/client_api.rbi +22 -0
- data/rbi/workos/client_api_token.rbi +30 -0
- data/rbi/workos/client_api_token_response.rbi +24 -0
- data/rbi/workos/configure_data_integration_body.rbi +42 -0
- data/rbi/workos/connect_application.rbi +0 -12
- data/rbi/workos/{dsync_deactivated_data.rbi → connect_application_m2m.rbi} +19 -19
- data/rbi/workos/connect_application_oauth.rbi +102 -0
- data/rbi/workos/connect_application_oauth_redirect_uris.rbi +30 -0
- data/rbi/workos/connected_account.rbi +12 -0
- data/rbi/workos/connected_account_dto.rbi +48 -0
- data/rbi/workos/connection_activated.rbi +6 -6
- data/rbi/workos/connection_deactivated.rbi +6 -6
- data/rbi/workos/connection_deleted.rbi +6 -6
- data/rbi/workos/connection_saml_certificate_renewal_required.rbi +6 -6
- data/rbi/workos/connection_saml_certificate_renewed.rbi +6 -6
- data/rbi/workos/create_data_integration.rbi +54 -0
- data/rbi/workos/create_data_key_request.rbi +24 -0
- data/rbi/workos/create_data_key_response.rbi +42 -0
- data/rbi/workos/create_group_role_assignment.rbi +42 -0
- data/rbi/workos/create_magic_code_and_return.rbi +24 -0
- data/rbi/workos/create_object_request.rbi +36 -0
- data/rbi/workos/create_organization_api_key.rbi +6 -0
- data/rbi/workos/create_user.rbi +24 -0
- data/rbi/workos/create_user_api_key.rbi +42 -0
- data/rbi/workos/custom_provider_definition.rbi +84 -0
- data/rbi/workos/data_integration.rbi +96 -0
- data/rbi/workos/data_integration_configuration_list_response.rbi +30 -0
- data/rbi/workos/data_integration_configuration_response.rbi +78 -0
- data/rbi/workos/data_integration_credential.rbi +36 -0
- data/rbi/workos/data_integration_credentials.rbi +48 -0
- data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
- data/rbi/workos/data_integration_custom_provider.rbi +84 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +6 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
- data/rbi/workos/decrypt_request.rbi +24 -0
- data/rbi/workos/decrypt_response.rbi +30 -0
- data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +42 -0
- data/rbi/workos/delete_object_response.rbi +30 -0
- data/rbi/workos/directory_user.rbi +6 -0
- data/rbi/workos/directory_user_with_groups.rbi +6 -0
- data/rbi/workos/dsync_activated.rbi +6 -6
- data/rbi/workos/dsync_deleted.rbi +6 -6
- data/rbi/workos/dsync_group_created.rbi +6 -6
- data/rbi/workos/dsync_group_deleted.rbi +6 -6
- data/rbi/workos/dsync_group_updated.rbi +6 -6
- data/rbi/workos/dsync_group_user_added.rbi +6 -6
- data/rbi/workos/dsync_group_user_removed.rbi +6 -6
- data/rbi/workos/dsync_token_created.rbi +54 -0
- data/rbi/workos/{audit_log_export_json.rbi → dsync_token_created_data.rbi} +9 -9
- data/rbi/workos/dsync_token_revoked.rbi +54 -0
- data/rbi/workos/{audit_log_action_json.rbi → dsync_token_revoked_data.rbi} +17 -11
- data/rbi/workos/dsync_user_created.rbi +6 -6
- data/rbi/workos/dsync_user_deleted.rbi +6 -6
- data/rbi/workos/dsync_user_updated.rbi +6 -6
- data/rbi/workos/dsync_user_updated_data.rbi +6 -0
- data/rbi/workos/email_change_confirmation_user.rbi +6 -0
- data/rbi/workos/email_verification_created.rbi +6 -6
- data/rbi/workos/error_response.rbi +24 -0
- data/rbi/workos/expire_api_key.rbi +24 -0
- data/rbi/workos/flag_created.rbi +6 -6
- data/rbi/workos/flag_deleted.rbi +6 -6
- data/rbi/workos/flag_rule_updated.rbi +6 -6
- data/rbi/workos/flag_updated.rbi +6 -6
- data/rbi/workos/generate_link.rbi +0 -6
- data/rbi/workos/group_created.rbi +6 -6
- data/rbi/workos/group_deleted.rbi +6 -6
- data/rbi/workos/group_member_added.rbi +6 -6
- data/rbi/workos/group_member_removed.rbi +6 -6
- data/rbi/workos/{role_assignment.rbi → group_role_assignment.rbi} +9 -3
- data/rbi/workos/group_role_assignment_resource.rbi +36 -0
- data/rbi/workos/group_updated.rbi +6 -6
- data/rbi/workos/invitation_accepted.rbi +6 -6
- data/rbi/workos/invitation_created.rbi +6 -6
- data/rbi/workos/invitation_resent.rbi +6 -6
- data/rbi/workos/invitation_revoked.rbi +6 -6
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/magic_auth_created.rbi +6 -6
- data/rbi/workos/{webhook_endpoint_json.rbi → magic_auth_send_magic_auth_code_and_return_response.rbi} +19 -13
- data/rbi/workos/object_metadata.rbi +60 -0
- data/rbi/workos/object_summary.rbi +36 -0
- data/rbi/workos/object_version.rbi +48 -0
- data/rbi/workos/object_without_value.rbi +36 -0
- data/rbi/workos/organization_api_key.rbi +78 -0
- data/rbi/workos/organization_api_key_owner.rbi +30 -0
- data/rbi/workos/organization_api_key_with_value.rbi +84 -0
- data/rbi/workos/organization_api_key_with_value_owner.rbi +30 -0
- data/rbi/workos/organization_created.rbi +6 -6
- data/rbi/workos/organization_deleted.rbi +6 -6
- data/rbi/workos/organization_domain_created.rbi +6 -6
- data/rbi/workos/organization_domain_deleted.rbi +6 -6
- data/rbi/workos/organization_domain_updated.rbi +6 -6
- data/rbi/workos/organization_domain_verification_failed.rbi +6 -6
- data/rbi/workos/organization_domain_verified.rbi +6 -6
- data/rbi/workos/organization_membership.rbi +12 -0
- data/rbi/workos/organization_membership_created.rbi +6 -6
- data/rbi/workos/organization_membership_deleted.rbi +6 -6
- data/rbi/workos/organization_membership_service.rbi +114 -0
- data/rbi/workos/organization_membership_updated.rbi +6 -6
- data/rbi/workos/organization_role_created.rbi +6 -6
- data/rbi/workos/organization_role_deleted.rbi +6 -6
- data/rbi/workos/organization_role_updated.rbi +6 -6
- data/rbi/workos/organization_updated.rbi +6 -6
- data/rbi/workos/password_reset_created.rbi +6 -6
- data/rbi/workos/password_reset_succeeded.rbi +6 -6
- data/rbi/workos/password_session_authenticate_request.rbi +12 -0
- data/rbi/workos/permission_created.rbi +6 -6
- data/rbi/workos/permission_deleted.rbi +6 -6
- data/rbi/workos/permission_updated.rbi +6 -6
- data/rbi/workos/pipe_connected_account.rbi +78 -0
- data/rbi/workos/pipes.rbi +105 -1
- data/rbi/workos/pipes_connected_account_connected.rbi +54 -0
- data/rbi/workos/pipes_connected_account_disconnected.rbi +54 -0
- data/rbi/workos/pipes_connected_account_reauthorization_needed.rbi +54 -0
- data/rbi/workos/pipes_provider.rbi +34 -0
- data/rbi/workos/profile.rbi +6 -0
- data/rbi/workos/radar.rbi +2 -3
- data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +2 -8
- data/rbi/workos/refresh_token_session_authenticate_request.rbi +2 -2
- data/rbi/workos/rekey_request.rbi +30 -0
- data/rbi/workos/replace_group_role_assignment_entry.rbi +42 -0
- data/rbi/workos/replace_group_role_assignments.rbi +24 -0
- data/rbi/workos/revoke_session.rbi +0 -6
- data/rbi/workos/role_created.rbi +6 -6
- data/rbi/workos/role_deleted.rbi +6 -6
- data/rbi/workos/role_updated.rbi +6 -6
- data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
- data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
- data/rbi/workos/session_created.rbi +6 -6
- data/rbi/workos/session_manager.rbi +1 -1
- data/rbi/workos/session_revoked.rbi +6 -6
- data/rbi/workos/update_custom_provider_definition.rbi +84 -0
- data/rbi/workos/update_data_integration.rbi +48 -0
- data/rbi/workos/update_object_request.rbi +30 -0
- data/rbi/workos/update_user.rbi +6 -0
- data/rbi/workos/user.rbi +6 -0
- data/rbi/workos/{api_key_with_value.rbi → user_api_key.rbi} +9 -9
- data/rbi/workos/user_api_key_created_data_owner.rbi +36 -0
- data/rbi/workos/{dsync_deactivated_data_domain.rbi → user_api_key_owner.rbi} +5 -5
- data/rbi/workos/user_api_key_revoked_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_updated_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_with_value.rbi +84 -0
- data/rbi/workos/user_api_key_with_value_owner.rbi +36 -0
- data/rbi/workos/user_create_response.rbi +108 -0
- data/rbi/workos/user_created.rbi +6 -6
- data/rbi/workos/user_deleted.rbi +6 -6
- data/rbi/workos/user_management.rbi +72 -86
- data/rbi/workos/user_object.rbi +6 -0
- data/rbi/workos/user_organization_membership.rbi +12 -0
- data/rbi/workos/user_organization_membership_base_list_data.rbi +6 -0
- data/rbi/workos/user_role_assignment.rbi +66 -0
- data/rbi/workos/{role_assignment_resource.rbi → user_role_assignment_resource.rbi} +1 -1
- data/rbi/workos/user_role_assignment_source.rbi +30 -0
- data/rbi/workos/user_updated.rbi +6 -6
- data/rbi/workos/vault.rbi +70 -95
- data/rbi/workos/vault_byok_key_deleted.rbi +54 -0
- data/rbi/workos/vault_byok_key_deleted_data.rbi +30 -0
- data/rbi/workos/vault_byok_key_verification_completed.rbi +6 -6
- data/rbi/workos/vault_data_created.rbi +6 -6
- data/rbi/workos/vault_data_deleted.rbi +6 -6
- data/rbi/workos/vault_data_read.rbi +6 -6
- data/rbi/workos/vault_data_updated.rbi +6 -6
- data/rbi/workos/vault_dek_decrypted.rbi +6 -6
- data/rbi/workos/vault_dek_read.rbi +6 -6
- data/rbi/workos/vault_kek_created.rbi +6 -6
- data/rbi/workos/vault_metadata_read.rbi +6 -6
- data/rbi/workos/vault_names_listed.rbi +6 -6
- data/rbi/workos/vault_object.rbi +42 -0
- data/rbi/workos/waitlist_user_approved.rbi +6 -6
- data/rbi/workos/waitlist_user_created.rbi +6 -6
- data/rbi/workos/waitlist_user_denied.rbi +6 -6
- data/rbi/workos/webhook_endpoint.rbi +1 -0
- data/rbi/workos/webhooks.rbi +2 -2
- data/renovate.json +1 -61
- data/script/docs +16 -0
- data/script/docs-serve +12 -0
- data/script/llms-txt +37 -0
- data/test/workos/test_actions.rb +9 -0
- data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
- data/test/workos/test_api_keys.rb +20 -12
- data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
- data/test/workos/test_authorization.rb +64 -0
- data/test/workos/test_authorization_model_round_trip.rb +456 -0
- data/test/workos/test_base_client.rb +108 -0
- data/test/workos/test_client_api.rb +33 -0
- data/test/workos/test_connect_model_round_trip.rb +30 -0
- data/test/workos/test_encryptors_aes_gcm.rb +16 -1
- data/test/workos/test_groups_model_round_trip.rb +33 -0
- data/test/workos/test_model_round_trip.rb +2 -7138
- data/test/workos/test_organization_membership_service.rb +107 -0
- data/test/workos/test_organizations_model_round_trip.rb +29 -0
- data/test/workos/test_pipes.rb +75 -3
- data/test/workos/test_pipes_model_round_trip.rb +389 -0
- data/test/workos/test_pipes_provider.rb +41 -0
- data/test/workos/test_radar_model_round_trip.rb +85 -0
- data/test/workos/test_session.rb +43 -4
- data/test/workos/test_shared_model_round_trip.rb +92 -0
- data/test/workos/test_user_management.rb +77 -73
- data/test/workos/test_user_management_model_round_trip.rb +1087 -0
- data/test/workos/test_vault.rb +91 -88
- data/test/workos/test_webhook_verify.rb +11 -0
- data/test/workos/test_webhooks_model_round_trip.rb +53 -0
- metadata +220 -85
- data/lib/workos/audit_logs/audit_log_schema_json.rb +0 -34
- data/lib/workos/organizations/audit_logs_retention_json.rb +0 -18
- data/lib/workos/types/audit_log_export_json_state.rb +0 -14
- data/lib/workos/types/directory_groups_order.rb +0 -9
- data/lib/workos/types/directory_users_order.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_state.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_type.rb +0 -9
- data/lib/workos/types/feature_flags_order.rb +0 -9
- data/lib/workos/types/groups_order.rb +0 -9
- data/lib/workos/types/organizations_api_keys_order.rb +0 -9
- data/lib/workos/types/organizations_feature_flags_order.rb +0 -9
- data/lib/workos/types/organizations_order.rb +0 -9
- data/lib/workos/types/permissions_order.rb +0 -9
- data/lib/workos/types/radar_type.rb +0 -9
- data/lib/workos/types/user_management_invitations_order.rb +0 -9
- data/lib/workos/types/user_management_multi_factor_authentication_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_order.rb +0 -9
- data/lib/workos/types/user_management_users_authorized_applications_order.rb +0 -9
- data/lib/workos/types/user_management_users_feature_flags_order.rb +0 -9
- data/lib/workos/types/user_management_users_order.rb +0 -9
- data/lib/workos/types/webhook_endpoint_json_status.rb +0 -9
- data/lib/workos/types/webhooks_order.rb +0 -9
- data/lib/workos/user_management_organization_membership_groups.rb +0 -60
- data/lib/workos/webhooks/webhook_endpoint_json.rb +0 -40
- data/rbi/workos/actions.rbi +0 -48
- data/rbi/workos/audit_log_schema_json.rbi +0 -54
- data/rbi/workos/base_client.rbi +0 -132
- data/rbi/workos/configuration.rbi +0 -68
- data/rbi/workos/encryptors/aes_gcm.rbi +0 -19
- data/rbi/workos/errors.rbi +0 -43
- data/rbi/workos/hash_provider.rbi +0 -18
- data/rbi/workos/passwordless.rbi +0 -47
- data/rbi/workos/public_client.rbi +0 -12
- data/rbi/workos/session.rbi +0 -43
- data/rbi/workos/types/api_response.rbi +0 -29
- data/rbi/workos/types/base_model.rbi +0 -22
- data/rbi/workos/types/list_struct.rbi +0 -89
- data/rbi/workos/user_management_organization_membership_groups.rbi +0 -25
- data/rbi/workos/util.rbi +0 -12
- data/test/workos/test_user_management_organization_membership_groups.rb +0 -33
- /data/lib/workos/{user_management → organization_membership}/create_user_organization_membership.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/update_user_organization_membership.rb +0 -0
data/lib/workos/authorization.rb
CHANGED
|
@@ -52,6 +52,186 @@ module WorkOS
|
|
|
52
52
|
@client = client
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
# List role assignments for a group
|
|
56
|
+
# @param group_id [String] The ID of the group.
|
|
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::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
61
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
62
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::GroupRoleAssignment>]
|
|
63
|
+
def list_group_role_assignments(
|
|
64
|
+
group_id:,
|
|
65
|
+
before: nil,
|
|
66
|
+
after: nil,
|
|
67
|
+
limit: 10,
|
|
68
|
+
order: "desc",
|
|
69
|
+
request_options: {}
|
|
70
|
+
)
|
|
71
|
+
params = {
|
|
72
|
+
"before" => before,
|
|
73
|
+
"after" => after,
|
|
74
|
+
"limit" => limit,
|
|
75
|
+
"order" => order
|
|
76
|
+
}.compact
|
|
77
|
+
response = @client.request(
|
|
78
|
+
method: :get,
|
|
79
|
+
path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
|
|
80
|
+
auth: true,
|
|
81
|
+
params: params,
|
|
82
|
+
request_options: request_options
|
|
83
|
+
)
|
|
84
|
+
fetch_next = ->(cursor) {
|
|
85
|
+
list_group_role_assignments(
|
|
86
|
+
group_id: group_id,
|
|
87
|
+
before: before,
|
|
88
|
+
after: cursor,
|
|
89
|
+
limit: limit,
|
|
90
|
+
order: order,
|
|
91
|
+
request_options: request_options
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
WorkOS::Types::ListStruct.from_response(
|
|
95
|
+
response,
|
|
96
|
+
model: WorkOS::GroupRoleAssignment,
|
|
97
|
+
filters: {group_id: group_id, before: before, limit: limit, order: order},
|
|
98
|
+
fetch_next: fetch_next
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Assign a role to a group
|
|
103
|
+
# @param group_id [String] The ID of the group.
|
|
104
|
+
# @param role_slug [String] The slug of the role to assign to the group.
|
|
105
|
+
# @param resource_id [String, nil] The ID of the resource. Omit along with the external-id fields to target the organization itself.
|
|
106
|
+
# @param resource_external_id [String, nil] The external ID of the resource.
|
|
107
|
+
# @param resource_type_slug [String, nil] The resource type slug.
|
|
108
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
109
|
+
# @return [WorkOS::GroupRoleAssignment]
|
|
110
|
+
def create_group_role_assignment(
|
|
111
|
+
group_id:,
|
|
112
|
+
role_slug:,
|
|
113
|
+
resource_id: nil,
|
|
114
|
+
resource_external_id: nil,
|
|
115
|
+
resource_type_slug: nil,
|
|
116
|
+
request_options: {}
|
|
117
|
+
)
|
|
118
|
+
body = {
|
|
119
|
+
"role_slug" => role_slug,
|
|
120
|
+
"resource_id" => resource_id,
|
|
121
|
+
"resource_external_id" => resource_external_id,
|
|
122
|
+
"resource_type_slug" => resource_type_slug
|
|
123
|
+
}.compact
|
|
124
|
+
response = @client.request(
|
|
125
|
+
method: :post,
|
|
126
|
+
path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
|
|
127
|
+
auth: true,
|
|
128
|
+
body: body,
|
|
129
|
+
request_options: request_options
|
|
130
|
+
)
|
|
131
|
+
result = WorkOS::GroupRoleAssignment.new(response.body)
|
|
132
|
+
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"])
|
|
133
|
+
result
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Replace all role assignments for a group
|
|
137
|
+
# @param group_id [String] The ID of the group.
|
|
138
|
+
# @param role_assignments [Array<WorkOS::ReplaceGroupRoleAssignmentEntry>] The list of role assignments that should exist for the group. All existing assignments will be replaced.
|
|
139
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
140
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::GroupRoleAssignment>]
|
|
141
|
+
def update_group_role_assignments(
|
|
142
|
+
group_id:,
|
|
143
|
+
role_assignments:,
|
|
144
|
+
request_options: {}
|
|
145
|
+
)
|
|
146
|
+
body = {
|
|
147
|
+
"role_assignments" => role_assignments
|
|
148
|
+
}
|
|
149
|
+
response = @client.request(
|
|
150
|
+
method: :put,
|
|
151
|
+
path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
|
|
152
|
+
auth: true,
|
|
153
|
+
body: body,
|
|
154
|
+
request_options: request_options
|
|
155
|
+
)
|
|
156
|
+
WorkOS::Types::ListStruct.from_response(
|
|
157
|
+
response,
|
|
158
|
+
model: WorkOS::GroupRoleAssignment,
|
|
159
|
+
filters: {group_id: group_id, role_assignments: role_assignments}
|
|
160
|
+
)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Remove group role assignments by criteria
|
|
164
|
+
# @param group_id [String] The ID of the group.
|
|
165
|
+
# @param role_slug [String] The slug of the role to remove assignments for.
|
|
166
|
+
# @param resource_id [String, nil] The ID of the resource. Mutually exclusive with `resource_external_id` and `resource_type_slug`.
|
|
167
|
+
# @param resource_external_id [String, nil] The external ID of the resource.
|
|
168
|
+
# @param resource_type_slug [String, nil] The resource type slug.
|
|
169
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
170
|
+
# @return [void]
|
|
171
|
+
def delete_group_role_assignments(
|
|
172
|
+
group_id:,
|
|
173
|
+
role_slug:,
|
|
174
|
+
resource_id: nil,
|
|
175
|
+
resource_external_id: nil,
|
|
176
|
+
resource_type_slug: nil,
|
|
177
|
+
request_options: {}
|
|
178
|
+
)
|
|
179
|
+
body = {
|
|
180
|
+
"role_slug" => role_slug,
|
|
181
|
+
"resource_id" => resource_id,
|
|
182
|
+
"resource_external_id" => resource_external_id,
|
|
183
|
+
"resource_type_slug" => resource_type_slug
|
|
184
|
+
}.compact
|
|
185
|
+
@client.request(
|
|
186
|
+
method: :delete,
|
|
187
|
+
path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
|
|
188
|
+
auth: true,
|
|
189
|
+
body: body,
|
|
190
|
+
request_options: request_options
|
|
191
|
+
)
|
|
192
|
+
nil
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Get a group role assignment
|
|
196
|
+
# @param group_id [String] The ID of the group.
|
|
197
|
+
# @param role_assignment_id [String] The ID of the group role assignment.
|
|
198
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
199
|
+
# @return [WorkOS::GroupRoleAssignment]
|
|
200
|
+
def get_group_role_assignment(
|
|
201
|
+
group_id:,
|
|
202
|
+
role_assignment_id:,
|
|
203
|
+
request_options: {}
|
|
204
|
+
)
|
|
205
|
+
response = @client.request(
|
|
206
|
+
method: :get,
|
|
207
|
+
path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}",
|
|
208
|
+
auth: true,
|
|
209
|
+
request_options: request_options
|
|
210
|
+
)
|
|
211
|
+
result = WorkOS::GroupRoleAssignment.new(response.body)
|
|
212
|
+
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"])
|
|
213
|
+
result
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Remove a group role assignment
|
|
217
|
+
# @param group_id [String] The ID of the group.
|
|
218
|
+
# @param role_assignment_id [String] The ID of the group role assignment to remove.
|
|
219
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
220
|
+
# @return [void]
|
|
221
|
+
def delete_group_role_assignment(
|
|
222
|
+
group_id:,
|
|
223
|
+
role_assignment_id:,
|
|
224
|
+
request_options: {}
|
|
225
|
+
)
|
|
226
|
+
@client.request(
|
|
227
|
+
method: :delete,
|
|
228
|
+
path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}",
|
|
229
|
+
auth: true,
|
|
230
|
+
request_options: request_options
|
|
231
|
+
)
|
|
232
|
+
nil
|
|
233
|
+
end
|
|
234
|
+
|
|
55
235
|
# Check authorization
|
|
56
236
|
# @param organization_membership_id [String] The ID of the organization membership to check.
|
|
57
237
|
# @param permission_slug [String] The slug of the permission to check.
|
|
@@ -93,7 +273,7 @@ module WorkOS
|
|
|
93
273
|
# @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"`.
|
|
94
274
|
# @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"`.
|
|
95
275
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
96
|
-
# @param order [WorkOS::Types::
|
|
276
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
97
277
|
# @param permission_slug [String] The permission slug to filter by. Only child resources where the organization membership has this permission are returned.
|
|
98
278
|
# @param parent_resource [WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId] Identifies the parent resource.
|
|
99
279
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -104,7 +284,7 @@ module WorkOS
|
|
|
104
284
|
parent_resource:,
|
|
105
285
|
before: nil,
|
|
106
286
|
after: nil,
|
|
107
|
-
limit:
|
|
287
|
+
limit: 10,
|
|
108
288
|
order: "desc",
|
|
109
289
|
request_options: {}
|
|
110
290
|
)
|
|
@@ -157,7 +337,7 @@ module WorkOS
|
|
|
157
337
|
# @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"`.
|
|
158
338
|
# @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"`.
|
|
159
339
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
160
|
-
# @param order [WorkOS::Types::
|
|
340
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
161
341
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
162
342
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
163
343
|
def list_effective_permissions(
|
|
@@ -165,7 +345,7 @@ module WorkOS
|
|
|
165
345
|
resource_id:,
|
|
166
346
|
before: nil,
|
|
167
347
|
after: nil,
|
|
168
|
-
limit:
|
|
348
|
+
limit: 10,
|
|
169
349
|
order: "desc",
|
|
170
350
|
request_options: {}
|
|
171
351
|
)
|
|
@@ -208,7 +388,7 @@ module WorkOS
|
|
|
208
388
|
# @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"`.
|
|
209
389
|
# @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"`.
|
|
210
390
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
211
|
-
# @param order [WorkOS::Types::
|
|
391
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
212
392
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
213
393
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
214
394
|
def list_effective_permissions_by_external_id(
|
|
@@ -217,7 +397,7 @@ module WorkOS
|
|
|
217
397
|
external_id:,
|
|
218
398
|
before: nil,
|
|
219
399
|
after: nil,
|
|
220
|
-
limit:
|
|
400
|
+
limit: 10,
|
|
221
401
|
order: "desc",
|
|
222
402
|
request_options: {}
|
|
223
403
|
)
|
|
@@ -259,22 +439,31 @@ module WorkOS
|
|
|
259
439
|
# @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"`.
|
|
260
440
|
# @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"`.
|
|
261
441
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
262
|
-
# @param order [WorkOS::Types::
|
|
442
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
443
|
+
# @param resource_id [String, nil] Filter assignments by the ID of the resource.
|
|
444
|
+
# @param resource_external_id [String, nil] Filter assignments by the external ID of the resource.
|
|
445
|
+
# @param resource_type_slug [String, nil] Filter assignments by the slug of the resource type.
|
|
263
446
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
264
|
-
# @return [WorkOS::Types::ListStruct<WorkOS::
|
|
447
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserRoleAssignment>]
|
|
265
448
|
def list_role_assignments(
|
|
266
449
|
organization_membership_id:,
|
|
267
450
|
before: nil,
|
|
268
451
|
after: nil,
|
|
269
|
-
limit:
|
|
452
|
+
limit: 10,
|
|
270
453
|
order: "desc",
|
|
454
|
+
resource_id: nil,
|
|
455
|
+
resource_external_id: nil,
|
|
456
|
+
resource_type_slug: nil,
|
|
271
457
|
request_options: {}
|
|
272
458
|
)
|
|
273
459
|
params = {
|
|
274
460
|
"before" => before,
|
|
275
461
|
"after" => after,
|
|
276
462
|
"limit" => limit,
|
|
277
|
-
"order" => order
|
|
463
|
+
"order" => order,
|
|
464
|
+
"resource_id" => resource_id,
|
|
465
|
+
"resource_external_id" => resource_external_id,
|
|
466
|
+
"resource_type_slug" => resource_type_slug
|
|
278
467
|
}.compact
|
|
279
468
|
response = @client.request(
|
|
280
469
|
method: :get,
|
|
@@ -290,13 +479,16 @@ module WorkOS
|
|
|
290
479
|
after: cursor,
|
|
291
480
|
limit: limit,
|
|
292
481
|
order: order,
|
|
482
|
+
resource_id: resource_id,
|
|
483
|
+
resource_external_id: resource_external_id,
|
|
484
|
+
resource_type_slug: resource_type_slug,
|
|
293
485
|
request_options: request_options
|
|
294
486
|
)
|
|
295
487
|
}
|
|
296
488
|
WorkOS::Types::ListStruct.from_response(
|
|
297
489
|
response,
|
|
298
|
-
model: WorkOS::
|
|
299
|
-
filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order},
|
|
490
|
+
model: WorkOS::UserRoleAssignment,
|
|
491
|
+
filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order, resource_id: resource_id, resource_external_id: resource_external_id, resource_type_slug: resource_type_slug},
|
|
300
492
|
fetch_next: fetch_next
|
|
301
493
|
)
|
|
302
494
|
end
|
|
@@ -306,7 +498,7 @@ module WorkOS
|
|
|
306
498
|
# @param role_slug [String] The slug of the role to assign.
|
|
307
499
|
# @param resource_target [WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId] Identifies the resource target.
|
|
308
500
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
309
|
-
# @return [WorkOS::
|
|
501
|
+
# @return [WorkOS::UserRoleAssignment]
|
|
310
502
|
def assign_role(
|
|
311
503
|
organization_membership_id:,
|
|
312
504
|
role_slug:,
|
|
@@ -332,7 +524,7 @@ module WorkOS
|
|
|
332
524
|
body: body,
|
|
333
525
|
request_options: request_options
|
|
334
526
|
)
|
|
335
|
-
result = WorkOS::
|
|
527
|
+
result = WorkOS::UserRoleAssignment.new(response.body)
|
|
336
528
|
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"])
|
|
337
529
|
result
|
|
338
530
|
end
|
|
@@ -671,7 +863,7 @@ module WorkOS
|
|
|
671
863
|
organization_id:,
|
|
672
864
|
resource_type_slug:,
|
|
673
865
|
external_id:,
|
|
674
|
-
cascade_delete:
|
|
866
|
+
cascade_delete: false,
|
|
675
867
|
request_options: {}
|
|
676
868
|
)
|
|
677
869
|
params = {
|
|
@@ -694,7 +886,7 @@ module WorkOS
|
|
|
694
886
|
# @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"`.
|
|
695
887
|
# @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"`.
|
|
696
888
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
697
|
-
# @param order [WorkOS::Types::
|
|
889
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
698
890
|
# @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned.
|
|
699
891
|
# @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use "direct" for direct assignments only, or "indirect" to include inherited assignments.
|
|
700
892
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -706,7 +898,7 @@ module WorkOS
|
|
|
706
898
|
permission_slug:,
|
|
707
899
|
before: nil,
|
|
708
900
|
after: nil,
|
|
709
|
-
limit:
|
|
901
|
+
limit: 10,
|
|
710
902
|
order: "desc",
|
|
711
903
|
assignment: nil,
|
|
712
904
|
request_options: {}
|
|
@@ -748,27 +940,82 @@ module WorkOS
|
|
|
748
940
|
)
|
|
749
941
|
end
|
|
750
942
|
|
|
943
|
+
# List role assignments for a resource by external ID
|
|
944
|
+
# @param organization_id [String] The ID of the organization that owns the resource.
|
|
945
|
+
# @param resource_type_slug [String] The slug of the resource type.
|
|
946
|
+
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
947
|
+
# @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"`.
|
|
948
|
+
# @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"`.
|
|
949
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
950
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
951
|
+
# @param role_slug [String, nil] Filter assignments by the slug of the role.
|
|
952
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
953
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserRoleAssignment>]
|
|
954
|
+
def list_role_assignments_for_resource_by_external_id(
|
|
955
|
+
organization_id:,
|
|
956
|
+
resource_type_slug:,
|
|
957
|
+
external_id:,
|
|
958
|
+
before: nil,
|
|
959
|
+
after: nil,
|
|
960
|
+
limit: 10,
|
|
961
|
+
order: "desc",
|
|
962
|
+
role_slug: nil,
|
|
963
|
+
request_options: {}
|
|
964
|
+
)
|
|
965
|
+
params = {
|
|
966
|
+
"before" => before,
|
|
967
|
+
"after" => after,
|
|
968
|
+
"limit" => limit,
|
|
969
|
+
"order" => order,
|
|
970
|
+
"role_slug" => role_slug
|
|
971
|
+
}.compact
|
|
972
|
+
response = @client.request(
|
|
973
|
+
method: :get,
|
|
974
|
+
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/role_assignments",
|
|
975
|
+
auth: true,
|
|
976
|
+
params: params,
|
|
977
|
+
request_options: request_options
|
|
978
|
+
)
|
|
979
|
+
fetch_next = ->(cursor) {
|
|
980
|
+
list_role_assignments_for_resource_by_external_id(
|
|
981
|
+
organization_id: organization_id,
|
|
982
|
+
resource_type_slug: resource_type_slug,
|
|
983
|
+
external_id: external_id,
|
|
984
|
+
before: before,
|
|
985
|
+
after: cursor,
|
|
986
|
+
limit: limit,
|
|
987
|
+
order: order,
|
|
988
|
+
role_slug: role_slug,
|
|
989
|
+
request_options: request_options
|
|
990
|
+
)
|
|
991
|
+
}
|
|
992
|
+
WorkOS::Types::ListStruct.from_response(
|
|
993
|
+
response,
|
|
994
|
+
model: WorkOS::UserRoleAssignment,
|
|
995
|
+
filters: {organization_id: organization_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order, role_slug: role_slug},
|
|
996
|
+
fetch_next: fetch_next
|
|
997
|
+
)
|
|
998
|
+
end
|
|
999
|
+
|
|
751
1000
|
# List resources
|
|
752
1001
|
# @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"`.
|
|
753
1002
|
# @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"`.
|
|
754
1003
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
755
|
-
# @param order [WorkOS::Types::
|
|
1004
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
756
1005
|
# @param organization_id [String, nil] Filter resources by organization ID.
|
|
757
1006
|
# @param resource_type_slug [String, nil] Filter resources by resource type slug.
|
|
758
1007
|
# @param resource_external_id [String, nil] Filter resources by external ID.
|
|
759
|
-
# @param search [String, nil] Search resources by name.
|
|
760
1008
|
# @param parent [WorkOS::Authorization::ParentById, WorkOS::Authorization::ParentByExternalId, nil] Identifies the parent.
|
|
761
1009
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
762
1010
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationResource>]
|
|
763
1011
|
def list_resources(
|
|
764
1012
|
before: nil,
|
|
765
1013
|
after: nil,
|
|
766
|
-
limit:
|
|
1014
|
+
limit: 10,
|
|
767
1015
|
order: "desc",
|
|
768
1016
|
organization_id: nil,
|
|
769
1017
|
resource_type_slug: nil,
|
|
770
1018
|
resource_external_id: nil,
|
|
771
|
-
search: nil,
|
|
772
1019
|
parent: nil,
|
|
773
1020
|
request_options: {}
|
|
774
1021
|
)
|
|
@@ -779,8 +1026,7 @@ module WorkOS
|
|
|
779
1026
|
"order" => order,
|
|
780
1027
|
"organization_id" => organization_id,
|
|
781
1028
|
"resource_type_slug" => resource_type_slug,
|
|
782
|
-
"resource_external_id" => resource_external_id
|
|
783
|
-
"search" => search
|
|
1029
|
+
"resource_external_id" => resource_external_id
|
|
784
1030
|
}.compact
|
|
785
1031
|
if parent
|
|
786
1032
|
case parent
|
|
@@ -809,7 +1055,6 @@ module WorkOS
|
|
|
809
1055
|
organization_id: organization_id,
|
|
810
1056
|
resource_type_slug: resource_type_slug,
|
|
811
1057
|
resource_external_id: resource_external_id,
|
|
812
|
-
search: search,
|
|
813
1058
|
parent: parent,
|
|
814
1059
|
request_options: request_options
|
|
815
1060
|
)
|
|
@@ -817,7 +1062,7 @@ module WorkOS
|
|
|
817
1062
|
WorkOS::Types::ListStruct.from_response(
|
|
818
1063
|
response,
|
|
819
1064
|
model: WorkOS::AuthorizationResource,
|
|
820
|
-
filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id,
|
|
1065
|
+
filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id, parent: parent},
|
|
821
1066
|
fetch_next: fetch_next
|
|
822
1067
|
)
|
|
823
1068
|
end
|
|
@@ -937,7 +1182,7 @@ module WorkOS
|
|
|
937
1182
|
# @return [void]
|
|
938
1183
|
def delete_resource(
|
|
939
1184
|
resource_id:,
|
|
940
|
-
cascade_delete:
|
|
1185
|
+
cascade_delete: false,
|
|
941
1186
|
request_options: {}
|
|
942
1187
|
)
|
|
943
1188
|
params = {
|
|
@@ -958,7 +1203,7 @@ module WorkOS
|
|
|
958
1203
|
# @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"`.
|
|
959
1204
|
# @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"`.
|
|
960
1205
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
961
|
-
# @param order [WorkOS::Types::
|
|
1206
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
962
1207
|
# @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned.
|
|
963
1208
|
# @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use `direct` for direct assignments only, or `indirect` to include inherited assignments.
|
|
964
1209
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -968,7 +1213,7 @@ module WorkOS
|
|
|
968
1213
|
permission_slug:,
|
|
969
1214
|
before: nil,
|
|
970
1215
|
after: nil,
|
|
971
|
-
limit:
|
|
1216
|
+
limit: 10,
|
|
972
1217
|
order: "desc",
|
|
973
1218
|
assignment: nil,
|
|
974
1219
|
request_options: {}
|
|
@@ -1008,6 +1253,57 @@ module WorkOS
|
|
|
1008
1253
|
)
|
|
1009
1254
|
end
|
|
1010
1255
|
|
|
1256
|
+
# List role assignments for a resource
|
|
1257
|
+
# @param resource_id [String] The ID of the authorization resource.
|
|
1258
|
+
# @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"`.
|
|
1259
|
+
# @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"`.
|
|
1260
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1261
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
1262
|
+
# @param role_slug [String, nil] Filter assignments by the slug of the role.
|
|
1263
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1264
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserRoleAssignment>]
|
|
1265
|
+
def list_role_assignments_for_resource(
|
|
1266
|
+
resource_id:,
|
|
1267
|
+
before: nil,
|
|
1268
|
+
after: nil,
|
|
1269
|
+
limit: 10,
|
|
1270
|
+
order: "desc",
|
|
1271
|
+
role_slug: nil,
|
|
1272
|
+
request_options: {}
|
|
1273
|
+
)
|
|
1274
|
+
params = {
|
|
1275
|
+
"before" => before,
|
|
1276
|
+
"after" => after,
|
|
1277
|
+
"limit" => limit,
|
|
1278
|
+
"order" => order,
|
|
1279
|
+
"role_slug" => role_slug
|
|
1280
|
+
}.compact
|
|
1281
|
+
response = @client.request(
|
|
1282
|
+
method: :get,
|
|
1283
|
+
path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}/role_assignments",
|
|
1284
|
+
auth: true,
|
|
1285
|
+
params: params,
|
|
1286
|
+
request_options: request_options
|
|
1287
|
+
)
|
|
1288
|
+
fetch_next = ->(cursor) {
|
|
1289
|
+
list_role_assignments_for_resource(
|
|
1290
|
+
resource_id: resource_id,
|
|
1291
|
+
before: before,
|
|
1292
|
+
after: cursor,
|
|
1293
|
+
limit: limit,
|
|
1294
|
+
order: order,
|
|
1295
|
+
role_slug: role_slug,
|
|
1296
|
+
request_options: request_options
|
|
1297
|
+
)
|
|
1298
|
+
}
|
|
1299
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1300
|
+
response,
|
|
1301
|
+
model: WorkOS::UserRoleAssignment,
|
|
1302
|
+
filters: {resource_id: resource_id, before: before, limit: limit, order: order, role_slug: role_slug},
|
|
1303
|
+
fetch_next: fetch_next
|
|
1304
|
+
)
|
|
1305
|
+
end
|
|
1306
|
+
|
|
1011
1307
|
# List environment roles
|
|
1012
1308
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1013
1309
|
# @return [WorkOS::RoleList]
|
|
@@ -1156,13 +1452,13 @@ module WorkOS
|
|
|
1156
1452
|
# @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"`.
|
|
1157
1453
|
# @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"`.
|
|
1158
1454
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1159
|
-
# @param order [WorkOS::Types::
|
|
1455
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
1160
1456
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1161
1457
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
1162
1458
|
def list_permissions(
|
|
1163
1459
|
before: nil,
|
|
1164
1460
|
after: nil,
|
|
1165
|
-
limit:
|
|
1461
|
+
limit: 10,
|
|
1166
1462
|
order: "desc",
|
|
1167
1463
|
request_options: {}
|
|
1168
1464
|
)
|