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,238 @@
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 ImportTransactionsRequest
18
+ # The transactions to import.
19
+ attr_accessor :transactions
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'transactions' => :'transactions'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'transactions' => :'Array<TransactionImportData>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::ImportTransactionsRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::ImportTransactionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'transactions')
68
+ if (value = attributes[:'transactions']).is_a?(Array)
69
+ self.transactions = value
70
+ end
71
+ else
72
+ self.transactions = nil
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if @transactions.nil?
82
+ invalid_properties.push('invalid value for "transactions", transactions cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ return false if @transactions.nil?
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param [Object] transactions Value to be assigned
98
+ def transactions=(transactions)
99
+ if transactions.nil?
100
+ fail ArgumentError, 'transactions cannot be nil'
101
+ end
102
+
103
+ @transactions = transactions
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ transactions == o.transactions
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [transactions].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def self._deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ ::Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = MoneyKit.const_get(type)
188
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+ end
238
+ end