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,136 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Ory Kratos
|
3
|
-
|
4
|
-
#Welcome to the ORY Kratos HTTP API documentation!
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.5.5-alpha.2
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'cgi'
|
14
|
-
|
15
|
-
module OryHydraClient
|
16
|
-
class HealthApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
# Check alive status
|
23
|
-
# This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
|
24
|
-
# @param [Hash] opts the optional parameters
|
25
|
-
# @return [HealthStatus]
|
26
|
-
def is_instance_alive(opts = {})
|
27
|
-
data, _status_code, _headers = is_instance_alive_with_http_info(opts)
|
28
|
-
data
|
29
|
-
end
|
30
|
-
|
31
|
-
# Check alive status
|
32
|
-
# This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
|
33
|
-
# @param [Hash] opts the optional parameters
|
34
|
-
# @return [Array<(HealthStatus, Integer, Hash)>] HealthStatus data, response status code and response headers
|
35
|
-
def is_instance_alive_with_http_info(opts = {})
|
36
|
-
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API: HealthApi.is_instance_alive ...'
|
38
|
-
end
|
39
|
-
# resource path
|
40
|
-
local_var_path = '/health/alive'
|
41
|
-
|
42
|
-
# query parameters
|
43
|
-
query_params = opts[:query_params] || {}
|
44
|
-
|
45
|
-
# header parameters
|
46
|
-
header_params = opts[:header_params] || {}
|
47
|
-
# HTTP header 'Accept' (if needed)
|
48
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
-
|
50
|
-
# form parameters
|
51
|
-
form_params = opts[:form_params] || {}
|
52
|
-
|
53
|
-
# http body (model)
|
54
|
-
post_body = opts[:debug_body]
|
55
|
-
|
56
|
-
# return_type
|
57
|
-
return_type = opts[:debug_return_type] || 'HealthStatus'
|
58
|
-
|
59
|
-
# auth_names
|
60
|
-
auth_names = opts[:debug_auth_names] || []
|
61
|
-
|
62
|
-
new_options = opts.merge(
|
63
|
-
:operation => :"HealthApi.is_instance_alive",
|
64
|
-
:header_params => header_params,
|
65
|
-
:query_params => query_params,
|
66
|
-
:form_params => form_params,
|
67
|
-
:body => post_body,
|
68
|
-
:auth_names => auth_names,
|
69
|
-
:return_type => return_type
|
70
|
-
)
|
71
|
-
|
72
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
-
if @api_client.config.debugging
|
74
|
-
@api_client.config.logger.debug "API called: HealthApi#is_instance_alive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
-
end
|
76
|
-
return data, status_code, headers
|
77
|
-
end
|
78
|
-
|
79
|
-
# Check readiness status
|
80
|
-
# This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
|
81
|
-
# @param [Hash] opts the optional parameters
|
82
|
-
# @return [HealthStatus]
|
83
|
-
def is_instance_ready(opts = {})
|
84
|
-
data, _status_code, _headers = is_instance_ready_with_http_info(opts)
|
85
|
-
data
|
86
|
-
end
|
87
|
-
|
88
|
-
# Check readiness status
|
89
|
-
# This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
|
90
|
-
# @param [Hash] opts the optional parameters
|
91
|
-
# @return [Array<(HealthStatus, Integer, Hash)>] HealthStatus data, response status code and response headers
|
92
|
-
def is_instance_ready_with_http_info(opts = {})
|
93
|
-
if @api_client.config.debugging
|
94
|
-
@api_client.config.logger.debug 'Calling API: HealthApi.is_instance_ready ...'
|
95
|
-
end
|
96
|
-
# resource path
|
97
|
-
local_var_path = '/health/ready'
|
98
|
-
|
99
|
-
# query parameters
|
100
|
-
query_params = opts[:query_params] || {}
|
101
|
-
|
102
|
-
# header parameters
|
103
|
-
header_params = opts[:header_params] || {}
|
104
|
-
# HTTP header 'Accept' (if needed)
|
105
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
106
|
-
|
107
|
-
# form parameters
|
108
|
-
form_params = opts[:form_params] || {}
|
109
|
-
|
110
|
-
# http body (model)
|
111
|
-
post_body = opts[:debug_body]
|
112
|
-
|
113
|
-
# return_type
|
114
|
-
return_type = opts[:debug_return_type] || 'HealthStatus'
|
115
|
-
|
116
|
-
# auth_names
|
117
|
-
auth_names = opts[:debug_auth_names] || []
|
118
|
-
|
119
|
-
new_options = opts.merge(
|
120
|
-
:operation => :"HealthApi.is_instance_ready",
|
121
|
-
:header_params => header_params,
|
122
|
-
:query_params => query_params,
|
123
|
-
:form_params => form_params,
|
124
|
-
:body => post_body,
|
125
|
-
:auth_names => auth_names,
|
126
|
-
:return_type => return_type
|
127
|
-
)
|
128
|
-
|
129
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
130
|
-
if @api_client.config.debugging
|
131
|
-
@api_client.config.logger.debug "API called: HealthApi#is_instance_ready\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
-
end
|
133
|
-
return data, status_code, headers
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Ory Kratos
|
3
|
-
|
4
|
-
#Welcome to the ORY Kratos HTTP API documentation!
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.5.5-alpha.2
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'cgi'
|
14
|
-
|
15
|
-
module OryHydraClient
|
16
|
-
class VersionApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
# Get service version
|
23
|
-
# This endpoint returns the service version typically notated using semantic versioning. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
|
24
|
-
# @param [Hash] opts the optional parameters
|
25
|
-
# @return [Version]
|
26
|
-
def get_version(opts = {})
|
27
|
-
data, _status_code, _headers = get_version_with_http_info(opts)
|
28
|
-
data
|
29
|
-
end
|
30
|
-
|
31
|
-
# Get service version
|
32
|
-
# This endpoint returns the service version typically notated using semantic versioning. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
|
33
|
-
# @param [Hash] opts the optional parameters
|
34
|
-
# @return [Array<(Version, Integer, Hash)>] Version data, response status code and response headers
|
35
|
-
def get_version_with_http_info(opts = {})
|
36
|
-
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API: VersionApi.get_version ...'
|
38
|
-
end
|
39
|
-
# resource path
|
40
|
-
local_var_path = '/version'
|
41
|
-
|
42
|
-
# query parameters
|
43
|
-
query_params = opts[:query_params] || {}
|
44
|
-
|
45
|
-
# header parameters
|
46
|
-
header_params = opts[:header_params] || {}
|
47
|
-
# HTTP header 'Accept' (if needed)
|
48
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
-
|
50
|
-
# form parameters
|
51
|
-
form_params = opts[:form_params] || {}
|
52
|
-
|
53
|
-
# http body (model)
|
54
|
-
post_body = opts[:debug_body]
|
55
|
-
|
56
|
-
# return_type
|
57
|
-
return_type = opts[:debug_return_type] || 'Version'
|
58
|
-
|
59
|
-
# auth_names
|
60
|
-
auth_names = opts[:debug_auth_names] || []
|
61
|
-
|
62
|
-
new_options = opts.merge(
|
63
|
-
:operation => :"VersionApi.get_version",
|
64
|
-
:header_params => header_params,
|
65
|
-
:query_params => query_params,
|
66
|
-
:form_params => form_params,
|
67
|
-
:body => post_body,
|
68
|
-
:auth_names => auth_names,
|
69
|
-
:return_type => return_type
|
70
|
-
)
|
71
|
-
|
72
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
-
if @api_client.config.debugging
|
74
|
-
@api_client.config.logger.debug "API called: VersionApi#get_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
-
end
|
76
|
-
return data, status_code, headers
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/lib/ory-kratos-client/models/complete_self_service_browser_profile_management_flow_payload.rb
DELETED
@@ -1,212 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Ory Kratos
|
3
|
-
|
4
|
-
#Welcome to the ORY Kratos HTTP API documentation!
|
5
|
-
|
6
|
-
The version of the OpenAPI document: latest
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.2.3
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module OryHydraClient
|
16
|
-
class CompleteSelfServiceBrowserProfileManagementFlowPayload
|
17
|
-
# Traits contains all of the identity's traits. type: string format: binary
|
18
|
-
attr_accessor :traits
|
19
|
-
|
20
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
-
def self.attribute_map
|
22
|
-
{
|
23
|
-
:'traits' => :'traits'
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
# Attribute type mapping.
|
28
|
-
def self.openapi_types
|
29
|
-
{
|
30
|
-
:'traits' => :'Object'
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
# List of attributes with nullable: true
|
35
|
-
def self.openapi_nullable
|
36
|
-
Set.new([
|
37
|
-
])
|
38
|
-
end
|
39
|
-
|
40
|
-
# Initializes the object
|
41
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
-
def initialize(attributes = {})
|
43
|
-
if (!attributes.is_a?(Hash))
|
44
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::CompleteSelfServiceBrowserProfileManagementFlowPayload` initialize method"
|
45
|
-
end
|
46
|
-
|
47
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::CompleteSelfServiceBrowserProfileManagementFlowPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
-
end
|
52
|
-
h[k.to_sym] = v
|
53
|
-
}
|
54
|
-
|
55
|
-
if attributes.key?(:'traits')
|
56
|
-
self.traits = attributes[:'traits']
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
-
# @return Array for valid properties with the reasons
|
62
|
-
def list_invalid_properties
|
63
|
-
invalid_properties = Array.new
|
64
|
-
if @traits.nil?
|
65
|
-
invalid_properties.push('invalid value for "traits", traits cannot be nil.')
|
66
|
-
end
|
67
|
-
|
68
|
-
invalid_properties
|
69
|
-
end
|
70
|
-
|
71
|
-
# Check to see if the all the properties in the model are valid
|
72
|
-
# @return true if the model is valid
|
73
|
-
def valid?
|
74
|
-
return false if @traits.nil?
|
75
|
-
true
|
76
|
-
end
|
77
|
-
|
78
|
-
# Checks equality by comparing each attribute.
|
79
|
-
# @param [Object] Object to be compared
|
80
|
-
def ==(o)
|
81
|
-
return true if self.equal?(o)
|
82
|
-
self.class == o.class &&
|
83
|
-
traits == o.traits
|
84
|
-
end
|
85
|
-
|
86
|
-
# @see the `==` method
|
87
|
-
# @param [Object] Object to be compared
|
88
|
-
def eql?(o)
|
89
|
-
self == o
|
90
|
-
end
|
91
|
-
|
92
|
-
# Calculates hash code according to all attributes.
|
93
|
-
# @return [Integer] Hash code
|
94
|
-
def hash
|
95
|
-
[traits].hash
|
96
|
-
end
|
97
|
-
|
98
|
-
# Builds the object from hash
|
99
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
-
# @return [Object] Returns the model itself
|
101
|
-
def self.build_from_hash(attributes)
|
102
|
-
new.build_from_hash(attributes)
|
103
|
-
end
|
104
|
-
|
105
|
-
# Builds the object from hash
|
106
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
-
# @return [Object] Returns the model itself
|
108
|
-
def build_from_hash(attributes)
|
109
|
-
return nil unless attributes.is_a?(Hash)
|
110
|
-
self.class.openapi_types.each_pair do |key, type|
|
111
|
-
if type =~ /\AArray<(.*)>/i
|
112
|
-
# check to ensure the input is an array given that the attribute
|
113
|
-
# is documented as an array but the input is not
|
114
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
116
|
-
end
|
117
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
119
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
-
end
|
121
|
-
|
122
|
-
self
|
123
|
-
end
|
124
|
-
|
125
|
-
# Deserializes the data based on type
|
126
|
-
# @param string type Data type
|
127
|
-
# @param string value Value to be deserialized
|
128
|
-
# @return [Object] Deserialized data
|
129
|
-
def _deserialize(type, value)
|
130
|
-
case type.to_sym
|
131
|
-
when :DateTime
|
132
|
-
DateTime.parse(value)
|
133
|
-
when :Date
|
134
|
-
Date.parse(value)
|
135
|
-
when :String
|
136
|
-
value.to_s
|
137
|
-
when :Integer
|
138
|
-
value.to_i
|
139
|
-
when :Float
|
140
|
-
value.to_f
|
141
|
-
when :Boolean
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
-
true
|
144
|
-
else
|
145
|
-
false
|
146
|
-
end
|
147
|
-
when :Object
|
148
|
-
# generic object (usually a Hash), return directly
|
149
|
-
value
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
156
|
-
{}.tap do |hash|
|
157
|
-
value.each do |k, v|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
else # model
|
162
|
-
OryHydraClient.const_get(type).build_from_hash(value)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
# Returns the string representation of the object
|
167
|
-
# @return [String] String presentation of the object
|
168
|
-
def to_s
|
169
|
-
to_hash.to_s
|
170
|
-
end
|
171
|
-
|
172
|
-
# to_body is an alias to to_hash (backward compatibility)
|
173
|
-
# @return [Hash] Returns the object in the form of hash
|
174
|
-
def to_body
|
175
|
-
to_hash
|
176
|
-
end
|
177
|
-
|
178
|
-
# Returns the object in the form of hash
|
179
|
-
# @return [Hash] Returns the object in the form of hash
|
180
|
-
def to_hash
|
181
|
-
hash = {}
|
182
|
-
self.class.attribute_map.each_pair do |attr, param|
|
183
|
-
value = self.send(attr)
|
184
|
-
if value.nil?
|
185
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
186
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
187
|
-
end
|
188
|
-
|
189
|
-
hash[param] = _to_hash(value)
|
190
|
-
end
|
191
|
-
hash
|
192
|
-
end
|
193
|
-
|
194
|
-
# Outputs non-array value in the form of hash
|
195
|
-
# For object, use to_hash. Otherwise, just return the value
|
196
|
-
# @param [Object] value Any valid value
|
197
|
-
# @return [Hash] Returns the value in the form of hash
|
198
|
-
def _to_hash(value)
|
199
|
-
if value.is_a?(Array)
|
200
|
-
value.compact.map { |v| _to_hash(v) }
|
201
|
-
elsif value.is_a?(Hash)
|
202
|
-
{}.tap do |hash|
|
203
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
204
|
-
end
|
205
|
-
elsif value.respond_to? :to_hash
|
206
|
-
value.to_hash
|
207
|
-
else
|
208
|
-
value
|
209
|
-
end
|
210
|
-
end
|
211
|
-
end
|
212
|
-
end
|
@@ -1,222 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Ory Kratos
|
3
|
-
|
4
|
-
#Welcome to the ORY Kratos HTTP API documentation!
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.4.6-alpha.1
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module OryHydraClient
|
16
|
-
class CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload
|
17
|
-
# RequestID is request ID. in: query
|
18
|
-
attr_accessor :request_id
|
19
|
-
|
20
|
-
# Traits contains all of the identity's traits. type: string format: binary
|
21
|
-
attr_accessor :traits
|
22
|
-
|
23
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
-
def self.attribute_map
|
25
|
-
{
|
26
|
-
:'request_id' => :'request_id',
|
27
|
-
:'traits' => :'traits'
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
# Attribute type mapping.
|
32
|
-
def self.openapi_types
|
33
|
-
{
|
34
|
-
:'request_id' => :'String',
|
35
|
-
:'traits' => :'Object'
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
|
-
# List of attributes with nullable: true
|
40
|
-
def self.openapi_nullable
|
41
|
-
Set.new([
|
42
|
-
])
|
43
|
-
end
|
44
|
-
|
45
|
-
# Initializes the object
|
46
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
-
def initialize(attributes = {})
|
48
|
-
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload` initialize method"
|
50
|
-
end
|
51
|
-
|
52
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
-
end
|
57
|
-
h[k.to_sym] = v
|
58
|
-
}
|
59
|
-
|
60
|
-
if attributes.key?(:'request_id')
|
61
|
-
self.request_id = attributes[:'request_id']
|
62
|
-
end
|
63
|
-
|
64
|
-
if attributes.key?(:'traits')
|
65
|
-
self.traits = attributes[:'traits']
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
-
# @return Array for valid properties with the reasons
|
71
|
-
def list_invalid_properties
|
72
|
-
invalid_properties = Array.new
|
73
|
-
if @traits.nil?
|
74
|
-
invalid_properties.push('invalid value for "traits", traits cannot be nil.')
|
75
|
-
end
|
76
|
-
|
77
|
-
invalid_properties
|
78
|
-
end
|
79
|
-
|
80
|
-
# Check to see if the all the properties in the model are valid
|
81
|
-
# @return true if the model is valid
|
82
|
-
def valid?
|
83
|
-
return false if @traits.nil?
|
84
|
-
true
|
85
|
-
end
|
86
|
-
|
87
|
-
# Checks equality by comparing each attribute.
|
88
|
-
# @param [Object] Object to be compared
|
89
|
-
def ==(o)
|
90
|
-
return true if self.equal?(o)
|
91
|
-
self.class == o.class &&
|
92
|
-
request_id == o.request_id &&
|
93
|
-
traits == o.traits
|
94
|
-
end
|
95
|
-
|
96
|
-
# @see the `==` method
|
97
|
-
# @param [Object] Object to be compared
|
98
|
-
def eql?(o)
|
99
|
-
self == o
|
100
|
-
end
|
101
|
-
|
102
|
-
# Calculates hash code according to all attributes.
|
103
|
-
# @return [Integer] Hash code
|
104
|
-
def hash
|
105
|
-
[request_id, traits].hash
|
106
|
-
end
|
107
|
-
|
108
|
-
# Builds the object from hash
|
109
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
-
# @return [Object] Returns the model itself
|
111
|
-
def self.build_from_hash(attributes)
|
112
|
-
new.build_from_hash(attributes)
|
113
|
-
end
|
114
|
-
|
115
|
-
# Builds the object from hash
|
116
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
-
# @return [Object] Returns the model itself
|
118
|
-
def build_from_hash(attributes)
|
119
|
-
return nil unless attributes.is_a?(Hash)
|
120
|
-
self.class.openapi_types.each_pair do |key, type|
|
121
|
-
if type =~ /\AArray<(.*)>/i
|
122
|
-
# check to ensure the input is an array given that the attribute
|
123
|
-
# is documented as an array but the input is not
|
124
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
-
end
|
127
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
-
end
|
131
|
-
|
132
|
-
self
|
133
|
-
end
|
134
|
-
|
135
|
-
# Deserializes the data based on type
|
136
|
-
# @param string type Data type
|
137
|
-
# @param string value Value to be deserialized
|
138
|
-
# @return [Object] Deserialized data
|
139
|
-
def _deserialize(type, value)
|
140
|
-
case type.to_sym
|
141
|
-
when :DateTime
|
142
|
-
DateTime.parse(value)
|
143
|
-
when :Date
|
144
|
-
Date.parse(value)
|
145
|
-
when :String
|
146
|
-
value.to_s
|
147
|
-
when :Integer
|
148
|
-
value.to_i
|
149
|
-
when :Float
|
150
|
-
value.to_f
|
151
|
-
when :Boolean
|
152
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
-
true
|
154
|
-
else
|
155
|
-
false
|
156
|
-
end
|
157
|
-
when :Object
|
158
|
-
# generic object (usually a Hash), return directly
|
159
|
-
value
|
160
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
-
inner_type = Regexp.last_match[:inner_type]
|
162
|
-
value.map { |v| _deserialize(inner_type, v) }
|
163
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
-
k_type = Regexp.last_match[:k_type]
|
165
|
-
v_type = Regexp.last_match[:v_type]
|
166
|
-
{}.tap do |hash|
|
167
|
-
value.each do |k, v|
|
168
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
else # model
|
172
|
-
OryHydraClient.const_get(type).build_from_hash(value)
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
# Returns the string representation of the object
|
177
|
-
# @return [String] String presentation of the object
|
178
|
-
def to_s
|
179
|
-
to_hash.to_s
|
180
|
-
end
|
181
|
-
|
182
|
-
# to_body is an alias to to_hash (backward compatibility)
|
183
|
-
# @return [Hash] Returns the object in the form of hash
|
184
|
-
def to_body
|
185
|
-
to_hash
|
186
|
-
end
|
187
|
-
|
188
|
-
# Returns the object in the form of hash
|
189
|
-
# @return [Hash] Returns the object in the form of hash
|
190
|
-
def to_hash
|
191
|
-
hash = {}
|
192
|
-
self.class.attribute_map.each_pair do |attr, param|
|
193
|
-
value = self.send(attr)
|
194
|
-
if value.nil?
|
195
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
-
end
|
198
|
-
|
199
|
-
hash[param] = _to_hash(value)
|
200
|
-
end
|
201
|
-
hash
|
202
|
-
end
|
203
|
-
|
204
|
-
# Outputs non-array value in the form of hash
|
205
|
-
# For object, use to_hash. Otherwise, just return the value
|
206
|
-
# @param [Object] value Any valid value
|
207
|
-
# @return [Hash] Returns the value in the form of hash
|
208
|
-
def _to_hash(value)
|
209
|
-
if value.is_a?(Array)
|
210
|
-
value.compact.map { |v| _to_hash(v) }
|
211
|
-
elsif value.is_a?(Hash)
|
212
|
-
{}.tap do |hash|
|
213
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
214
|
-
end
|
215
|
-
elsif value.respond_to? :to_hash
|
216
|
-
value.to_hash
|
217
|
-
else
|
218
|
-
value
|
219
|
-
end
|
220
|
-
end
|
221
|
-
end
|
222
|
-
end
|