ynab 1.27.0 → 1.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d79f634b95d7ce4dada9421d20f203a3fd77a8c111c1debf5f8bad1c09284bf
4
- data.tar.gz: fd9500c732cebbeba2790fd58b9e0fcbf1b7228bdf4bbc6a9233aebf028281db
3
+ metadata.gz: 306574eacfc6eb25c6c585e4a58721c97178f821033c723c302726438b80e687
4
+ data.tar.gz: 733bd356cb7937e5d0431627c9a001d7b6778a6cd2d3cdde5e6d7f77445440a8
5
5
  SHA512:
6
- metadata.gz: 47168c88d3b5b35255ccf998ed1102f88a9c8e709e44db698b9f6b4d799543a5d237345c15487966fe0c6b13457abe37cb9c3d43c3b9000ee5662c431902928f
7
- data.tar.gz: 9ae3fd198d06147c5d48df99c48ffe8b3701f76fff38abf7bad23d10e5e7872d55af11d4f73444d3a0e68819d332c7c50596521a92ed8a307d2ce92016d3adcc
6
+ metadata.gz: '0490e176ddfe56696c600dd9ce3d76106a77500784f8e5098c5c2e03a302ca78eb14379a35a8708116344c7962749fd5a15a2947b639b312690817a84fb67090'
7
+ data.tar.gz: 30fdc6295db42b1c26a8da02ca1d3dade17d594cd2a343a179f6db866e6a70c3f9a2309afd3cdd6060ca8a1ec04329cc90172f815c5c6419799564e0d7a4dcfa
@@ -46,6 +46,21 @@ module YNAB
46
46
  # If an account linked to a financial institution (direct_import_linked=true) and the linked connection is not in a healthy state, this will be true.
47
47
  attr_accessor :direct_import_in_error
48
48
 
49
+ # A date/time specifying when the account was last reconciled.
50
+ attr_accessor :last_reconciled_at
51
+
52
+ # The original debt/loan account balance, specified in milliunits format.
53
+ attr_accessor :debt_original_balance
54
+
55
+ # The debt/loan account interest rate(s), by effective date.
56
+ attr_accessor :debt_interest_rates
57
+
58
+ # The minimum payment amount(s) for the debt/loan account, by effective date. The amounts are specified in milliunits format.
59
+ attr_accessor :debt_minimum_payments
60
+
61
+ # The escrow value(s) for the debt/loan account, by effective date. The amounts are specified in milliunits format.
62
+ attr_accessor :debt_escrow_amounts
63
+
49
64
  # Whether or not the account has been deleted. Deleted accounts will only be included in delta requests.
50
65
  attr_accessor :deleted
51
66
 
@@ -64,6 +79,11 @@ module YNAB
64
79
  :'transfer_payee_id' => :'transfer_payee_id',
65
80
  :'direct_import_linked' => :'direct_import_linked',
66
81
  :'direct_import_in_error' => :'direct_import_in_error',
82
+ :'last_reconciled_at' => :'last_reconciled_at',
83
+ :'debt_original_balance' => :'debt_original_balance',
84
+ :'debt_interest_rates' => :'debt_interest_rates',
85
+ :'debt_minimum_payments' => :'debt_minimum_payments',
86
+ :'debt_escrow_amounts' => :'debt_escrow_amounts',
67
87
  :'deleted' => :'deleted'
68
88
  }
69
89
  end
@@ -83,6 +103,11 @@ module YNAB
83
103
  :'transfer_payee_id' => :'String',
84
104
  :'direct_import_linked' => :'BOOLEAN',
85
105
  :'direct_import_in_error' => :'BOOLEAN',
106
+ :'last_reconciled_at' => :'DateTime',
107
+ :'debt_original_balance' => :'Integer',
108
+ :'debt_interest_rates' => :'LoanAccountPeriodicValue',
109
+ :'debt_minimum_payments' => :'LoanAccountPeriodicValue',
110
+ :'debt_escrow_amounts' => :'LoanAccountPeriodicValue',
86
111
  :'deleted' => :'BOOLEAN'
87
112
  }
88
113
  end
@@ -143,6 +168,26 @@ module YNAB
143
168
  self.direct_import_in_error = attributes[:'direct_import_in_error']
144
169
  end
145
170
 
171
+ if attributes.has_key?(:'last_reconciled_at')
172
+ self.last_reconciled_at = attributes[:'last_reconciled_at']
173
+ end
174
+
175
+ if attributes.has_key?(:'debt_original_balance')
176
+ self.debt_original_balance = attributes[:'debt_original_balance']
177
+ end
178
+
179
+ if attributes.has_key?(:'debt_interest_rates')
180
+ self.debt_interest_rates = attributes[:'debt_interest_rates']
181
+ end
182
+
183
+ if attributes.has_key?(:'debt_minimum_payments')
184
+ self.debt_minimum_payments = attributes[:'debt_minimum_payments']
185
+ end
186
+
187
+ if attributes.has_key?(:'debt_escrow_amounts')
188
+ self.debt_escrow_amounts = attributes[:'debt_escrow_amounts']
189
+ end
190
+
146
191
  if attributes.has_key?(:'deleted')
147
192
  self.deleted = attributes[:'deleted']
148
193
  end
@@ -228,6 +273,11 @@ module YNAB
228
273
  transfer_payee_id == o.transfer_payee_id &&
229
274
  direct_import_linked == o.direct_import_linked &&
230
275
  direct_import_in_error == o.direct_import_in_error &&
276
+ last_reconciled_at == o.last_reconciled_at &&
277
+ debt_original_balance == o.debt_original_balance &&
278
+ debt_interest_rates == o.debt_interest_rates &&
279
+ debt_minimum_payments == o.debt_minimum_payments &&
280
+ debt_escrow_amounts == o.debt_escrow_amounts &&
231
281
  deleted == o.deleted
232
282
  end
233
283
 
@@ -240,7 +290,7 @@ module YNAB
240
290
  # Calculates hash code according to all attributes.
241
291
  # @return [Fixnum] Hash code
242
292
  def hash
243
- [id, name, type, on_budget, closed, note, balance, cleared_balance, uncleared_balance, transfer_payee_id, direct_import_linked, direct_import_in_error, deleted].hash
293
+ [id, name, type, on_budget, closed, note, balance, cleared_balance, uncleared_balance, transfer_payee_id, direct_import_linked, direct_import_in_error, last_reconciled_at, debt_original_balance, debt_interest_rates, debt_minimum_payments, debt_escrow_amounts, deleted].hash
244
294
  end
245
295
  # Builds the object from hash
246
296
  # @param [Hash] attributes Model attributes in the form of hash
@@ -40,6 +40,15 @@ module YNAB
40
40
  # The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending')
41
41
  attr_accessor :goal_type
42
42
 
43
+ # The day of the goal
44
+ attr_accessor :goal_day
45
+
46
+ # The goal cadence
47
+ attr_accessor :goal_cadence
48
+
49
+ # The goal cadence frequency
50
+ attr_accessor :goal_cadence_frequency
51
+
43
52
  # The month a goal was created
44
53
  attr_accessor :goal_creation_month
45
54
 
@@ -102,6 +111,9 @@ module YNAB
102
111
  :'activity' => :'activity',
103
112
  :'balance' => :'balance',
104
113
  :'goal_type' => :'goal_type',
114
+ :'goal_day' => :'goal_day',
115
+ :'goal_cadence' => :'goal_cadence',
116
+ :'goal_cadence_frequency' => :'goal_cadence_frequency',
105
117
  :'goal_creation_month' => :'goal_creation_month',
106
118
  :'goal_target' => :'goal_target',
107
119
  :'goal_target_month' => :'goal_target_month',
@@ -127,6 +139,9 @@ module YNAB
127
139
  :'activity' => :'Integer',
128
140
  :'balance' => :'Integer',
129
141
  :'goal_type' => :'String',
142
+ :'goal_day' => :'Integer',
143
+ :'goal_cadence' => :'Integer',
144
+ :'goal_cadence_frequency' => :'Integer',
130
145
  :'goal_creation_month' => :'Date',
131
146
  :'goal_target' => :'Integer',
132
147
  :'goal_target_month' => :'Date',
@@ -187,6 +202,18 @@ module YNAB
187
202
  self.goal_type = attributes[:'goal_type']
188
203
  end
189
204
 
205
+ if attributes.has_key?(:'goal_day')
206
+ self.goal_day = attributes[:'goal_day']
207
+ end
208
+
209
+ if attributes.has_key?(:'goal_cadence')
210
+ self.goal_cadence = attributes[:'goal_cadence']
211
+ end
212
+
213
+ if attributes.has_key?(:'goal_cadence_frequency')
214
+ self.goal_cadence_frequency = attributes[:'goal_cadence_frequency']
215
+ end
216
+
190
217
  if attributes.has_key?(:'goal_creation_month')
191
218
  self.goal_creation_month = attributes[:'goal_creation_month']
192
219
  end
@@ -300,6 +327,9 @@ module YNAB
300
327
  activity == o.activity &&
301
328
  balance == o.balance &&
302
329
  goal_type == o.goal_type &&
330
+ goal_day == o.goal_day &&
331
+ goal_cadence == o.goal_cadence &&
332
+ goal_cadence_frequency == o.goal_cadence_frequency &&
303
333
  goal_creation_month == o.goal_creation_month &&
304
334
  goal_target == o.goal_target &&
305
335
  goal_target_month == o.goal_target_month &&
@@ -320,7 +350,7 @@ module YNAB
320
350
  # Calculates hash code according to all attributes.
321
351
  # @return [Fixnum] Hash code
322
352
  def hash
323
- [id, category_group_id, name, hidden, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_creation_month, goal_target, goal_target_month, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, deleted].hash
353
+ [id, category_group_id, name, hidden, original_category_group_id, note, budgeted, activity, balance, goal_type, goal_day, goal_cadence, goal_cadence_frequency, goal_creation_month, goal_target, goal_target_month, goal_percentage_complete, goal_months_to_budget, goal_under_funded, goal_overall_funded, goal_overall_left, deleted].hash
324
354
  end
325
355
  # Builds the object from hash
326
356
  # @param [Hash] attributes Model attributes in the form of hash
@@ -57,6 +57,9 @@ module YNAB
57
57
  # If the transaction was imported, the original payee name as it appeared on the statement
58
58
  attr_accessor :import_payee_name_original
59
59
 
60
+ # If the transaction is a debt/loan account transaction, the type of transaction
61
+ attr_accessor :debt_transaction_type
62
+
60
63
  # Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests.
61
64
  attr_accessor :deleted
62
65
 
@@ -113,6 +116,7 @@ module YNAB
113
116
  :'import_id' => :'import_id',
114
117
  :'import_payee_name' => :'import_payee_name',
115
118
  :'import_payee_name_original' => :'import_payee_name_original',
119
+ :'debt_transaction_type' => :'debt_transaction_type',
116
120
  :'deleted' => :'deleted',
117
121
  :'type' => :'type',
118
122
  :'parent_transaction_id' => :'parent_transaction_id',
@@ -141,6 +145,7 @@ module YNAB
141
145
  :'import_id' => :'String',
142
146
  :'import_payee_name' => :'String',
143
147
  :'import_payee_name_original' => :'String',
148
+ :'debt_transaction_type' => :'String',
144
149
  :'deleted' => :'BOOLEAN',
145
150
  :'type' => :'String',
146
151
  :'parent_transaction_id' => :'String',
@@ -222,6 +227,10 @@ module YNAB
222
227
  self.import_payee_name_original = attributes[:'import_payee_name_original']
223
228
  end
224
229
 
230
+ if attributes.has_key?(:'debt_transaction_type')
231
+ self.debt_transaction_type = attributes[:'debt_transaction_type']
232
+ end
233
+
225
234
  if attributes.has_key?(:'deleted')
226
235
  self.deleted = attributes[:'deleted']
227
236
  end
@@ -275,14 +284,6 @@ module YNAB
275
284
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
276
285
  end
277
286
 
278
- if !@import_payee_name.nil? && @import_payee_name.to_s.length > 200
279
- invalid_properties.push('invalid value for "import_payee_name", the character length must be smaller than or equal to 200.')
280
- end
281
-
282
- if !@import_payee_name_original.nil? && @import_payee_name_original.to_s.length > 200
283
- invalid_properties.push('invalid value for "import_payee_name_original", the character length must be smaller than or equal to 200.')
284
- end
285
-
286
287
  if @deleted.nil?
287
288
  invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
288
289
  end
@@ -311,8 +312,8 @@ module YNAB
311
312
  flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
312
313
  return false unless flag_color_validator.valid?(@flag_color)
313
314
  return false if @account_id.nil?
314
- return false if !@import_payee_name.nil? && @import_payee_name.to_s.length > 200
315
- return false if !@import_payee_name_original.nil? && @import_payee_name_original.to_s.length > 200
315
+ debt_transaction_type_validator = EnumAttributeValidator.new('String', ['payment', 'refund', 'fee', 'interest', 'escrow', 'balancedAdjustment', 'credit', 'charge'])
316
+ return false unless debt_transaction_type_validator.valid?(@debt_transaction_type)
316
317
  return false if @deleted.nil?
317
318
  return false if @type.nil?
318
319
  type_validator = EnumAttributeValidator.new('String', ['transaction', 'subtransaction'])
@@ -333,24 +334,10 @@ module YNAB
333
334
  @flag_color = flag_color
334
335
  end
335
336
 
336
- # Custom attribute writer method with validation
337
- # @param [Object] import_payee_name Value to be assigned
338
- def import_payee_name=(import_payee_name)
339
- if !import_payee_name.nil? && import_payee_name.to_s.length > 200
340
- fail ArgumentError, 'invalid value for "import_payee_name", the character length must be smaller than or equal to 200.'
341
- end
342
-
343
- @import_payee_name = import_payee_name
344
- end
345
-
346
- # Custom attribute writer method with validation
347
- # @param [Object] import_payee_name_original Value to be assigned
348
- def import_payee_name_original=(import_payee_name_original)
349
- if !import_payee_name_original.nil? && import_payee_name_original.to_s.length > 200
350
- fail ArgumentError, 'invalid value for "import_payee_name_original", the character length must be smaller than or equal to 200.'
351
- end
352
-
353
- @import_payee_name_original = import_payee_name_original
337
+ # Custom attribute writer method checking allowed values (enum).
338
+ # @param [Object] debt_transaction_type Object to be assigned
339
+ def debt_transaction_type=(debt_transaction_type)
340
+ @debt_transaction_type = debt_transaction_type
354
341
  end
355
342
 
356
343
  # Custom attribute writer method checking allowed values (enum).
@@ -380,6 +367,7 @@ module YNAB
380
367
  import_id == o.import_id &&
381
368
  import_payee_name == o.import_payee_name &&
382
369
  import_payee_name_original == o.import_payee_name_original &&
370
+ debt_transaction_type == o.debt_transaction_type &&
383
371
  deleted == o.deleted &&
384
372
  type == o.type &&
385
373
  parent_transaction_id == o.parent_transaction_id &&
@@ -397,7 +385,7 @@ module YNAB
397
385
  # Calculates hash code according to all attributes.
398
386
  # @return [Fixnum] Hash code
399
387
  def hash
400
- [id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, deleted, type, parent_transaction_id, account_name, payee_name, category_name].hash
388
+ [id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted, type, parent_transaction_id, account_name, payee_name, category_name].hash
401
389
  end
402
390
  # Builds the object from hash
403
391
  # @param [Hash] attributes Model attributes in the form of hash
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #YNAB API Endpoints
3
+
4
+ #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module YNAB
16
+ class LoanAccountPeriodicValue
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+ end
37
+
38
+ # Show invalid properties with the reasons. Usually used together with valid?
39
+ # @return Array for valid properties with the reasons
40
+ def list_invalid_properties
41
+ invalid_properties = Array.new
42
+ invalid_properties
43
+ end
44
+
45
+ # Check to see if the all the properties in the model are valid
46
+ # @return true if the model is valid
47
+ def valid?
48
+ true
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] Object to be compared
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class
56
+ end
57
+
58
+ # @see the `==` method
59
+ # @param [Object] Object to be compared
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculates hash code according to all attributes.
65
+ # @return [Fixnum] Hash code
66
+ def hash
67
+ [].hash
68
+ end
69
+ # Builds the object from hash
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ # @return [Object] Returns the model itself
72
+ def build_from_hash(attributes)
73
+ return nil unless attributes.is_a?(Hash)
74
+ self.class.swagger_types.each_pair do |key, type|
75
+ if type =~ /\AArray<(.*)>/i
76
+ # check to ensure the input is an array given that the attribute
77
+ # is documented as an array but the input is not
78
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
79
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
80
+ end
81
+ elsif !attributes[self.class.attribute_map[key]].nil?
82
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
83
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
84
+ end
85
+
86
+ self
87
+ end
88
+
89
+ # Deserializes the data based on type
90
+ # @param string type Data type
91
+ # @param string value Value to be deserialized
92
+ # @return [Object] Deserialized data
93
+ def _deserialize(type, value)
94
+ case type.to_sym
95
+ when :DateTime
96
+ DateTime.parse(value)
97
+ when :Date
98
+ Date.parse(value)
99
+ when :String
100
+ value.to_s
101
+ when :Integer
102
+ value.to_i
103
+ when :Float
104
+ value.to_f
105
+ when :BOOLEAN
106
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
107
+ true
108
+ else
109
+ false
110
+ end
111
+ when :Object
112
+ # generic object (usually a Hash), return directly
113
+ value
114
+ when /\AArray<(?<inner_type>.+)>\z/
115
+ inner_type = Regexp.last_match[:inner_type]
116
+ value.map { |v| _deserialize(inner_type, v) }
117
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
118
+ k_type = Regexp.last_match[:k_type]
119
+ v_type = Regexp.last_match[:v_type]
120
+ {}.tap do |hash|
121
+ value.each do |k, v|
122
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
123
+ end
124
+ end
125
+ else # model
126
+ temp_model = YNAB.const_get(type).new
127
+ temp_model.build_from_hash(value)
128
+ end
129
+ end
130
+
131
+ # Returns the string representation of the object
132
+ # @return [String] String presentation of the object
133
+ def to_s
134
+ to_hash.to_s
135
+ end
136
+
137
+ # to_body is an alias to to_hash (backward compatibility)
138
+ # @return [Hash] Returns the object in the form of hash
139
+ def to_body
140
+ to_hash
141
+ end
142
+
143
+ # Returns the object in the form of hash
144
+ # @return [Hash] Returns the object in the form of hash
145
+ def to_hash
146
+ hash = {}
147
+ self.class.attribute_map.each_pair do |attr, param|
148
+ value = self.send(attr)
149
+ next if value.nil?
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ # Outputs non-array value in the form of hash
156
+ # For object, use to_hash. Otherwise, just return the value
157
+ # @param [Object] value Any valid value
158
+ # @return [Hash] Returns the value in the form of hash
159
+ def _to_hash(value)
160
+ if value.is_a?(Array)
161
+ value.compact.map { |v| _to_hash(v) }
162
+ elsif value.is_a?(Hash)
163
+ {}.tap do |hash|
164
+ value.each { |k, v| hash[k] = _to_hash(v) }
165
+ end
166
+ elsif value.respond_to? :to_hash
167
+ value.to_hash
168
+ else
169
+ value
170
+ end
171
+ end
172
+
173
+ end
174
+
175
+ end
@@ -57,6 +57,9 @@ module YNAB
57
57
  # If the transaction was imported, the original payee name as it appeared on the statement
58
58
  attr_accessor :import_payee_name_original
59
59
 
60
+ # If the transaction is a debt/loan account transaction, the type of transaction
61
+ attr_accessor :debt_transaction_type
62
+
60
63
  # Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests.
61
64
  attr_accessor :deleted
62
65
 
@@ -110,6 +113,7 @@ module YNAB
110
113
  :'import_id' => :'import_id',
111
114
  :'import_payee_name' => :'import_payee_name',
112
115
  :'import_payee_name_original' => :'import_payee_name_original',
116
+ :'debt_transaction_type' => :'debt_transaction_type',
113
117
  :'deleted' => :'deleted',
114
118
  :'account_name' => :'account_name',
115
119
  :'payee_name' => :'payee_name',
@@ -137,6 +141,7 @@ module YNAB
137
141
  :'import_id' => :'String',
138
142
  :'import_payee_name' => :'String',
139
143
  :'import_payee_name_original' => :'String',
144
+ :'debt_transaction_type' => :'String',
140
145
  :'deleted' => :'BOOLEAN',
141
146
  :'account_name' => :'String',
142
147
  :'payee_name' => :'String',
@@ -217,6 +222,10 @@ module YNAB
217
222
  self.import_payee_name_original = attributes[:'import_payee_name_original']
218
223
  end
219
224
 
225
+ if attributes.has_key?(:'debt_transaction_type')
226
+ self.debt_transaction_type = attributes[:'debt_transaction_type']
227
+ end
228
+
220
229
  if attributes.has_key?(:'deleted')
221
230
  self.deleted = attributes[:'deleted']
222
231
  end
@@ -268,14 +277,6 @@ module YNAB
268
277
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
269
278
  end
270
279
 
271
- if !@import_payee_name.nil? && @import_payee_name.to_s.length > 200
272
- invalid_properties.push('invalid value for "import_payee_name", the character length must be smaller than or equal to 200.')
273
- end
274
-
275
- if !@import_payee_name_original.nil? && @import_payee_name_original.to_s.length > 200
276
- invalid_properties.push('invalid value for "import_payee_name_original", the character length must be smaller than or equal to 200.')
277
- end
278
-
279
280
  if @deleted.nil?
280
281
  invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
281
282
  end
@@ -304,8 +305,8 @@ module YNAB
304
305
  flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
305
306
  return false unless flag_color_validator.valid?(@flag_color)
306
307
  return false if @account_id.nil?
307
- return false if !@import_payee_name.nil? && @import_payee_name.to_s.length > 200
308
- return false if !@import_payee_name_original.nil? && @import_payee_name_original.to_s.length > 200
308
+ debt_transaction_type_validator = EnumAttributeValidator.new('String', ['payment', 'refund', 'fee', 'interest', 'escrow', 'balancedAdjustment', 'credit', 'charge'])
309
+ return false unless debt_transaction_type_validator.valid?(@debt_transaction_type)
309
310
  return false if @deleted.nil?
310
311
  return false if @account_name.nil?
311
312
  return false if @subtransactions.nil?
@@ -324,24 +325,10 @@ module YNAB
324
325
  @flag_color = flag_color
325
326
  end
326
327
 
327
- # Custom attribute writer method with validation
328
- # @param [Object] import_payee_name Value to be assigned
329
- def import_payee_name=(import_payee_name)
330
- if !import_payee_name.nil? && import_payee_name.to_s.length > 200
331
- fail ArgumentError, 'invalid value for "import_payee_name", the character length must be smaller than or equal to 200.'
332
- end
333
-
334
- @import_payee_name = import_payee_name
335
- end
336
-
337
- # Custom attribute writer method with validation
338
- # @param [Object] import_payee_name_original Value to be assigned
339
- def import_payee_name_original=(import_payee_name_original)
340
- if !import_payee_name_original.nil? && import_payee_name_original.to_s.length > 200
341
- fail ArgumentError, 'invalid value for "import_payee_name_original", the character length must be smaller than or equal to 200.'
342
- end
343
-
344
- @import_payee_name_original = import_payee_name_original
328
+ # Custom attribute writer method checking allowed values (enum).
329
+ # @param [Object] debt_transaction_type Object to be assigned
330
+ def debt_transaction_type=(debt_transaction_type)
331
+ @debt_transaction_type = debt_transaction_type
345
332
  end
346
333
 
347
334
  # Checks equality by comparing each attribute.
@@ -365,6 +352,7 @@ module YNAB
365
352
  import_id == o.import_id &&
366
353
  import_payee_name == o.import_payee_name &&
367
354
  import_payee_name_original == o.import_payee_name_original &&
355
+ debt_transaction_type == o.debt_transaction_type &&
368
356
  deleted == o.deleted &&
369
357
  account_name == o.account_name &&
370
358
  payee_name == o.payee_name &&
@@ -381,7 +369,7 @@ module YNAB
381
369
  # Calculates hash code according to all attributes.
382
370
  # @return [Fixnum] Hash code
383
371
  def hash
384
- [id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, deleted, account_name, payee_name, category_name, subtransactions].hash
372
+ [id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted, account_name, payee_name, category_name, subtransactions].hash
385
373
  end
386
374
  # Builds the object from hash
387
375
  # @param [Hash] attributes Model attributes in the form of hash
@@ -57,6 +57,9 @@ module YNAB
57
57
  # If the transaction was imported, the original payee name as it appeared on the statement
58
58
  attr_accessor :import_payee_name_original
59
59
 
60
+ # If the transaction is a debt/loan account transaction, the type of transaction
61
+ attr_accessor :debt_transaction_type
62
+
60
63
  # Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests.
61
64
  attr_accessor :deleted
62
65
 
@@ -101,6 +104,7 @@ module YNAB
101
104
  :'import_id' => :'import_id',
102
105
  :'import_payee_name' => :'import_payee_name',
103
106
  :'import_payee_name_original' => :'import_payee_name_original',
107
+ :'debt_transaction_type' => :'debt_transaction_type',
104
108
  :'deleted' => :'deleted'
105
109
  }
106
110
  end
@@ -124,6 +128,7 @@ module YNAB
124
128
  :'import_id' => :'String',
125
129
  :'import_payee_name' => :'String',
126
130
  :'import_payee_name_original' => :'String',
131
+ :'debt_transaction_type' => :'String',
127
132
  :'deleted' => :'BOOLEAN'
128
133
  }
129
134
  end
@@ -200,6 +205,10 @@ module YNAB
200
205
  self.import_payee_name_original = attributes[:'import_payee_name_original']
201
206
  end
202
207
 
208
+ if attributes.has_key?(:'debt_transaction_type')
209
+ self.debt_transaction_type = attributes[:'debt_transaction_type']
210
+ end
211
+
203
212
  if attributes.has_key?(:'deleted')
204
213
  self.deleted = attributes[:'deleted']
205
214
  end
@@ -233,14 +242,6 @@ module YNAB
233
242
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
234
243
  end
235
244
 
236
- if !@import_payee_name.nil? && @import_payee_name.to_s.length > 200
237
- invalid_properties.push('invalid value for "import_payee_name", the character length must be smaller than or equal to 200.')
238
- end
239
-
240
- if !@import_payee_name_original.nil? && @import_payee_name_original.to_s.length > 200
241
- invalid_properties.push('invalid value for "import_payee_name_original", the character length must be smaller than or equal to 200.')
242
- end
243
-
244
245
  if @deleted.nil?
245
246
  invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
246
247
  end
@@ -261,8 +262,8 @@ module YNAB
261
262
  flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
262
263
  return false unless flag_color_validator.valid?(@flag_color)
263
264
  return false if @account_id.nil?
264
- return false if !@import_payee_name.nil? && @import_payee_name.to_s.length > 200
265
- return false if !@import_payee_name_original.nil? && @import_payee_name_original.to_s.length > 200
265
+ debt_transaction_type_validator = EnumAttributeValidator.new('String', ['payment', 'refund', 'fee', 'interest', 'escrow', 'balancedAdjustment', 'credit', 'charge'])
266
+ return false unless debt_transaction_type_validator.valid?(@debt_transaction_type)
266
267
  return false if @deleted.nil?
267
268
  true
268
269
  end
@@ -279,24 +280,10 @@ module YNAB
279
280
  @flag_color = flag_color
280
281
  end
281
282
 
282
- # Custom attribute writer method with validation
283
- # @param [Object] import_payee_name Value to be assigned
284
- def import_payee_name=(import_payee_name)
285
- if !import_payee_name.nil? && import_payee_name.to_s.length > 200
286
- fail ArgumentError, 'invalid value for "import_payee_name", the character length must be smaller than or equal to 200.'
287
- end
288
-
289
- @import_payee_name = import_payee_name
290
- end
291
-
292
- # Custom attribute writer method with validation
293
- # @param [Object] import_payee_name_original Value to be assigned
294
- def import_payee_name_original=(import_payee_name_original)
295
- if !import_payee_name_original.nil? && import_payee_name_original.to_s.length > 200
296
- fail ArgumentError, 'invalid value for "import_payee_name_original", the character length must be smaller than or equal to 200.'
297
- end
298
-
299
- @import_payee_name_original = import_payee_name_original
283
+ # Custom attribute writer method checking allowed values (enum).
284
+ # @param [Object] debt_transaction_type Object to be assigned
285
+ def debt_transaction_type=(debt_transaction_type)
286
+ @debt_transaction_type = debt_transaction_type
300
287
  end
301
288
 
302
289
  # Checks equality by comparing each attribute.
@@ -320,6 +307,7 @@ module YNAB
320
307
  import_id == o.import_id &&
321
308
  import_payee_name == o.import_payee_name &&
322
309
  import_payee_name_original == o.import_payee_name_original &&
310
+ debt_transaction_type == o.debt_transaction_type &&
323
311
  deleted == o.deleted
324
312
  end
325
313
 
@@ -332,7 +320,7 @@ module YNAB
332
320
  # Calculates hash code according to all attributes.
333
321
  # @return [Fixnum] Hash code
334
322
  def hash
335
- [id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, deleted].hash
323
+ [id, date, amount, memo, cleared, approved, flag_color, account_id, payee_id, category_id, transfer_account_id, transfer_transaction_id, matched_transaction_id, import_id, import_payee_name, import_payee_name_original, debt_transaction_type, deleted].hash
336
324
  end
337
325
  # Builds the object from hash
338
326
  # @param [Hash] attributes Model attributes in the form of hash
data/lib/ynab/version.rb CHANGED
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module YNAB
14
- VERSION = '1.27.0'
14
+ VERSION = '1.29.0'
15
15
  end
data/lib/ynab.rb CHANGED
@@ -47,6 +47,7 @@ require 'ynab/models/error_detail'
47
47
  require 'ynab/models/error_response'
48
48
  require 'ynab/models/hybrid_transactions_response'
49
49
  require 'ynab/models/hybrid_transactions_response_data'
50
+ require 'ynab/models/loan_account_periodic_value'
50
51
  require 'ynab/models/month_detail_response'
51
52
  require 'ynab/models/month_detail_response_data'
52
53
  require 'ynab/models/month_summaries_response'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ynab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.0
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - You Need A Budget, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -146,6 +146,7 @@ files:
146
146
  - lib/ynab/models/hybrid_transaction.rb
147
147
  - lib/ynab/models/hybrid_transactions_response.rb
148
148
  - lib/ynab/models/hybrid_transactions_response_data.rb
149
+ - lib/ynab/models/loan_account_periodic_value.rb
149
150
  - lib/ynab/models/month_detail.rb
150
151
  - lib/ynab/models/month_detail_response.rb
151
152
  - lib/ynab/models/month_detail_response_data.rb
@@ -269,54 +270,54 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
270
  - !ruby/object:Gem::Version
270
271
  version: '0'
271
272
  requirements: []
272
- rubygems_version: 3.4.4
273
+ rubygems_version: 3.4.7
273
274
  signing_key:
274
275
  specification_version: 4
275
276
  summary: YNAB API Endpoints Ruby Gem
276
277
  test_files:
277
- - spec/api/scheduled_transactions_spec.rb
278
- - spec/api/payees_spec.rb
279
- - spec/api/categories_spec.rb
280
- - spec/api/budgets_spec.rb
281
- - spec/api/accounts_spec.rb
282
278
  - spec/api/transactions_spec.rb
279
+ - spec/api/budgets_spec.rb
280
+ - spec/api/payees_spec.rb
283
281
  - spec/api/months_spec.rb
284
282
  - spec/api/payee_locations_spec.rb
283
+ - spec/api/accounts_spec.rb
284
+ - spec/api/categories_spec.rb
285
+ - spec/api/scheduled_transactions_spec.rb
285
286
  - spec/api_error_spec.rb
286
- - spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml
287
- - spec/fixtures/vcr_cassettes/multiple_transactions.yml
287
+ - spec/fixtures/vcr_cassettes/create_transaction.yml
288
288
  - spec/fixtures/vcr_cassettes/bulk_transactions.yml
289
- - spec/fixtures/vcr_cassettes/categories.yml
290
- - spec/fixtures/vcr_cassettes/categories_unauthorized.yml
291
289
  - spec/fixtures/vcr_cassettes/payees.yml
292
- - spec/fixtures/vcr_cassettes/update_transactions.yml
293
- - spec/fixtures/vcr_cassettes/create_account.yml
290
+ - spec/fixtures/vcr_cassettes/multiple_transactions.yml
291
+ - spec/fixtures/vcr_cassettes/transaction.yml
292
+ - spec/fixtures/vcr_cassettes/month.yml
293
+ - spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml
294
+ - spec/fixtures/vcr_cassettes/scheduled_transactions.yml
295
+ - spec/fixtures/vcr_cassettes/account.yml
296
+ - spec/fixtures/vcr_cassettes/transactions.yml
294
297
  - spec/fixtures/vcr_cassettes/budget.yml
295
- - spec/fixtures/vcr_cassettes/transactions_unauthorized.yml
298
+ - spec/fixtures/vcr_cassettes/payee_transactions.yml
296
299
  - spec/fixtures/vcr_cassettes/payee_location.yml
297
- - spec/fixtures/vcr_cassettes/scheduled_transactions.yml
298
- - spec/fixtures/vcr_cassettes/create_transaction.yml
299
- - spec/fixtures/vcr_cassettes/patch_month_category.yml
300
- - spec/fixtures/vcr_cassettes/create_transactions.yml
301
- - spec/fixtures/vcr_cassettes/budgets_unauthorized.yml
302
- - spec/fixtures/vcr_cassettes/month.yml
303
- - spec/fixtures/vcr_cassettes/months.yml
300
+ - spec/fixtures/vcr_cassettes/budgets.yml
301
+ - spec/fixtures/vcr_cassettes/category.yml
302
+ - spec/fixtures/vcr_cassettes/payee.yml
304
303
  - spec/fixtures/vcr_cassettes/category_transactions.yml
305
- - spec/fixtures/vcr_cassettes/update_transaction.yml
306
- - spec/fixtures/vcr_cassettes/transaction.yml
307
- - spec/fixtures/vcr_cassettes/scheduled_transaction.yml
304
+ - spec/fixtures/vcr_cassettes/months.yml
305
+ - spec/fixtures/vcr_cassettes/transactions_unauthorized.yml
308
306
  - spec/fixtures/vcr_cassettes/payee_locations.yml
309
- - spec/fixtures/vcr_cassettes/months_unauthorized.yml
307
+ - spec/fixtures/vcr_cassettes/categories_unauthorized.yml
308
+ - spec/fixtures/vcr_cassettes/update_transactions.yml
310
309
  - spec/fixtures/vcr_cassettes/accounts_unauthorized.yml
311
- - spec/fixtures/vcr_cassettes/transactions.yml
312
- - spec/fixtures/vcr_cassettes/account.yml
310
+ - spec/fixtures/vcr_cassettes/patch_month_category.yml
311
+ - spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml
312
+ - spec/fixtures/vcr_cassettes/months_unauthorized.yml
313
+ - spec/fixtures/vcr_cassettes/create_transactions.yml
313
314
  - spec/fixtures/vcr_cassettes/accounts.yml
315
+ - spec/fixtures/vcr_cassettes/update_transaction.yml
314
316
  - spec/fixtures/vcr_cassettes/payees_unauthorized.yml
315
- - spec/fixtures/vcr_cassettes/payee.yml
316
- - spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml
317
- - spec/fixtures/vcr_cassettes/payee_transactions.yml
318
317
  - spec/fixtures/vcr_cassettes/import_transactions.yml
319
- - spec/fixtures/vcr_cassettes/category.yml
320
- - spec/fixtures/vcr_cassettes/budgets.yml
318
+ - spec/fixtures/vcr_cassettes/categories.yml
319
+ - spec/fixtures/vcr_cassettes/create_account.yml
320
+ - spec/fixtures/vcr_cassettes/budgets_unauthorized.yml
321
+ - spec/fixtures/vcr_cassettes/scheduled_transaction.yml
321
322
  - spec/models/transaction_detail_spec.rb
322
323
  - spec/spec_helper.rb