moneykit 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +1 -1
  4. data/docs/ApiPublicTransactionsGetTransactionsResponse.md +24 -0
  5. data/docs/ApiPublicTransactionsLegacyGetTransactionsResponse.md +28 -0
  6. data/docs/BudCategory.md +20 -0
  7. data/docs/BudPrimaryCategory.md +15 -0
  8. data/docs/BudSubcategory.md +15 -0
  9. data/docs/CustomSandboxAccount.md +24 -0
  10. data/docs/CustomSandboxData.md +20 -0
  11. data/docs/GetLinksLink.md +20 -0
  12. data/docs/GetLinksResponse.md +20 -0
  13. data/docs/ImportTransactionsRequest.md +18 -0
  14. data/docs/ProductStateChangedWebhook.md +38 -0
  15. data/docs/Response401CorrectEnrichmentLinksIdTransactionsTxnIdEnrichmentPost.md +22 -0
  16. data/docs/Response401CreateLinkSessionLinkSessionPost.md +22 -0
  17. data/docs/Response401GetLinksLinksGet.md +22 -0
  18. data/docs/Response401ImportTransactionsLinksIdImportTransactionsPost.md +22 -0
  19. data/docs/Response401ResetLinkLinksIdResetPost.md +22 -0
  20. data/lib/moneykit/models/api_public_transactions_get_transactions_response.rb +321 -0
  21. data/lib/moneykit/models/api_public_transactions_legacy_get_transactions_response.rb +375 -0
  22. data/lib/moneykit/models/bud_category.rb +266 -0
  23. data/lib/moneykit/models/bud_primary_category.rb +61 -0
  24. data/lib/moneykit/models/bud_subcategory.rb +165 -0
  25. data/lib/moneykit/models/custom_sandbox_account.rb +300 -0
  26. data/lib/moneykit/models/custom_sandbox_data.rb +250 -0
  27. data/lib/moneykit/models/get_links_link.rb +261 -0
  28. data/lib/moneykit/models/get_links_response.rb +231 -0
  29. data/lib/moneykit/models/import_transactions_request.rb +238 -0
  30. data/lib/moneykit/models/product_state_changed_webhook.rb +493 -0
  31. data/lib/moneykit/models/response401_correct_enrichment_links_id_transactions_txn_id_enrichment_post.rb +104 -0
  32. data/lib/moneykit/models/response401_create_link_session_link_session_post.rb +103 -0
  33. data/lib/moneykit/models/response401_get_links_links_get.rb +103 -0
  34. data/lib/moneykit/models/response401_import_transactions_links_id_import_transactions_post.rb +103 -0
  35. data/lib/moneykit/models/response401_reset_link_links_id_reset_post.rb +104 -0
  36. data/lib/moneykit/version.rb +1 -1
  37. data/spec/models/api_public_transactions_get_transactions_response_spec.rb +54 -0
  38. data/spec/models/api_public_transactions_legacy_get_transactions_response_spec.rb +66 -0
  39. data/spec/models/bud_category_spec.rb +42 -0
  40. data/spec/models/bud_primary_category_spec.rb +30 -0
  41. data/spec/models/bud_subcategory_spec.rb +30 -0
  42. data/spec/models/custom_sandbox_account_spec.rb +54 -0
  43. data/spec/models/custom_sandbox_data_spec.rb +42 -0
  44. data/spec/models/get_links_link_spec.rb +42 -0
  45. data/spec/models/get_links_response_spec.rb +42 -0
  46. data/spec/models/import_transactions_request_spec.rb +36 -0
  47. data/spec/models/product_state_changed_webhook_spec.rb +108 -0
  48. data/spec/models/response401_correct_enrichment_links_id_transactions_txn_id_enrichment_post_spec.rb +21 -0
  49. data/spec/models/response401_create_link_session_link_session_post_spec.rb +21 -0
  50. data/spec/models/response401_get_links_links_get_spec.rb +21 -0
  51. data/spec/models/response401_import_transactions_links_id_import_transactions_post_spec.rb +21 -0
  52. data/spec/models/response401_reset_link_links_id_reset_post_spec.rb +21 -0
  53. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-12.0.0/gem_make.out +5 -5
  54. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.11.3/gem_make.out +5 -5
  55. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.4.0/gem_make.out +5 -5
  56. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  57. metadata +66 -2
@@ -0,0 +1,261 @@
1
+ =begin
2
+ #MoneyKit API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2023-02-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MoneyKit
17
+ class GetLinksLink
18
+ attr_accessor :link_id
19
+
20
+ attr_accessor :created_at
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'link_id' => :'link_id',
26
+ :'created_at' => :'created_at'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'link_id' => :'String',
44
+ :'created_at' => :'Time'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::GetLinksLink` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::GetLinksLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'link_id')
71
+ self.link_id = attributes[:'link_id']
72
+ else
73
+ self.link_id = nil
74
+ end
75
+
76
+ if attributes.key?(:'created_at')
77
+ self.created_at = attributes[:'created_at']
78
+ else
79
+ self.created_at = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @link_id.nil?
89
+ invalid_properties.push('invalid value for "link_id", link_id cannot be nil.')
90
+ end
91
+
92
+ if @created_at.nil?
93
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @link_id.nil?
104
+ return false if @created_at.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] link_id Value to be assigned
110
+ def link_id=(link_id)
111
+ if link_id.nil?
112
+ fail ArgumentError, 'link_id cannot be nil'
113
+ end
114
+
115
+ @link_id = link_id
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] created_at Value to be assigned
120
+ def created_at=(created_at)
121
+ if created_at.nil?
122
+ fail ArgumentError, 'created_at cannot be nil'
123
+ end
124
+
125
+ @created_at = created_at
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
+ link_id == o.link_id &&
134
+ created_at == o.created_at
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [link_id, created_at].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def self._deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ ::Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = MoneyKit.const_get(type)
211
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,231 @@
1
+ =begin
2
+ #MoneyKit API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2023-02-18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MoneyKit
17
+ class GetLinksResponse
18
+ attr_accessor :links
19
+
20
+ attr_accessor :next_cursor
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'links' => :'links',
26
+ :'next_cursor' => :'next_cursor'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'links' => :'Array<GetLinksLink>',
44
+ :'next_cursor' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::GetLinksResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::GetLinksResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'links')
71
+ if (value = attributes[:'links']).is_a?(Array)
72
+ self.links = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'next_cursor')
77
+ self.next_cursor = attributes[:'next_cursor']
78
+ else
79
+ self.next_cursor = ''
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ warn '[DEPRECATED] the `valid?` method is obsolete'
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ links == o.links &&
104
+ next_cursor == o.next_cursor
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [links, next_cursor].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ attributes = attributes.transform_keys(&:to_sym)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
+ end
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def self._deserialize(type, value)
147
+ case type.to_sym
148
+ when :Time
149
+ Time.parse(value)
150
+ when :Date
151
+ ::Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ # models (e.g. Pet) or oneOf
180
+ klass = MoneyKit.const_get(type)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end