mx-platform-ruby 0.3.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +29 -222
  4. data/docs/ChallengeResponse.md +2 -2
  5. data/docs/{ChallengeImageOptions.md → ImageOptionResponse.md} +2 -2
  6. data/docs/{ChallengeOptions.md → OptionResponse.md} +2 -2
  7. data/lib/mx-platform-ruby/models/challenge_response.rb +2 -2
  8. data/lib/mx-platform-ruby/models/{challenge_image_options.rb → image_option_response.rb} +3 -3
  9. data/lib/mx-platform-ruby/models/{challenge_options.rb → option_response.rb} +3 -3
  10. data/lib/mx-platform-ruby/version.rb +1 -1
  11. data/lib/mx-platform-ruby.rb +2 -2
  12. data/openapi/config.yml +1 -1
  13. data/openapi/templates/README.mustache +71 -0
  14. data/spec/models/{challenge_image_options_spec.rb → image_option_response_spec.rb} +6 -6
  15. data/spec/models/{challenge_options_spec.rb → option_response_spec.rb} +6 -6
  16. metadata +88 -190
  17. data/docs/Account.md +0 -96
  18. data/docs/AccountNumber.md +0 -32
  19. data/docs/AccountOwner.md +0 -40
  20. data/docs/Category.md +0 -32
  21. data/docs/Challenge.md +0 -30
  22. data/docs/ChallengeResponseImageOptions.md +0 -22
  23. data/docs/ChallengeResponseOptions.md +0 -20
  24. data/docs/ConnectWidget.md +0 -20
  25. data/docs/Credential.md +0 -26
  26. data/docs/EnhanceTransaction.md +0 -48
  27. data/docs/Holding.md +0 -52
  28. data/docs/InlineResponse200.md +0 -18
  29. data/docs/Institution.md +0 -36
  30. data/docs/Member.md +0 -40
  31. data/docs/MemberStatus.md +0 -34
  32. data/docs/Merchant.md +0 -28
  33. data/docs/OAuthWindow.md +0 -20
  34. data/docs/Pagination.md +0 -24
  35. data/docs/Statement.md +0 -32
  36. data/docs/Tag.md +0 -22
  37. data/docs/Tagging.md +0 -26
  38. data/docs/Transaction.md +0 -88
  39. data/docs/TransactionRule.md +0 -30
  40. data/docs/User.md +0 -26
  41. data/docs/Widget.md +0 -22
  42. data/lib/mx-platform-ruby/models/account.rb +0 -569
  43. data/lib/mx-platform-ruby/models/account_number.rb +0 -281
  44. data/lib/mx-platform-ruby/models/account_owner.rb +0 -317
  45. data/lib/mx-platform-ruby/models/category.rb +0 -281
  46. data/lib/mx-platform-ruby/models/challenge.rb +0 -276
  47. data/lib/mx-platform-ruby/models/challenge_response_image_options.rb +0 -236
  48. data/lib/mx-platform-ruby/models/challenge_response_options.rb +0 -227
  49. data/lib/mx-platform-ruby/models/connect_widget.rb +0 -227
  50. data/lib/mx-platform-ruby/models/credential.rb +0 -254
  51. data/lib/mx-platform-ruby/models/enhance_transaction.rb +0 -353
  52. data/lib/mx-platform-ruby/models/holding.rb +0 -371
  53. data/lib/mx-platform-ruby/models/inline_response200.rb +0 -218
  54. data/lib/mx-platform-ruby/models/institution.rb +0 -299
  55. data/lib/mx-platform-ruby/models/member.rb +0 -317
  56. data/lib/mx-platform-ruby/models/member_status.rb +0 -292
  57. data/lib/mx-platform-ruby/models/merchant.rb +0 -263
  58. data/lib/mx-platform-ruby/models/o_auth_window.rb +0 -227
  59. data/lib/mx-platform-ruby/models/pagination.rb +0 -245
  60. data/lib/mx-platform-ruby/models/statement.rb +0 -281
  61. data/lib/mx-platform-ruby/models/tag.rb +0 -236
  62. data/lib/mx-platform-ruby/models/tagging.rb +0 -254
  63. data/lib/mx-platform-ruby/models/transaction.rb +0 -533
  64. data/lib/mx-platform-ruby/models/transaction_rule.rb +0 -272
  65. data/lib/mx-platform-ruby/models/user.rb +0 -254
  66. data/lib/mx-platform-ruby/models/widget.rb +0 -236
  67. data/openapi/mx_platform_ruby.yml +0 -11
  68. data/pkg/mx-platform-ruby-0.2.0.gem +0 -0
  69. data/pkg/mx-platform-ruby-0.2.1.gem +0 -0
  70. data/spec/models/account_number_spec.rb +0 -76
  71. data/spec/models/account_owner_spec.rb +0 -100
  72. data/spec/models/account_spec.rb +0 -268
  73. data/spec/models/category_spec.rb +0 -76
  74. data/spec/models/challenge_response_image_options_spec.rb +0 -46
  75. data/spec/models/challenge_response_options_spec.rb +0 -40
  76. data/spec/models/challenge_spec.rb +0 -70
  77. data/spec/models/connect_widget_spec.rb +0 -40
  78. data/spec/models/credential_spec.rb +0 -58
  79. data/spec/models/enhance_transaction_spec.rb +0 -124
  80. data/spec/models/holding_spec.rb +0 -136
  81. data/spec/models/inline_response200_spec.rb +0 -34
  82. data/spec/models/institution_spec.rb +0 -88
  83. data/spec/models/member_spec.rb +0 -100
  84. data/spec/models/member_status_spec.rb +0 -82
  85. data/spec/models/merchant_spec.rb +0 -64
  86. data/spec/models/o_auth_window_spec.rb +0 -40
  87. data/spec/models/pagination_spec.rb +0 -52
  88. data/spec/models/statement_spec.rb +0 -76
  89. data/spec/models/tag_spec.rb +0 -46
  90. data/spec/models/tagging_spec.rb +0 -58
  91. data/spec/models/transaction_rule_spec.rb +0 -70
  92. data/spec/models/transaction_spec.rb +0 -244
  93. data/spec/models/user_spec.rb +0 -58
  94. data/spec/models/widget_spec.rb +0 -46
@@ -1,281 +0,0 @@
1
- =begin
2
- #MX Platform API
3
-
4
- #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module MxPlatformRuby
17
- class AccountNumber
18
- attr_accessor :account_guid
19
-
20
- attr_accessor :account_number
21
-
22
- attr_accessor :guid
23
-
24
- attr_accessor :institution_number
25
-
26
- attr_accessor :member_guid
27
-
28
- attr_accessor :routing_number
29
-
30
- attr_accessor :transit_number
31
-
32
- attr_accessor :user_guid
33
-
34
- # Attribute mapping from ruby-style variable name to JSON key.
35
- def self.attribute_map
36
- {
37
- :'account_guid' => :'account_guid',
38
- :'account_number' => :'account_number',
39
- :'guid' => :'guid',
40
- :'institution_number' => :'institution_number',
41
- :'member_guid' => :'member_guid',
42
- :'routing_number' => :'routing_number',
43
- :'transit_number' => :'transit_number',
44
- :'user_guid' => :'user_guid'
45
- }
46
- end
47
-
48
- # Returns all the JSON keys this model knows about
49
- def self.acceptable_attributes
50
- attribute_map.values
51
- end
52
-
53
- # Attribute type mapping.
54
- def self.openapi_types
55
- {
56
- :'account_guid' => :'String',
57
- :'account_number' => :'String',
58
- :'guid' => :'String',
59
- :'institution_number' => :'String',
60
- :'member_guid' => :'String',
61
- :'routing_number' => :'String',
62
- :'transit_number' => :'String',
63
- :'user_guid' => :'String'
64
- }
65
- end
66
-
67
- # List of attributes with nullable: true
68
- def self.openapi_nullable
69
- Set.new([
70
- ])
71
- end
72
-
73
- # Initializes the object
74
- # @param [Hash] attributes Model attributes in the form of hash
75
- def initialize(attributes = {})
76
- if (!attributes.is_a?(Hash))
77
- fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::AccountNumber` initialize method"
78
- end
79
-
80
- # check to see if the attribute exists and convert string to symbol for hash key
81
- attributes = attributes.each_with_object({}) { |(k, v), h|
82
- if (!self.class.attribute_map.key?(k.to_sym))
83
- fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::AccountNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
- end
85
- h[k.to_sym] = v
86
- }
87
-
88
- if attributes.key?(:'account_guid')
89
- self.account_guid = attributes[:'account_guid']
90
- end
91
-
92
- if attributes.key?(:'account_number')
93
- self.account_number = attributes[:'account_number']
94
- end
95
-
96
- if attributes.key?(:'guid')
97
- self.guid = attributes[:'guid']
98
- end
99
-
100
- if attributes.key?(:'institution_number')
101
- self.institution_number = attributes[:'institution_number']
102
- end
103
-
104
- if attributes.key?(:'member_guid')
105
- self.member_guid = attributes[:'member_guid']
106
- end
107
-
108
- if attributes.key?(:'routing_number')
109
- self.routing_number = attributes[:'routing_number']
110
- end
111
-
112
- if attributes.key?(:'transit_number')
113
- self.transit_number = attributes[:'transit_number']
114
- end
115
-
116
- if attributes.key?(:'user_guid')
117
- self.user_guid = attributes[:'user_guid']
118
- end
119
- end
120
-
121
- # Show invalid properties with the reasons. Usually used together with valid?
122
- # @return Array for valid properties with the reasons
123
- def list_invalid_properties
124
- invalid_properties = Array.new
125
- invalid_properties
126
- end
127
-
128
- # Check to see if the all the properties in the model are valid
129
- # @return true if the model is valid
130
- def valid?
131
- true
132
- end
133
-
134
- # Checks equality by comparing each attribute.
135
- # @param [Object] Object to be compared
136
- def ==(o)
137
- return true if self.equal?(o)
138
- self.class == o.class &&
139
- account_guid == o.account_guid &&
140
- account_number == o.account_number &&
141
- guid == o.guid &&
142
- institution_number == o.institution_number &&
143
- member_guid == o.member_guid &&
144
- routing_number == o.routing_number &&
145
- transit_number == o.transit_number &&
146
- user_guid == o.user_guid
147
- end
148
-
149
- # @see the `==` method
150
- # @param [Object] Object to be compared
151
- def eql?(o)
152
- self == o
153
- end
154
-
155
- # Calculates hash code according to all attributes.
156
- # @return [Integer] Hash code
157
- def hash
158
- [account_guid, account_number, guid, institution_number, member_guid, routing_number, transit_number, user_guid].hash
159
- end
160
-
161
- # Builds the object from hash
162
- # @param [Hash] attributes Model attributes in the form of hash
163
- # @return [Object] Returns the model itself
164
- def self.build_from_hash(attributes)
165
- new.build_from_hash(attributes)
166
- end
167
-
168
- # Builds the object from hash
169
- # @param [Hash] attributes Model attributes in the form of hash
170
- # @return [Object] Returns the model itself
171
- def build_from_hash(attributes)
172
- return nil unless attributes.is_a?(Hash)
173
- self.class.openapi_types.each_pair do |key, type|
174
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
175
- self.send("#{key}=", nil)
176
- elsif type =~ /\AArray<(.*)>/i
177
- # check to ensure the input is an array given that the attribute
178
- # is documented as an array but the input is not
179
- if attributes[self.class.attribute_map[key]].is_a?(Array)
180
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
181
- end
182
- elsif !attributes[self.class.attribute_map[key]].nil?
183
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
184
- end
185
- end
186
-
187
- self
188
- end
189
-
190
- # Deserializes the data based on type
191
- # @param string type Data type
192
- # @param string value Value to be deserialized
193
- # @return [Object] Deserialized data
194
- def _deserialize(type, value)
195
- case type.to_sym
196
- when :Time
197
- Time.parse(value)
198
- when :Date
199
- Date.parse(value)
200
- when :String
201
- value.to_s
202
- when :Integer
203
- value.to_i
204
- when :Float
205
- value.to_f
206
- when :Boolean
207
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
- true
209
- else
210
- false
211
- end
212
- when :Object
213
- # generic object (usually a Hash), return directly
214
- value
215
- when /\AArray<(?<inner_type>.+)>\z/
216
- inner_type = Regexp.last_match[:inner_type]
217
- value.map { |v| _deserialize(inner_type, v) }
218
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
- k_type = Regexp.last_match[:k_type]
220
- v_type = Regexp.last_match[:v_type]
221
- {}.tap do |hash|
222
- value.each do |k, v|
223
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
- end
225
- end
226
- else # model
227
- # models (e.g. Pet) or oneOf
228
- klass = MxPlatformRuby.const_get(type)
229
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
- end
231
- end
232
-
233
- # Returns the string representation of the object
234
- # @return [String] String presentation of the object
235
- def to_s
236
- to_hash.to_s
237
- end
238
-
239
- # to_body is an alias to to_hash (backward compatibility)
240
- # @return [Hash] Returns the object in the form of hash
241
- def to_body
242
- to_hash
243
- end
244
-
245
- # Returns the object in the form of hash
246
- # @return [Hash] Returns the object in the form of hash
247
- def to_hash
248
- hash = {}
249
- self.class.attribute_map.each_pair do |attr, param|
250
- value = self.send(attr)
251
- if value.nil?
252
- is_nullable = self.class.openapi_nullable.include?(attr)
253
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
- end
255
-
256
- hash[param] = _to_hash(value)
257
- end
258
- hash
259
- end
260
-
261
- # Outputs non-array value in the form of hash
262
- # For object, use to_hash. Otherwise, just return the value
263
- # @param [Object] value Any valid value
264
- # @return [Hash] Returns the value in the form of hash
265
- def _to_hash(value)
266
- if value.is_a?(Array)
267
- value.compact.map { |v| _to_hash(v) }
268
- elsif value.is_a?(Hash)
269
- {}.tap do |hash|
270
- value.each { |k, v| hash[k] = _to_hash(v) }
271
- end
272
- elsif value.respond_to? :to_hash
273
- value.to_hash
274
- else
275
- value
276
- end
277
- end
278
-
279
- end
280
-
281
- end
@@ -1,317 +0,0 @@
1
- =begin
2
- #MX Platform API
3
-
4
- #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module MxPlatformRuby
17
- class AccountOwner
18
- attr_accessor :account_guid
19
-
20
- attr_accessor :address
21
-
22
- attr_accessor :city
23
-
24
- attr_accessor :country
25
-
26
- attr_accessor :email
27
-
28
- attr_accessor :guid
29
-
30
- attr_accessor :member_guid
31
-
32
- attr_accessor :owner_name
33
-
34
- attr_accessor :phone
35
-
36
- attr_accessor :postal_code
37
-
38
- attr_accessor :state
39
-
40
- attr_accessor :user_guid
41
-
42
- # Attribute mapping from ruby-style variable name to JSON key.
43
- def self.attribute_map
44
- {
45
- :'account_guid' => :'account_guid',
46
- :'address' => :'address',
47
- :'city' => :'city',
48
- :'country' => :'country',
49
- :'email' => :'email',
50
- :'guid' => :'guid',
51
- :'member_guid' => :'member_guid',
52
- :'owner_name' => :'owner_name',
53
- :'phone' => :'phone',
54
- :'postal_code' => :'postal_code',
55
- :'state' => :'state',
56
- :'user_guid' => :'user_guid'
57
- }
58
- end
59
-
60
- # Returns all the JSON keys this model knows about
61
- def self.acceptable_attributes
62
- attribute_map.values
63
- end
64
-
65
- # Attribute type mapping.
66
- def self.openapi_types
67
- {
68
- :'account_guid' => :'String',
69
- :'address' => :'String',
70
- :'city' => :'String',
71
- :'country' => :'String',
72
- :'email' => :'String',
73
- :'guid' => :'String',
74
- :'member_guid' => :'String',
75
- :'owner_name' => :'String',
76
- :'phone' => :'String',
77
- :'postal_code' => :'String',
78
- :'state' => :'String',
79
- :'user_guid' => :'String'
80
- }
81
- end
82
-
83
- # List of attributes with nullable: true
84
- def self.openapi_nullable
85
- Set.new([
86
- ])
87
- end
88
-
89
- # Initializes the object
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- def initialize(attributes = {})
92
- if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::AccountOwner` initialize method"
94
- end
95
-
96
- # check to see if the attribute exists and convert string to symbol for hash key
97
- attributes = attributes.each_with_object({}) { |(k, v), h|
98
- if (!self.class.attribute_map.key?(k.to_sym))
99
- fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::AccountOwner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
- end
101
- h[k.to_sym] = v
102
- }
103
-
104
- if attributes.key?(:'account_guid')
105
- self.account_guid = attributes[:'account_guid']
106
- end
107
-
108
- if attributes.key?(:'address')
109
- self.address = attributes[:'address']
110
- end
111
-
112
- if attributes.key?(:'city')
113
- self.city = attributes[:'city']
114
- end
115
-
116
- if attributes.key?(:'country')
117
- self.country = attributes[:'country']
118
- end
119
-
120
- if attributes.key?(:'email')
121
- self.email = attributes[:'email']
122
- end
123
-
124
- if attributes.key?(:'guid')
125
- self.guid = attributes[:'guid']
126
- end
127
-
128
- if attributes.key?(:'member_guid')
129
- self.member_guid = attributes[:'member_guid']
130
- end
131
-
132
- if attributes.key?(:'owner_name')
133
- self.owner_name = attributes[:'owner_name']
134
- end
135
-
136
- if attributes.key?(:'phone')
137
- self.phone = attributes[:'phone']
138
- end
139
-
140
- if attributes.key?(:'postal_code')
141
- self.postal_code = attributes[:'postal_code']
142
- end
143
-
144
- if attributes.key?(:'state')
145
- self.state = attributes[:'state']
146
- end
147
-
148
- if attributes.key?(:'user_guid')
149
- self.user_guid = attributes[:'user_guid']
150
- end
151
- end
152
-
153
- # Show invalid properties with the reasons. Usually used together with valid?
154
- # @return Array for valid properties with the reasons
155
- def list_invalid_properties
156
- invalid_properties = Array.new
157
- invalid_properties
158
- end
159
-
160
- # Check to see if the all the properties in the model are valid
161
- # @return true if the model is valid
162
- def valid?
163
- true
164
- end
165
-
166
- # Checks equality by comparing each attribute.
167
- # @param [Object] Object to be compared
168
- def ==(o)
169
- return true if self.equal?(o)
170
- self.class == o.class &&
171
- account_guid == o.account_guid &&
172
- address == o.address &&
173
- city == o.city &&
174
- country == o.country &&
175
- email == o.email &&
176
- guid == o.guid &&
177
- member_guid == o.member_guid &&
178
- owner_name == o.owner_name &&
179
- phone == o.phone &&
180
- postal_code == o.postal_code &&
181
- state == o.state &&
182
- user_guid == o.user_guid
183
- end
184
-
185
- # @see the `==` method
186
- # @param [Object] Object to be compared
187
- def eql?(o)
188
- self == o
189
- end
190
-
191
- # Calculates hash code according to all attributes.
192
- # @return [Integer] Hash code
193
- def hash
194
- [account_guid, address, city, country, email, guid, member_guid, owner_name, phone, postal_code, state, user_guid].hash
195
- end
196
-
197
- # Builds the object from hash
198
- # @param [Hash] attributes Model attributes in the form of hash
199
- # @return [Object] Returns the model itself
200
- def self.build_from_hash(attributes)
201
- new.build_from_hash(attributes)
202
- end
203
-
204
- # Builds the object from hash
205
- # @param [Hash] attributes Model attributes in the form of hash
206
- # @return [Object] Returns the model itself
207
- def build_from_hash(attributes)
208
- return nil unless attributes.is_a?(Hash)
209
- self.class.openapi_types.each_pair do |key, type|
210
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
211
- self.send("#{key}=", nil)
212
- elsif type =~ /\AArray<(.*)>/i
213
- # check to ensure the input is an array given that the attribute
214
- # is documented as an array but the input is not
215
- if attributes[self.class.attribute_map[key]].is_a?(Array)
216
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
217
- end
218
- elsif !attributes[self.class.attribute_map[key]].nil?
219
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
220
- end
221
- end
222
-
223
- self
224
- end
225
-
226
- # Deserializes the data based on type
227
- # @param string type Data type
228
- # @param string value Value to be deserialized
229
- # @return [Object] Deserialized data
230
- def _deserialize(type, value)
231
- case type.to_sym
232
- when :Time
233
- Time.parse(value)
234
- when :Date
235
- Date.parse(value)
236
- when :String
237
- value.to_s
238
- when :Integer
239
- value.to_i
240
- when :Float
241
- value.to_f
242
- when :Boolean
243
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
244
- true
245
- else
246
- false
247
- end
248
- when :Object
249
- # generic object (usually a Hash), return directly
250
- value
251
- when /\AArray<(?<inner_type>.+)>\z/
252
- inner_type = Regexp.last_match[:inner_type]
253
- value.map { |v| _deserialize(inner_type, v) }
254
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
255
- k_type = Regexp.last_match[:k_type]
256
- v_type = Regexp.last_match[:v_type]
257
- {}.tap do |hash|
258
- value.each do |k, v|
259
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
260
- end
261
- end
262
- else # model
263
- # models (e.g. Pet) or oneOf
264
- klass = MxPlatformRuby.const_get(type)
265
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
266
- end
267
- end
268
-
269
- # Returns the string representation of the object
270
- # @return [String] String presentation of the object
271
- def to_s
272
- to_hash.to_s
273
- end
274
-
275
- # to_body is an alias to to_hash (backward compatibility)
276
- # @return [Hash] Returns the object in the form of hash
277
- def to_body
278
- to_hash
279
- end
280
-
281
- # Returns the object in the form of hash
282
- # @return [Hash] Returns the object in the form of hash
283
- def to_hash
284
- hash = {}
285
- self.class.attribute_map.each_pair do |attr, param|
286
- value = self.send(attr)
287
- if value.nil?
288
- is_nullable = self.class.openapi_nullable.include?(attr)
289
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
290
- end
291
-
292
- hash[param] = _to_hash(value)
293
- end
294
- hash
295
- end
296
-
297
- # Outputs non-array value in the form of hash
298
- # For object, use to_hash. Otherwise, just return the value
299
- # @param [Object] value Any valid value
300
- # @return [Hash] Returns the value in the form of hash
301
- def _to_hash(value)
302
- if value.is_a?(Array)
303
- value.compact.map { |v| _to_hash(v) }
304
- elsif value.is_a?(Hash)
305
- {}.tap do |hash|
306
- value.each { |k, v| hash[k] = _to_hash(v) }
307
- end
308
- elsif value.respond_to? :to_hash
309
- value.to_hash
310
- else
311
- value
312
- end
313
- end
314
-
315
- end
316
-
317
- end