ory-hydra-client 1.9.0.alpha1 → 1.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/docs/AcceptConsentRequest.md +18 -17
  4. data/docs/AcceptLoginRequest.md +18 -17
  5. data/docs/AdminApi.md +816 -304
  6. data/docs/CompletedRequest.md +8 -7
  7. data/docs/ConsentRequest.md +30 -29
  8. data/docs/ConsentRequestSession.md +10 -9
  9. data/docs/ContainerWaitOKBodyError.md +8 -7
  10. data/docs/FlushInactiveOAuth2TokensRequest.md +8 -7
  11. data/docs/GenericError.md +14 -13
  12. data/docs/HealthNotReadyStatus.md +8 -7
  13. data/docs/HealthStatus.md +8 -7
  14. data/docs/JSONWebKey.md +40 -39
  15. data/docs/JSONWebKeySet.md +8 -7
  16. data/docs/JsonWebKeySetGeneratorRequest.md +12 -11
  17. data/docs/LoginRequest.md +24 -23
  18. data/docs/LogoutRequest.md +14 -13
  19. data/docs/OAuth2Client.md +72 -71
  20. data/docs/OAuth2TokenIntrospection.md +34 -31
  21. data/docs/Oauth2TokenResponse.md +18 -17
  22. data/docs/OpenIDConnectContext.md +16 -15
  23. data/docs/PluginConfig.md +38 -37
  24. data/docs/PluginConfigArgs.md +14 -13
  25. data/docs/PluginConfigInterface.md +10 -9
  26. data/docs/PluginConfigLinux.md +12 -11
  27. data/docs/PluginConfigNetwork.md +8 -7
  28. data/docs/PluginConfigRootfs.md +10 -9
  29. data/docs/PluginConfigUser.md +10 -9
  30. data/docs/PluginDevice.md +14 -13
  31. data/docs/PluginEnv.md +14 -13
  32. data/docs/PluginInterfaceType.md +12 -11
  33. data/docs/PluginMount.md +20 -19
  34. data/docs/PluginSettings.md +14 -13
  35. data/docs/PreviousConsentSession.md +20 -19
  36. data/docs/PublicApi.md +201 -60
  37. data/docs/RejectRequest.md +16 -15
  38. data/docs/UserinfoResponse.md +44 -43
  39. data/docs/Version.md +8 -7
  40. data/docs/VolumeUsageData.md +10 -9
  41. data/docs/WellKnown.md +58 -55
  42. data/lib/ory-hydra-client.rb +2 -2
  43. data/lib/ory-hydra-client/api/admin_api.rb +126 -96
  44. data/lib/ory-hydra-client/api/public_api.rb +34 -26
  45. data/lib/ory-hydra-client/api_client.rb +50 -48
  46. data/lib/ory-hydra-client/api_error.rb +2 -2
  47. data/lib/ory-hydra-client/configuration.rb +34 -7
  48. data/lib/ory-hydra-client/models/accept_consent_request.rb +21 -9
  49. data/lib/ory-hydra-client/models/accept_login_request.rb +20 -8
  50. data/lib/ory-hydra-client/models/completed_request.rb +20 -8
  51. data/lib/ory-hydra-client/models/consent_request.rb +20 -8
  52. data/lib/ory-hydra-client/models/consent_request_session.rb +20 -8
  53. data/lib/ory-hydra-client/models/container_wait_ok_body_error.rb +20 -8
  54. data/lib/ory-hydra-client/models/flush_inactive_o_auth2_tokens_request.rb +21 -9
  55. data/lib/ory-hydra-client/models/generic_error.rb +20 -8
  56. data/lib/ory-hydra-client/models/health_not_ready_status.rb +20 -8
  57. data/lib/ory-hydra-client/models/health_status.rb +20 -8
  58. data/lib/ory-hydra-client/models/json_web_key.rb +20 -8
  59. data/lib/ory-hydra-client/models/json_web_key_set.rb +20 -8
  60. data/lib/ory-hydra-client/models/json_web_key_set_generator_request.rb +20 -8
  61. data/lib/ory-hydra-client/models/login_request.rb +20 -8
  62. data/lib/ory-hydra-client/models/logout_request.rb +20 -8
  63. data/lib/ory-hydra-client/models/o_auth2_client.rb +22 -10
  64. data/lib/ory-hydra-client/models/o_auth2_token_introspection.rb +32 -10
  65. data/lib/ory-hydra-client/models/oauth2_token_response.rb +20 -8
  66. data/lib/ory-hydra-client/models/open_id_connect_context.rb +20 -8
  67. data/lib/ory-hydra-client/models/plugin_config.rb +20 -8
  68. data/lib/ory-hydra-client/models/plugin_config_args.rb +20 -8
  69. data/lib/ory-hydra-client/models/plugin_config_interface.rb +20 -8
  70. data/lib/ory-hydra-client/models/plugin_config_linux.rb +20 -8
  71. data/lib/ory-hydra-client/models/plugin_config_network.rb +20 -8
  72. data/lib/ory-hydra-client/models/plugin_config_rootfs.rb +20 -8
  73. data/lib/ory-hydra-client/models/plugin_config_user.rb +20 -8
  74. data/lib/ory-hydra-client/models/plugin_device.rb +20 -8
  75. data/lib/ory-hydra-client/models/plugin_env.rb +20 -8
  76. data/lib/ory-hydra-client/models/plugin_interface_type.rb +20 -8
  77. data/lib/ory-hydra-client/models/plugin_mount.rb +20 -8
  78. data/lib/ory-hydra-client/models/plugin_settings.rb +20 -8
  79. data/lib/ory-hydra-client/models/previous_consent_session.rb +21 -9
  80. data/lib/ory-hydra-client/models/reject_request.rb +20 -8
  81. data/lib/ory-hydra-client/models/userinfo_response.rb +20 -8
  82. data/lib/ory-hydra-client/models/version.rb +20 -8
  83. data/lib/ory-hydra-client/models/volume_usage_data.rb +20 -8
  84. data/lib/ory-hydra-client/models/well_known.rb +33 -9
  85. data/lib/ory-hydra-client/version.rb +3 -3
  86. data/ory-hydra-client.gemspec +4 -5
  87. data/spec/api_client_spec.rb +3 -3
  88. data/spec/configuration_spec.rb +2 -2
  89. data/spec/spec_helper.rb +2 -2
  90. metadata +30 -50
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
5
 
6
- The version of the OpenAPI document: v1.9.0-alpha.1
6
+ The version of the OpenAPI document: v1.9.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
 
@@ -49,15 +49,16 @@ module OryHydraClient
49
49
  form_params = opts[:form_params] || {}
50
50
 
51
51
  # http body (model)
52
- post_body = opts[:body]
52
+ post_body = opts[:debug_body]
53
53
 
54
54
  # return_type
55
- return_type = opts[:return_type]
55
+ return_type = opts[:debug_return_type]
56
56
 
57
57
  # auth_names
58
- auth_names = opts[:auth_names] || []
58
+ auth_names = opts[:debug_auth_names] || []
59
59
 
60
60
  new_options = opts.merge(
61
+ :operation => :"PublicApi.disconnect_user",
61
62
  :header_params => header_params,
62
63
  :query_params => query_params,
63
64
  :form_params => form_params,
@@ -105,15 +106,16 @@ module OryHydraClient
105
106
  form_params = opts[:form_params] || {}
106
107
 
107
108
  # http body (model)
108
- post_body = opts[:body]
109
+ post_body = opts[:debug_body]
109
110
 
110
111
  # return_type
111
- return_type = opts[:return_type] || 'WellKnown'
112
+ return_type = opts[:debug_return_type] || 'WellKnown'
112
113
 
113
114
  # auth_names
114
- auth_names = opts[:auth_names] || []
115
+ auth_names = opts[:debug_auth_names] || []
115
116
 
116
117
  new_options = opts.merge(
118
+ :operation => :"PublicApi.discover_open_id_configuration",
117
119
  :header_params => header_params,
118
120
  :query_params => query_params,
119
121
  :form_params => form_params,
@@ -161,15 +163,16 @@ module OryHydraClient
161
163
  form_params = opts[:form_params] || {}
162
164
 
163
165
  # http body (model)
164
- post_body = opts[:body]
166
+ post_body = opts[:debug_body]
165
167
 
166
168
  # return_type
167
- return_type = opts[:return_type] || 'HealthStatus'
169
+ return_type = opts[:debug_return_type] || 'HealthStatus'
168
170
 
169
171
  # auth_names
170
- auth_names = opts[:auth_names] || []
172
+ auth_names = opts[:debug_auth_names] || []
171
173
 
172
174
  new_options = opts.merge(
175
+ :operation => :"PublicApi.is_instance_ready",
173
176
  :header_params => header_params,
174
177
  :query_params => query_params,
175
178
  :form_params => form_params,
@@ -238,15 +241,16 @@ module OryHydraClient
238
241
  form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
239
242
 
240
243
  # http body (model)
241
- post_body = opts[:body]
244
+ post_body = opts[:debug_body]
242
245
 
243
246
  # return_type
244
- return_type = opts[:return_type] || 'Oauth2TokenResponse'
247
+ return_type = opts[:debug_return_type] || 'Oauth2TokenResponse'
245
248
 
246
249
  # auth_names
247
- auth_names = opts[:auth_names] || ['basic', 'oauth2']
250
+ auth_names = opts[:debug_auth_names] || ['basic', 'oauth2']
248
251
 
249
252
  new_options = opts.merge(
253
+ :operation => :"PublicApi.oauth2_token",
250
254
  :header_params => header_params,
251
255
  :query_params => query_params,
252
256
  :form_params => form_params,
@@ -294,15 +298,16 @@ module OryHydraClient
294
298
  form_params = opts[:form_params] || {}
295
299
 
296
300
  # http body (model)
297
- post_body = opts[:body]
301
+ post_body = opts[:debug_body]
298
302
 
299
303
  # return_type
300
- return_type = opts[:return_type]
304
+ return_type = opts[:debug_return_type]
301
305
 
302
306
  # auth_names
303
- auth_names = opts[:auth_names] || []
307
+ auth_names = opts[:debug_auth_names] || []
304
308
 
305
309
  new_options = opts.merge(
310
+ :operation => :"PublicApi.oauth_auth",
306
311
  :header_params => header_params,
307
312
  :query_params => query_params,
308
313
  :form_params => form_params,
@@ -359,15 +364,16 @@ module OryHydraClient
359
364
  form_params['token'] = token
360
365
 
361
366
  # http body (model)
362
- post_body = opts[:body]
367
+ post_body = opts[:debug_body]
363
368
 
364
369
  # return_type
365
- return_type = opts[:return_type]
370
+ return_type = opts[:debug_return_type]
366
371
 
367
372
  # auth_names
368
- auth_names = opts[:auth_names] || ['basic', 'oauth2']
373
+ auth_names = opts[:debug_auth_names] || ['basic', 'oauth2']
369
374
 
370
375
  new_options = opts.merge(
376
+ :operation => :"PublicApi.revoke_o_auth2_token",
371
377
  :header_params => header_params,
372
378
  :query_params => query_params,
373
379
  :form_params => form_params,
@@ -415,15 +421,16 @@ module OryHydraClient
415
421
  form_params = opts[:form_params] || {}
416
422
 
417
423
  # http body (model)
418
- post_body = opts[:body]
424
+ post_body = opts[:debug_body]
419
425
 
420
426
  # return_type
421
- return_type = opts[:return_type] || 'UserinfoResponse'
427
+ return_type = opts[:debug_return_type] || 'UserinfoResponse'
422
428
 
423
429
  # auth_names
424
- auth_names = opts[:auth_names] || ['oauth2']
430
+ auth_names = opts[:debug_auth_names] || ['oauth2']
425
431
 
426
432
  new_options = opts.merge(
433
+ :operation => :"PublicApi.userinfo",
427
434
  :header_params => header_params,
428
435
  :query_params => query_params,
429
436
  :form_params => form_params,
@@ -471,15 +478,16 @@ module OryHydraClient
471
478
  form_params = opts[:form_params] || {}
472
479
 
473
480
  # http body (model)
474
- post_body = opts[:body]
481
+ post_body = opts[:debug_body]
475
482
 
476
483
  # return_type
477
- return_type = opts[:return_type] || 'JSONWebKeySet'
484
+ return_type = opts[:debug_return_type] || 'JSONWebKeySet'
478
485
 
479
486
  # auth_names
480
- auth_names = opts[:auth_names] || []
487
+ auth_names = opts[:debug_auth_names] || []
481
488
 
482
489
  new_options = opts.merge(
490
+ :operation => :"PublicApi.well_known",
483
491
  :header_params => header_params,
484
492
  :query_params => query_params,
485
493
  :form_params => form_params,
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
5
 
6
- The version of the OpenAPI document: v1.9.0-alpha.1
6
+ The version of the OpenAPI document: v1.9.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
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'json'
15
15
  require 'logger'
16
16
  require 'tempfile'
17
+ require 'time'
17
18
  require 'typhoeus'
18
19
 
19
20
  module OryHydraClient
@@ -86,7 +87,7 @@ module OryHydraClient
86
87
  # @option opts [Object] :body HTTP body (JSON/XML)
87
88
  # @return [Typhoeus::Request] A Typhoeus Request
88
89
  def build_request(http_method, path, opts = {})
89
- url = build_request_url(path)
90
+ url = build_request_url(path, opts)
90
91
  http_method = http_method.to_sym.downcase
91
92
 
92
93
  header_params = @default_headers.merge(opts[:header_params] || {})
@@ -155,6 +156,44 @@ module OryHydraClient
155
156
  data
156
157
  end
157
158
 
159
+ # Save response body into a file in (the defined) temporary folder, using the filename
160
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
161
+ # The response body is written to the file in chunks in order to handle files which
162
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
163
+ # process can use.
164
+ #
165
+ # @see Configuration#temp_folder_path
166
+ def download_file(request)
167
+ tempfile = nil
168
+ encoding = nil
169
+ request.on_headers do |response|
170
+ content_disposition = response.headers['Content-Disposition']
171
+ if content_disposition && content_disposition =~ /filename=/i
172
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
173
+ prefix = sanitize_filename(filename)
174
+ else
175
+ prefix = 'download-'
176
+ end
177
+ prefix = prefix + '-' unless prefix.end_with?('-')
178
+ encoding = response.body.encoding
179
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
180
+ @tempfile = tempfile
181
+ end
182
+ request.on_body do |chunk|
183
+ chunk.force_encoding(encoding)
184
+ tempfile.write(chunk)
185
+ end
186
+ request.on_complete do |response|
187
+ if tempfile
188
+ tempfile.close
189
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
190
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
191
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
192
+ "explicitly with `tempfile.delete`"
193
+ end
194
+ end
195
+ end
196
+
158
197
  # Check if the given MIME is a JSON MIME.
159
198
  # JSON MIME examples:
160
199
  # application/json
@@ -191,7 +230,7 @@ module OryHydraClient
191
230
  begin
192
231
  data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
193
232
  rescue JSON::ParserError => e
194
- if %w(String Date DateTime).include?(return_type)
233
+ if %w(String Date Time).include?(return_type)
195
234
  data = body
196
235
  else
197
236
  raise e
@@ -216,9 +255,9 @@ module OryHydraClient
216
255
  data.to_f
217
256
  when 'Boolean'
218
257
  data == true
219
- when 'DateTime'
258
+ when 'Time'
220
259
  # parse date time (expecting ISO 8601 format)
221
- DateTime.parse data
260
+ Time.parse data
222
261
  when 'Date'
223
262
  # parse date time (expecting ISO 8601 format)
224
263
  Date.parse data
@@ -236,46 +275,9 @@ module OryHydraClient
236
275
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
237
276
  end
238
277
  else
239
- # models, e.g. Pet
240
- OryHydraClient.const_get(return_type).build_from_hash(data)
241
- end
242
- end
243
-
244
- # Save response body into a file in (the defined) temporary folder, using the filename
245
- # from the "Content-Disposition" header if provided, otherwise a random filename.
246
- # The response body is written to the file in chunks in order to handle files which
247
- # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
248
- # process can use.
249
- #
250
- # @see Configuration#temp_folder_path
251
- def download_file(request)
252
- tempfile = nil
253
- encoding = nil
254
- request.on_headers do |response|
255
- content_disposition = response.headers['Content-Disposition']
256
- if content_disposition && content_disposition =~ /filename=/i
257
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
258
- prefix = sanitize_filename(filename)
259
- else
260
- prefix = 'download-'
261
- end
262
- prefix = prefix + '-' unless prefix.end_with?('-')
263
- encoding = response.body.encoding
264
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
265
- @tempfile = tempfile
266
- end
267
- request.on_body do |chunk|
268
- chunk.force_encoding(encoding)
269
- tempfile.write(chunk)
270
- end
271
- request.on_complete do |response|
272
- if tempfile
273
- tempfile.close
274
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
275
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
276
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
277
- "explicitly with `tempfile.delete`"
278
- end
278
+ # models (e.g. Pet) or oneOf
279
+ klass = OryHydraClient.const_get(return_type)
280
+ klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
279
281
  end
280
282
  end
281
283
 
@@ -288,10 +290,10 @@ module OryHydraClient
288
290
  filename.gsub(/.*[\/\\]/, '')
289
291
  end
290
292
 
291
- def build_request_url(path)
293
+ def build_request_url(path, opts = {})
292
294
  # Add leading and trailing slashes to path
293
295
  path = "/#{path}".gsub(/\/+/, '/')
294
- @config.base_url + path
296
+ @config.base_url(opts[:operation]) + path
295
297
  end
296
298
 
297
299
  # Update hearder and query params based on authentication settings.
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
5
 
6
- The version of the OpenAPI document: v1.9.0-alpha.1
6
+ The version of the OpenAPI document: v1.9.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
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
5
 
6
- The version of the OpenAPI document: v1.9.0-alpha.1
6
+ The version of the OpenAPI document: v1.9.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
 
@@ -21,6 +21,18 @@ module OryHydraClient
21
21
  # Defines url base path
22
22
  attr_accessor :base_path
23
23
 
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
24
36
  # Defines API keys used with API Key authentications.
25
37
  #
26
38
  # @return [Hash] key: parameter name, value: parameter value (API key)
@@ -129,6 +141,10 @@ module OryHydraClient
129
141
  @scheme = 'http'
130
142
  @host = 'localhost'
131
143
  @base_path = ''
144
+ @server_index = 0
145
+ @server_operation_index = {}
146
+ @server_variables = {}
147
+ @server_operation_variables = {}
132
148
  @api_key = {}
133
149
  @api_key_prefix = {}
134
150
  @timeout = 0
@@ -171,8 +187,12 @@ module OryHydraClient
171
187
  @base_path = '' if @base_path == '/'
172
188
  end
173
189
 
174
- def base_url
175
- "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
190
+ # Returns base URL for specified operation based on server settings
191
+ def base_url(operation = nil)
192
+ index = server_operation_index.fetch(operation, server_index)
193
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
194
+
195
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
176
196
  end
177
197
 
178
198
  # Gets API key (with prefix if set).
@@ -220,12 +240,17 @@ module OryHydraClient
220
240
  ]
221
241
  end
222
242
 
243
+ def operation_server_settings
244
+ {
245
+ }
246
+ end
247
+
223
248
  # Returns URL based on server settings
224
249
  #
225
250
  # @param index array index of the server settings
226
251
  # @param variables hash of variable and the corresponding value
227
- def server_url(index, variables = {})
228
- servers = server_settings
252
+ def server_url(index, variables = {}, servers = nil)
253
+ servers = server_settings if servers == nil
229
254
 
230
255
  # check array index out of bound
231
256
  if (index < 0 || index >= servers.size)
@@ -235,10 +260,12 @@ module OryHydraClient
235
260
  server = servers[index]
236
261
  url = server[:url]
237
262
 
263
+ return url unless server.key? :variables
264
+
238
265
  # go through variable and assign a value
239
266
  server[:variables].each do |name, variable|
240
267
  if variables.key?(name)
241
- if (server[:variables][name][:enum_values].include? variables[name])
268
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
242
269
  url.gsub! "{" + name.to_s + "}", variables[name]
243
270
  else
244
271
  fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
@@ -3,14 +3,15 @@
3
3
 
4
4
  #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
5
 
6
- The version of the OpenAPI document: v1.9.0-alpha.1
6
+ The version of the OpenAPI document: v1.9.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 AcceptConsentRequest
@@ -40,12 +41,17 @@ module OryHydraClient
40
41
  }
41
42
  end
42
43
 
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
43
49
  # Attribute type mapping.
44
50
  def self.openapi_types
45
51
  {
46
52
  :'grant_access_token_audience' => :'Array<String>',
47
53
  :'grant_scope' => :'Array<String>',
48
- :'handled_at' => :'DateTime',
54
+ :'handled_at' => :'Time',
49
55
  :'remember' => :'Boolean',
50
56
  :'remember_for' => :'Integer',
51
57
  :'session' => :'ConsentRequestSession'
@@ -153,7 +159,9 @@ module OryHydraClient
153
159
  def build_from_hash(attributes)
154
160
  return nil unless attributes.is_a?(Hash)
155
161
  self.class.openapi_types.each_pair do |key, type|
156
- if type =~ /\AArray<(.*)>/i
162
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
+ self.send("#{key}=", nil)
164
+ elsif type =~ /\AArray<(.*)>/i
157
165
  # check to ensure the input is an array given that the attribute
158
166
  # is documented as an array but the input is not
159
167
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -161,7 +169,7 @@ module OryHydraClient
161
169
  end
162
170
  elsif !attributes[self.class.attribute_map[key]].nil?
163
171
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
- end # or else data not found in attributes(hash), not an issue as the data can be optional
172
+ end
165
173
  end
166
174
 
167
175
  self
@@ -173,8 +181,8 @@ module OryHydraClient
173
181
  # @return [Object] Deserialized data
174
182
  def _deserialize(type, value)
175
183
  case type.to_sym
176
- when :DateTime
177
- DateTime.parse(value)
184
+ when :Time
185
+ Time.parse(value)
178
186
  when :Date
179
187
  Date.parse(value)
180
188
  when :String
@@ -204,7 +212,9 @@ module OryHydraClient
204
212
  end
205
213
  end
206
214
  else # model
207
- OryHydraClient.const_get(type).build_from_hash(value)
215
+ # models (e.g. Pet) or oneOf
216
+ klass = OryHydraClient.const_get(type)
217
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
218
  end
209
219
  end
210
220
 
@@ -230,7 +240,7 @@ module OryHydraClient
230
240
  is_nullable = self.class.openapi_nullable.include?(attr)
231
241
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
242
  end
233
-
243
+
234
244
  hash[param] = _to_hash(value)
235
245
  end
236
246
  hash
@@ -253,5 +263,7 @@ module OryHydraClient
253
263
  value
254
264
  end
255
265
  end
266
+
256
267
  end
268
+
257
269
  end