ory-client-client 0.0.1.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +231 -0
- data/Rakefile +10 -0
- 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/CreateIdentity.md +20 -0
- data/docs/CreateRecoveryLink.md +20 -0
- data/docs/DefaultApi.md +2902 -0
- data/docs/ErrorContainer.md +20 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/GenericError.md +30 -0
- data/docs/GraphDriverData.md +20 -0
- data/docs/HealthNotReadyStatus.md +18 -0
- data/docs/HealthStatus.md +18 -0
- data/docs/IdResponse.md +18 -0
- data/docs/Identity.md +28 -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/JsonError.md +18 -0
- data/docs/LoginFlow.md +32 -0
- data/docs/LoginViaApiResponse.md +20 -0
- 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/RecoveryAddress.md +22 -0
- data/docs/RecoveryFlow.md +32 -0
- data/docs/RecoveryLink.md +20 -0
- data/docs/RegistrationFlow.md +30 -0
- data/docs/RegistrationViaApiResponse.md +22 -0
- data/docs/RevokeSession.md +18 -0
- data/docs/ServiceUpdateResponse.md +18 -0
- data/docs/Session.md +28 -0
- data/docs/SettingsFlow.md +34 -0
- data/docs/SettingsProfileFormConfig.md +24 -0
- data/docs/SettingsViaApiResponse.md +20 -0
- data/docs/SubmitSelfServiceBrowserSettingsOIDCFlowPayload.md +22 -0
- data/docs/SubmitSelfServiceLoginFlow.md +47 -0
- data/docs/SubmitSelfServiceLoginFlowWithPasswordMethod.md +24 -0
- data/docs/SubmitSelfServiceRecoveryFlowWithLinkMethod.md +20 -0
- data/docs/SubmitSelfServiceRegistrationFlow.md +47 -0
- data/docs/SubmitSelfServiceRegistrationFlowWithPasswordMethod.md +24 -0
- data/docs/SubmitSelfServiceSettingsFlow.md +49 -0
- data/docs/SubmitSelfServiceSettingsFlowWithPasswordMethod.md +22 -0
- data/docs/SubmitSelfServiceSettingsFlowWithProfileMethod.md +22 -0
- data/docs/SubmitSelfServiceVerificationFlowWithLinkMethod.md +20 -0
- data/docs/UiContainer.md +24 -0
- 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/UpdateIdentity.md +20 -0
- data/docs/VerifiableIdentityAddress.md +32 -0
- data/docs/VerificationFlow.md +32 -0
- data/docs/Version.md +18 -0
- data/docs/Volume.md +34 -0
- data/docs/VolumeUsageData.md +20 -0
- data/lib/ory-client-client.rb +117 -0
- data/lib/ory-client-client/api/default_api.rb +2690 -0
- data/lib/ory-client-client/api_client.rb +390 -0
- data/lib/ory-client-client/api_error.rb +57 -0
- data/lib/ory-client-client/configuration.rb +297 -0
- data/lib/ory-client-client/models/authenticate_ok_body.rb +240 -0
- data/lib/ory-client-client/models/container_change_response_item.rb +240 -0
- data/lib/ory-client-client/models/container_create_created_body.rb +242 -0
- data/lib/ory-client-client/models/container_top_ok_body.rb +244 -0
- data/lib/ory-client-client/models/container_update_ok_body.rb +227 -0
- data/lib/ory-client-client/models/container_wait_ok_body.rb +239 -0
- data/lib/ory-client-client/models/container_wait_ok_body_error.rb +220 -0
- data/lib/ory-client-client/models/create_identity.rb +239 -0
- data/lib/ory-client-client/models/create_recovery_link.rb +250 -0
- data/lib/ory-client-client/models/error_container.rb +240 -0
- data/lib/ory-client-client/models/error_response.rb +224 -0
- data/lib/ory-client-client/models/generic_error.rb +286 -0
- data/lib/ory-client-client/models/graph_driver_data.rb +241 -0
- data/lib/ory-client-client/models/health_not_ready_status.rb +221 -0
- data/lib/ory-client-client/models/health_status.rb +219 -0
- data/lib/ory-client-client/models/id_response.rb +225 -0
- data/lib/ory-client-client/models/identity.rb +289 -0
- data/lib/ory-client-client/models/identity_credentials.rb +241 -0
- data/lib/ory-client-client/models/image_delete_response_item.rb +230 -0
- data/lib/ory-client-client/models/image_summary.rb +366 -0
- data/lib/ory-client-client/models/inline_response200.rb +224 -0
- data/lib/ory-client-client/models/inline_response2001.rb +224 -0
- data/lib/ory-client-client/models/inline_response503.rb +226 -0
- data/lib/ory-client-client/models/json_error.rb +224 -0
- data/lib/ory-client-client/models/login_flow.rb +318 -0
- data/lib/ory-client-client/models/login_via_api_response.rb +239 -0
- data/lib/ory-client-client/models/meta.rb +219 -0
- data/lib/ory-client-client/models/plugin.rb +288 -0
- data/lib/ory-client-client/models/plugin_config.rb +434 -0
- data/lib/ory-client-client/models/plugin_config_args.rb +274 -0
- data/lib/ory-client-client/models/plugin_config_interface.rb +242 -0
- data/lib/ory-client-client/models/plugin_config_linux.rb +259 -0
- data/lib/ory-client-client/models/plugin_config_network.rb +225 -0
- data/lib/ory-client-client/models/plugin_config_rootfs.rb +232 -0
- data/lib/ory-client-client/models/plugin_config_user.rb +230 -0
- data/lib/ory-client-client/models/plugin_device.rb +272 -0
- data/lib/ory-client-client/models/plugin_env.rb +272 -0
- data/lib/ory-client-client/models/plugin_interface_type.rb +255 -0
- data/lib/ory-client-client/models/plugin_mount.rb +319 -0
- data/lib/ory-client-client/models/plugin_settings.rb +277 -0
- data/lib/ory-client-client/models/port.rb +260 -0
- data/lib/ory-client-client/models/recovery_address.rb +251 -0
- data/lib/ory-client-client/models/recovery_flow.rb +317 -0
- data/lib/ory-client-client/models/recovery_link.rb +234 -0
- data/lib/ory-client-client/models/registration_flow.rb +302 -0
- data/lib/ory-client-client/models/registration_via_api_response.rb +248 -0
- data/lib/ory-client-client/models/revoke_session.rb +224 -0
- data/lib/ory-client-client/models/service_update_response.rb +222 -0
- data/lib/ory-client-client/models/session.rb +288 -0
- data/lib/ory-client-client/models/settings_flow.rb +331 -0
- data/lib/ory-client-client/models/settings_profile_form_config.rb +266 -0
- data/lib/ory-client-client/models/settings_via_api_response.rb +238 -0
- data/lib/ory-client-client/models/submit_self_service_browser_settings_oidc_flow_payload.rb +239 -0
- data/lib/ory-client-client/models/submit_self_service_login_flow.rb +104 -0
- data/lib/ory-client-client/models/submit_self_service_login_flow_with_password_method.rb +249 -0
- data/lib/ory-client-client/models/submit_self_service_recovery_flow_with_link_method.rb +229 -0
- data/lib/ory-client-client/models/submit_self_service_registration_flow.rb +104 -0
- data/lib/ory-client-client/models/submit_self_service_registration_flow_with_password_method.rb +276 -0
- data/lib/ory-client-client/models/submit_self_service_settings_flow.rb +105 -0
- data/lib/ory-client-client/models/submit_self_service_settings_flow_with_password_method.rb +244 -0
- data/lib/ory-client-client/models/submit_self_service_settings_flow_with_profile_method.rb +245 -0
- data/lib/ory-client-client/models/submit_self_service_verification_flow_with_link_method.rb +230 -0
- data/lib/ory-client-client/models/ui_container.rb +267 -0
- data/lib/ory-client-client/models/ui_node.rb +282 -0
- data/lib/ory-client-client/models/ui_node_anchor_attributes.rb +238 -0
- data/lib/ory-client-client/models/ui_node_attributes.rb +107 -0
- data/lib/ory-client-client/models/ui_node_image_attributes.rb +224 -0
- data/lib/ory-client-client/models/ui_node_input_attributes.rb +292 -0
- data/lib/ory-client-client/models/ui_node_input_attributes_value.rb +106 -0
- data/lib/ory-client-client/models/ui_node_text_attributes.rb +223 -0
- data/lib/ory-client-client/models/ui_text.rb +262 -0
- data/lib/ory-client-client/models/update_identity.rb +234 -0
- data/lib/ory-client-client/models/verifiable_identity_address.rb +313 -0
- data/lib/ory-client-client/models/verification_flow.rb +307 -0
- data/lib/ory-client-client/models/version.rb +219 -0
- data/lib/ory-client-client/models/volume.rb +335 -0
- data/lib/ory-client-client/models/volume_usage_data.rb +240 -0
- data/lib/ory-client-client/version.rb +15 -0
- data/ory-client-client.gemspec +38 -0
- data/spec/api/default_api_spec.rb +544 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- 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 +40 -0
- data/spec/models/create_recovery_link_spec.rb +40 -0
- data/spec/models/error_container_spec.rb +40 -0
- data/spec/models/error_response_spec.rb +34 -0
- data/spec/models/generic_error_spec.rb +70 -0
- data/spec/models/graph_driver_data_spec.rb +40 -0
- data/spec/models/health_not_ready_status_spec.rb +34 -0
- data/spec/models/health_status_spec.rb +34 -0
- data/spec/models/id_response_spec.rb +34 -0
- data/spec/models/identity_credentials_spec.rb +46 -0
- data/spec/models/identity_spec.rb +64 -0
- 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/json_error_spec.rb +34 -0
- data/spec/models/login_flow_spec.rb +76 -0
- data/spec/models/login_via_api_response_spec.rb +40 -0
- 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/plugin_mount_spec.rb +70 -0
- data/spec/models/plugin_settings_spec.rb +52 -0
- data/spec/models/plugin_spec.rb +64 -0
- data/spec/models/port_spec.rb +52 -0
- data/spec/models/recovery_address_spec.rb +46 -0
- data/spec/models/recovery_flow_spec.rb +76 -0
- data/spec/models/recovery_link_spec.rb +40 -0
- data/spec/models/registration_flow_spec.rb +70 -0
- data/spec/models/registration_via_api_response_spec.rb +46 -0
- data/spec/models/revoke_session_spec.rb +34 -0
- data/spec/models/service_update_response_spec.rb +34 -0
- data/spec/models/session_spec.rb +64 -0
- data/spec/models/settings_flow_spec.rb +82 -0
- data/spec/models/settings_profile_form_config_spec.rb +52 -0
- data/spec/models/settings_via_api_response_spec.rb +40 -0
- 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 +52 -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/ui_container_spec.rb +52 -0
- 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/ui_node_input_attributes_spec.rb +70 -0
- data/spec/models/ui_node_input_attributes_value_spec.rb +31 -0
- data/spec/models/ui_node_spec.rb +58 -0
- data/spec/models/ui_node_text_attributes_spec.rb +34 -0
- data/spec/models/ui_text_spec.rb +52 -0
- data/spec/models/update_identity_spec.rb +40 -0
- data/spec/models/verifiable_identity_address_spec.rb +76 -0
- data/spec/models/verification_flow_spec.rb +76 -0
- data/spec/models/version_spec.rb +34 -0
- data/spec/models/volume_spec.rb +82 -0
- data/spec/models/volume_usage_data_spec.rb +40 -0
- data/spec/spec_helper.rb +111 -0
- metadata +413 -0
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory APIs
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.1-alpha.1
|
7
|
+
Contact: support@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
|
+
# The standard Ory JSON API error format.
|
18
|
+
class JsonError
|
19
|
+
attr_accessor :error
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'error' => :'error'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'error' => :'GenericError'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::JsonError` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::JsonError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'error')
|
62
|
+
self.error = attributes[:'error']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
if @error.nil?
|
71
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
72
|
+
end
|
73
|
+
|
74
|
+
invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return false if @error.nil?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if self.equal?(o)
|
88
|
+
self.class == o.class &&
|
89
|
+
error == o.error
|
90
|
+
end
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def eql?(o)
|
95
|
+
self == o
|
96
|
+
end
|
97
|
+
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Integer] Hash code
|
100
|
+
def hash
|
101
|
+
[error].hash
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def self.build_from_hash(attributes)
|
108
|
+
new.build_from_hash(attributes)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def build_from_hash(attributes)
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
117
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
118
|
+
self.send("#{key}=", nil)
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
123
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
124
|
+
end
|
125
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def _deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :Boolean
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
when :Object
|
156
|
+
# generic object (usually a Hash), return directly
|
157
|
+
value
|
158
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
+
inner_type = Regexp.last_match[:inner_type]
|
160
|
+
value.map { |v| _deserialize(inner_type, v) }
|
161
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
+
k_type = Regexp.last_match[:k_type]
|
163
|
+
v_type = Regexp.last_match[:v_type]
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each do |k, v|
|
166
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
else # model
|
170
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = OryHydraClient.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
|
+
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
@@ -0,0 +1,318 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory APIs
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.1-alpha.1
|
7
|
+
Contact: support@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
|
+
# This object represents a login flow. A login flow is initiated at the \"Initiate Login API / Browser Flow\" endpoint by a client. Once a login flow is completed successfully, a session cookie or session token will be issued.
|
18
|
+
class LoginFlow
|
19
|
+
# and so on.
|
20
|
+
attr_accessor :active
|
21
|
+
|
22
|
+
# ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in, a new flow has to be initiated.
|
23
|
+
attr_accessor :expires_at
|
24
|
+
|
25
|
+
# Forced stores whether this login flow should enforce re-authentication.
|
26
|
+
attr_accessor :forced
|
27
|
+
|
28
|
+
attr_accessor :id
|
29
|
+
|
30
|
+
# IssuedAt is the time (UTC) when the flow started.
|
31
|
+
attr_accessor :issued_at
|
32
|
+
|
33
|
+
# RequestURL is the initial URL that was requested from Ory Kratos. It can be used to forward information contained in the URL's path or query for example.
|
34
|
+
attr_accessor :request_url
|
35
|
+
|
36
|
+
# The flow type can either be `api` or `browser`.
|
37
|
+
attr_accessor :type
|
38
|
+
|
39
|
+
attr_accessor :ui
|
40
|
+
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
42
|
+
def self.attribute_map
|
43
|
+
{
|
44
|
+
:'active' => :'active',
|
45
|
+
:'expires_at' => :'expires_at',
|
46
|
+
:'forced' => :'forced',
|
47
|
+
:'id' => :'id',
|
48
|
+
:'issued_at' => :'issued_at',
|
49
|
+
:'request_url' => :'request_url',
|
50
|
+
:'type' => :'type',
|
51
|
+
:'ui' => :'ui'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Returns all the JSON keys this model knows about
|
56
|
+
def self.acceptable_attributes
|
57
|
+
attribute_map.values
|
58
|
+
end
|
59
|
+
|
60
|
+
# Attribute type mapping.
|
61
|
+
def self.openapi_types
|
62
|
+
{
|
63
|
+
:'active' => :'String',
|
64
|
+
:'expires_at' => :'Time',
|
65
|
+
:'forced' => :'Boolean',
|
66
|
+
:'id' => :'String',
|
67
|
+
:'issued_at' => :'Time',
|
68
|
+
:'request_url' => :'String',
|
69
|
+
:'type' => :'String',
|
70
|
+
:'ui' => :'UiContainer'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# List of attributes with nullable: true
|
75
|
+
def self.openapi_nullable
|
76
|
+
Set.new([
|
77
|
+
])
|
78
|
+
end
|
79
|
+
|
80
|
+
# Initializes the object
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
def initialize(attributes = {})
|
83
|
+
if (!attributes.is_a?(Hash))
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::LoginFlow` initialize method"
|
85
|
+
end
|
86
|
+
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
89
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::LoginFlow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
91
|
+
end
|
92
|
+
h[k.to_sym] = v
|
93
|
+
}
|
94
|
+
|
95
|
+
if attributes.key?(:'active')
|
96
|
+
self.active = attributes[:'active']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'expires_at')
|
100
|
+
self.expires_at = attributes[:'expires_at']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'forced')
|
104
|
+
self.forced = attributes[:'forced']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'id')
|
108
|
+
self.id = attributes[:'id']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'issued_at')
|
112
|
+
self.issued_at = attributes[:'issued_at']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'request_url')
|
116
|
+
self.request_url = attributes[:'request_url']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'type')
|
120
|
+
self.type = attributes[:'type']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'ui')
|
124
|
+
self.ui = attributes[:'ui']
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
129
|
+
# @return Array for valid properties with the reasons
|
130
|
+
def list_invalid_properties
|
131
|
+
invalid_properties = Array.new
|
132
|
+
if @expires_at.nil?
|
133
|
+
invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
|
134
|
+
end
|
135
|
+
|
136
|
+
if @id.nil?
|
137
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
138
|
+
end
|
139
|
+
|
140
|
+
if @issued_at.nil?
|
141
|
+
invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
|
142
|
+
end
|
143
|
+
|
144
|
+
if @request_url.nil?
|
145
|
+
invalid_properties.push('invalid value for "request_url", request_url cannot be nil.')
|
146
|
+
end
|
147
|
+
|
148
|
+
if @type.nil?
|
149
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @ui.nil?
|
153
|
+
invalid_properties.push('invalid value for "ui", ui cannot be nil.')
|
154
|
+
end
|
155
|
+
|
156
|
+
invalid_properties
|
157
|
+
end
|
158
|
+
|
159
|
+
# Check to see if the all the properties in the model are valid
|
160
|
+
# @return true if the model is valid
|
161
|
+
def valid?
|
162
|
+
return false if @expires_at.nil?
|
163
|
+
return false if @id.nil?
|
164
|
+
return false if @issued_at.nil?
|
165
|
+
return false if @request_url.nil?
|
166
|
+
return false if @type.nil?
|
167
|
+
return false if @ui.nil?
|
168
|
+
true
|
169
|
+
end
|
170
|
+
|
171
|
+
# Checks equality by comparing each attribute.
|
172
|
+
# @param [Object] Object to be compared
|
173
|
+
def ==(o)
|
174
|
+
return true if self.equal?(o)
|
175
|
+
self.class == o.class &&
|
176
|
+
active == o.active &&
|
177
|
+
expires_at == o.expires_at &&
|
178
|
+
forced == o.forced &&
|
179
|
+
id == o.id &&
|
180
|
+
issued_at == o.issued_at &&
|
181
|
+
request_url == o.request_url &&
|
182
|
+
type == o.type &&
|
183
|
+
ui == o.ui
|
184
|
+
end
|
185
|
+
|
186
|
+
# @see the `==` method
|
187
|
+
# @param [Object] Object to be compared
|
188
|
+
def eql?(o)
|
189
|
+
self == o
|
190
|
+
end
|
191
|
+
|
192
|
+
# Calculates hash code according to all attributes.
|
193
|
+
# @return [Integer] Hash code
|
194
|
+
def hash
|
195
|
+
[active, expires_at, forced, id, issued_at, request_url, type, ui].hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Builds the object from hash
|
199
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
200
|
+
# @return [Object] Returns the model itself
|
201
|
+
def self.build_from_hash(attributes)
|
202
|
+
new.build_from_hash(attributes)
|
203
|
+
end
|
204
|
+
|
205
|
+
# Builds the object from hash
|
206
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
207
|
+
# @return [Object] Returns the model itself
|
208
|
+
def build_from_hash(attributes)
|
209
|
+
return nil unless attributes.is_a?(Hash)
|
210
|
+
self.class.openapi_types.each_pair do |key, type|
|
211
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
212
|
+
self.send("#{key}=", nil)
|
213
|
+
elsif type =~ /\AArray<(.*)>/i
|
214
|
+
# check to ensure the input is an array given that the attribute
|
215
|
+
# is documented as an array but the input is not
|
216
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
217
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
218
|
+
end
|
219
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
220
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
self
|
225
|
+
end
|
226
|
+
|
227
|
+
# Deserializes the data based on type
|
228
|
+
# @param string type Data type
|
229
|
+
# @param string value Value to be deserialized
|
230
|
+
# @return [Object] Deserialized data
|
231
|
+
def _deserialize(type, value)
|
232
|
+
case type.to_sym
|
233
|
+
when :Time
|
234
|
+
Time.parse(value)
|
235
|
+
when :Date
|
236
|
+
Date.parse(value)
|
237
|
+
when :String
|
238
|
+
value.to_s
|
239
|
+
when :Integer
|
240
|
+
value.to_i
|
241
|
+
when :Float
|
242
|
+
value.to_f
|
243
|
+
when :Boolean
|
244
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
245
|
+
true
|
246
|
+
else
|
247
|
+
false
|
248
|
+
end
|
249
|
+
when :Object
|
250
|
+
# generic object (usually a Hash), return directly
|
251
|
+
value
|
252
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
253
|
+
inner_type = Regexp.last_match[:inner_type]
|
254
|
+
value.map { |v| _deserialize(inner_type, v) }
|
255
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
256
|
+
k_type = Regexp.last_match[:k_type]
|
257
|
+
v_type = Regexp.last_match[:v_type]
|
258
|
+
{}.tap do |hash|
|
259
|
+
value.each do |k, v|
|
260
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
261
|
+
end
|
262
|
+
end
|
263
|
+
else # model
|
264
|
+
# models (e.g. Pet) or oneOf
|
265
|
+
klass = OryHydraClient.const_get(type)
|
266
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
# Returns the string representation of the object
|
271
|
+
# @return [String] String presentation of the object
|
272
|
+
def to_s
|
273
|
+
to_hash.to_s
|
274
|
+
end
|
275
|
+
|
276
|
+
# to_body is an alias to to_hash (backward compatibility)
|
277
|
+
# @return [Hash] Returns the object in the form of hash
|
278
|
+
def to_body
|
279
|
+
to_hash
|
280
|
+
end
|
281
|
+
|
282
|
+
# Returns the object in the form of hash
|
283
|
+
# @return [Hash] Returns the object in the form of hash
|
284
|
+
def to_hash
|
285
|
+
hash = {}
|
286
|
+
self.class.attribute_map.each_pair do |attr, param|
|
287
|
+
value = self.send(attr)
|
288
|
+
if value.nil?
|
289
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
290
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
291
|
+
end
|
292
|
+
|
293
|
+
hash[param] = _to_hash(value)
|
294
|
+
end
|
295
|
+
hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Outputs non-array value in the form of hash
|
299
|
+
# For object, use to_hash. Otherwise, just return the value
|
300
|
+
# @param [Object] value Any valid value
|
301
|
+
# @return [Hash] Returns the value in the form of hash
|
302
|
+
def _to_hash(value)
|
303
|
+
if value.is_a?(Array)
|
304
|
+
value.compact.map { |v| _to_hash(v) }
|
305
|
+
elsif value.is_a?(Hash)
|
306
|
+
{}.tap do |hash|
|
307
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
308
|
+
end
|
309
|
+
elsif value.respond_to? :to_hash
|
310
|
+
value.to_hash
|
311
|
+
else
|
312
|
+
value
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|
317
|
+
|
318
|
+
end
|