mx-platform-ruby 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/docs/AccountResponse.md +2 -2
- data/docs/InsightResponse.md +56 -0
- data/docs/InsightResponseBody.md +18 -0
- data/docs/InsightUpdateRequest.md +20 -0
- data/docs/InsightsApi.md +706 -0
- data/docs/InsightsResponseBody.md +20 -0
- data/docs/MxPlatformApi.md +1 -1
- data/docs/ScheduledPaymentResponse.md +42 -0
- data/docs/ScheduledPaymentsResponseBody.md +20 -0
- data/docs/WidgetRequest.md +1 -1
- data/lib/mx-platform-ruby/api/insights_api.rb +690 -0
- data/lib/mx-platform-ruby/api/mx_platform_api.rb +2 -2
- data/lib/mx-platform-ruby/models/account_response.rb +11 -11
- data/lib/mx-platform-ruby/models/insight_response.rb +404 -0
- data/lib/mx-platform-ruby/models/insight_response_body.rb +216 -0
- data/lib/mx-platform-ruby/models/insight_update_request.rb +223 -0
- data/lib/mx-platform-ruby/models/insights_response_body.rb +225 -0
- data/lib/mx-platform-ruby/models/scheduled_payment_response.rb +322 -0
- data/lib/mx-platform-ruby/models/scheduled_payments_response_body.rb +225 -0
- data/lib/mx-platform-ruby/version.rb +1 -1
- data/lib/mx-platform-ruby.rb +7 -0
- data/openapi/config.yml +1 -1
- data/spec/api/insights_api_spec.rb +166 -0
- data/spec/api/mx_platform_api_spec.rb +1 -1
- data/spec/models/account_response_spec.rb +3 -3
- data/spec/models/insight_response_body_spec.rb +34 -0
- data/spec/models/insight_response_spec.rb +148 -0
- data/spec/models/insight_update_request_spec.rb +40 -0
- data/spec/models/insights_response_body_spec.rb +40 -0
- data/spec/models/scheduled_payment_response_spec.rb +106 -0
- data/spec/models/scheduled_payments_response_body_spec.rb +40 -0
- metadata +30 -2
@@ -0,0 +1,322 @@
|
|
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: 7.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MxPlatformRuby
|
17
|
+
class ScheduledPaymentResponse
|
18
|
+
attr_accessor :amount
|
19
|
+
|
20
|
+
attr_accessor :created_at
|
21
|
+
|
22
|
+
attr_accessor :description
|
23
|
+
|
24
|
+
attr_accessor :guid
|
25
|
+
|
26
|
+
attr_accessor :is_completed
|
27
|
+
|
28
|
+
attr_accessor :is_recurring
|
29
|
+
|
30
|
+
attr_accessor :merchant_guid
|
31
|
+
|
32
|
+
attr_accessor :occurs_on
|
33
|
+
|
34
|
+
attr_accessor :recurrence_day
|
35
|
+
|
36
|
+
attr_accessor :recurrence_type
|
37
|
+
|
38
|
+
attr_accessor :transaction_type
|
39
|
+
|
40
|
+
attr_accessor :updated_at
|
41
|
+
|
42
|
+
attr_accessor :user_guid
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'amount' => :'amount',
|
48
|
+
:'created_at' => :'created_at',
|
49
|
+
:'description' => :'description',
|
50
|
+
:'guid' => :'guid',
|
51
|
+
:'is_completed' => :'is_completed',
|
52
|
+
:'is_recurring' => :'is_recurring',
|
53
|
+
:'merchant_guid' => :'merchant_guid',
|
54
|
+
:'occurs_on' => :'occurs_on',
|
55
|
+
:'recurrence_day' => :'recurrence_day',
|
56
|
+
:'recurrence_type' => :'recurrence_type',
|
57
|
+
:'transaction_type' => :'transaction_type',
|
58
|
+
:'updated_at' => :'updated_at',
|
59
|
+
:'user_guid' => :'user_guid'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns all the JSON keys this model knows about
|
64
|
+
def self.acceptable_attributes
|
65
|
+
attribute_map.values
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.openapi_types
|
70
|
+
{
|
71
|
+
:'amount' => :'Float',
|
72
|
+
:'created_at' => :'String',
|
73
|
+
:'description' => :'String',
|
74
|
+
:'guid' => :'String',
|
75
|
+
:'is_completed' => :'Boolean',
|
76
|
+
:'is_recurring' => :'Boolean',
|
77
|
+
:'merchant_guid' => :'String',
|
78
|
+
:'occurs_on' => :'String',
|
79
|
+
:'recurrence_day' => :'Integer',
|
80
|
+
:'recurrence_type' => :'String',
|
81
|
+
:'transaction_type' => :'String',
|
82
|
+
:'updated_at' => :'String',
|
83
|
+
:'user_guid' => :'String'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# List of attributes with nullable: true
|
88
|
+
def self.openapi_nullable
|
89
|
+
Set.new([
|
90
|
+
])
|
91
|
+
end
|
92
|
+
|
93
|
+
# Initializes the object
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
def initialize(attributes = {})
|
96
|
+
if (!attributes.is_a?(Hash))
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::ScheduledPaymentResponse` initialize method"
|
98
|
+
end
|
99
|
+
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
102
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::ScheduledPaymentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
104
|
+
end
|
105
|
+
h[k.to_sym] = v
|
106
|
+
}
|
107
|
+
|
108
|
+
if attributes.key?(:'amount')
|
109
|
+
self.amount = attributes[:'amount']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'created_at')
|
113
|
+
self.created_at = attributes[:'created_at']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'description')
|
117
|
+
self.description = attributes[:'description']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'guid')
|
121
|
+
self.guid = attributes[:'guid']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'is_completed')
|
125
|
+
self.is_completed = attributes[:'is_completed']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'is_recurring')
|
129
|
+
self.is_recurring = attributes[:'is_recurring']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'merchant_guid')
|
133
|
+
self.merchant_guid = attributes[:'merchant_guid']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'occurs_on')
|
137
|
+
self.occurs_on = attributes[:'occurs_on']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'recurrence_day')
|
141
|
+
self.recurrence_day = attributes[:'recurrence_day']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'recurrence_type')
|
145
|
+
self.recurrence_type = attributes[:'recurrence_type']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'transaction_type')
|
149
|
+
self.transaction_type = attributes[:'transaction_type']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'updated_at')
|
153
|
+
self.updated_at = attributes[:'updated_at']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'user_guid')
|
157
|
+
self.user_guid = attributes[:'user_guid']
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
162
|
+
# @return Array for valid properties with the reasons
|
163
|
+
def list_invalid_properties
|
164
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
165
|
+
invalid_properties = Array.new
|
166
|
+
invalid_properties
|
167
|
+
end
|
168
|
+
|
169
|
+
# Check to see if the all the properties in the model are valid
|
170
|
+
# @return true if the model is valid
|
171
|
+
def valid?
|
172
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
173
|
+
true
|
174
|
+
end
|
175
|
+
|
176
|
+
# Checks equality by comparing each attribute.
|
177
|
+
# @param [Object] Object to be compared
|
178
|
+
def ==(o)
|
179
|
+
return true if self.equal?(o)
|
180
|
+
self.class == o.class &&
|
181
|
+
amount == o.amount &&
|
182
|
+
created_at == o.created_at &&
|
183
|
+
description == o.description &&
|
184
|
+
guid == o.guid &&
|
185
|
+
is_completed == o.is_completed &&
|
186
|
+
is_recurring == o.is_recurring &&
|
187
|
+
merchant_guid == o.merchant_guid &&
|
188
|
+
occurs_on == o.occurs_on &&
|
189
|
+
recurrence_day == o.recurrence_day &&
|
190
|
+
recurrence_type == o.recurrence_type &&
|
191
|
+
transaction_type == o.transaction_type &&
|
192
|
+
updated_at == o.updated_at &&
|
193
|
+
user_guid == o.user_guid
|
194
|
+
end
|
195
|
+
|
196
|
+
# @see the `==` method
|
197
|
+
# @param [Object] Object to be compared
|
198
|
+
def eql?(o)
|
199
|
+
self == o
|
200
|
+
end
|
201
|
+
|
202
|
+
# Calculates hash code according to all attributes.
|
203
|
+
# @return [Integer] Hash code
|
204
|
+
def hash
|
205
|
+
[amount, created_at, description, guid, is_completed, is_recurring, merchant_guid, occurs_on, recurrence_day, recurrence_type, transaction_type, updated_at, user_guid].hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Builds the object from hash
|
209
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
210
|
+
# @return [Object] Returns the model itself
|
211
|
+
def self.build_from_hash(attributes)
|
212
|
+
return nil unless attributes.is_a?(Hash)
|
213
|
+
attributes = attributes.transform_keys(&:to_sym)
|
214
|
+
transformed_hash = {}
|
215
|
+
openapi_types.each_pair do |key, type|
|
216
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
217
|
+
transformed_hash["#{key}"] = nil
|
218
|
+
elsif type =~ /\AArray<(.*)>/i
|
219
|
+
# check to ensure the input is an array given that the attribute
|
220
|
+
# is documented as an array but the input is not
|
221
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
222
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
223
|
+
end
|
224
|
+
elsif !attributes[attribute_map[key]].nil?
|
225
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
226
|
+
end
|
227
|
+
end
|
228
|
+
new(transformed_hash)
|
229
|
+
end
|
230
|
+
|
231
|
+
# Deserializes the data based on type
|
232
|
+
# @param string type Data type
|
233
|
+
# @param string value Value to be deserialized
|
234
|
+
# @return [Object] Deserialized data
|
235
|
+
def self._deserialize(type, value)
|
236
|
+
case type.to_sym
|
237
|
+
when :Time
|
238
|
+
Time.parse(value)
|
239
|
+
when :Date
|
240
|
+
Date.parse(value)
|
241
|
+
when :String
|
242
|
+
value.to_s
|
243
|
+
when :Integer
|
244
|
+
value.to_i
|
245
|
+
when :Float
|
246
|
+
value.to_f
|
247
|
+
when :Boolean
|
248
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
249
|
+
true
|
250
|
+
else
|
251
|
+
false
|
252
|
+
end
|
253
|
+
when :Object
|
254
|
+
# generic object (usually a Hash), return directly
|
255
|
+
value
|
256
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
257
|
+
inner_type = Regexp.last_match[:inner_type]
|
258
|
+
value.map { |v| _deserialize(inner_type, v) }
|
259
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
260
|
+
k_type = Regexp.last_match[:k_type]
|
261
|
+
v_type = Regexp.last_match[:v_type]
|
262
|
+
{}.tap do |hash|
|
263
|
+
value.each do |k, v|
|
264
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
else # model
|
268
|
+
# models (e.g. Pet) or oneOf
|
269
|
+
klass = MxPlatformRuby.const_get(type)
|
270
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
# Returns the string representation of the object
|
275
|
+
# @return [String] String presentation of the object
|
276
|
+
def to_s
|
277
|
+
to_hash.to_s
|
278
|
+
end
|
279
|
+
|
280
|
+
# to_body is an alias to to_hash (backward compatibility)
|
281
|
+
# @return [Hash] Returns the object in the form of hash
|
282
|
+
def to_body
|
283
|
+
to_hash
|
284
|
+
end
|
285
|
+
|
286
|
+
# Returns the object in the form of hash
|
287
|
+
# @return [Hash] Returns the object in the form of hash
|
288
|
+
def to_hash
|
289
|
+
hash = {}
|
290
|
+
self.class.attribute_map.each_pair do |attr, param|
|
291
|
+
value = self.send(attr)
|
292
|
+
if value.nil?
|
293
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
294
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
295
|
+
end
|
296
|
+
|
297
|
+
hash[param] = _to_hash(value)
|
298
|
+
end
|
299
|
+
hash
|
300
|
+
end
|
301
|
+
|
302
|
+
# Outputs non-array value in the form of hash
|
303
|
+
# For object, use to_hash. Otherwise, just return the value
|
304
|
+
# @param [Object] value Any valid value
|
305
|
+
# @return [Hash] Returns the value in the form of hash
|
306
|
+
def _to_hash(value)
|
307
|
+
if value.is_a?(Array)
|
308
|
+
value.compact.map { |v| _to_hash(v) }
|
309
|
+
elsif value.is_a?(Hash)
|
310
|
+
{}.tap do |hash|
|
311
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
312
|
+
end
|
313
|
+
elsif value.respond_to? :to_hash
|
314
|
+
value.to_hash
|
315
|
+
else
|
316
|
+
value
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
end
|
321
|
+
|
322
|
+
end
|
@@ -0,0 +1,225 @@
|
|
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: 7.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MxPlatformRuby
|
17
|
+
class ScheduledPaymentsResponseBody
|
18
|
+
attr_accessor :pagination
|
19
|
+
|
20
|
+
attr_accessor :scheduled_payments
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'pagination' => :'pagination',
|
26
|
+
:'scheduled_payments' => :'scheduled_payments'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'pagination' => :'PaginationResponse',
|
39
|
+
:'scheduled_payments' => :'Array<ScheduledPaymentResponse>'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::ScheduledPaymentsResponseBody` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::ScheduledPaymentsResponseBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'pagination')
|
65
|
+
self.pagination = attributes[:'pagination']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'scheduled_payments')
|
69
|
+
if (value = attributes[:'scheduled_payments']).is_a?(Array)
|
70
|
+
self.scheduled_payments = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
79
|
+
invalid_properties = Array.new
|
80
|
+
invalid_properties
|
81
|
+
end
|
82
|
+
|
83
|
+
# Check to see if the all the properties in the model are valid
|
84
|
+
# @return true if the model is valid
|
85
|
+
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
pagination == o.pagination &&
|
96
|
+
scheduled_payments == o.scheduled_payments
|
97
|
+
end
|
98
|
+
|
99
|
+
# @see the `==` method
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def eql?(o)
|
102
|
+
self == o
|
103
|
+
end
|
104
|
+
|
105
|
+
# Calculates hash code according to all attributes.
|
106
|
+
# @return [Integer] Hash code
|
107
|
+
def hash
|
108
|
+
[pagination, scheduled_payments].hash
|
109
|
+
end
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def self.build_from_hash(attributes)
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
121
|
+
elsif 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[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
126
|
+
end
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
|
+
end
|
130
|
+
end
|
131
|
+
new(transformed_hash)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def self._deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :Time
|
141
|
+
Time.parse(value)
|
142
|
+
when :Date
|
143
|
+
Date.parse(value)
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :Boolean
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
# models (e.g. Pet) or oneOf
|
172
|
+
klass = MxPlatformRuby.const_get(type)
|
173
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
if value.nil?
|
196
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
197
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
198
|
+
end
|
199
|
+
|
200
|
+
hash[param] = _to_hash(value)
|
201
|
+
end
|
202
|
+
hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Outputs non-array value in the form of hash
|
206
|
+
# For object, use to_hash. Otherwise, just return the value
|
207
|
+
# @param [Object] value Any valid value
|
208
|
+
# @return [Hash] Returns the value in the form of hash
|
209
|
+
def _to_hash(value)
|
210
|
+
if value.is_a?(Array)
|
211
|
+
value.compact.map { |v| _to_hash(v) }
|
212
|
+
elsif value.is_a?(Hash)
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
215
|
+
end
|
216
|
+
elsif value.respond_to? :to_hash
|
217
|
+
value.to_hash
|
218
|
+
else
|
219
|
+
value
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
data/lib/mx-platform-ruby.rb
CHANGED
@@ -56,6 +56,10 @@ require 'mx-platform-ruby/models/holding_response'
|
|
56
56
|
require 'mx-platform-ruby/models/holding_response_body'
|
57
57
|
require 'mx-platform-ruby/models/holdings_response_body'
|
58
58
|
require 'mx-platform-ruby/models/image_option_response'
|
59
|
+
require 'mx-platform-ruby/models/insight_response'
|
60
|
+
require 'mx-platform-ruby/models/insight_response_body'
|
61
|
+
require 'mx-platform-ruby/models/insight_update_request'
|
62
|
+
require 'mx-platform-ruby/models/insights_response_body'
|
59
63
|
require 'mx-platform-ruby/models/institution_response'
|
60
64
|
require 'mx-platform-ruby/models/institution_response_body'
|
61
65
|
require 'mx-platform-ruby/models/institutions_response_body'
|
@@ -95,6 +99,8 @@ require 'mx-platform-ruby/models/payment_processor_authorization_code_request'
|
|
95
99
|
require 'mx-platform-ruby/models/payment_processor_authorization_code_request_body'
|
96
100
|
require 'mx-platform-ruby/models/payment_processor_authorization_code_response'
|
97
101
|
require 'mx-platform-ruby/models/payment_processor_authorization_code_response_body'
|
102
|
+
require 'mx-platform-ruby/models/scheduled_payment_response'
|
103
|
+
require 'mx-platform-ruby/models/scheduled_payments_response_body'
|
98
104
|
require 'mx-platform-ruby/models/spending_plan_account_response'
|
99
105
|
require 'mx-platform-ruby/models/spending_plan_accounts_response'
|
100
106
|
require 'mx-platform-ruby/models/spending_plan_iteration_item_create_request_body'
|
@@ -149,6 +155,7 @@ require 'mx-platform-ruby/models/widget_response'
|
|
149
155
|
require 'mx-platform-ruby/models/widget_response_body'
|
150
156
|
|
151
157
|
# APIs
|
158
|
+
require 'mx-platform-ruby/api/insights_api'
|
152
159
|
require 'mx-platform-ruby/api/mx_platform_api'
|
153
160
|
require 'mx-platform-ruby/api/spending_plan_api'
|
154
161
|
|