mx-platform-ruby 0.20.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/docs/MemberCreateRequestBody.md +2 -0
  4. data/docs/MxPlatformApi.md +1588 -507
  5. data/docs/SpendingPlanAccountResponse.md +30 -0
  6. data/docs/SpendingPlanAccountsResponse.md +20 -0
  7. data/docs/SpendingPlanIterationItemCreateRequestBody.md +26 -0
  8. data/docs/SpendingPlanIterationItemResponse.md +40 -0
  9. data/docs/SpendingPlanIterationItemsResponseBody.md +20 -0
  10. data/docs/SpendingPlanIterationResponse.md +32 -0
  11. data/docs/SpendingPlanIterationsResponse.md +20 -0
  12. data/docs/SpendingPlanResponse.md +26 -0
  13. data/docs/SpendingPlansResponseBody.md +20 -0
  14. data/lib/mx-platform-ruby/api/mx_platform_api.rb +1065 -8
  15. data/lib/mx-platform-ruby/models/member_create_request_body.rb +10 -1
  16. data/lib/mx-platform-ruby/models/spending_plan_account_response.rb +272 -0
  17. data/lib/mx-platform-ruby/models/spending_plan_accounts_response.rb +229 -0
  18. data/lib/mx-platform-ruby/models/spending_plan_iteration_item_create_request_body.rb +259 -0
  19. data/lib/mx-platform-ruby/models/spending_plan_iteration_item_response.rb +330 -0
  20. data/lib/mx-platform-ruby/models/spending_plan_iteration_items_response_body.rb +229 -0
  21. data/lib/mx-platform-ruby/models/spending_plan_iteration_response.rb +289 -0
  22. data/lib/mx-platform-ruby/models/spending_plan_iterations_response.rb +229 -0
  23. data/lib/mx-platform-ruby/models/spending_plan_response.rb +259 -0
  24. data/lib/mx-platform-ruby/models/spending_plans_response_body.rb +229 -0
  25. data/lib/mx-platform-ruby/version.rb +1 -1
  26. data/lib/mx-platform-ruby.rb +9 -0
  27. data/openapi/config.yml +1 -1
  28. data/spec/api/mx_platform_api_spec.rb +205 -0
  29. data/spec/models/member_create_request_body_spec.rb +6 -0
  30. data/spec/models/spending_plan_account_response_spec.rb +70 -0
  31. data/spec/models/spending_plan_accounts_response_spec.rb +40 -0
  32. data/spec/models/spending_plan_iteration_item_create_request_body_spec.rb +58 -0
  33. data/spec/models/spending_plan_iteration_item_response_spec.rb +100 -0
  34. data/spec/models/spending_plan_iteration_items_response_body_spec.rb +40 -0
  35. data/spec/models/spending_plan_iteration_response_spec.rb +76 -0
  36. data/spec/models/spending_plan_iterations_response_spec.rb +40 -0
  37. data/spec/models/spending_plan_response_spec.rb +58 -0
  38. data/spec/models/spending_plans_response_body_spec.rb +40 -0
  39. metadata +142 -106
@@ -0,0 +1,229 @@
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.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MxPlatformRuby
17
+ class SpendingPlanIterationItemsResponseBody
18
+ attr_accessor :iteration_items
19
+
20
+ attr_accessor :pagination
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'iteration_items' => :'iteration_items',
26
+ :'pagination' => :'pagination'
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
+ :'iteration_items' => :'Array<SpendingPlanIterationItemResponse>',
39
+ :'pagination' => :'PaginationResponse'
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::SpendingPlanIterationItemsResponseBody` 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::SpendingPlanIterationItemsResponseBody`. 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?(:'iteration_items')
65
+ if (value = attributes[:'iteration_items']).is_a?(Array)
66
+ self.iteration_items = value
67
+ end
68
+ end
69
+
70
+ if attributes.key?(:'pagination')
71
+ self.pagination = attributes[:'pagination']
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
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ iteration_items == o.iteration_items &&
94
+ pagination == o.pagination
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [iteration_items, pagination].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ new.build_from_hash(attributes)
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.openapi_types.each_pair do |key, type|
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
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = MxPlatformRuby.const_get(type)
177
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -0,0 +1,289 @@
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.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MxPlatformRuby
17
+ class SpendingPlanIterationResponse
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :end_on
21
+
22
+ attr_accessor :guid
23
+
24
+ attr_accessor :iteration_number
25
+
26
+ attr_accessor :spending_plan_guid
27
+
28
+ attr_accessor :start_on
29
+
30
+ attr_accessor :updated_at
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
+ :'created_at' => :'created_at',
38
+ :'end_on' => :'end_on',
39
+ :'guid' => :'guid',
40
+ :'iteration_number' => :'iteration_number',
41
+ :'spending_plan_guid' => :'spending_plan_guid',
42
+ :'start_on' => :'start_on',
43
+ :'updated_at' => :'updated_at',
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
+ :'created_at' => :'String',
57
+ :'end_on' => :'String',
58
+ :'guid' => :'String',
59
+ :'iteration_number' => :'Integer',
60
+ :'spending_plan_guid' => :'String',
61
+ :'start_on' => :'String',
62
+ :'updated_at' => :'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
+ :'created_at',
71
+ :'end_on',
72
+ :'guid',
73
+ :'iteration_number',
74
+ :'spending_plan_guid',
75
+ :'start_on',
76
+ :'updated_at',
77
+ :'user_guid'
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::SpendingPlanIterationResponse` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::SpendingPlanIterationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'created_at')
97
+ self.created_at = attributes[:'created_at']
98
+ end
99
+
100
+ if attributes.key?(:'end_on')
101
+ self.end_on = attributes[:'end_on']
102
+ end
103
+
104
+ if attributes.key?(:'guid')
105
+ self.guid = attributes[:'guid']
106
+ end
107
+
108
+ if attributes.key?(:'iteration_number')
109
+ self.iteration_number = attributes[:'iteration_number']
110
+ end
111
+
112
+ if attributes.key?(:'spending_plan_guid')
113
+ self.spending_plan_guid = attributes[:'spending_plan_guid']
114
+ end
115
+
116
+ if attributes.key?(:'start_on')
117
+ self.start_on = attributes[:'start_on']
118
+ end
119
+
120
+ if attributes.key?(:'updated_at')
121
+ self.updated_at = attributes[:'updated_at']
122
+ end
123
+
124
+ if attributes.key?(:'user_guid')
125
+ self.user_guid = attributes[:'user_guid']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ created_at == o.created_at &&
148
+ end_on == o.end_on &&
149
+ guid == o.guid &&
150
+ iteration_number == o.iteration_number &&
151
+ spending_plan_guid == o.spending_plan_guid &&
152
+ start_on == o.start_on &&
153
+ updated_at == o.updated_at &&
154
+ user_guid == o.user_guid
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [created_at, end_on, guid, iteration_number, spending_plan_guid, start_on, updated_at, user_guid].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ new.build_from_hash(attributes)
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.openapi_types.each_pair do |key, type|
182
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
183
+ self.send("#{key}=", nil)
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :Time
205
+ Time.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ # models (e.g. Pet) or oneOf
236
+ klass = MxPlatformRuby.const_get(type)
237
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end