onelogin 1.4.1 → 3.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +7 -4
- data/README.md +245 -423
- data/Rakefile +7 -3
- data/docs/Action.md +26 -0
- data/docs/ActivateFactorRequest.md +24 -0
- data/docs/AddAccessTokenClaimRequest.md +22 -0
- data/docs/AddClientAppRequest.md +20 -0
- data/docs/AddRoleUsers200ResponseInner.md +18 -0
- data/docs/AddScopeRequest.md +20 -0
- data/docs/AuthMethod.md +15 -0
- data/docs/AuthServerConfiguration.md +24 -0
- data/docs/ClientApp.md +20 -0
- data/docs/Condition.md +22 -0
- data/docs/Connector.md +26 -0
- data/docs/CreateAuthorizationServerRequest.md +22 -0
- data/docs/CreateEnvironmentVariableRequest.md +20 -0
- data/docs/CreateRoles201ResponseInner.md +18 -0
- data/docs/DefaultApi.md +6812 -0
- data/docs/Device.md +26 -0
- data/docs/EnrollFactorRequest.md +28 -0
- data/docs/Envvar.md +24 -0
- data/docs/ErrorStatus.md +22 -0
- data/docs/ErrorStatusErrorsInner.md +20 -0
- data/docs/FactorInner.md +32 -0
- data/docs/FactorInnerFactorData.md +20 -0
- data/docs/GenerateMfaToken200Response.md +24 -0
- data/docs/GenerateMfaToken422Response.md +24 -0
- data/docs/GenerateMfaToken422ResponseDetails.md +18 -0
- data/docs/GenerateMfaTokenRequest.md +20 -0
- data/docs/GenerateSamlAssertionRequest.md +26 -0
- data/docs/GenerateToken200Response.md +28 -0
- data/docs/GenerateToken400Response.md +18 -0
- data/docs/GenerateTokenRequest.md +18 -0
- data/docs/GetAuthorizationServer200Response.md +24 -0
- data/docs/GetAvailableFactors200ResponseInner.md +22 -0
- data/docs/GetClientApps200ResponseInner.md +24 -0
- data/docs/GetClientApps200ResponseInnerScopesInner.md +22 -0
- data/docs/GetRateLimit200Response.md +20 -0
- data/docs/GetRateLimit200ResponseData.md +22 -0
- data/docs/GetRiskScore200Response.md +20 -0
- data/docs/GetRiskScore400Response.md +18 -0
- data/docs/GetRiskScoreRequest.md +30 -0
- data/docs/GetScoreInsights200Response.md +20 -0
- data/docs/GetScoreInsights200ResponseScores.md +26 -0
- data/docs/GetUserApps200ResponseInner.md +32 -0
- data/docs/Hook.md +46 -0
- data/docs/HookConditionsInner.md +22 -0
- data/docs/HookOptions.md +22 -0
- data/docs/HookStatus.md +20 -0
- data/docs/Id.md +18 -0
- data/docs/ListAccessTokenClaims200ResponseInner.md +34 -0
- data/docs/ListActions200ResponseInner.md +20 -0
- data/docs/ListAppUsers200ResponseInner.md +26 -0
- data/docs/ListAuthorizationServers200ResponseInner.md +24 -0
- data/docs/ListAuthorizationServers200ResponseInnerConfiguration.md +20 -0
- data/docs/ListConditionOperators200ResponseInner.md +20 -0
- data/docs/ListConditionValues200ResponseInner.md +20 -0
- data/docs/ListConditions200ResponseInner.md +20 -0
- data/docs/ListMappingConditionOperators200ResponseInner.md +20 -0
- data/docs/ListMappingConditions200ResponseInner.md +20 -0
- data/docs/ListScopes200ResponseInner.md +22 -0
- data/docs/Log.md +24 -0
- data/docs/Mapping.md +30 -0
- data/docs/Registration.md +22 -0
- data/docs/RemoveRoleUsersRequest.md +18 -0
- data/docs/RevokeTokenRequest.md +18 -0
- data/docs/RiskDevice.md +18 -0
- data/docs/RiskRule.md +30 -0
- data/docs/RiskUser.md +22 -0
- data/docs/Role.md +26 -0
- data/docs/Rule.md +30 -0
- data/docs/RuleId.md +18 -0
- data/docs/Schema.md +56 -0
- data/docs/Schema1.md +28 -0
- data/docs/Schema1AddedBy.md +20 -0
- data/docs/SchemaProvisioning.md +18 -0
- data/docs/Session.md +18 -0
- data/docs/SetRoleApps200ResponseInner.md +18 -0
- data/docs/Source.md +20 -0
- data/docs/Status.md +24 -0
- data/docs/Status1.md +22 -0
- data/docs/Status2.md +18 -0
- data/docs/Status2Status.md +24 -0
- data/docs/TrackEventRequest.md +34 -0
- data/docs/UpdateAuthorizationServer400Response.md +24 -0
- data/docs/UpdateClientAppRequest.md +18 -0
- data/docs/UpdateEnvironmentVariableRequest.md +18 -0
- data/docs/UpdateRole200Response.md +18 -0
- data/docs/User.md +90 -0
- data/docs/VerifyEnrollmentRequest.md +18 -0
- data/docs/VerifyFactorRequest.md +20 -0
- data/docs/VerifyFactorSaml200Response.md +20 -0
- data/docs/VerifyFactorSamlRequest.md +26 -0
- data/docs/VerifyFactorVoice200ResponseInner.md +22 -0
- data/git_push.sh +57 -0
- data/lib/onelogin/api/default_api.rb +7334 -0
- data/lib/onelogin/api_client.rb +391 -0
- data/lib/onelogin/api_error.rb +57 -0
- data/lib/onelogin/configuration.rb +282 -0
- data/lib/onelogin/models/action.rb +262 -0
- data/lib/onelogin/models/activate_factor_request.rb +250 -0
- data/lib/onelogin/models/add_access_token_claim_request.rb +237 -0
- data/lib/onelogin/models/add_client_app_request.rb +230 -0
- data/lib/onelogin/models/add_role_users200_response_inner.rb +219 -0
- data/lib/onelogin/models/add_scope_request.rb +228 -0
- data/lib/onelogin/models/auth_method.rb +43 -0
- data/lib/onelogin/models/auth_server_configuration.rb +248 -0
- data/lib/onelogin/models/client_app.rb +228 -0
- data/lib/onelogin/models/condition.rb +240 -0
- data/lib/onelogin/models/connector.rb +259 -0
- data/lib/onelogin/models/create_authorization_server_request.rb +237 -0
- data/lib/onelogin/models/create_environment_variable_request.rb +240 -0
- data/lib/onelogin/models/create_roles201_response_inner.rb +219 -0
- data/lib/onelogin/models/device.rb +255 -0
- data/lib/onelogin/models/enroll_factor_request.rb +280 -0
- data/lib/onelogin/models/envvar.rb +250 -0
- data/lib/onelogin/models/error_status.rb +239 -0
- data/lib/onelogin/models/error_status_errors_inner.rb +230 -0
- data/lib/onelogin/models/factor_inner.rb +323 -0
- data/lib/onelogin/models/factor_inner_factor_data.rb +231 -0
- data/lib/onelogin/models/generate_mfa_token200_response.rb +250 -0
- data/lib/onelogin/models/generate_mfa_token422_response.rb +246 -0
- data/lib/onelogin/models/generate_mfa_token422_response_details.rb +221 -0
- data/lib/onelogin/models/generate_mfa_token_request.rb +230 -0
- data/lib/onelogin/models/generate_saml_assertion_request.rb +280 -0
- data/lib/onelogin/models/generate_token200_response.rb +264 -0
- data/lib/onelogin/models/generate_token400_response.rb +219 -0
- data/lib/onelogin/models/generate_token_request.rb +253 -0
- data/lib/onelogin/models/get_authorization_server200_response.rb +246 -0
- data/lib/onelogin/models/get_available_factors200_response_inner.rb +240 -0
- data/lib/onelogin/models/get_client_apps200_response_inner.rb +248 -0
- data/lib/onelogin/models/get_client_apps200_response_inner_scopes_inner.rb +237 -0
- data/lib/onelogin/models/get_rate_limit200_response.rb +228 -0
- data/lib/onelogin/models/get_rate_limit200_response_data.rb +237 -0
- data/lib/onelogin/models/get_risk_score200_response.rb +256 -0
- data/lib/onelogin/models/get_risk_score400_response.rb +221 -0
- data/lib/onelogin/models/get_risk_score_request.rb +291 -0
- data/lib/onelogin/models/get_score_insights200_response.rb +228 -0
- data/lib/onelogin/models/get_score_insights200_response_scores.rb +255 -0
- data/lib/onelogin/models/get_user_apps200_response_inner.rb +335 -0
- data/lib/onelogin/models/hook.rb +462 -0
- data/lib/onelogin/models/hook_conditions_inner.rb +237 -0
- data/lib/onelogin/models/hook_options.rb +238 -0
- data/lib/onelogin/models/hook_status.rb +228 -0
- data/lib/onelogin/models/id.rb +219 -0
- data/lib/onelogin/models/list_access_token_claims200_response_inner.rb +293 -0
- data/lib/onelogin/models/list_actions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_app_users200_response_inner.rb +255 -0
- data/lib/onelogin/models/list_authorization_servers200_response_inner.rb +246 -0
- data/lib/onelogin/models/list_authorization_servers200_response_inner_configuration.rb +230 -0
- data/lib/onelogin/models/list_condition_operators200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_condition_values200_response_inner.rb +228 -0
- data/lib/onelogin/models/list_conditions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_mapping_condition_operators200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_mapping_conditions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_scopes200_response_inner.rb +237 -0
- data/lib/onelogin/models/log.rb +248 -0
- data/lib/onelogin/models/mapping.rb +342 -0
- data/lib/onelogin/models/registration.rb +274 -0
- data/lib/onelogin/models/remove_role_users_request.rb +221 -0
- data/lib/onelogin/models/revoke_token_request.rb +219 -0
- data/lib/onelogin/models/risk_device.rb +221 -0
- data/lib/onelogin/models/risk_rule.rb +325 -0
- data/lib/onelogin/models/risk_user.rb +248 -0
- data/lib/onelogin/models/role.rb +266 -0
- data/lib/onelogin/models/rule.rb +317 -0
- data/lib/onelogin/models/rule_id.rb +219 -0
- data/lib/onelogin/models/schema.rb +441 -0
- data/lib/onelogin/models/schema1.rb +265 -0
- data/lib/onelogin/models/schema1_added_by.rb +228 -0
- data/lib/onelogin/models/schema_provisioning.rb +220 -0
- data/lib/onelogin/models/session.rb +221 -0
- data/lib/onelogin/models/set_role_apps200_response_inner.rb +220 -0
- data/lib/onelogin/models/source.rb +230 -0
- data/lib/onelogin/models/status.rb +246 -0
- data/lib/onelogin/models/status1.rb +237 -0
- data/lib/onelogin/models/status2.rb +219 -0
- data/lib/onelogin/models/status2_status.rb +246 -0
- data/lib/onelogin/models/track_event_request.rb +316 -0
- data/lib/onelogin/models/update_authorization_server400_response.rb +246 -0
- data/lib/onelogin/models/update_client_app_request.rb +221 -0
- data/lib/onelogin/models/update_environment_variable_request.rb +225 -0
- data/lib/onelogin/models/update_role200_response.rb +219 -0
- data/lib/onelogin/models/user.rb +615 -0
- data/lib/onelogin/models/verify_enrollment_request.rb +219 -0
- data/lib/onelogin/models/verify_factor_request.rb +230 -0
- data/lib/onelogin/models/verify_factor_saml200_response.rb +230 -0
- data/lib/onelogin/models/verify_factor_saml_request.rb +275 -0
- data/lib/onelogin/models/verify_factor_voice200_response_inner.rb +271 -0
- data/lib/onelogin/version.rb +13 -1
- data/lib/onelogin.rb +130 -1
- data/onelogin.gemspec +36 -43
- data/spec/api/default_api_spec.rb +1259 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +58 -0
- data/spec/models/activate_factor_request_spec.rb +52 -0
- data/spec/models/add_access_token_claim_request_spec.rb +46 -0
- data/spec/models/add_client_app_request_spec.rb +40 -0
- data/spec/models/add_role_users200_response_inner_spec.rb +34 -0
- data/spec/models/add_scope_request_spec.rb +40 -0
- data/spec/models/auth_method_spec.rb +28 -0
- data/spec/models/auth_server_configuration_spec.rb +52 -0
- data/spec/models/client_app_spec.rb +40 -0
- data/spec/models/condition_spec.rb +46 -0
- data/spec/models/connector_spec.rb +58 -0
- data/spec/models/create_authorization_server_request_spec.rb +46 -0
- data/spec/models/create_environment_variable_request_spec.rb +40 -0
- data/spec/models/create_roles201_response_inner_spec.rb +34 -0
- data/spec/models/device_spec.rb +58 -0
- data/spec/models/enroll_factor_request_spec.rb +64 -0
- data/spec/models/envvar_spec.rb +52 -0
- data/spec/models/error_status_errors_inner_spec.rb +40 -0
- data/spec/models/error_status_spec.rb +46 -0
- data/spec/models/factor_inner_factor_data_spec.rb +40 -0
- data/spec/models/factor_inner_spec.rb +80 -0
- data/spec/models/generate_mfa_token200_response_spec.rb +52 -0
- data/spec/models/generate_mfa_token422_response_details_spec.rb +34 -0
- data/spec/models/generate_mfa_token422_response_spec.rb +52 -0
- data/spec/models/generate_mfa_token_request_spec.rb +40 -0
- data/spec/models/generate_saml_assertion_request_spec.rb +58 -0
- data/spec/models/generate_token200_response_spec.rb +64 -0
- data/spec/models/generate_token400_response_spec.rb +34 -0
- data/spec/models/generate_token_request_spec.rb +38 -0
- data/spec/models/get_authorization_server200_response_spec.rb +52 -0
- data/spec/models/get_available_factors200_response_inner_spec.rb +46 -0
- data/spec/models/get_client_apps200_response_inner_scopes_inner_spec.rb +46 -0
- data/spec/models/get_client_apps200_response_inner_spec.rb +52 -0
- data/spec/models/get_rate_limit200_response_data_spec.rb +46 -0
- data/spec/models/get_rate_limit200_response_spec.rb +40 -0
- data/spec/models/get_risk_score200_response_spec.rb +40 -0
- data/spec/models/get_risk_score400_response_spec.rb +34 -0
- data/spec/models/get_risk_score_request_spec.rb +70 -0
- data/spec/models/get_score_insights200_response_scores_spec.rb +58 -0
- data/spec/models/get_score_insights200_response_spec.rb +40 -0
- data/spec/models/get_user_apps200_response_inner_spec.rb +84 -0
- data/spec/models/hook_conditions_inner_spec.rb +46 -0
- data/spec/models/hook_options_spec.rb +46 -0
- data/spec/models/hook_spec.rb +122 -0
- data/spec/models/hook_status_spec.rb +40 -0
- data/spec/models/id_spec.rb +34 -0
- data/spec/models/list_access_token_claims200_response_inner_spec.rb +82 -0
- data/spec/models/list_actions200_response_inner_spec.rb +40 -0
- data/spec/models/list_app_users200_response_inner_spec.rb +58 -0
- data/spec/models/list_authorization_servers200_response_inner_configuration_spec.rb +40 -0
- data/spec/models/list_authorization_servers200_response_inner_spec.rb +52 -0
- data/spec/models/list_condition_operators200_response_inner_spec.rb +40 -0
- data/spec/models/list_condition_values200_response_inner_spec.rb +40 -0
- data/spec/models/list_conditions200_response_inner_spec.rb +40 -0
- data/spec/models/list_mapping_condition_operators200_response_inner_spec.rb +40 -0
- data/spec/models/list_mapping_conditions200_response_inner_spec.rb +40 -0
- data/spec/models/list_scopes200_response_inner_spec.rb +46 -0
- data/spec/models/log_spec.rb +52 -0
- data/spec/models/mapping_spec.rb +74 -0
- data/spec/models/registration_spec.rb +50 -0
- data/spec/models/remove_role_users_request_spec.rb +34 -0
- data/spec/models/revoke_token_request_spec.rb +34 -0
- data/spec/models/risk_device_spec.rb +34 -0
- data/spec/models/risk_rule_spec.rb +78 -0
- data/spec/models/risk_user_spec.rb +46 -0
- data/spec/models/role_spec.rb +58 -0
- data/spec/models/rule_id_spec.rb +34 -0
- data/spec/models/rule_spec.rb +74 -0
- data/spec/models/schema1_added_by_spec.rb +40 -0
- data/spec/models/schema1_spec.rb +64 -0
- data/spec/models/schema_provisioning_spec.rb +34 -0
- data/spec/models/schema_spec.rb +152 -0
- data/spec/models/session_spec.rb +34 -0
- data/spec/models/set_role_apps200_response_inner_spec.rb +34 -0
- data/spec/models/source_spec.rb +40 -0
- data/spec/models/status1_spec.rb +46 -0
- data/spec/models/status2_spec.rb +34 -0
- data/spec/models/status2_status_spec.rb +52 -0
- data/spec/models/status_spec.rb +52 -0
- data/spec/models/track_event_request_spec.rb +82 -0
- data/spec/models/update_authorization_server400_response_spec.rb +52 -0
- data/spec/models/update_client_app_request_spec.rb +34 -0
- data/spec/models/update_environment_variable_request_spec.rb +34 -0
- data/spec/models/update_role200_response_spec.rb +34 -0
- data/spec/models/user_spec.rb +258 -0
- data/spec/models/verify_enrollment_request_spec.rb +34 -0
- data/spec/models/verify_factor_request_spec.rb +40 -0
- data/spec/models/verify_factor_saml200_response_spec.rb +40 -0
- data/spec/models/verify_factor_saml_request_spec.rb +58 -0
- data/spec/models/verify_factor_voice200_response_inner_spec.rb +50 -0
- data/spec/spec_helper.rb +111 -0
- metadata +402 -210
- data/.gitignore +0 -12
- data/.travis.yml +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -6
- data/examples/Gemfile +0 -3
- data/examples/Gemfile.lock +0 -21
- data/examples/README.md +0 -19
- data/examples/all-users-to-csv.rb +0 -48
- data/examples/create-user.rb +0 -16
- data/examples/events-to-csv.rb +0 -93
- data/examples/last-app-user-login-to-csv.rb +0 -72
- data/examples/list-users.rb +0 -15
- data/examples/rails-custom-login-page/.gitignore +0 -45
- data/examples/rails-custom-login-page/.ruby-version +0 -1
- data/examples/rails-custom-login-page/Gemfile +0 -57
- data/examples/rails-custom-login-page/Gemfile.lock +0 -208
- data/examples/rails-custom-login-page/README.md +0 -105
- data/examples/rails-custom-login-page/Rakefile +0 -6
- data/examples/rails-custom-login-page/app/assets/config/manifest.js +0 -3
- data/examples/rails-custom-login-page/app/assets/images/.keep +0 -0
- data/examples/rails-custom-login-page/app/assets/javascripts/application.js +0 -18
- data/examples/rails-custom-login-page/app/assets/javascripts/cable.js +0 -13
- data/examples/rails-custom-login-page/app/assets/javascripts/channels/.keep +0 -0
- data/examples/rails-custom-login-page/app/assets/javascripts/dashboard.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/javascripts/home.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/javascripts/sessions.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/application.css +0 -15
- data/examples/rails-custom-login-page/app/assets/stylesheets/dashboard.scss +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/home.scss +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/sessions.scss +0 -3
- data/examples/rails-custom-login-page/app/channels/application_cable/channel.rb +0 -4
- data/examples/rails-custom-login-page/app/channels/application_cable/connection.rb +0 -4
- data/examples/rails-custom-login-page/app/controllers/application_controller.rb +0 -23
- data/examples/rails-custom-login-page/app/controllers/concerns/.keep +0 -0
- data/examples/rails-custom-login-page/app/controllers/dashboard_controller.rb +0 -10
- data/examples/rails-custom-login-page/app/controllers/home_controller.rb +0 -4
- data/examples/rails-custom-login-page/app/controllers/sessions_controller.rb +0 -46
- data/examples/rails-custom-login-page/app/controllers/users_controller.rb +0 -116
- data/examples/rails-custom-login-page/app/helpers/application_helper.rb +0 -2
- data/examples/rails-custom-login-page/app/helpers/dashboard_helper.rb +0 -28
- data/examples/rails-custom-login-page/app/helpers/home_helper.rb +0 -2
- data/examples/rails-custom-login-page/app/helpers/sessions_helper.rb +0 -87
- data/examples/rails-custom-login-page/app/helpers/users_helper.rb +0 -3
- data/examples/rails-custom-login-page/app/jobs/application_job.rb +0 -2
- data/examples/rails-custom-login-page/app/mailers/application_mailer.rb +0 -4
- data/examples/rails-custom-login-page/app/models/application_record.rb +0 -3
- data/examples/rails-custom-login-page/app/models/concerns/.keep +0 -0
- data/examples/rails-custom-login-page/app/views/dashboard/index.html.erb +0 -50
- data/examples/rails-custom-login-page/app/views/home/index.html.erb +0 -209
- data/examples/rails-custom-login-page/app/views/layouts/application.html.erb +0 -31
- data/examples/rails-custom-login-page/app/views/layouts/mailer.html.erb +0 -13
- data/examples/rails-custom-login-page/app/views/layouts/mailer.text.erb +0 -1
- data/examples/rails-custom-login-page/app/views/users/_form.html.erb +0 -1
- data/examples/rails-custom-login-page/app/views/users/_user.json.jbuilder +0 -2
- data/examples/rails-custom-login-page/app/views/users/edit.html.erb +0 -27
- data/examples/rails-custom-login-page/app/views/users/index.html.erb +0 -30
- data/examples/rails-custom-login-page/app/views/users/index.json.jbuilder +0 -1
- data/examples/rails-custom-login-page/app/views/users/new.html.erb +0 -60
- data/examples/rails-custom-login-page/app/views/users/onboard.html.erb +0 -54
- data/examples/rails-custom-login-page/app/views/users/show.html.erb +0 -14
- data/examples/rails-custom-login-page/app/views/users/show.json.jbuilder +0 -1
- data/examples/rails-custom-login-page/bin/bundle +0 -3
- data/examples/rails-custom-login-page/bin/rails +0 -9
- data/examples/rails-custom-login-page/bin/rake +0 -9
- data/examples/rails-custom-login-page/bin/setup +0 -38
- data/examples/rails-custom-login-page/bin/spring +0 -17
- data/examples/rails-custom-login-page/bin/update +0 -29
- data/examples/rails-custom-login-page/bin/yarn +0 -11
- data/examples/rails-custom-login-page/config/application.rb +0 -18
- data/examples/rails-custom-login-page/config/boot.rb +0 -3
- data/examples/rails-custom-login-page/config/cable.yml +0 -10
- data/examples/rails-custom-login-page/config/database.yml +0 -25
- data/examples/rails-custom-login-page/config/environment.rb +0 -5
- data/examples/rails-custom-login-page/config/environments/development.rb +0 -54
- data/examples/rails-custom-login-page/config/environments/production.rb +0 -91
- data/examples/rails-custom-login-page/config/environments/test.rb +0 -42
- data/examples/rails-custom-login-page/config/initializers/application_controller_renderer.rb +0 -8
- data/examples/rails-custom-login-page/config/initializers/assets.rb +0 -14
- data/examples/rails-custom-login-page/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/rails-custom-login-page/config/initializers/cookies_serializer.rb +0 -5
- data/examples/rails-custom-login-page/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/inflections.rb +0 -16
- data/examples/rails-custom-login-page/config/initializers/mime_types.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/onelogin.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/wrap_parameters.rb +0 -14
- data/examples/rails-custom-login-page/config/locales/en.yml +0 -33
- data/examples/rails-custom-login-page/config/puma.rb +0 -56
- data/examples/rails-custom-login-page/config/routes.rb +0 -23
- data/examples/rails-custom-login-page/config/secrets.yml.sample +0 -36
- data/examples/rails-custom-login-page/config/spring.rb +0 -6
- data/examples/rails-custom-login-page/config.ru +0 -5
- data/examples/rails-custom-login-page/db/seeds.rb +0 -7
- data/examples/rails-custom-login-page/lib/assets/.keep +0 -0
- data/examples/rails-custom-login-page/lib/tasks/.keep +0 -0
- data/examples/rails-custom-login-page/package.json +0 -5
- data/examples/rails-custom-login-page/public/404.html +0 -67
- data/examples/rails-custom-login-page/public/422.html +0 -67
- data/examples/rails-custom-login-page/public/500.html +0 -66
- data/examples/rails-custom-login-page/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails-custom-login-page/public/apple-touch-icon.png +0 -0
- data/examples/rails-custom-login-page/public/favicon.ico +0 -0
- data/examples/rails-custom-login-page/public/robots.txt +0 -1
- data/examples/rails-custom-login-page/test/application_system_test_case.rb +0 -5
- data/examples/rails-custom-login-page/test/controllers/.keep +0 -0
- data/examples/rails-custom-login-page/test/controllers/dashboard_controller_test.rb +0 -9
- data/examples/rails-custom-login-page/test/controllers/home_controller_test.rb +0 -9
- data/examples/rails-custom-login-page/test/controllers/sessions_controller_test.rb +0 -7
- data/examples/rails-custom-login-page/test/controllers/users_controller_test.rb +0 -48
- data/examples/rails-custom-login-page/test/fixtures/.keep +0 -0
- data/examples/rails-custom-login-page/test/fixtures/files/.keep +0 -0
- data/examples/rails-custom-login-page/test/helpers/.keep +0 -0
- data/examples/rails-custom-login-page/test/integration/.keep +0 -0
- data/examples/rails-custom-login-page/test/mailers/.keep +0 -0
- data/examples/rails-custom-login-page/test/models/.keep +0 -0
- data/examples/rails-custom-login-page/test/system/.keep +0 -0
- data/examples/rails-custom-login-page/test/test_helper.rb +0 -9
- data/examples/rails-custom-login-page/vendor/.keep +0 -0
- data/lib/onelogin/api/apiexception.rb +0 -10
- data/lib/onelogin/api/client.rb +0 -2328
- data/lib/onelogin/api/cursor.rb +0 -113
- data/lib/onelogin/api/models/app.rb +0 -22
- data/lib/onelogin/api/models/auth_factor.rb +0 -16
- data/lib/onelogin/api/models/device.rb +0 -18
- data/lib/onelogin/api/models/embed_app.rb +0 -31
- data/lib/onelogin/api/models/event.rb +0 -54
- data/lib/onelogin/api/models/event_type.rb +0 -17
- data/lib/onelogin/api/models/factor_enrollment_response.rb +0 -22
- data/lib/onelogin/api/models/group.rb +0 -17
- data/lib/onelogin/api/models/mfa.rb +0 -26
- data/lib/onelogin/api/models/mfa_token.rb +0 -18
- data/lib/onelogin/api/models/onelogin_token.rb +0 -20
- data/lib/onelogin/api/models/otp_device.rb +0 -25
- data/lib/onelogin/api/models/privilege.rb +0 -51
- data/lib/onelogin/api/models/rate_limit.rb +0 -17
- data/lib/onelogin/api/models/role.rb +0 -16
- data/lib/onelogin/api/models/saml_endpoint_response.rb +0 -18
- data/lib/onelogin/api/models/session_token_info.rb +0 -21
- data/lib/onelogin/api/models/session_token_mfa_info.rb +0 -26
- data/lib/onelogin/api/models/statement.rb +0 -36
- data/lib/onelogin/api/models/user.rb +0 -135
- data/lib/onelogin/api/models/user_data.rb +0 -13
- data/lib/onelogin/api/models/user_metadata.rb +0 -13
- data/lib/onelogin/api/models.rb +0 -22
- data/lib/onelogin/api/util/constants.rb +0 -160
- data/lib/onelogin/api/util/parser.rb +0 -56
- data/lib/onelogin/api/util/url_builder.rb +0 -24
- data/lib/onelogin/api/util.rb +0 -13
- data/lib/onelogin/api.rb +0 -2
@@ -0,0 +1,325 @@
|
|
1
|
+
=begin
|
2
|
+
#OneLogin API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 3.0.0-alpha.1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OneLogin
|
17
|
+
class RiskRule
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# The name of this rule
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
attr_accessor :description
|
24
|
+
|
25
|
+
# The type parameter specifies the type of rule that will be created.
|
26
|
+
attr_accessor :type
|
27
|
+
|
28
|
+
# The target parameter that will be used when evaluating the rule against an incoming event.
|
29
|
+
attr_accessor :target
|
30
|
+
|
31
|
+
# A list of IP addresses or country codes or names to evaluate against each event.
|
32
|
+
attr_accessor :filters
|
33
|
+
|
34
|
+
attr_accessor :source
|
35
|
+
|
36
|
+
class EnumAttributeValidator
|
37
|
+
attr_reader :datatype
|
38
|
+
attr_reader :allowable_values
|
39
|
+
|
40
|
+
def initialize(datatype, allowable_values)
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
42
|
+
case datatype.to_s
|
43
|
+
when /Integer/i
|
44
|
+
value.to_i
|
45
|
+
when /Float/i
|
46
|
+
value.to_f
|
47
|
+
else
|
48
|
+
value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def valid?(value)
|
54
|
+
!value || allowable_values.include?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'id' => :'id',
|
62
|
+
:'name' => :'name',
|
63
|
+
:'description' => :'description',
|
64
|
+
:'type' => :'type',
|
65
|
+
:'target' => :'target',
|
66
|
+
:'filters' => :'filters',
|
67
|
+
:'source' => :'source'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns all the JSON keys this model knows about
|
72
|
+
def self.acceptable_attributes
|
73
|
+
attribute_map.values
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.openapi_types
|
78
|
+
{
|
79
|
+
:'id' => :'String',
|
80
|
+
:'name' => :'String',
|
81
|
+
:'description' => :'String',
|
82
|
+
:'type' => :'String',
|
83
|
+
:'target' => :'String',
|
84
|
+
:'filters' => :'Array<String>',
|
85
|
+
:'source' => :'Source'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
def self.openapi_nullable
|
91
|
+
Set.new([
|
92
|
+
])
|
93
|
+
end
|
94
|
+
|
95
|
+
# Initializes the object
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
def initialize(attributes = {})
|
98
|
+
if (!attributes.is_a?(Hash))
|
99
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneLogin::RiskRule` initialize method"
|
100
|
+
end
|
101
|
+
|
102
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
104
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneLogin::RiskRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
106
|
+
end
|
107
|
+
h[k.to_sym] = v
|
108
|
+
}
|
109
|
+
|
110
|
+
if attributes.key?(:'id')
|
111
|
+
self.id = attributes[:'id']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'name')
|
115
|
+
self.name = attributes[:'name']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'description')
|
119
|
+
self.description = attributes[:'description']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'type')
|
123
|
+
self.type = attributes[:'type']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'target')
|
127
|
+
self.target = attributes[:'target']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'filters')
|
131
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
132
|
+
self.filters = value
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'source')
|
137
|
+
self.source = attributes[:'source']
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
142
|
+
# @return Array for valid properties with the reasons
|
143
|
+
def list_invalid_properties
|
144
|
+
invalid_properties = Array.new
|
145
|
+
invalid_properties
|
146
|
+
end
|
147
|
+
|
148
|
+
# Check to see if the all the properties in the model are valid
|
149
|
+
# @return true if the model is valid
|
150
|
+
def valid?
|
151
|
+
type_validator = EnumAttributeValidator.new('String', ["blacklist", "whitelist"])
|
152
|
+
return false unless type_validator.valid?(@type)
|
153
|
+
target_validator = EnumAttributeValidator.new('String', ["location.ip", "location.address.country_iso_code"])
|
154
|
+
return false unless target_validator.valid?(@target)
|
155
|
+
true
|
156
|
+
end
|
157
|
+
|
158
|
+
# Custom attribute writer method checking allowed values (enum).
|
159
|
+
# @param [Object] type Object to be assigned
|
160
|
+
def type=(type)
|
161
|
+
validator = EnumAttributeValidator.new('String', ["blacklist", "whitelist"])
|
162
|
+
unless validator.valid?(type)
|
163
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
164
|
+
end
|
165
|
+
@type = type
|
166
|
+
end
|
167
|
+
|
168
|
+
# Custom attribute writer method checking allowed values (enum).
|
169
|
+
# @param [Object] target Object to be assigned
|
170
|
+
def target=(target)
|
171
|
+
validator = EnumAttributeValidator.new('String', ["location.ip", "location.address.country_iso_code"])
|
172
|
+
unless validator.valid?(target)
|
173
|
+
fail ArgumentError, "invalid value for \"target\", must be one of #{validator.allowable_values}."
|
174
|
+
end
|
175
|
+
@target = target
|
176
|
+
end
|
177
|
+
|
178
|
+
# Checks equality by comparing each attribute.
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def ==(o)
|
181
|
+
return true if self.equal?(o)
|
182
|
+
self.class == o.class &&
|
183
|
+
id == o.id &&
|
184
|
+
name == o.name &&
|
185
|
+
description == o.description &&
|
186
|
+
type == o.type &&
|
187
|
+
target == o.target &&
|
188
|
+
filters == o.filters &&
|
189
|
+
source == o.source
|
190
|
+
end
|
191
|
+
|
192
|
+
# @see the `==` method
|
193
|
+
# @param [Object] Object to be compared
|
194
|
+
def eql?(o)
|
195
|
+
self == o
|
196
|
+
end
|
197
|
+
|
198
|
+
# Calculates hash code according to all attributes.
|
199
|
+
# @return [Integer] Hash code
|
200
|
+
def hash
|
201
|
+
[id, name, description, type, target, filters, source].hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Builds the object from hash
|
205
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
206
|
+
# @return [Object] Returns the model itself
|
207
|
+
def self.build_from_hash(attributes)
|
208
|
+
new.build_from_hash(attributes)
|
209
|
+
end
|
210
|
+
|
211
|
+
# Builds the object from hash
|
212
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
213
|
+
# @return [Object] Returns the model itself
|
214
|
+
def build_from_hash(attributes)
|
215
|
+
return nil unless attributes.is_a?(Hash)
|
216
|
+
attributes = attributes.transform_keys(&:to_sym)
|
217
|
+
self.class.openapi_types.each_pair do |key, type|
|
218
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
219
|
+
self.send("#{key}=", nil)
|
220
|
+
elsif type =~ /\AArray<(.*)>/i
|
221
|
+
# check to ensure the input is an array given that the attribute
|
222
|
+
# is documented as an array but the input is not
|
223
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
224
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
225
|
+
end
|
226
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
227
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
self
|
232
|
+
end
|
233
|
+
|
234
|
+
# Deserializes the data based on type
|
235
|
+
# @param string type Data type
|
236
|
+
# @param string value Value to be deserialized
|
237
|
+
# @return [Object] Deserialized data
|
238
|
+
def _deserialize(type, value)
|
239
|
+
case type.to_sym
|
240
|
+
when :Time
|
241
|
+
Time.parse(value)
|
242
|
+
when :Date
|
243
|
+
Date.parse(value)
|
244
|
+
when :String
|
245
|
+
value.to_s
|
246
|
+
when :Integer
|
247
|
+
value.to_i
|
248
|
+
when :Float
|
249
|
+
value.to_f
|
250
|
+
when :Boolean
|
251
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
252
|
+
true
|
253
|
+
else
|
254
|
+
false
|
255
|
+
end
|
256
|
+
when :Object
|
257
|
+
# generic object (usually a Hash), return directly
|
258
|
+
value
|
259
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
260
|
+
inner_type = Regexp.last_match[:inner_type]
|
261
|
+
value.map { |v| _deserialize(inner_type, v) }
|
262
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
263
|
+
k_type = Regexp.last_match[:k_type]
|
264
|
+
v_type = Regexp.last_match[:v_type]
|
265
|
+
{}.tap do |hash|
|
266
|
+
value.each do |k, v|
|
267
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
else # model
|
271
|
+
# models (e.g. Pet) or oneOf
|
272
|
+
klass = OneLogin.const_get(type)
|
273
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
# Returns the string representation of the object
|
278
|
+
# @return [String] String presentation of the object
|
279
|
+
def to_s
|
280
|
+
to_hash.to_s
|
281
|
+
end
|
282
|
+
|
283
|
+
# to_body is an alias to to_hash (backward compatibility)
|
284
|
+
# @return [Hash] Returns the object in the form of hash
|
285
|
+
def to_body
|
286
|
+
to_hash
|
287
|
+
end
|
288
|
+
|
289
|
+
# Returns the object in the form of hash
|
290
|
+
# @return [Hash] Returns the object in the form of hash
|
291
|
+
def to_hash
|
292
|
+
hash = {}
|
293
|
+
self.class.attribute_map.each_pair do |attr, param|
|
294
|
+
value = self.send(attr)
|
295
|
+
if value.nil?
|
296
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
297
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
298
|
+
end
|
299
|
+
|
300
|
+
hash[param] = _to_hash(value)
|
301
|
+
end
|
302
|
+
hash
|
303
|
+
end
|
304
|
+
|
305
|
+
# Outputs non-array value in the form of hash
|
306
|
+
# For object, use to_hash. Otherwise, just return the value
|
307
|
+
# @param [Object] value Any valid value
|
308
|
+
# @return [Hash] Returns the value in the form of hash
|
309
|
+
def _to_hash(value)
|
310
|
+
if value.is_a?(Array)
|
311
|
+
value.compact.map { |v| _to_hash(v) }
|
312
|
+
elsif value.is_a?(Hash)
|
313
|
+
{}.tap do |hash|
|
314
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
315
|
+
end
|
316
|
+
elsif value.respond_to? :to_hash
|
317
|
+
value.to_hash
|
318
|
+
else
|
319
|
+
value
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
end
|
324
|
+
|
325
|
+
end
|
@@ -0,0 +1,248 @@
|
|
1
|
+
=begin
|
2
|
+
#OneLogin API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 3.0.0-alpha.1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OneLogin
|
17
|
+
# An Object containing User details.
|
18
|
+
class RiskUser
|
19
|
+
# A unique identifier for the user.
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# A name for the user.
|
23
|
+
attr_accessor :name
|
24
|
+
|
25
|
+
# Indicates if the metadata supplied in this event should be considered as trusted for the user.
|
26
|
+
attr_accessor :authenticated
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'id' => :'id',
|
32
|
+
:'name' => :'name',
|
33
|
+
:'authenticated' => :'authenticated'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'id' => :'String',
|
46
|
+
:'name' => :'String',
|
47
|
+
:'authenticated' => :'Boolean'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneLogin::RiskUser` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneLogin::RiskUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'id')
|
73
|
+
self.id = attributes[:'id']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'name')
|
77
|
+
self.name = attributes[:'name']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'authenticated')
|
81
|
+
self.authenticated = attributes[:'authenticated']
|
82
|
+
else
|
83
|
+
self.authenticated = false
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
if @id.nil?
|
92
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
return false if @id.nil?
|
102
|
+
true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
id == o.id &&
|
111
|
+
name == o.name &&
|
112
|
+
authenticated == o.authenticated
|
113
|
+
end
|
114
|
+
|
115
|
+
# @see the `==` method
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def eql?(o)
|
118
|
+
self == o
|
119
|
+
end
|
120
|
+
|
121
|
+
# Calculates hash code according to all attributes.
|
122
|
+
# @return [Integer] Hash code
|
123
|
+
def hash
|
124
|
+
[id, name, authenticated].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def self.build_from_hash(attributes)
|
131
|
+
new.build_from_hash(attributes)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
140
|
+
self.class.openapi_types.each_pair do |key, type|
|
141
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
142
|
+
self.send("#{key}=", nil)
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
144
|
+
# check to ensure the input is an array given that the attribute
|
145
|
+
# is documented as an array but the input is not
|
146
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
147
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
148
|
+
end
|
149
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
150
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
self
|
155
|
+
end
|
156
|
+
|
157
|
+
# Deserializes the data based on type
|
158
|
+
# @param string type Data type
|
159
|
+
# @param string value Value to be deserialized
|
160
|
+
# @return [Object] Deserialized data
|
161
|
+
def _deserialize(type, value)
|
162
|
+
case type.to_sym
|
163
|
+
when :Time
|
164
|
+
Time.parse(value)
|
165
|
+
when :Date
|
166
|
+
Date.parse(value)
|
167
|
+
when :String
|
168
|
+
value.to_s
|
169
|
+
when :Integer
|
170
|
+
value.to_i
|
171
|
+
when :Float
|
172
|
+
value.to_f
|
173
|
+
when :Boolean
|
174
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
175
|
+
true
|
176
|
+
else
|
177
|
+
false
|
178
|
+
end
|
179
|
+
when :Object
|
180
|
+
# generic object (usually a Hash), return directly
|
181
|
+
value
|
182
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
183
|
+
inner_type = Regexp.last_match[:inner_type]
|
184
|
+
value.map { |v| _deserialize(inner_type, v) }
|
185
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
186
|
+
k_type = Regexp.last_match[:k_type]
|
187
|
+
v_type = Regexp.last_match[:v_type]
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each do |k, v|
|
190
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
else # model
|
194
|
+
# models (e.g. Pet) or oneOf
|
195
|
+
klass = OneLogin.const_get(type)
|
196
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the string representation of the object
|
201
|
+
# @return [String] String presentation of the object
|
202
|
+
def to_s
|
203
|
+
to_hash.to_s
|
204
|
+
end
|
205
|
+
|
206
|
+
# to_body is an alias to to_hash (backward compatibility)
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
208
|
+
def to_body
|
209
|
+
to_hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the object in the form of hash
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
214
|
+
def to_hash
|
215
|
+
hash = {}
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
217
|
+
value = self.send(attr)
|
218
|
+
if value.nil?
|
219
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
220
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
221
|
+
end
|
222
|
+
|
223
|
+
hash[param] = _to_hash(value)
|
224
|
+
end
|
225
|
+
hash
|
226
|
+
end
|
227
|
+
|
228
|
+
# Outputs non-array value in the form of hash
|
229
|
+
# For object, use to_hash. Otherwise, just return the value
|
230
|
+
# @param [Object] value Any valid value
|
231
|
+
# @return [Hash] Returns the value in the form of hash
|
232
|
+
def _to_hash(value)
|
233
|
+
if value.is_a?(Array)
|
234
|
+
value.compact.map { |v| _to_hash(v) }
|
235
|
+
elsif value.is_a?(Hash)
|
236
|
+
{}.tap do |hash|
|
237
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
238
|
+
end
|
239
|
+
elsif value.respond_to? :to_hash
|
240
|
+
value.to_hash
|
241
|
+
else
|
242
|
+
value
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|