ory-kratos-client 0.5.5.alpha2 → 0.6.0.alpha4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +85 -36
- data/docs/AdminApi.md +206 -20
- data/docs/AuthenticateOKBody.md +20 -0
- data/docs/ContainerChangeResponseItem.md +20 -0
- data/docs/ContainerCreateCreatedBody.md +20 -0
- data/docs/ContainerTopOKBody.md +20 -0
- data/docs/ContainerUpdateOKBody.md +18 -0
- data/docs/ContainerWaitOKBody.md +20 -0
- data/docs/ContainerWaitOKBodyError.md +18 -0
- data/docs/ErrorContainer.md +1 -1
- data/docs/ErrorResponse.md +18 -0
- data/docs/GenericErrorPayload.md +1 -1
- data/docs/GraphDriverData.md +20 -0
- data/docs/IdResponse.md +18 -0
- data/docs/IdentityCredentials.md +22 -0
- data/docs/ImageDeleteResponseItem.md +20 -0
- data/docs/ImageSummary.md +36 -0
- data/docs/InlineResponse200.md +18 -0
- data/docs/InlineResponse2001.md +18 -0
- data/docs/InlineResponse503.md +18 -0
- data/docs/LoginFlow.md +5 -7
- data/docs/Meta.md +18 -0
- data/docs/Plugin.md +28 -0
- data/docs/PluginConfig.md +48 -0
- data/docs/PluginConfigArgs.md +24 -0
- data/docs/PluginConfigInterface.md +20 -0
- data/docs/PluginConfigLinux.md +22 -0
- data/docs/PluginConfigNetwork.md +18 -0
- data/docs/PluginConfigRootfs.md +20 -0
- data/docs/PluginConfigUser.md +20 -0
- data/docs/PluginDevice.md +24 -0
- data/docs/PluginEnv.md +24 -0
- data/docs/PluginInterfaceType.md +22 -0
- data/docs/PluginMount.md +30 -0
- data/docs/PluginSettings.md +24 -0
- data/docs/Port.md +24 -0
- data/docs/PublicApi.md +481 -552
- data/docs/RecoveryFlow.md +4 -6
- data/docs/RegistrationFlow.md +4 -6
- data/docs/ServiceUpdateResponse.md +18 -0
- data/docs/SettingsFlow.md +4 -6
- data/docs/{RecoveryFlowMethodConfig.md → SettingsProfileFormConfig.md} +6 -6
- data/docs/SubmitSelfServiceBrowserSettingsOIDCFlowPayload.md +22 -0
- data/docs/SubmitSelfServiceLoginFlow.md +47 -0
- data/docs/SubmitSelfServiceLoginFlowWithPasswordMethod.md +24 -0
- data/docs/{CompleteSelfServiceRecoveryFlowWithLinkMethod.md → SubmitSelfServiceRecoveryFlowWithLinkMethod.md} +2 -2
- data/docs/SubmitSelfServiceRegistrationFlow.md +47 -0
- data/docs/SubmitSelfServiceRegistrationFlowWithPasswordMethod.md +24 -0
- data/docs/SubmitSelfServiceSettingsFlow.md +49 -0
- data/docs/{CompleteSelfServiceSettingsFlowWithPasswordMethod.md → SubmitSelfServiceSettingsFlowWithPasswordMethod.md} +4 -2
- data/docs/SubmitSelfServiceSettingsFlowWithProfileMethod.md +22 -0
- data/docs/{CompleteSelfServiceVerificationFlowWithLinkMethod.md → SubmitSelfServiceVerificationFlowWithLinkMethod.md} +2 -2
- data/docs/{SettingsFlowMethodConfig.md → UiContainer.md} +6 -6
- data/docs/UiNode.md +26 -0
- data/docs/UiNodeAnchorAttributes.md +20 -0
- data/docs/UiNodeAttributes.md +53 -0
- data/docs/UiNodeImageAttributes.md +18 -0
- data/docs/UiNodeInputAttributes.md +30 -0
- data/docs/UiNodeInputAttributesValue.md +51 -0
- data/docs/UiNodeTextAttributes.md +18 -0
- data/docs/UiText.md +24 -0
- data/docs/VerificationFlow.md +6 -8
- data/docs/Volume.md +34 -0
- data/docs/VolumeUsageData.md +20 -0
- data/lib/ory-kratos-client.rb +59 -23
- data/lib/ory-kratos-client/api/admin_api.rb +207 -36
- data/lib/ory-kratos-client/api/public_api.rb +494 -538
- data/lib/ory-kratos-client/api_client.rb +6 -6
- data/lib/ory-kratos-client/api_error.rb +5 -5
- data/lib/ory-kratos-client/configuration.rb +36 -13
- data/lib/ory-kratos-client/models/authenticate_ok_body.rb +240 -0
- data/lib/ory-kratos-client/models/container_change_response_item.rb +240 -0
- data/lib/ory-kratos-client/models/container_create_created_body.rb +242 -0
- data/lib/ory-kratos-client/models/container_top_ok_body.rb +244 -0
- data/lib/ory-kratos-client/models/container_update_ok_body.rb +227 -0
- data/lib/ory-kratos-client/models/container_wait_ok_body.rb +239 -0
- data/lib/ory-kratos-client/models/container_wait_ok_body_error.rb +220 -0
- data/lib/ory-kratos-client/models/create_identity.rb +5 -5
- data/lib/ory-kratos-client/models/create_recovery_link.rb +5 -5
- data/lib/ory-kratos-client/models/error_container.rb +9 -7
- data/lib/ory-kratos-client/models/{registration_flow_method.rb → error_response.rb} +19 -33
- data/lib/ory-kratos-client/models/generic_error.rb +5 -5
- data/lib/ory-kratos-client/models/generic_error_payload.rb +9 -7
- data/lib/ory-kratos-client/models/graph_driver_data.rb +241 -0
- data/lib/ory-kratos-client/models/health_not_ready_status.rb +5 -5
- data/lib/ory-kratos-client/models/health_status.rb +5 -5
- data/lib/ory-kratos-client/models/id_response.rb +225 -0
- data/lib/ory-kratos-client/models/identity.rb +5 -5
- data/lib/ory-kratos-client/models/identity_credentials.rb +241 -0
- data/lib/ory-kratos-client/models/{complete_self_service_login_flow_with_password_method.rb → image_delete_response_item.rb} +24 -33
- data/lib/ory-kratos-client/models/image_summary.rb +366 -0
- data/lib/ory-kratos-client/models/{recovery_flow_method.rb → inline_response200.rb} +19 -33
- data/lib/ory-kratos-client/models/{settings_flow_method.rb → inline_response2001.rb} +19 -33
- data/lib/ory-kratos-client/models/inline_response503.rb +226 -0
- data/lib/ory-kratos-client/models/login_flow.rb +29 -38
- data/lib/ory-kratos-client/models/login_via_api_response.rb +5 -5
- data/lib/ory-kratos-client/models/meta.rb +219 -0
- data/lib/ory-kratos-client/models/plugin.rb +288 -0
- data/lib/ory-kratos-client/models/plugin_config.rb +434 -0
- data/lib/ory-kratos-client/models/plugin_config_args.rb +274 -0
- data/lib/ory-kratos-client/models/plugin_config_interface.rb +242 -0
- data/lib/ory-kratos-client/models/plugin_config_linux.rb +259 -0
- data/lib/ory-kratos-client/models/{message.rb → plugin_config_network.rb} +17 -38
- data/lib/ory-kratos-client/models/plugin_config_rootfs.rb +232 -0
- data/lib/ory-kratos-client/models/plugin_config_user.rb +230 -0
- data/lib/ory-kratos-client/models/plugin_device.rb +272 -0
- data/lib/ory-kratos-client/models/plugin_env.rb +272 -0
- data/lib/ory-kratos-client/models/{settings_flow_method_config.rb → plugin_interface_type.rb} +40 -52
- data/lib/ory-kratos-client/models/plugin_mount.rb +319 -0
- data/lib/ory-kratos-client/models/plugin_settings.rb +277 -0
- data/lib/ory-kratos-client/models/port.rb +260 -0
- data/lib/ory-kratos-client/models/recovery_address.rb +5 -5
- data/lib/ory-kratos-client/models/recovery_flow.rb +24 -38
- data/lib/ory-kratos-client/models/recovery_link.rb +5 -5
- data/lib/ory-kratos-client/models/registration_flow.rb +24 -38
- data/lib/ory-kratos-client/models/registration_via_api_response.rb +5 -5
- data/lib/ory-kratos-client/models/revoke_session.rb +5 -5
- data/lib/ory-kratos-client/models/service_update_response.rb +222 -0
- data/lib/ory-kratos-client/models/session.rb +5 -5
- data/lib/ory-kratos-client/models/settings_flow.rb +24 -38
- data/lib/ory-kratos-client/models/{login_flow_method_config.rb → settings_profile_form_config.rb} +22 -35
- data/lib/ory-kratos-client/models/settings_via_api_response.rb +5 -5
- data/lib/ory-kratos-client/models/submit_self_service_browser_settings_oidc_flow_payload.rb +239 -0
- data/lib/ory-kratos-client/models/submit_self_service_login_flow.rb +104 -0
- data/lib/ory-kratos-client/models/submit_self_service_login_flow_with_password_method.rb +249 -0
- data/lib/ory-kratos-client/models/{complete_self_service_recovery_flow_with_link_method.rb → submit_self_service_recovery_flow_with_link_method.rb} +8 -8
- data/lib/ory-kratos-client/models/submit_self_service_registration_flow.rb +104 -0
- data/lib/ory-kratos-client/models/{recovery_flow_method_config.rb → submit_self_service_registration_flow_with_password_method.rb} +38 -50
- data/lib/ory-kratos-client/models/submit_self_service_settings_flow.rb +105 -0
- data/lib/ory-kratos-client/models/{complete_self_service_settings_flow_with_password_method.rb → submit_self_service_settings_flow_with_password_method.rb} +19 -9
- data/lib/ory-kratos-client/models/submit_self_service_settings_flow_with_profile_method.rb +245 -0
- data/lib/ory-kratos-client/models/{complete_self_service_verification_flow_with_link_method.rb → submit_self_service_verification_flow_with_link_method.rb} +9 -8
- data/lib/ory-kratos-client/models/{registration_flow_method_config.rb → ui_container.rb} +23 -35
- data/lib/ory-kratos-client/models/ui_node.rb +282 -0
- data/lib/ory-kratos-client/models/{verification_flow_method.rb → ui_node_anchor_attributes.rb} +28 -28
- data/lib/ory-kratos-client/models/ui_node_attributes.rb +107 -0
- data/lib/ory-kratos-client/models/ui_node_image_attributes.rb +224 -0
- data/lib/ory-kratos-client/models/{form_field.rb → ui_node_input_attributes.rb} +26 -25
- data/lib/ory-kratos-client/models/ui_node_input_attributes_value.rb +106 -0
- data/lib/ory-kratos-client/models/{login_flow_method.rb → ui_node_text_attributes.rb} +18 -33
- data/lib/ory-kratos-client/models/{verification_flow_method_config.rb → ui_text.rb} +44 -49
- data/lib/ory-kratos-client/models/update_identity.rb +5 -5
- data/lib/ory-kratos-client/models/verifiable_address.rb +5 -5
- data/lib/ory-kratos-client/models/verification_flow.rb +32 -36
- data/lib/ory-kratos-client/models/version.rb +5 -5
- data/lib/ory-kratos-client/models/volume.rb +335 -0
- data/lib/ory-kratos-client/models/volume_usage_data.rb +240 -0
- data/lib/ory-kratos-client/version.rb +6 -6
- data/ory-kratos-client.gemspec +7 -7
- data/spec/api/admin_api_spec.rb +134 -41
- data/spec/api/public_api_spec.rb +268 -37
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +8 -8
- data/spec/models/authenticate_ok_body_spec.rb +40 -0
- data/spec/models/container_change_response_item_spec.rb +40 -0
- data/spec/models/container_create_created_body_spec.rb +40 -0
- data/spec/models/container_top_ok_body_spec.rb +40 -0
- data/spec/models/container_update_ok_body_spec.rb +34 -0
- data/spec/models/container_wait_ok_body_error_spec.rb +34 -0
- data/spec/models/container_wait_ok_body_spec.rb +40 -0
- data/spec/models/create_identity_spec.rb +8 -15
- data/spec/models/create_recovery_link_spec.rb +8 -15
- data/spec/models/error_container_spec.rb +8 -15
- data/spec/models/error_response_spec.rb +34 -0
- data/spec/models/generic_error_payload_spec.rb +8 -15
- data/spec/models/generic_error_spec.rb +8 -33
- data/spec/models/graph_driver_data_spec.rb +40 -0
- data/spec/models/health_not_ready_status_spec.rb +8 -15
- data/spec/models/health_status_spec.rb +8 -15
- data/spec/models/id_response_spec.rb +34 -0
- data/spec/models/identity_credentials_spec.rb +46 -0
- data/spec/models/identity_spec.rb +27 -16
- data/spec/models/image_delete_response_item_spec.rb +40 -0
- data/spec/models/image_summary_spec.rb +88 -0
- data/spec/models/inline_response2001_spec.rb +34 -0
- data/spec/models/inline_response200_spec.rb +34 -0
- data/spec/models/inline_response503_spec.rb +34 -0
- data/spec/models/login_flow_spec.rb +11 -24
- data/spec/models/login_via_api_response_spec.rb +8 -15
- data/spec/models/meta_spec.rb +34 -0
- data/spec/models/plugin_config_args_spec.rb +52 -0
- data/spec/models/plugin_config_interface_spec.rb +40 -0
- data/spec/models/plugin_config_linux_spec.rb +46 -0
- data/spec/models/plugin_config_network_spec.rb +34 -0
- data/spec/models/plugin_config_rootfs_spec.rb +40 -0
- data/spec/models/plugin_config_spec.rb +124 -0
- data/spec/models/plugin_config_user_spec.rb +40 -0
- data/spec/models/plugin_device_spec.rb +52 -0
- data/spec/models/plugin_env_spec.rb +52 -0
- data/spec/models/plugin_interface_type_spec.rb +46 -0
- data/spec/models/{settings_request_spec.rb → plugin_mount_spec.rb} +18 -31
- data/spec/models/plugin_settings_spec.rb +52 -0
- data/spec/models/{registration_request_spec.rb → plugin_spec.rb} +16 -23
- data/spec/models/port_spec.rb +52 -0
- data/spec/models/recovery_address_spec.rb +8 -15
- data/spec/models/recovery_flow_spec.rb +12 -25
- data/spec/models/recovery_link_spec.rb +8 -15
- data/spec/models/registration_flow_spec.rb +11 -24
- data/spec/models/registration_via_api_response_spec.rb +8 -15
- data/spec/models/revoke_session_spec.rb +8 -15
- data/spec/models/service_update_response_spec.rb +34 -0
- data/spec/models/session_spec.rb +17 -18
- data/spec/models/settings_flow_spec.rb +12 -25
- data/spec/models/settings_profile_form_config_spec.rb +52 -0
- data/spec/models/settings_via_api_response_spec.rb +8 -15
- data/spec/models/submit_self_service_browser_settings_oidc_flow_payload_spec.rb +46 -0
- data/spec/models/submit_self_service_login_flow_spec.rb +31 -0
- data/spec/models/submit_self_service_login_flow_with_password_method_spec.rb +52 -0
- data/spec/models/submit_self_service_recovery_flow_with_link_method_spec.rb +40 -0
- data/spec/models/submit_self_service_registration_flow_spec.rb +31 -0
- data/spec/models/submit_self_service_registration_flow_with_password_method_spec.rb +46 -0
- data/spec/models/submit_self_service_settings_flow_spec.rb +31 -0
- data/spec/models/submit_self_service_settings_flow_with_password_method_spec.rb +46 -0
- data/spec/models/submit_self_service_settings_flow_with_profile_method_spec.rb +46 -0
- data/spec/models/submit_self_service_verification_flow_with_link_method_spec.rb +40 -0
- data/spec/models/{registration_flow_method_config_spec.rb → ui_container_spec.rb} +12 -25
- data/spec/models/ui_node_anchor_attributes_spec.rb +40 -0
- data/spec/models/ui_node_attributes_spec.rb +31 -0
- data/spec/models/ui_node_image_attributes_spec.rb +34 -0
- data/spec/models/{verification_request_spec.rb → ui_node_input_attributes_spec.rb} +18 -25
- data/spec/models/ui_node_input_attributes_value_spec.rb +31 -0
- data/spec/models/{login_flow_method_config_spec.rb → ui_node_spec.rb} +15 -22
- data/spec/models/ui_node_text_attributes_spec.rb +34 -0
- data/spec/models/{message_spec.rb → ui_text_spec.rb} +11 -18
- data/spec/models/update_identity_spec.rb +8 -15
- data/spec/models/verifiable_address_spec.rb +10 -17
- data/spec/models/verification_flow_spec.rb +12 -25
- data/spec/models/version_spec.rb +8 -15
- data/spec/models/{recovery_request_spec.rb → volume_spec.rb} +24 -25
- data/spec/models/volume_usage_data_spec.rb +40 -0
- data/spec/spec_helper.rb +5 -5
- metadata +225 -160
- data/docs/CommonApi.md +0 -345
- data/docs/CompleteSelfServiceBrowserProfileManagementFlowPayload.md +0 -17
- data/docs/CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload.md +0 -19
- data/docs/CompleteSelfServiceLoginFlowWithPasswordMethod.md +0 -22
- data/docs/Error.md +0 -17
- data/docs/Form.md +0 -23
- data/docs/FormField.md +0 -30
- data/docs/HealthApi.md +0 -131
- data/docs/LoginFlowMethod.md +0 -20
- data/docs/LoginFlowMethodConfig.md +0 -26
- data/docs/LoginRequest.md +0 -31
- data/docs/LoginRequestMethod.md +0 -19
- data/docs/LoginRequestMethodConfig.md +0 -25
- data/docs/Message.md +0 -24
- data/docs/OidcStrategyCredentialsConfig.md +0 -19
- data/docs/OidcStrategyRequestMethod.md +0 -25
- data/docs/ProfileManagementRequest.md +0 -29
- data/docs/ProviderCredentialsConfig.md +0 -19
- data/docs/RecoveryFlowMethod.md +0 -20
- data/docs/RecoveryRequest.md +0 -31
- data/docs/RecoveryRequestMethod.md +0 -19
- data/docs/RegistrationFlowMethod.md +0 -20
- data/docs/RegistrationFlowMethodConfig.md +0 -26
- data/docs/RegistrationRequest.md +0 -29
- data/docs/RegistrationRequestMethod.md +0 -19
- data/docs/RegistrationRequestMethodConfig.md +0 -25
- data/docs/RequestMethodConfig.md +0 -23
- data/docs/SettingsFlowMethod.md +0 -20
- data/docs/SettingsRequest.md +0 -33
- data/docs/SettingsRequestMethod.md +0 -19
- data/docs/VerificationFlowMethod.md +0 -20
- data/docs/VerificationFlowMethodConfig.md +0 -24
- data/docs/VerificationRequest.md +0 -31
- data/docs/VersionApi.md +0 -69
- data/lib/ory-kratos-client/api/common_api.rb +0 -456
- data/lib/ory-kratos-client/api/health_api.rb +0 -136
- data/lib/ory-kratos-client/api/version_api.rb +0 -79
- data/lib/ory-kratos-client/models/complete_self_service_browser_profile_management_flow_payload.rb +0 -212
- data/lib/ory-kratos-client/models/complete_self_service_browser_settings_strategy_profile_flow_payload.rb +0 -222
- data/lib/ory-kratos-client/models/error.rb +0 -207
- data/lib/ory-kratos-client/models/form.rb +0 -256
- data/lib/ory-kratos-client/models/login_request.rb +0 -304
- data/lib/ory-kratos-client/models/login_request_method.rb +0 -226
- data/lib/ory-kratos-client/models/login_request_method_config.rb +0 -267
- data/lib/ory-kratos-client/models/oidc_strategy_credentials_config.rb +0 -215
- data/lib/ory-kratos-client/models/oidc_strategy_request_method.rb +0 -252
- data/lib/ory-kratos-client/models/profile_management_request.rb +0 -300
- data/lib/ory-kratos-client/models/provider_credentials_config.rb +0 -215
- data/lib/ory-kratos-client/models/recovery_request.rb +0 -309
- data/lib/ory-kratos-client/models/recovery_request_method.rb +0 -216
- data/lib/ory-kratos-client/models/registration_request.rb +0 -294
- data/lib/ory-kratos-client/models/registration_request_method.rb +0 -216
- data/lib/ory-kratos-client/models/registration_request_method_config.rb +0 -267
- data/lib/ory-kratos-client/models/request_method_config.rb +0 -255
- data/lib/ory-kratos-client/models/settings_request.rb +0 -323
- data/lib/ory-kratos-client/models/settings_request_method.rb +0 -216
- data/lib/ory-kratos-client/models/verification_request.rb +0 -276
- data/spec/api/common_api_spec.rb +0 -83
- data/spec/api/health_api_spec.rb +0 -57
- data/spec/api/version_api_spec.rb +0 -46
- data/spec/models/complete_self_service_browser_profile_management_flow_payload_spec.rb +0 -41
- data/spec/models/complete_self_service_browser_settings_strategy_profile_flow_payload_spec.rb +0 -47
- data/spec/models/complete_self_service_login_flow_with_password_method_spec.rb +0 -53
- data/spec/models/complete_self_service_recovery_flow_with_link_method_spec.rb +0 -47
- data/spec/models/complete_self_service_settings_flow_with_password_method_spec.rb +0 -47
- data/spec/models/complete_self_service_verification_flow_with_link_method_spec.rb +0 -47
- data/spec/models/error_spec.rb +0 -41
- data/spec/models/form_field_spec.rb +0 -65
- data/spec/models/form_spec.rb +0 -59
- data/spec/models/login_flow_method_spec.rb +0 -47
- data/spec/models/login_request_method_config_spec.rb +0 -35
- data/spec/models/login_request_method_spec.rb +0 -47
- data/spec/models/login_request_spec.rb +0 -71
- data/spec/models/oidc_strategy_credentials_config_spec.rb +0 -47
- data/spec/models/oidc_strategy_request_method_spec.rb +0 -65
- data/spec/models/profile_management_request_spec.rb +0 -77
- data/spec/models/provider_credentials_config_spec.rb +0 -47
- data/spec/models/recovery_flow_method_config_spec.rb +0 -59
- data/spec/models/recovery_flow_method_spec.rb +0 -47
- data/spec/models/recovery_request_method_spec.rb +0 -47
- data/spec/models/registration_flow_method_spec.rb +0 -47
- data/spec/models/registration_request_method_config_spec.rb +0 -35
- data/spec/models/registration_request_method_spec.rb +0 -47
- data/spec/models/request_method_config_spec.rb +0 -59
- data/spec/models/settings_flow_method_config_spec.rb +0 -59
- data/spec/models/settings_flow_method_spec.rb +0 -47
- data/spec/models/settings_request_method_spec.rb +0 -47
- data/spec/models/verification_flow_method_config_spec.rb +0 -59
- data/spec/models/verification_flow_method_spec.rb +0 -47
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
|
-
#Ory Kratos
|
2
|
+
#Ory Kratos API
|
3
3
|
|
4
|
-
#
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.5.5-alpha.2
|
4
|
+
#Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
|
7
5
|
|
6
|
+
The version of the OpenAPI document: v0.6.0-alpha.4
|
7
|
+
Contact: hi@ory.sh
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,25 +14,27 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module OryHydraClient
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
# SubmitSelfServiceRegistrationFlowWithPasswordMethod is used to decode the registration form payload when using the password method.
|
18
|
+
class SubmitSelfServiceRegistrationFlowWithPasswordMethod
|
19
|
+
# The CSRF Token
|
20
|
+
attr_accessor :csrf_token
|
20
21
|
|
21
|
-
#
|
22
|
-
attr_accessor :
|
22
|
+
# Method to use This field must be set to `password` when using the password method.
|
23
|
+
attr_accessor :method
|
23
24
|
|
24
|
-
|
25
|
+
# Password to sign the user up with
|
26
|
+
attr_accessor :password
|
25
27
|
|
26
|
-
#
|
27
|
-
attr_accessor :
|
28
|
+
# The identity's traits
|
29
|
+
attr_accessor :traits
|
28
30
|
|
29
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
32
|
def self.attribute_map
|
31
33
|
{
|
32
|
-
:'
|
33
|
-
:'
|
34
|
-
:'
|
35
|
-
:'
|
34
|
+
:'csrf_token' => :'csrf_token',
|
35
|
+
:'method' => :'method',
|
36
|
+
:'password' => :'password',
|
37
|
+
:'traits' => :'traits'
|
36
38
|
}
|
37
39
|
end
|
38
40
|
|
@@ -44,10 +46,10 @@ module OryHydraClient
|
|
44
46
|
# Attribute type mapping.
|
45
47
|
def self.openapi_types
|
46
48
|
{
|
47
|
-
:'
|
48
|
-
:'
|
49
|
-
:'
|
50
|
-
:'
|
49
|
+
:'csrf_token' => :'String',
|
50
|
+
:'method' => :'String',
|
51
|
+
:'password' => :'String',
|
52
|
+
:'traits' => :'Object'
|
51
53
|
}
|
52
54
|
end
|
53
55
|
|
@@ -61,35 +63,31 @@ module OryHydraClient
|
|
61
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
62
64
|
def initialize(attributes = {})
|
63
65
|
if (!attributes.is_a?(Hash))
|
64
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::SubmitSelfServiceRegistrationFlowWithPasswordMethod` initialize method"
|
65
67
|
end
|
66
68
|
|
67
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
68
70
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
69
71
|
if (!self.class.attribute_map.key?(k.to_sym))
|
70
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SubmitSelfServiceRegistrationFlowWithPasswordMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
71
73
|
end
|
72
74
|
h[k.to_sym] = v
|
73
75
|
}
|
74
76
|
|
75
|
-
if attributes.key?(:'
|
76
|
-
self.
|
77
|
+
if attributes.key?(:'csrf_token')
|
78
|
+
self.csrf_token = attributes[:'csrf_token']
|
77
79
|
end
|
78
80
|
|
79
|
-
if attributes.key?(:'
|
80
|
-
|
81
|
-
self.fields = value
|
82
|
-
end
|
81
|
+
if attributes.key?(:'method')
|
82
|
+
self.method = attributes[:'method']
|
83
83
|
end
|
84
84
|
|
85
|
-
if attributes.key?(:'
|
86
|
-
|
87
|
-
self.messages = value
|
88
|
-
end
|
85
|
+
if attributes.key?(:'password')
|
86
|
+
self.password = attributes[:'password']
|
89
87
|
end
|
90
88
|
|
91
|
-
if attributes.key?(:'
|
92
|
-
self.
|
89
|
+
if attributes.key?(:'traits')
|
90
|
+
self.traits = attributes[:'traits']
|
93
91
|
end
|
94
92
|
end
|
95
93
|
|
@@ -97,14 +95,6 @@ module OryHydraClient
|
|
97
95
|
# @return Array for valid properties with the reasons
|
98
96
|
def list_invalid_properties
|
99
97
|
invalid_properties = Array.new
|
100
|
-
if @action.nil?
|
101
|
-
invalid_properties.push('invalid value for "action", action cannot be nil.')
|
102
|
-
end
|
103
|
-
|
104
|
-
if @fields.nil?
|
105
|
-
invalid_properties.push('invalid value for "fields", fields cannot be nil.')
|
106
|
-
end
|
107
|
-
|
108
98
|
if @method.nil?
|
109
99
|
invalid_properties.push('invalid value for "method", method cannot be nil.')
|
110
100
|
end
|
@@ -115,8 +105,6 @@ module OryHydraClient
|
|
115
105
|
# Check to see if the all the properties in the model are valid
|
116
106
|
# @return true if the model is valid
|
117
107
|
def valid?
|
118
|
-
return false if @action.nil?
|
119
|
-
return false if @fields.nil?
|
120
108
|
return false if @method.nil?
|
121
109
|
true
|
122
110
|
end
|
@@ -126,10 +114,10 @@ module OryHydraClient
|
|
126
114
|
def ==(o)
|
127
115
|
return true if self.equal?(o)
|
128
116
|
self.class == o.class &&
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
117
|
+
csrf_token == o.csrf_token &&
|
118
|
+
method == o.method &&
|
119
|
+
password == o.password &&
|
120
|
+
traits == o.traits
|
133
121
|
end
|
134
122
|
|
135
123
|
# @see the `==` method
|
@@ -141,7 +129,7 @@ module OryHydraClient
|
|
141
129
|
# Calculates hash code according to all attributes.
|
142
130
|
# @return [Integer] Hash code
|
143
131
|
def hash
|
144
|
-
[
|
132
|
+
[csrf_token, method, password, traits].hash
|
145
133
|
end
|
146
134
|
|
147
135
|
# Builds the object from hash
|
@@ -0,0 +1,105 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory Kratos API
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.6.0-alpha.4
|
7
|
+
Contact: hi@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OryHydraClient
|
17
|
+
module SubmitSelfServiceSettingsFlow
|
18
|
+
class << self
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
20
|
+
def openapi_one_of
|
21
|
+
[
|
22
|
+
:'SubmitSelfServiceSettingsFlowWithPasswordMethod',
|
23
|
+
:'SubmitSelfServiceSettingsFlowWithProfileMethod'
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Builds the object
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
29
|
+
# @return [Object] Returns the model or the data itself
|
30
|
+
def build(data)
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
32
|
+
# Note:
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
36
|
+
# - TODO: scalar values are defacto behaving as if they were nullable.
|
37
|
+
# - TODO: logging when debugging is set.
|
38
|
+
openapi_one_of.each do |klass|
|
39
|
+
begin
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
42
|
+
return typed_data if typed_data
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
53
|
+
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
55
|
+
def find_and_cast_into_type(klass, data)
|
56
|
+
return if data.nil?
|
57
|
+
|
58
|
+
case klass.to_s
|
59
|
+
when 'Boolean'
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
61
|
+
when 'Float'
|
62
|
+
return data if data.instance_of?(Float)
|
63
|
+
when 'Integer'
|
64
|
+
return data if data.instance_of?(Integer)
|
65
|
+
when 'Time'
|
66
|
+
return Time.parse(data)
|
67
|
+
when 'Date'
|
68
|
+
return Date.parse(data)
|
69
|
+
when 'String'
|
70
|
+
return data if data.instance_of?(String)
|
71
|
+
when 'Object' # "type: object"
|
72
|
+
return data if data.instance_of?(Hash)
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
74
|
+
if data.instance_of?(Array)
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
77
|
+
end
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
82
|
+
end
|
83
|
+
else # model
|
84
|
+
const = OryHydraClient.const_get(klass)
|
85
|
+
if const
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
87
|
+
model = const.build(data)
|
88
|
+
return model if model
|
89
|
+
else
|
90
|
+
# raise if data contains keys that are not known to the model
|
91
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
92
|
+
model = const.build_from_hash(data)
|
93
|
+
return model if model && model.valid?
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
raise # if no match by now, raise
|
99
|
+
rescue
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
|
-
#Ory Kratos
|
2
|
+
#Ory Kratos API
|
3
3
|
|
4
|
-
#
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.5.5-alpha.2
|
4
|
+
#Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
|
7
5
|
|
6
|
+
The version of the OpenAPI document: v0.6.0-alpha.4
|
7
|
+
Contact: hi@ory.sh
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,10 +14,13 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module OryHydraClient
|
17
|
-
class
|
17
|
+
class SubmitSelfServiceSettingsFlowWithPasswordMethod
|
18
18
|
# CSRFToken is the anti-CSRF token type: string
|
19
19
|
attr_accessor :csrf_token
|
20
20
|
|
21
|
+
# Method Should be set to password when trying to update a password. type: string
|
22
|
+
attr_accessor :method
|
23
|
+
|
21
24
|
# Password is the updated password type: string
|
22
25
|
attr_accessor :password
|
23
26
|
|
@@ -25,6 +28,7 @@ module OryHydraClient
|
|
25
28
|
def self.attribute_map
|
26
29
|
{
|
27
30
|
:'csrf_token' => :'csrf_token',
|
31
|
+
:'method' => :'method',
|
28
32
|
:'password' => :'password'
|
29
33
|
}
|
30
34
|
end
|
@@ -38,6 +42,7 @@ module OryHydraClient
|
|
38
42
|
def self.openapi_types
|
39
43
|
{
|
40
44
|
:'csrf_token' => :'String',
|
45
|
+
:'method' => :'String',
|
41
46
|
:'password' => :'String'
|
42
47
|
}
|
43
48
|
end
|
@@ -52,13 +57,13 @@ module OryHydraClient
|
|
52
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
53
58
|
def initialize(attributes = {})
|
54
59
|
if (!attributes.is_a?(Hash))
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::SubmitSelfServiceSettingsFlowWithPasswordMethod` initialize method"
|
56
61
|
end
|
57
62
|
|
58
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
59
64
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
65
|
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SubmitSelfServiceSettingsFlowWithPasswordMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
67
|
end
|
63
68
|
h[k.to_sym] = v
|
64
69
|
}
|
@@ -67,6 +72,10 @@ module OryHydraClient
|
|
67
72
|
self.csrf_token = attributes[:'csrf_token']
|
68
73
|
end
|
69
74
|
|
75
|
+
if attributes.key?(:'method')
|
76
|
+
self.method = attributes[:'method']
|
77
|
+
end
|
78
|
+
|
70
79
|
if attributes.key?(:'password')
|
71
80
|
self.password = attributes[:'password']
|
72
81
|
end
|
@@ -96,6 +105,7 @@ module OryHydraClient
|
|
96
105
|
return true if self.equal?(o)
|
97
106
|
self.class == o.class &&
|
98
107
|
csrf_token == o.csrf_token &&
|
108
|
+
method == o.method &&
|
99
109
|
password == o.password
|
100
110
|
end
|
101
111
|
|
@@ -108,7 +118,7 @@ module OryHydraClient
|
|
108
118
|
# Calculates hash code according to all attributes.
|
109
119
|
# @return [Integer] Hash code
|
110
120
|
def hash
|
111
|
-
[csrf_token, password].hash
|
121
|
+
[csrf_token, method, password].hash
|
112
122
|
end
|
113
123
|
|
114
124
|
# Builds the object from hash
|
@@ -0,0 +1,245 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory Kratos API
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.6.0-alpha.4
|
7
|
+
Contact: hi@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OryHydraClient
|
17
|
+
# nolint:deadcode,unused
|
18
|
+
class SubmitSelfServiceSettingsFlowWithProfileMethod
|
19
|
+
# The Anti-CSRF Token This token is only required when performing browser flows.
|
20
|
+
attr_accessor :csrf_token
|
21
|
+
|
22
|
+
# Method Should be set to profile when trying to update a profile. type: string
|
23
|
+
attr_accessor :method
|
24
|
+
|
25
|
+
# Traits contains all of the identity's traits.
|
26
|
+
attr_accessor :traits
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'csrf_token' => :'csrf_token',
|
32
|
+
:'method' => :'method',
|
33
|
+
:'traits' => :'traits'
|
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
|
+
:'csrf_token' => :'String',
|
46
|
+
:'method' => :'String',
|
47
|
+
:'traits' => :'Object'
|
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 `OryHydraClient::SubmitSelfServiceSettingsFlowWithProfileMethod` 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 `OryHydraClient::SubmitSelfServiceSettingsFlowWithProfileMethod`. 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?(:'csrf_token')
|
73
|
+
self.csrf_token = attributes[:'csrf_token']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'method')
|
77
|
+
self.method = attributes[:'method']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'traits')
|
81
|
+
self.traits = attributes[:'traits']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
if @traits.nil?
|
90
|
+
invalid_properties.push('invalid value for "traits", traits cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
return false if @traits.nil?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
csrf_token == o.csrf_token &&
|
109
|
+
method == o.method &&
|
110
|
+
traits == o.traits
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[csrf_token, method, traits].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
new.build_from_hash(attributes)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
138
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
139
|
+
self.send("#{key}=", nil)
|
140
|
+
elsif type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :Time
|
161
|
+
Time.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
# models (e.g. Pet) or oneOf
|
192
|
+
klass = OryHydraClient.const_get(type)
|
193
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|