ory-kratos-client 0.5.4.alpha1 → 0.5.5.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/docs/AdminApi.md +382 -143
  4. data/docs/CompleteSelfServiceLoginFlowWithPasswordMethod.md +12 -11
  5. data/docs/CompleteSelfServiceRecoveryFlowWithLinkMethod.md +10 -9
  6. data/docs/CompleteSelfServiceSettingsFlowWithPasswordMethod.md +10 -9
  7. data/docs/CompleteSelfServiceVerificationFlowWithLinkMethod.md +10 -9
  8. data/docs/CreateIdentity.md +10 -9
  9. data/docs/CreateRecoveryLink.md +10 -9
  10. data/docs/ErrorContainer.md +10 -9
  11. data/docs/FormField.md +20 -19
  12. data/docs/GenericError.md +8 -7
  13. data/docs/GenericErrorPayload.md +20 -19
  14. data/docs/HealthApi.md +50 -15
  15. data/docs/HealthNotReadyStatus.md +8 -7
  16. data/docs/HealthStatus.md +8 -7
  17. data/docs/Identity.md +18 -17
  18. data/docs/LoginFlow.md +24 -23
  19. data/docs/LoginFlowMethod.md +10 -9
  20. data/docs/LoginFlowMethodConfig.md +16 -15
  21. data/docs/LoginViaApiResponse.md +10 -9
  22. data/docs/Message.md +14 -13
  23. data/docs/PublicApi.md +707 -237
  24. data/docs/RecoveryAddress.md +12 -11
  25. data/docs/RecoveryFlow.md +24 -23
  26. data/docs/RecoveryFlowMethod.md +10 -9
  27. data/docs/RecoveryFlowMethodConfig.md +14 -13
  28. data/docs/RecoveryLink.md +10 -9
  29. data/docs/RegistrationFlow.md +22 -21
  30. data/docs/RegistrationFlowMethod.md +10 -9
  31. data/docs/RegistrationFlowMethodConfig.md +16 -15
  32. data/docs/RegistrationViaApiResponse.md +12 -11
  33. data/docs/RevokeSession.md +8 -7
  34. data/docs/Session.md +18 -17
  35. data/docs/SettingsFlow.md +26 -25
  36. data/docs/SettingsFlowMethod.md +10 -9
  37. data/docs/SettingsFlowMethodConfig.md +14 -13
  38. data/docs/SettingsViaApiResponse.md +10 -9
  39. data/docs/UpdateIdentity.md +10 -9
  40. data/docs/VerifiableAddress.md +18 -17
  41. data/docs/VerificationFlow.md +24 -23
  42. data/docs/VerificationFlowMethod.md +10 -9
  43. data/docs/VerificationFlowMethodConfig.md +14 -13
  44. data/docs/Version.md +8 -7
  45. data/docs/VersionApi.md +26 -9
  46. data/lib/ory-kratos-client.rb +2 -2
  47. data/lib/ory-kratos-client/api/admin_api.rb +58 -44
  48. data/lib/ory-kratos-client/api/health_api.rb +10 -8
  49. data/lib/ory-kratos-client/api/public_api.rb +113 -86
  50. data/lib/ory-kratos-client/api/version_api.rb +6 -5
  51. data/lib/ory-kratos-client/api_client.rb +50 -48
  52. data/lib/ory-kratos-client/api_error.rb +2 -2
  53. data/lib/ory-kratos-client/configuration.rb +34 -7
  54. data/lib/ory-kratos-client/models/complete_self_service_login_flow_with_password_method.rb +20 -8
  55. data/lib/ory-kratos-client/models/complete_self_service_recovery_flow_with_link_method.rb +20 -8
  56. data/lib/ory-kratos-client/models/complete_self_service_settings_flow_with_password_method.rb +20 -8
  57. data/lib/ory-kratos-client/models/complete_self_service_verification_flow_with_link_method.rb +20 -8
  58. data/lib/ory-kratos-client/models/create_identity.rb +20 -8
  59. data/lib/ory-kratos-client/models/create_recovery_link.rb +20 -8
  60. data/lib/ory-kratos-client/models/error_container.rb +20 -8
  61. data/lib/ory-kratos-client/models/form_field.rb +20 -8
  62. data/lib/ory-kratos-client/models/generic_error.rb +20 -8
  63. data/lib/ory-kratos-client/models/generic_error_payload.rb +20 -8
  64. data/lib/ory-kratos-client/models/health_not_ready_status.rb +20 -8
  65. data/lib/ory-kratos-client/models/health_status.rb +20 -8
  66. data/lib/ory-kratos-client/models/identity.rb +20 -8
  67. data/lib/ory-kratos-client/models/login_flow.rb +22 -10
  68. data/lib/ory-kratos-client/models/login_flow_method.rb +20 -8
  69. data/lib/ory-kratos-client/models/login_flow_method_config.rb +20 -8
  70. data/lib/ory-kratos-client/models/login_via_api_response.rb +20 -8
  71. data/lib/ory-kratos-client/models/message.rb +20 -8
  72. data/lib/ory-kratos-client/models/recovery_address.rb +20 -8
  73. data/lib/ory-kratos-client/models/recovery_flow.rb +22 -10
  74. data/lib/ory-kratos-client/models/recovery_flow_method.rb +20 -8
  75. data/lib/ory-kratos-client/models/recovery_flow_method_config.rb +20 -8
  76. data/lib/ory-kratos-client/models/recovery_link.rb +21 -9
  77. data/lib/ory-kratos-client/models/registration_flow.rb +22 -10
  78. data/lib/ory-kratos-client/models/registration_flow_method.rb +20 -8
  79. data/lib/ory-kratos-client/models/registration_flow_method_config.rb +20 -8
  80. data/lib/ory-kratos-client/models/registration_via_api_response.rb +20 -8
  81. data/lib/ory-kratos-client/models/revoke_session.rb +20 -8
  82. data/lib/ory-kratos-client/models/session.rb +23 -11
  83. data/lib/ory-kratos-client/models/settings_flow.rb +22 -10
  84. data/lib/ory-kratos-client/models/settings_flow_method.rb +20 -8
  85. data/lib/ory-kratos-client/models/settings_flow_method_config.rb +20 -8
  86. data/lib/ory-kratos-client/models/settings_via_api_response.rb +20 -8
  87. data/lib/ory-kratos-client/models/update_identity.rb +20 -8
  88. data/lib/ory-kratos-client/models/verifiable_address.rb +21 -9
  89. data/lib/ory-kratos-client/models/verification_flow.rb +22 -10
  90. data/lib/ory-kratos-client/models/verification_flow_method.rb +20 -8
  91. data/lib/ory-kratos-client/models/verification_flow_method_config.rb +20 -8
  92. data/lib/ory-kratos-client/models/version.rb +20 -8
  93. data/lib/ory-kratos-client/version.rb +3 -3
  94. data/ory-kratos-client.gemspec +4 -5
  95. data/spec/api_client_spec.rb +3 -3
  96. data/spec/configuration_spec.rb +2 -2
  97. data/spec/spec_helper.rb +2 -2
  98. metadata +48 -68
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: v0.5.4-alpha.1
6
+ The version of the OpenAPI document: v0.5.5-alpha.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OryHydraClient
16
17
  class CompleteSelfServiceSettingsFlowWithPasswordMethod
@@ -28,6 +29,11 @@ module OryHydraClient
28
29
  }
29
30
  end
30
31
 
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
31
37
  # Attribute type mapping.
32
38
  def self.openapi_types
33
39
  {
@@ -118,7 +124,9 @@ module OryHydraClient
118
124
  def build_from_hash(attributes)
119
125
  return nil unless attributes.is_a?(Hash)
120
126
  self.class.openapi_types.each_pair do |key, type|
121
- if type =~ /\AArray<(.*)>/i
127
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
+ self.send("#{key}=", nil)
129
+ elsif type =~ /\AArray<(.*)>/i
122
130
  # check to ensure the input is an array given that the attribute
123
131
  # is documented as an array but the input is not
124
132
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -126,7 +134,7 @@ module OryHydraClient
126
134
  end
127
135
  elsif !attributes[self.class.attribute_map[key]].nil?
128
136
  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
137
+ end
130
138
  end
131
139
 
132
140
  self
@@ -138,8 +146,8 @@ module OryHydraClient
138
146
  # @return [Object] Deserialized data
139
147
  def _deserialize(type, value)
140
148
  case type.to_sym
141
- when :DateTime
142
- DateTime.parse(value)
149
+ when :Time
150
+ Time.parse(value)
143
151
  when :Date
144
152
  Date.parse(value)
145
153
  when :String
@@ -169,7 +177,9 @@ module OryHydraClient
169
177
  end
170
178
  end
171
179
  else # model
172
- OryHydraClient.const_get(type).build_from_hash(value)
180
+ # models (e.g. Pet) or oneOf
181
+ klass = OryHydraClient.const_get(type)
182
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
183
  end
174
184
  end
175
185
 
@@ -195,7 +205,7 @@ module OryHydraClient
195
205
  is_nullable = self.class.openapi_nullable.include?(attr)
196
206
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
207
  end
198
-
208
+
199
209
  hash[param] = _to_hash(value)
200
210
  end
201
211
  hash
@@ -218,5 +228,7 @@ module OryHydraClient
218
228
  value
219
229
  end
220
230
  end
231
+
221
232
  end
233
+
222
234
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: v0.5.4-alpha.1
6
+ The version of the OpenAPI document: v0.5.5-alpha.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OryHydraClient
16
17
  class CompleteSelfServiceVerificationFlowWithLinkMethod
@@ -28,6 +29,11 @@ module OryHydraClient
28
29
  }
29
30
  end
30
31
 
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
31
37
  # Attribute type mapping.
32
38
  def self.openapi_types
33
39
  {
@@ -113,7 +119,9 @@ module OryHydraClient
113
119
  def build_from_hash(attributes)
114
120
  return nil unless attributes.is_a?(Hash)
115
121
  self.class.openapi_types.each_pair do |key, type|
116
- if type =~ /\AArray<(.*)>/i
122
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
+ self.send("#{key}=", nil)
124
+ elsif type =~ /\AArray<(.*)>/i
117
125
  # check to ensure the input is an array given that the attribute
118
126
  # is documented as an array but the input is not
119
127
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -121,7 +129,7 @@ module OryHydraClient
121
129
  end
122
130
  elsif !attributes[self.class.attribute_map[key]].nil?
123
131
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
- end # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
125
133
  end
126
134
 
127
135
  self
@@ -133,8 +141,8 @@ module OryHydraClient
133
141
  # @return [Object] Deserialized data
134
142
  def _deserialize(type, value)
135
143
  case type.to_sym
136
- when :DateTime
137
- DateTime.parse(value)
144
+ when :Time
145
+ Time.parse(value)
138
146
  when :Date
139
147
  Date.parse(value)
140
148
  when :String
@@ -164,7 +172,9 @@ module OryHydraClient
164
172
  end
165
173
  end
166
174
  else # model
167
- OryHydraClient.const_get(type).build_from_hash(value)
175
+ # models (e.g. Pet) or oneOf
176
+ klass = OryHydraClient.const_get(type)
177
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
178
  end
169
179
  end
170
180
 
@@ -190,7 +200,7 @@ module OryHydraClient
190
200
  is_nullable = self.class.openapi_nullable.include?(attr)
191
201
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
202
  end
193
-
203
+
194
204
  hash[param] = _to_hash(value)
195
205
  end
196
206
  hash
@@ -213,5 +223,7 @@ module OryHydraClient
213
223
  value
214
224
  end
215
225
  end
226
+
216
227
  end
228
+
217
229
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: v0.5.4-alpha.1
6
+ The version of the OpenAPI document: v0.5.5-alpha.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OryHydraClient
16
17
  class CreateIdentity
@@ -28,6 +29,11 @@ module OryHydraClient
28
29
  }
29
30
  end
30
31
 
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
31
37
  # Attribute type mapping.
32
38
  def self.openapi_types
33
39
  {
@@ -123,7 +129,9 @@ module OryHydraClient
123
129
  def build_from_hash(attributes)
124
130
  return nil unless attributes.is_a?(Hash)
125
131
  self.class.openapi_types.each_pair do |key, type|
126
- if type =~ /\AArray<(.*)>/i
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
127
135
  # check to ensure the input is an array given that the attribute
128
136
  # is documented as an array but the input is not
129
137
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -131,7 +139,7 @@ module OryHydraClient
131
139
  end
132
140
  elsif !attributes[self.class.attribute_map[key]].nil?
133
141
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
- end # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
135
143
  end
136
144
 
137
145
  self
@@ -143,8 +151,8 @@ module OryHydraClient
143
151
  # @return [Object] Deserialized data
144
152
  def _deserialize(type, value)
145
153
  case type.to_sym
146
- when :DateTime
147
- DateTime.parse(value)
154
+ when :Time
155
+ Time.parse(value)
148
156
  when :Date
149
157
  Date.parse(value)
150
158
  when :String
@@ -174,7 +182,9 @@ module OryHydraClient
174
182
  end
175
183
  end
176
184
  else # model
177
- OryHydraClient.const_get(type).build_from_hash(value)
185
+ # models (e.g. Pet) or oneOf
186
+ klass = OryHydraClient.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
188
  end
179
189
  end
180
190
 
@@ -200,7 +210,7 @@ module OryHydraClient
200
210
  is_nullable = self.class.openapi_nullable.include?(attr)
201
211
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
212
  end
203
-
213
+
204
214
  hash[param] = _to_hash(value)
205
215
  end
206
216
  hash
@@ -223,5 +233,7 @@ module OryHydraClient
223
233
  value
224
234
  end
225
235
  end
236
+
226
237
  end
238
+
227
239
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: v0.5.4-alpha.1
6
+ The version of the OpenAPI document: v0.5.5-alpha.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OryHydraClient
16
17
  class CreateRecoveryLink
@@ -27,6 +28,11 @@ module OryHydraClient
27
28
  }
28
29
  end
29
30
 
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
30
36
  # Attribute type mapping.
31
37
  def self.openapi_types
32
38
  {
@@ -134,7 +140,9 @@ module OryHydraClient
134
140
  def build_from_hash(attributes)
135
141
  return nil unless attributes.is_a?(Hash)
136
142
  self.class.openapi_types.each_pair do |key, type|
137
- if type =~ /\AArray<(.*)>/i
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
138
146
  # check to ensure the input is an array given that the attribute
139
147
  # is documented as an array but the input is not
140
148
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -142,7 +150,7 @@ module OryHydraClient
142
150
  end
143
151
  elsif !attributes[self.class.attribute_map[key]].nil?
144
152
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
- end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
146
154
  end
147
155
 
148
156
  self
@@ -154,8 +162,8 @@ module OryHydraClient
154
162
  # @return [Object] Deserialized data
155
163
  def _deserialize(type, value)
156
164
  case type.to_sym
157
- when :DateTime
158
- DateTime.parse(value)
165
+ when :Time
166
+ Time.parse(value)
159
167
  when :Date
160
168
  Date.parse(value)
161
169
  when :String
@@ -185,7 +193,9 @@ module OryHydraClient
185
193
  end
186
194
  end
187
195
  else # model
188
- OryHydraClient.const_get(type).build_from_hash(value)
196
+ # models (e.g. Pet) or oneOf
197
+ klass = OryHydraClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
199
  end
190
200
  end
191
201
 
@@ -211,7 +221,7 @@ module OryHydraClient
211
221
  is_nullable = self.class.openapi_nullable.include?(attr)
212
222
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
223
  end
214
-
224
+
215
225
  hash[param] = _to_hash(value)
216
226
  end
217
227
  hash
@@ -234,5 +244,7 @@ module OryHydraClient
234
244
  value
235
245
  end
236
246
  end
247
+
237
248
  end
249
+
238
250
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: v0.5.4-alpha.1
6
+ The version of the OpenAPI document: v0.5.5-alpha.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OryHydraClient
16
17
  class ErrorContainer
@@ -27,6 +28,11 @@ module OryHydraClient
27
28
  }
28
29
  end
29
30
 
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
30
36
  # Attribute type mapping.
31
37
  def self.openapi_types
32
38
  {
@@ -122,7 +128,9 @@ module OryHydraClient
122
128
  def build_from_hash(attributes)
123
129
  return nil unless attributes.is_a?(Hash)
124
130
  self.class.openapi_types.each_pair do |key, type|
125
- if type =~ /\AArray<(.*)>/i
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
126
134
  # check to ensure the input is an array given that the attribute
127
135
  # is documented as an array but the input is not
128
136
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -130,7 +138,7 @@ module OryHydraClient
130
138
  end
131
139
  elsif !attributes[self.class.attribute_map[key]].nil?
132
140
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
- end # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
134
142
  end
135
143
 
136
144
  self
@@ -142,8 +150,8 @@ module OryHydraClient
142
150
  # @return [Object] Deserialized data
143
151
  def _deserialize(type, value)
144
152
  case type.to_sym
145
- when :DateTime
146
- DateTime.parse(value)
153
+ when :Time
154
+ Time.parse(value)
147
155
  when :Date
148
156
  Date.parse(value)
149
157
  when :String
@@ -173,7 +181,9 @@ module OryHydraClient
173
181
  end
174
182
  end
175
183
  else # model
176
- OryHydraClient.const_get(type).build_from_hash(value)
184
+ # models (e.g. Pet) or oneOf
185
+ klass = OryHydraClient.const_get(type)
186
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
187
  end
178
188
  end
179
189
 
@@ -199,7 +209,7 @@ module OryHydraClient
199
209
  is_nullable = self.class.openapi_nullable.include?(attr)
200
210
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
211
  end
202
-
212
+
203
213
  hash[param] = _to_hash(value)
204
214
  end
205
215
  hash
@@ -222,5 +232,7 @@ module OryHydraClient
222
232
  value
223
233
  end
224
234
  end
235
+
225
236
  end
237
+
226
238
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: v0.5.4-alpha.1
6
+ The version of the OpenAPI document: v0.5.5-alpha.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OryHydraClient
16
17
  # Field represents a HTML Form Field
@@ -48,6 +49,11 @@ module OryHydraClient
48
49
  }
49
50
  end
50
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
51
57
  # Attribute type mapping.
52
58
  def self.openapi_types
53
59
  {
@@ -175,7 +181,9 @@ module OryHydraClient
175
181
  def build_from_hash(attributes)
176
182
  return nil unless attributes.is_a?(Hash)
177
183
  self.class.openapi_types.each_pair do |key, type|
178
- if type =~ /\AArray<(.*)>/i
184
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
185
+ self.send("#{key}=", nil)
186
+ elsif type =~ /\AArray<(.*)>/i
179
187
  # check to ensure the input is an array given that the attribute
180
188
  # is documented as an array but the input is not
181
189
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -183,7 +191,7 @@ module OryHydraClient
183
191
  end
184
192
  elsif !attributes[self.class.attribute_map[key]].nil?
185
193
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
- end # or else data not found in attributes(hash), not an issue as the data can be optional
194
+ end
187
195
  end
188
196
 
189
197
  self
@@ -195,8 +203,8 @@ module OryHydraClient
195
203
  # @return [Object] Deserialized data
196
204
  def _deserialize(type, value)
197
205
  case type.to_sym
198
- when :DateTime
199
- DateTime.parse(value)
206
+ when :Time
207
+ Time.parse(value)
200
208
  when :Date
201
209
  Date.parse(value)
202
210
  when :String
@@ -226,7 +234,9 @@ module OryHydraClient
226
234
  end
227
235
  end
228
236
  else # model
229
- OryHydraClient.const_get(type).build_from_hash(value)
237
+ # models (e.g. Pet) or oneOf
238
+ klass = OryHydraClient.const_get(type)
239
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
240
  end
231
241
  end
232
242
 
@@ -252,7 +262,7 @@ module OryHydraClient
252
262
  is_nullable = self.class.openapi_nullable.include?(attr)
253
263
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
264
  end
255
-
265
+
256
266
  hash[param] = _to_hash(value)
257
267
  end
258
268
  hash
@@ -275,5 +285,7 @@ module OryHydraClient
275
285
  value
276
286
  end
277
287
  end
288
+
278
289
  end
290
+
279
291
  end