ory-hydra-client 1.4.10 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +20 -6
  4. data/docs/AdminApi.md +4 -2
  5. data/docs/CompletedRequest.md +1 -1
  6. data/docs/ConsentRequest.md +1 -1
  7. data/docs/ConsentRequestSession.md +2 -2
  8. data/docs/ContainerWaitOKBodyError.md +17 -0
  9. data/docs/JSONWebKey.md +12 -12
  10. data/docs/LoginRequest.md +7 -7
  11. data/docs/OAuth2Client.md +3 -1
  12. data/docs/OAuth2TokenIntrospection.md +2 -2
  13. data/docs/Oauth2TokenResponse.md +6 -6
  14. data/docs/OpenIDConnectContext.md +1 -1
  15. data/docs/PluginConfig.md +47 -0
  16. data/docs/PluginConfigArgs.md +23 -0
  17. data/docs/PluginConfigInterface.md +19 -0
  18. data/docs/PluginConfigLinux.md +21 -0
  19. data/docs/PluginConfigNetwork.md +17 -0
  20. data/docs/PluginConfigRootfs.md +19 -0
  21. data/docs/PluginConfigUser.md +19 -0
  22. data/docs/PluginDevice.md +23 -0
  23. data/docs/PluginEnv.md +23 -0
  24. data/docs/PluginInterfaceType.md +21 -0
  25. data/docs/PluginMount.md +29 -0
  26. data/docs/PluginSettings.md +23 -0
  27. data/docs/PreviousConsentSession.md +3 -3
  28. data/docs/RejectRequest.md +5 -5
  29. data/docs/VolumeUsageData.md +19 -0
  30. data/lib/ory-hydra-client.rb +16 -2
  31. data/lib/ory-hydra-client/api/admin_api.rb +7 -4
  32. data/lib/ory-hydra-client/api/public_api.rb +2 -2
  33. data/lib/ory-hydra-client/api_client.rb +9 -7
  34. data/lib/ory-hydra-client/api_error.rb +2 -2
  35. data/lib/ory-hydra-client/configuration.rb +2 -2
  36. data/lib/ory-hydra-client/models/accept_consent_request.rb +2 -2
  37. data/lib/ory-hydra-client/models/accept_login_request.rb +2 -2
  38. data/lib/ory-hydra-client/models/completed_request.rb +7 -2
  39. data/lib/ory-hydra-client/models/consent_request.rb +7 -2
  40. data/lib/ory-hydra-client/models/consent_request_session.rb +6 -10
  41. data/lib/ory-hydra-client/models/container_wait_ok_body_error.rb +208 -0
  42. data/lib/ory-hydra-client/models/flush_inactive_o_auth2_tokens_request.rb +2 -2
  43. data/lib/ory-hydra-client/models/generic_error.rb +2 -2
  44. data/lib/ory-hydra-client/models/health_not_ready_status.rb +2 -3
  45. data/lib/ory-hydra-client/models/health_status.rb +2 -2
  46. data/lib/ory-hydra-client/models/json_web_key.rb +3 -15
  47. data/lib/ory-hydra-client/models/json_web_key_set.rb +3 -3
  48. data/lib/ory-hydra-client/models/json_web_key_set_generator_request.rb +2 -2
  49. data/lib/ory-hydra-client/models/login_request.rb +37 -2
  50. data/lib/ory-hydra-client/models/logout_request.rb +2 -2
  51. data/lib/ory-hydra-client/models/o_auth2_client.rb +14 -4
  52. data/lib/ory-hydra-client/models/o_auth2_token_introspection.rb +5 -7
  53. data/lib/ory-hydra-client/models/oauth2_token_response.rb +3 -9
  54. data/lib/ory-hydra-client/models/open_id_connect_context.rb +4 -6
  55. data/lib/ory-hydra-client/models/plugin_config.rb +422 -0
  56. data/lib/ory-hydra-client/models/plugin_config_args.rb +262 -0
  57. data/lib/ory-hydra-client/models/plugin_config_interface.rb +230 -0
  58. data/lib/ory-hydra-client/models/plugin_config_linux.rb +247 -0
  59. data/lib/ory-hydra-client/models/plugin_config_network.rb +213 -0
  60. data/lib/ory-hydra-client/models/plugin_config_rootfs.rb +220 -0
  61. data/lib/ory-hydra-client/models/plugin_config_user.rb +218 -0
  62. data/lib/ory-hydra-client/models/plugin_device.rb +260 -0
  63. data/lib/ory-hydra-client/models/plugin_env.rb +260 -0
  64. data/lib/ory-hydra-client/models/plugin_interface_type.rb +243 -0
  65. data/lib/ory-hydra-client/models/plugin_mount.rb +307 -0
  66. data/lib/ory-hydra-client/models/plugin_settings.rb +265 -0
  67. data/lib/ory-hydra-client/models/previous_consent_session.rb +3 -6
  68. data/lib/ory-hydra-client/models/reject_request.rb +7 -7
  69. data/lib/ory-hydra-client/models/userinfo_response.rb +3 -3
  70. data/lib/ory-hydra-client/models/version.rb +2 -3
  71. data/lib/ory-hydra-client/models/volume_usage_data.rb +228 -0
  72. data/lib/ory-hydra-client/models/well_known.rb +2 -2
  73. data/lib/ory-hydra-client/version.rb +3 -3
  74. data/ory-hydra-client.gemspec +2 -2
  75. data/spec/models/container_wait_ok_body_error_spec.rb +41 -0
  76. data/spec/models/plugin_config_args_spec.rb +59 -0
  77. data/spec/models/plugin_config_interface_spec.rb +47 -0
  78. data/spec/models/plugin_config_linux_spec.rb +53 -0
  79. data/spec/models/plugin_config_network_spec.rb +41 -0
  80. data/spec/models/plugin_config_rootfs_spec.rb +47 -0
  81. data/spec/models/plugin_config_spec.rb +131 -0
  82. data/spec/models/plugin_config_user_spec.rb +47 -0
  83. data/spec/models/plugin_device_spec.rb +59 -0
  84. data/spec/models/plugin_env_spec.rb +59 -0
  85. data/spec/models/plugin_interface_type_spec.rb +53 -0
  86. data/spec/models/plugin_mount_spec.rb +77 -0
  87. data/spec/models/plugin_settings_spec.rb +59 -0
  88. data/spec/models/volume_usage_data_spec.rb +47 -0
  89. metadata +74 -18
@@ -0,0 +1,307 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v1.7.0
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
+ # PluginMount plugin mount
17
+ class PluginMount
18
+ # description
19
+ attr_accessor :description
20
+
21
+ # destination
22
+ attr_accessor :destination
23
+
24
+ # name
25
+ attr_accessor :name
26
+
27
+ # options
28
+ attr_accessor :options
29
+
30
+ # settable
31
+ attr_accessor :settable
32
+
33
+ # source
34
+ attr_accessor :source
35
+
36
+ # type
37
+ attr_accessor :type
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'description' => :'Description',
43
+ :'destination' => :'Destination',
44
+ :'name' => :'Name',
45
+ :'options' => :'Options',
46
+ :'settable' => :'Settable',
47
+ :'source' => :'Source',
48
+ :'type' => :'Type'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'description' => :'String',
56
+ :'destination' => :'String',
57
+ :'name' => :'String',
58
+ :'options' => :'Array<String>',
59
+ :'settable' => :'Array<String>',
60
+ :'source' => :'String',
61
+ :'type' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::PluginMount` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::PluginMount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'description')
87
+ self.description = attributes[:'description']
88
+ end
89
+
90
+ if attributes.key?(:'destination')
91
+ self.destination = attributes[:'destination']
92
+ end
93
+
94
+ if attributes.key?(:'name')
95
+ self.name = attributes[:'name']
96
+ end
97
+
98
+ if attributes.key?(:'options')
99
+ if (value = attributes[:'options']).is_a?(Array)
100
+ self.options = value
101
+ end
102
+ end
103
+
104
+ if attributes.key?(:'settable')
105
+ if (value = attributes[:'settable']).is_a?(Array)
106
+ self.settable = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'source')
111
+ self.source = attributes[:'source']
112
+ end
113
+
114
+ if attributes.key?(:'type')
115
+ self.type = attributes[:'type']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ if @description.nil?
124
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
125
+ end
126
+
127
+ if @destination.nil?
128
+ invalid_properties.push('invalid value for "destination", destination cannot be nil.')
129
+ end
130
+
131
+ if @name.nil?
132
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
133
+ end
134
+
135
+ if @options.nil?
136
+ invalid_properties.push('invalid value for "options", options cannot be nil.')
137
+ end
138
+
139
+ if @settable.nil?
140
+ invalid_properties.push('invalid value for "settable", settable cannot be nil.')
141
+ end
142
+
143
+ if @source.nil?
144
+ invalid_properties.push('invalid value for "source", source cannot be nil.')
145
+ end
146
+
147
+ if @type.nil?
148
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
149
+ end
150
+
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ return false if @description.nil?
158
+ return false if @destination.nil?
159
+ return false if @name.nil?
160
+ return false if @options.nil?
161
+ return false if @settable.nil?
162
+ return false if @source.nil?
163
+ return false if @type.nil?
164
+ true
165
+ end
166
+
167
+ # Checks equality by comparing each attribute.
168
+ # @param [Object] Object to be compared
169
+ def ==(o)
170
+ return true if self.equal?(o)
171
+ self.class == o.class &&
172
+ description == o.description &&
173
+ destination == o.destination &&
174
+ name == o.name &&
175
+ options == o.options &&
176
+ settable == o.settable &&
177
+ source == o.source &&
178
+ type == o.type
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [description, destination, name, options, settable, source, type].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ new.build_from_hash(attributes)
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ self.class.openapi_types.each_pair do |key, type|
206
+ if type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
210
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
+ end
212
+ elsif !attributes[self.class.attribute_map[key]].nil?
213
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
215
+ end
216
+
217
+ self
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def _deserialize(type, value)
225
+ case type.to_sym
226
+ when :DateTime
227
+ DateTime.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value.to_s
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :Boolean
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ OryHydraClient.const_get(type).build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+ end
307
+ end
@@ -0,0 +1,265 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v1.7.0
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 PluginSettings
17
+ # args
18
+ attr_accessor :args
19
+
20
+ # devices
21
+ attr_accessor :devices
22
+
23
+ # env
24
+ attr_accessor :env
25
+
26
+ # mounts
27
+ attr_accessor :mounts
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'args' => :'Args',
33
+ :'devices' => :'Devices',
34
+ :'env' => :'Env',
35
+ :'mounts' => :'Mounts'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'args' => :'Array<String>',
43
+ :'devices' => :'Array<PluginDevice>',
44
+ :'env' => :'Array<String>',
45
+ :'mounts' => :'Array<PluginMount>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::PluginSettings` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::PluginSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'args')
71
+ if (value = attributes[:'args']).is_a?(Array)
72
+ self.args = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'devices')
77
+ if (value = attributes[:'devices']).is_a?(Array)
78
+ self.devices = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'env')
83
+ if (value = attributes[:'env']).is_a?(Array)
84
+ self.env = value
85
+ end
86
+ end
87
+
88
+ if attributes.key?(:'mounts')
89
+ if (value = attributes[:'mounts']).is_a?(Array)
90
+ self.mounts = value
91
+ end
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @args.nil?
100
+ invalid_properties.push('invalid value for "args", args cannot be nil.')
101
+ end
102
+
103
+ if @devices.nil?
104
+ invalid_properties.push('invalid value for "devices", devices cannot be nil.')
105
+ end
106
+
107
+ if @env.nil?
108
+ invalid_properties.push('invalid value for "env", env cannot be nil.')
109
+ end
110
+
111
+ if @mounts.nil?
112
+ invalid_properties.push('invalid value for "mounts", mounts cannot be nil.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ return false if @args.nil?
122
+ return false if @devices.nil?
123
+ return false if @env.nil?
124
+ return false if @mounts.nil?
125
+ true
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ args == o.args &&
134
+ devices == o.devices &&
135
+ env == o.env &&
136
+ mounts == o.mounts
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [args, devices, env, mounts].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ new.build_from_hash(attributes)
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ self.class.openapi_types.each_pair do |key, type|
164
+ if type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :DateTime
185
+ DateTime.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ OryHydraClient.const_get(type).build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+ end
265
+ end