ory-kratos-client 0.2.1.alpha1 → 0.5.2.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +84 -52
- data/docs/AdminApi.md +244 -86
- data/docs/CommonApi.md +54 -6
- data/docs/CompleteSelfServiceLoginFlowWithPasswordMethod.md +21 -0
- data/docs/CompleteSelfServiceRecoveryFlowWithLinkMethod.md +19 -0
- data/docs/CompleteSelfServiceSettingsFlowWithPasswordMethod.md +19 -0
- data/docs/CompleteSelfServiceVerificationFlowWithLinkMethod.md +19 -0
- data/docs/CreateIdentity.md +19 -0
- data/docs/CreateRecoveryLink.md +19 -0
- data/docs/ErrorContainer.md +2 -2
- data/docs/Form.md +2 -2
- data/docs/FormField.md +4 -4
- data/docs/GenericErrorPayload.md +1 -1
- data/docs/Identity.md +9 -7
- data/docs/LoginFlow.md +33 -0
- data/docs/LoginFlowMethod.md +19 -0
- data/docs/LoginFlowMethodConfig.md +25 -0
- data/docs/LoginRequest.md +2 -0
- data/docs/LoginRequestMethodConfig.md +2 -2
- data/docs/LoginViaApiResponse.md +19 -0
- data/docs/Message.md +23 -0
- data/docs/ProviderCredentialsConfig.md +19 -0
- data/docs/PublicApi.md +726 -151
- data/docs/RecoveryAddress.md +21 -0
- data/docs/RecoveryFlow.md +33 -0
- data/docs/RecoveryFlowMethod.md +19 -0
- data/docs/RecoveryFlowMethodConfig.md +23 -0
- data/docs/RecoveryLink.md +19 -0
- data/docs/RecoveryRequest.md +31 -0
- data/docs/RecoveryRequestMethod.md +19 -0
- data/docs/RegistrationFlow.md +31 -0
- data/docs/RegistrationFlowMethod.md +19 -0
- data/docs/RegistrationFlowMethodConfig.md +25 -0
- data/docs/RegistrationRequest.md +3 -1
- data/docs/RegistrationRequestMethodConfig.md +2 -2
- data/docs/RegistrationViaApiResponse.md +21 -0
- data/docs/RequestMethodConfig.md +2 -2
- data/docs/RevokeSession.md +17 -0
- data/docs/Session.md +6 -4
- data/docs/SettingsFlow.md +35 -0
- data/docs/SettingsFlowMethod.md +19 -0
- data/docs/SettingsFlowMethodConfig.md +23 -0
- data/docs/SettingsRequest.md +4 -2
- data/docs/SettingsViaApiResponse.md +19 -0
- data/docs/UpdateIdentity.md +19 -0
- data/docs/VerifiableAddress.md +3 -3
- data/docs/VerificationFlow.md +33 -0
- data/docs/VerificationFlowMethod.md +19 -0
- data/docs/VerificationFlowMethodConfig.md +23 -0
- data/docs/VerificationRequest.md +2 -0
- data/lib/ory-kratos-client.rb +31 -16
- data/lib/ory-kratos-client/api/admin_api.rb +321 -130
- data/lib/ory-kratos-client/api/common_api.rb +75 -12
- data/lib/ory-kratos-client/api/health_api.rb +2 -2
- data/lib/ory-kratos-client/api/public_api.rb +896 -246
- data/lib/ory-kratos-client/api/version_api.rb +2 -2
- data/lib/ory-kratos-client/api_client.rb +10 -7
- data/lib/ory-kratos-client/api_error.rb +2 -2
- data/lib/ory-kratos-client/configuration.rb +9 -2
- data/lib/ory-kratos-client/models/complete_self_service_browser_settings_strategy_profile_flow_payload.rb +2 -2
- data/lib/ory-kratos-client/models/complete_self_service_login_flow_with_password_method.rb +227 -0
- data/lib/ory-kratos-client/models/complete_self_service_recovery_flow_with_link_method.rb +217 -0
- data/lib/ory-kratos-client/models/complete_self_service_settings_flow_with_password_method.rb +222 -0
- data/lib/ory-kratos-client/models/complete_self_service_verification_flow_with_link_method.rb +217 -0
- data/lib/ory-kratos-client/models/create_identity.rb +227 -0
- data/lib/ory-kratos-client/models/create_recovery_link.rb +238 -0
- data/lib/ory-kratos-client/models/error_container.rb +13 -2
- data/lib/ory-kratos-client/models/form.rb +14 -15
- data/lib/ory-kratos-client/models/form_field.rb +11 -17
- data/lib/ory-kratos-client/models/generic_error.rb +2 -2
- data/lib/ory-kratos-client/models/generic_error_payload.rb +4 -6
- data/lib/ory-kratos-client/models/health_not_ready_status.rb +2 -2
- data/lib/ory-kratos-client/models/health_status.rb +2 -2
- data/lib/ory-kratos-client/models/identity.rb +53 -35
- data/lib/ory-kratos-client/models/login_flow.rb +315 -0
- data/lib/ory-kratos-client/models/login_flow_method.rb +226 -0
- data/lib/ory-kratos-client/models/login_flow_method_config.rb +267 -0
- data/lib/ory-kratos-client/models/login_request.rb +14 -3
- data/lib/ory-kratos-client/models/login_request_method.rb +2 -2
- data/lib/ory-kratos-client/models/login_request_method_config.rb +14 -15
- data/lib/ory-kratos-client/models/login_via_api_response.rb +227 -0
- data/lib/ory-kratos-client/models/message.rb +234 -0
- data/lib/ory-kratos-client/models/provider_credentials_config.rb +215 -0
- data/lib/ory-kratos-client/models/recovery_address.rb +239 -0
- data/lib/ory-kratos-client/models/recovery_flow.rb +319 -0
- data/lib/ory-kratos-client/models/recovery_flow_method.rb +226 -0
- data/lib/ory-kratos-client/models/recovery_flow_method_config.rb +255 -0
- data/lib/ory-kratos-client/models/recovery_link.rb +222 -0
- data/lib/ory-kratos-client/models/recovery_request.rb +309 -0
- data/lib/ory-kratos-client/models/recovery_request_method.rb +216 -0
- data/lib/ory-kratos-client/models/registration_flow.rb +304 -0
- data/lib/ory-kratos-client/models/registration_flow_method.rb +226 -0
- data/lib/ory-kratos-client/models/registration_flow_method_config.rb +267 -0
- data/lib/ory-kratos-client/models/registration_request.rb +14 -8
- data/lib/ory-kratos-client/models/registration_request_method.rb +2 -2
- data/lib/ory-kratos-client/models/registration_request_method_config.rb +14 -15
- data/lib/ory-kratos-client/models/registration_via_api_response.rb +236 -0
- data/lib/ory-kratos-client/models/request_method_config.rb +14 -15
- data/lib/ory-kratos-client/models/revoke_session.rb +212 -0
- data/lib/ory-kratos-client/models/session.rb +29 -20
- data/lib/ory-kratos-client/models/settings_flow.rb +333 -0
- data/lib/ory-kratos-client/models/settings_flow_method.rb +226 -0
- data/lib/ory-kratos-client/models/settings_flow_method_config.rb +255 -0
- data/lib/ory-kratos-client/models/settings_request.rb +24 -14
- data/lib/ory-kratos-client/models/settings_request_method.rb +2 -2
- data/lib/ory-kratos-client/models/settings_via_api_response.rb +226 -0
- data/lib/ory-kratos-client/models/update_identity.rb +222 -0
- data/lib/ory-kratos-client/models/verifiable_address.rb +17 -17
- data/lib/ory-kratos-client/models/verification_flow.rb +299 -0
- data/lib/ory-kratos-client/models/verification_flow_method.rb +226 -0
- data/lib/ory-kratos-client/models/verification_flow_method_config.rb +255 -0
- data/lib/ory-kratos-client/models/verification_request.rb +14 -3
- data/lib/ory-kratos-client/models/version.rb +2 -2
- data/lib/ory-kratos-client/version.rb +3 -3
- data/ory-kratos-client.gemspec +2 -2
- data/spec/models/complete_self_service_login_flow_with_password_method_spec.rb +53 -0
- data/spec/models/complete_self_service_recovery_flow_with_link_method_spec.rb +47 -0
- data/spec/models/complete_self_service_settings_flow_with_password_method_spec.rb +47 -0
- data/spec/models/complete_self_service_verification_flow_with_link_method_spec.rb +47 -0
- data/spec/models/create_identity_spec.rb +47 -0
- data/spec/models/create_recovery_link_spec.rb +47 -0
- data/spec/models/login_flow_method_config_spec.rb +65 -0
- data/spec/models/login_flow_method_spec.rb +47 -0
- data/spec/models/login_flow_spec.rb +89 -0
- data/spec/models/login_via_api_response_spec.rb +47 -0
- data/spec/models/message_spec.rb +59 -0
- data/spec/models/provider_credentials_config_spec.rb +47 -0
- data/spec/models/recovery_address_spec.rb +53 -0
- data/spec/models/recovery_flow_method_config_spec.rb +59 -0
- data/spec/models/recovery_flow_method_spec.rb +47 -0
- data/spec/models/recovery_flow_spec.rb +89 -0
- data/spec/models/recovery_link_spec.rb +47 -0
- data/spec/models/recovery_request_method_spec.rb +47 -0
- data/spec/models/recovery_request_spec.rb +83 -0
- data/spec/models/registration_flow_method_config_spec.rb +65 -0
- data/spec/models/registration_flow_method_spec.rb +47 -0
- data/spec/models/registration_flow_spec.rb +83 -0
- data/spec/models/registration_via_api_response_spec.rb +53 -0
- data/spec/models/revoke_session_spec.rb +41 -0
- data/spec/models/settings_flow_method_config_spec.rb +59 -0
- data/spec/models/settings_flow_method_spec.rb +47 -0
- data/spec/models/settings_flow_spec.rb +95 -0
- data/spec/models/settings_via_api_response_spec.rb +47 -0
- data/spec/models/update_identity_spec.rb +47 -0
- data/spec/models/verification_flow_method_config_spec.rb +59 -0
- data/spec/models/verification_flow_method_spec.rb +47 -0
- data/spec/models/verification_flow_spec.rb +89 -0
- metadata +150 -22
@@ -0,0 +1,255 @@
|
|
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.2-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 RecoveryFlowMethodConfig
|
17
|
+
# Action should be used as the form action URL `<form action=\"{{ .Action }}\" method=\"post\">`.
|
18
|
+
attr_accessor :action
|
19
|
+
|
20
|
+
# Fields contains multiple fields
|
21
|
+
attr_accessor :fields
|
22
|
+
|
23
|
+
attr_accessor :messages
|
24
|
+
|
25
|
+
# Method is the form method (e.g. POST)
|
26
|
+
attr_accessor :method
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'action' => :'action',
|
32
|
+
:'fields' => :'fields',
|
33
|
+
:'messages' => :'messages',
|
34
|
+
:'method' => :'method'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'action' => :'String',
|
42
|
+
:'fields' => :'Array<FormField>',
|
43
|
+
:'messages' => :'Array<Message>',
|
44
|
+
:'method' => :'String'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.openapi_nullable
|
50
|
+
Set.new([
|
51
|
+
])
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::RecoveryFlowMethodConfig` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::RecoveryFlowMethodConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'action')
|
70
|
+
self.action = attributes[:'action']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'fields')
|
74
|
+
if (value = attributes[:'fields']).is_a?(Array)
|
75
|
+
self.fields = value
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'messages')
|
80
|
+
if (value = attributes[:'messages']).is_a?(Array)
|
81
|
+
self.messages = value
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'method')
|
86
|
+
self.method = attributes[:'method']
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
91
|
+
# @return Array for valid properties with the reasons
|
92
|
+
def list_invalid_properties
|
93
|
+
invalid_properties = Array.new
|
94
|
+
if @action.nil?
|
95
|
+
invalid_properties.push('invalid value for "action", action cannot be nil.')
|
96
|
+
end
|
97
|
+
|
98
|
+
if @fields.nil?
|
99
|
+
invalid_properties.push('invalid value for "fields", fields cannot be nil.')
|
100
|
+
end
|
101
|
+
|
102
|
+
if @method.nil?
|
103
|
+
invalid_properties.push('invalid value for "method", method cannot be nil.')
|
104
|
+
end
|
105
|
+
|
106
|
+
invalid_properties
|
107
|
+
end
|
108
|
+
|
109
|
+
# Check to see if the all the properties in the model are valid
|
110
|
+
# @return true if the model is valid
|
111
|
+
def valid?
|
112
|
+
return false if @action.nil?
|
113
|
+
return false if @fields.nil?
|
114
|
+
return false if @method.nil?
|
115
|
+
true
|
116
|
+
end
|
117
|
+
|
118
|
+
# Checks equality by comparing each attribute.
|
119
|
+
# @param [Object] Object to be compared
|
120
|
+
def ==(o)
|
121
|
+
return true if self.equal?(o)
|
122
|
+
self.class == o.class &&
|
123
|
+
action == o.action &&
|
124
|
+
fields == o.fields &&
|
125
|
+
messages == o.messages &&
|
126
|
+
method == o.method
|
127
|
+
end
|
128
|
+
|
129
|
+
# @see the `==` method
|
130
|
+
# @param [Object] Object to be compared
|
131
|
+
def eql?(o)
|
132
|
+
self == o
|
133
|
+
end
|
134
|
+
|
135
|
+
# Calculates hash code according to all attributes.
|
136
|
+
# @return [Integer] Hash code
|
137
|
+
def hash
|
138
|
+
[action, fields, messages, method].hash
|
139
|
+
end
|
140
|
+
|
141
|
+
# Builds the object from hash
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
# @return [Object] Returns the model itself
|
144
|
+
def self.build_from_hash(attributes)
|
145
|
+
new.build_from_hash(attributes)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Builds the object from hash
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
+
# @return [Object] Returns the model itself
|
151
|
+
def build_from_hash(attributes)
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
153
|
+
self.class.openapi_types.each_pair do |key, type|
|
154
|
+
if type =~ /\AArray<(.*)>/i
|
155
|
+
# check to ensure the input is an array given that the attribute
|
156
|
+
# is documented as an array but the input is not
|
157
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
158
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
159
|
+
end
|
160
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
161
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
162
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
163
|
+
end
|
164
|
+
|
165
|
+
self
|
166
|
+
end
|
167
|
+
|
168
|
+
# Deserializes the data based on type
|
169
|
+
# @param string type Data type
|
170
|
+
# @param string value Value to be deserialized
|
171
|
+
# @return [Object] Deserialized data
|
172
|
+
def _deserialize(type, value)
|
173
|
+
case type.to_sym
|
174
|
+
when :DateTime
|
175
|
+
DateTime.parse(value)
|
176
|
+
when :Date
|
177
|
+
Date.parse(value)
|
178
|
+
when :String
|
179
|
+
value.to_s
|
180
|
+
when :Integer
|
181
|
+
value.to_i
|
182
|
+
when :Float
|
183
|
+
value.to_f
|
184
|
+
when :Boolean
|
185
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
186
|
+
true
|
187
|
+
else
|
188
|
+
false
|
189
|
+
end
|
190
|
+
when :Object
|
191
|
+
# generic object (usually a Hash), return directly
|
192
|
+
value
|
193
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
194
|
+
inner_type = Regexp.last_match[:inner_type]
|
195
|
+
value.map { |v| _deserialize(inner_type, v) }
|
196
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
197
|
+
k_type = Regexp.last_match[:k_type]
|
198
|
+
v_type = Regexp.last_match[:v_type]
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each do |k, v|
|
201
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
else # model
|
205
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_body
|
218
|
+
to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = self.send(attr)
|
227
|
+
if value.nil?
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
|
+
end
|
231
|
+
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Outputs non-array value in the form of hash
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
239
|
+
# @param [Object] value Any valid value
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
241
|
+
def _to_hash(value)
|
242
|
+
if value.is_a?(Array)
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
244
|
+
elsif value.is_a?(Hash)
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
247
|
+
end
|
248
|
+
elsif value.respond_to? :to_hash
|
249
|
+
value.to_hash
|
250
|
+
else
|
251
|
+
value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
@@ -0,0 +1,222 @@
|
|
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.2-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 RecoveryLink
|
17
|
+
# Recovery Link Expires At The timestamp when the recovery link expires.
|
18
|
+
attr_accessor :expires_at
|
19
|
+
|
20
|
+
# Recovery Link This link can be used to recover the account.
|
21
|
+
attr_accessor :recovery_link
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'expires_at' => :'expires_at',
|
27
|
+
:'recovery_link' => :'recovery_link'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'expires_at' => :'DateTime',
|
35
|
+
:'recovery_link' => :'String'
|
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::RecoveryLink` 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::RecoveryLink`. 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?(:'expires_at')
|
61
|
+
self.expires_at = attributes[:'expires_at']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'recovery_link')
|
65
|
+
self.recovery_link = attributes[:'recovery_link']
|
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 @recovery_link.nil?
|
74
|
+
invalid_properties.push('invalid value for "recovery_link", recovery_link 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 @recovery_link.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
|
+
expires_at == o.expires_at &&
|
93
|
+
recovery_link == o.recovery_link
|
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
|
+
[expires_at, recovery_link].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
|