onelogin 1.6.0 → 3.0.0.pre.alpha.1

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