ynab 1.14.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/ynab.rb +11 -8
  4. data/lib/ynab/api/accounts_api.rb +3 -3
  5. data/lib/ynab/api/budgets_api.rb +6 -3
  6. data/lib/ynab/api/categories_api.rb +7 -7
  7. data/lib/ynab/api/deprecated_api.rb +1 -1
  8. data/lib/ynab/api/months_api.rb +3 -3
  9. data/lib/ynab/api/payee_locations_api.rb +1 -1
  10. data/lib/ynab/api/payees_api.rb +3 -3
  11. data/lib/ynab/api/scheduled_transactions_api.rb +3 -3
  12. data/lib/ynab/api/transactions_api.rb +77 -25
  13. data/lib/ynab/api/user_api.rb +1 -1
  14. data/lib/ynab/api_client.rb +3 -2
  15. data/lib/ynab/configuration.rb +2 -3
  16. data/lib/ynab/models/account.rb +4 -12
  17. data/lib/ynab/models/account_response.rb +4 -3
  18. data/lib/ynab/models/account_response_data.rb +4 -3
  19. data/lib/ynab/models/accounts_response.rb +4 -3
  20. data/lib/ynab/models/accounts_response_data.rb +4 -3
  21. data/lib/ynab/models/budget_detail.rb +4 -3
  22. data/lib/ynab/models/budget_detail_response.rb +4 -3
  23. data/lib/ynab/models/budget_detail_response_data.rb +4 -3
  24. data/lib/ynab/models/budget_settings.rb +4 -3
  25. data/lib/ynab/models/budget_settings_response.rb +4 -3
  26. data/lib/ynab/models/budget_settings_response_data.rb +4 -3
  27. data/lib/ynab/models/budget_summary.rb +20 -7
  28. data/lib/ynab/models/budget_summary_response.rb +4 -3
  29. data/lib/ynab/models/budget_summary_response_data.rb +4 -3
  30. data/lib/ynab/models/bulk_response.rb +4 -3
  31. data/lib/ynab/models/bulk_response_data.rb +4 -3
  32. data/lib/ynab/models/bulk_response_data_bulk.rb +5 -4
  33. data/lib/ynab/models/bulk_transactions.rb +4 -3
  34. data/lib/ynab/models/categories_response.rb +4 -3
  35. data/lib/ynab/models/categories_response_data.rb +4 -3
  36. data/lib/ynab/models/category.rb +6 -39
  37. data/lib/ynab/models/category_group.rb +4 -3
  38. data/lib/ynab/models/category_group_with_categories.rb +4 -3
  39. data/lib/ynab/models/category_response.rb +4 -3
  40. data/lib/ynab/models/category_response_data.rb +4 -3
  41. data/lib/ynab/models/currency_format.rb +4 -3
  42. data/lib/ynab/models/date_format.rb +4 -3
  43. data/lib/ynab/models/error_detail.rb +4 -3
  44. data/lib/ynab/models/error_response.rb +4 -3
  45. data/lib/ynab/models/hybrid_transaction.rb +4 -15
  46. data/lib/ynab/models/hybrid_transactions_response.rb +4 -3
  47. data/lib/ynab/models/hybrid_transactions_response_data.rb +4 -3
  48. data/lib/ynab/models/month_detail.rb +6 -5
  49. data/lib/ynab/models/month_detail_response.rb +4 -3
  50. data/lib/ynab/models/month_detail_response_data.rb +4 -3
  51. data/lib/ynab/models/month_summaries_response.rb +4 -3
  52. data/lib/ynab/models/month_summaries_response_data.rb +4 -3
  53. data/lib/ynab/models/month_summary.rb +6 -5
  54. data/lib/ynab/models/payee.rb +5 -4
  55. data/lib/ynab/models/payee_location.rb +4 -3
  56. data/lib/ynab/models/payee_location_response.rb +4 -3
  57. data/lib/ynab/models/payee_location_response_data.rb +4 -3
  58. data/lib/ynab/models/payee_locations_response.rb +4 -3
  59. data/lib/ynab/models/payee_locations_response_data.rb +4 -3
  60. data/lib/ynab/models/payee_response.rb +4 -3
  61. data/lib/ynab/models/payee_response_data.rb +4 -3
  62. data/lib/ynab/models/payees_response.rb +4 -3
  63. data/lib/ynab/models/payees_response_data.rb +4 -3
  64. data/lib/ynab/models/save_category_response.rb +4 -3
  65. data/lib/ynab/models/save_category_response_data.rb +4 -3
  66. data/lib/ynab/models/save_month_category.rb +4 -3
  67. data/lib/ynab/models/save_month_category_wrapper.rb +4 -3
  68. data/lib/ynab/models/save_sub_transaction.rb +259 -0
  69. data/lib/ynab/models/save_transaction.rb +24 -19
  70. data/lib/ynab/models/save_transaction_wrapper.rb +4 -3
  71. data/lib/ynab/models/save_transactions_response.rb +4 -3
  72. data/lib/ynab/models/save_transactions_response_data.rb +5 -4
  73. data/lib/ynab/models/save_transactions_wrapper.rb +4 -3
  74. data/lib/ynab/models/scheduled_sub_transaction.rb +4 -3
  75. data/lib/ynab/models/scheduled_transaction_detail.rb +4 -11
  76. data/lib/ynab/models/scheduled_transaction_response.rb +4 -3
  77. data/lib/ynab/models/scheduled_transaction_response_data.rb +4 -3
  78. data/lib/ynab/models/scheduled_transaction_summary.rb +4 -11
  79. data/lib/ynab/models/scheduled_transactions_response.rb +4 -3
  80. data/lib/ynab/models/scheduled_transactions_response_data.rb +4 -3
  81. data/lib/ynab/models/sub_transaction.rb +33 -4
  82. data/lib/ynab/models/transaction_detail.rb +4 -11
  83. data/lib/ynab/models/transaction_response.rb +4 -3
  84. data/lib/ynab/models/transaction_response_data.rb +4 -3
  85. data/lib/ynab/models/transaction_summary.rb +4 -11
  86. data/lib/ynab/models/transactions_import_response.rb +189 -0
  87. data/lib/ynab/models/transactions_import_response_data.rb +192 -0
  88. data/lib/ynab/models/transactions_response.rb +4 -3
  89. data/lib/ynab/models/transactions_response_data.rb +4 -3
  90. data/lib/ynab/models/update_transaction.rb +18 -27
  91. data/lib/ynab/models/update_transactions_wrapper.rb +4 -3
  92. data/lib/ynab/models/user.rb +4 -3
  93. data/lib/ynab/models/user_response.rb +4 -3
  94. data/lib/ynab/models/user_response_data.rb +4 -3
  95. data/lib/ynab/version.rb +1 -1
  96. data/spec/api/transactions_spec.rb +11 -0
  97. data/spec/fixtures/vcr_cassettes/import_transactions.yml +50 -0
  98. data/spec/models/transaction_detail_spec.rb +11 -0
  99. metadata +22 -15
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -80,7 +80,6 @@ module YNAB
80
80
  def hash
81
81
  [data].hash
82
82
  end
83
-
84
83
  # Builds the object from hash
85
84
  # @param [Hash] attributes Model attributes in the form of hash
86
85
  # @return [Object] Returns the model itself
@@ -88,7 +87,7 @@ module YNAB
88
87
  return nil unless attributes.is_a?(Hash)
89
88
  self.class.swagger_types.each_pair do |key, type|
90
89
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
90
+ # check to ensure the input is an array given that the attribute
92
91
  # is documented as an array but the input is not
93
92
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
93
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +183,7 @@ module YNAB
184
183
  value
185
184
  end
186
185
  end
186
+
187
187
  end
188
+
188
189
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -97,7 +97,6 @@ module YNAB
97
97
  def hash
98
98
  [transactions, server_knowledge].hash
99
99
  end
100
-
101
100
  # Builds the object from hash
102
101
  # @param [Hash] attributes Model attributes in the form of hash
103
102
  # @return [Object] Returns the model itself
@@ -105,7 +104,7 @@ module YNAB
105
104
  return nil unless attributes.is_a?(Hash)
106
105
  self.class.swagger_types.each_pair do |key, type|
107
106
  if type =~ /\AArray<(.*)>/i
108
- # check to ensure the input is an array given that the the attribute
107
+ # check to ensure the input is an array given that the attribute
109
108
  # is documented as an array but the input is not
110
109
  if attributes[self.class.attribute_map[key]].is_a?(Array)
111
110
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -201,5 +200,7 @@ module YNAB
201
200
  value
202
201
  end
203
202
  end
203
+
204
204
  end
205
+
205
206
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -22,13 +22,13 @@ module YNAB
22
22
  # The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored.
23
23
  attr_accessor :amount
24
24
 
25
- # The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as tranfer_payee_id on the account resource.
25
+ # The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `tranfer_payee_id` on the account resource.
26
26
  attr_accessor :payee_id
27
27
 
28
- # The payee name. If a payee_name value is provided and payee_id has a null value, the payee_name value will be used to resolve the payee by either (1) a matching payee rename rule (only if import_id is also specified) or (2) a payee with the same name or (3) creation of a new payee.
28
+ # The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee.
29
29
  attr_accessor :payee_name
30
30
 
31
- # The category for the transaction. Split and Credit Card Payment categories are not permitted and will be ignored if supplied. If an existing transaction has a Split category it cannot be changed.
31
+ # The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied.
32
32
  attr_accessor :category_id
33
33
 
34
34
  attr_accessor :memo
@@ -42,10 +42,11 @@ module YNAB
42
42
  # The transaction flag
43
43
  attr_accessor :flag_color
44
44
 
45
- # If specified, the new transaction will be assigned this import_id and considered \"imported\". We will also attempt to match this imported transaction to an existing \"user-entered\" transation on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a \"user-entered\" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API).
45
+ # If specified, the new transaction will be assigned this `import_id` and considered \"imported\". We will also attempt to match this imported transaction to an existing \"user-entered\" transation on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a \"user-entered\" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API).
46
46
  attr_accessor :import_id
47
47
 
48
- attr_accessor :id
48
+ # An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.
49
+ attr_accessor :subtransactions
49
50
 
50
51
  class EnumAttributeValidator
51
52
  attr_reader :datatype
@@ -83,7 +84,7 @@ module YNAB
83
84
  :'approved' => :'approved',
84
85
  :'flag_color' => :'flag_color',
85
86
  :'import_id' => :'import_id',
86
- :'id' => :'id'
87
+ :'subtransactions' => :'subtransactions'
87
88
  }
88
89
  end
89
90
 
@@ -101,7 +102,7 @@ module YNAB
101
102
  :'approved' => :'BOOLEAN',
102
103
  :'flag_color' => :'String',
103
104
  :'import_id' => :'String',
104
- :'id' => :'String'
105
+ :'subtransactions' => :'Array<SaveSubTransaction>'
105
106
  }
106
107
  end
107
108
 
@@ -157,8 +158,10 @@ module YNAB
157
158
  self.import_id = attributes[:'import_id']
158
159
  end
159
160
 
160
- if attributes.has_key?(:'id')
161
- self.id = attributes[:'id']
161
+ if attributes.has_key?(:'subtransactions')
162
+ if (value = attributes[:'subtransactions']).is_a?(Array)
163
+ self.subtransactions = value
164
+ end
162
165
  end
163
166
  end
164
167
 
@@ -190,10 +193,6 @@ module YNAB
190
193
  invalid_properties.push('invalid value for "import_id", the character length must be smaller than or equal to 36.')
191
194
  end
192
195
 
193
- if @id.nil?
194
- invalid_properties.push('invalid value for "id", id cannot be nil.')
195
- end
196
-
197
196
  invalid_properties
198
197
  end
199
198
 
@@ -210,7 +209,6 @@ module YNAB
210
209
  flag_color_validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
211
210
  return false unless flag_color_validator.valid?(@flag_color)
212
211
  return false if !@import_id.nil? && @import_id.to_s.length > 36
213
- return false if @id.nil?
214
212
  true
215
213
  end
216
214
 
@@ -237,20 +235,12 @@ module YNAB
237
235
  # Custom attribute writer method checking allowed values (enum).
238
236
  # @param [Object] cleared Object to be assigned
239
237
  def cleared=(cleared)
240
- validator = EnumAttributeValidator.new('String', ['cleared', 'uncleared', 'reconciled'])
241
- unless validator.valid?(cleared)
242
- fail ArgumentError, 'invalid value for "cleared", must be one of #{validator.allowable_values}.'
243
- end
244
238
  @cleared = cleared
245
239
  end
246
240
 
247
241
  # Custom attribute writer method checking allowed values (enum).
248
242
  # @param [Object] flag_color Object to be assigned
249
243
  def flag_color=(flag_color)
250
- validator = EnumAttributeValidator.new('String', ['red', 'orange', 'yellow', 'green', 'blue', 'purple'])
251
- unless validator.valid?(flag_color)
252
- fail ArgumentError, 'invalid value for "flag_color", must be one of #{validator.allowable_values}.'
253
- end
254
244
  @flag_color = flag_color
255
245
  end
256
246
 
@@ -280,7 +270,7 @@ module YNAB
280
270
  approved == o.approved &&
281
271
  flag_color == o.flag_color &&
282
272
  import_id == o.import_id &&
283
- id == o.id
273
+ subtransactions == o.subtransactions
284
274
  end
285
275
 
286
276
  # @see the `==` method
@@ -292,9 +282,8 @@ module YNAB
292
282
  # Calculates hash code according to all attributes.
293
283
  # @return [Fixnum] Hash code
294
284
  def hash
295
- [account_id, date, amount, payee_id, payee_name, category_id, memo, cleared, approved, flag_color, import_id, id].hash
285
+ [account_id, date, amount, payee_id, payee_name, category_id, memo, cleared, approved, flag_color, import_id, subtransactions].hash
296
286
  end
297
-
298
287
  # Builds the object from hash
299
288
  # @param [Hash] attributes Model attributes in the form of hash
300
289
  # @return [Object] Returns the model itself
@@ -302,7 +291,7 @@ module YNAB
302
291
  return nil unless attributes.is_a?(Hash)
303
292
  self.class.swagger_types.each_pair do |key, type|
304
293
  if type =~ /\AArray<(.*)>/i
305
- # check to ensure the input is an array given that the the attribute
294
+ # check to ensure the input is an array given that the attribute
306
295
  # is documented as an array but the input is not
307
296
  if attributes[self.class.attribute_map[key]].is_a?(Array)
308
297
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -398,5 +387,7 @@ module YNAB
398
387
  value
399
388
  end
400
389
  end
390
+
401
391
  end
392
+
402
393
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -82,7 +82,6 @@ module YNAB
82
82
  def hash
83
83
  [transactions].hash
84
84
  end
85
-
86
85
  # Builds the object from hash
87
86
  # @param [Hash] attributes Model attributes in the form of hash
88
87
  # @return [Object] Returns the model itself
@@ -90,7 +89,7 @@ module YNAB
90
89
  return nil unless attributes.is_a?(Hash)
91
90
  self.class.swagger_types.each_pair do |key, type|
92
91
  if type =~ /\AArray<(.*)>/i
93
- # check to ensure the input is an array given that the the attribute
92
+ # check to ensure the input is an array given that the attribute
94
93
  # is documented as an array but the input is not
95
94
  if attributes[self.class.attribute_map[key]].is_a?(Array)
96
95
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -186,5 +185,7 @@ module YNAB
186
185
  value
187
186
  end
188
187
  end
188
+
189
189
  end
190
+
190
191
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -80,7 +80,6 @@ module YNAB
80
80
  def hash
81
81
  [id].hash
82
82
  end
83
-
84
83
  # Builds the object from hash
85
84
  # @param [Hash] attributes Model attributes in the form of hash
86
85
  # @return [Object] Returns the model itself
@@ -88,7 +87,7 @@ module YNAB
88
87
  return nil unless attributes.is_a?(Hash)
89
88
  self.class.swagger_types.each_pair do |key, type|
90
89
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
90
+ # check to ensure the input is an array given that the attribute
92
91
  # is documented as an array but the input is not
93
92
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
93
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +183,7 @@ module YNAB
184
183
  value
185
184
  end
186
185
  end
186
+
187
187
  end
188
+
188
189
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -80,7 +80,6 @@ module YNAB
80
80
  def hash
81
81
  [data].hash
82
82
  end
83
-
84
83
  # Builds the object from hash
85
84
  # @param [Hash] attributes Model attributes in the form of hash
86
85
  # @return [Object] Returns the model itself
@@ -88,7 +87,7 @@ module YNAB
88
87
  return nil unless attributes.is_a?(Hash)
89
88
  self.class.swagger_types.each_pair do |key, type|
90
89
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
90
+ # check to ensure the input is an array given that the attribute
92
91
  # is documented as an array but the input is not
93
92
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
93
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +183,7 @@ module YNAB
184
183
  value
185
184
  end
186
185
  end
186
+
187
187
  end
188
+
188
189
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -80,7 +80,6 @@ module YNAB
80
80
  def hash
81
81
  [user].hash
82
82
  end
83
-
84
83
  # Builds the object from hash
85
84
  # @param [Hash] attributes Model attributes in the form of hash
86
85
  # @return [Object] Returns the model itself
@@ -88,7 +87,7 @@ module YNAB
88
87
  return nil unless attributes.is_a?(Hash)
89
88
  self.class.swagger_types.each_pair do |key, type|
90
89
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
90
+ # check to ensure the input is an array given that the attribute
92
91
  # is documented as an array but the input is not
93
92
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
93
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +183,7 @@ module YNAB
184
183
  value
185
184
  end
186
185
  end
186
+
187
187
  end
188
+
188
189
  end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module YNAB
14
- VERSION = '1.14.0'
14
+ VERSION = '1.19.0'
15
15
  end
@@ -188,6 +188,17 @@ describe 'transactions' do
188
188
  end
189
189
  end
190
190
 
191
+ describe 'POST /budgets/{budget_id}/transactions/import' do
192
+ it "import transactions" do
193
+ VCR.use_cassette("import_transactions") do
194
+ response = instance.import_transactions(budget_id)
195
+ expect(client.last_request.response.options[:code]).to be 201
196
+ expect(response.data.transaction_ids.length).to eq 1
197
+ expect(response.data.transaction_ids).to include '07b68f11-98bd-4184-8866-83268a654318'
198
+ end
199
+ end
200
+ end
201
+
191
202
  describe 'POST /budgets/{budget_id}/transactions/bulk' do
192
203
  it "bulk creations transactions" do
193
204
  VCR.use_cassette("bulk_transactions") do
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/import
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - api_client/ruby/1.17.0
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ Authorization:
17
+ - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045
18
+ Expect:
19
+ - ''
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ X-Content-Type-Options:
28
+ - nosniff
29
+ X-Frame-Options:
30
+ - deny
31
+ Vary:
32
+ - Accept-Encoding, Origin
33
+ ETag:
34
+ - W/"59dad611fef6101f6355d263fe3c332d"
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - b9d42c37-15d3-4c4c-98d3-7b33da03a745
39
+ X-Runtime:
40
+ - '0.518840'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"data":{"transaction_ids":["07b68f11-98bd-4184-8866-83268a654318"]}}'
46
+ http_version: '1.1'
47
+ adapter_metadata:
48
+ effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/import
49
+ recorded_at: Tue, 28 Apr 2020 19:10:16 GMT
50
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe YNAB::TransactionDetail do
4
+ subject(:transaction) { described_class.new() }
5
+
6
+ describe '#flag_color' do
7
+ it 'allows setting an unsupported value' do
8
+ expect { transaction.flag_color = 'invalidFlagName' }.not_to raise_error
9
+ end
10
+ end
11
+ end
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.14.0
4
+ version: 1.19.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: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -34,42 +34,42 @@ dependencies:
34
34
  name: json
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 2.1.0
40
37
  - - "~>"
41
38
  - !ruby/object:Gem::Version
42
39
  version: '2.1'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.1.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 2.1.0
50
47
  - - "~>"
51
48
  - !ruby/object:Gem::Version
52
49
  version: '2.1'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 2.1.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: 3.6.0
60
57
  - - "~>"
61
58
  - !ruby/object:Gem::Version
62
59
  version: '3.6'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 3.6.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: 3.6.0
70
67
  - - "~>"
71
68
  - !ruby/object:Gem::Version
72
69
  version: '3.6'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 3.6.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: vcr
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -165,6 +165,7 @@ files:
165
165
  - lib/ynab/models/save_category_response_data.rb
166
166
  - lib/ynab/models/save_month_category.rb
167
167
  - lib/ynab/models/save_month_category_wrapper.rb
168
+ - lib/ynab/models/save_sub_transaction.rb
168
169
  - lib/ynab/models/save_transaction.rb
169
170
  - lib/ynab/models/save_transaction_wrapper.rb
170
171
  - lib/ynab/models/save_transactions_response.rb
@@ -182,6 +183,8 @@ files:
182
183
  - lib/ynab/models/transaction_response.rb
183
184
  - lib/ynab/models/transaction_response_data.rb
184
185
  - lib/ynab/models/transaction_summary.rb
186
+ - lib/ynab/models/transactions_import_response.rb
187
+ - lib/ynab/models/transactions_import_response_data.rb
185
188
  - lib/ynab/models/transactions_response.rb
186
189
  - lib/ynab/models/transactions_response_data.rb
187
190
  - lib/ynab/models/update_transaction.rb
@@ -213,6 +216,7 @@ files:
213
216
  - spec/fixtures/vcr_cassettes/category_transactions.yml
214
217
  - spec/fixtures/vcr_cassettes/create_transaction.yml
215
218
  - spec/fixtures/vcr_cassettes/create_transactions.yml
219
+ - spec/fixtures/vcr_cassettes/import_transactions.yml
216
220
  - spec/fixtures/vcr_cassettes/month.yml
217
221
  - spec/fixtures/vcr_cassettes/months.yml
218
222
  - spec/fixtures/vcr_cassettes/months_unauthorized.yml
@@ -233,6 +237,7 @@ files:
233
237
  - spec/fixtures/vcr_cassettes/transactions_unauthorized.yml
234
238
  - spec/fixtures/vcr_cassettes/update_transaction.yml
235
239
  - spec/fixtures/vcr_cassettes/update_transactions.yml
240
+ - spec/models/transaction_detail_spec.rb
236
241
  - spec/spec_helper.rb
237
242
  homepage: https://github.com/ynab/ynab-sdk-ruby
238
243
  licenses:
@@ -253,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
258
  - !ruby/object:Gem::Version
254
259
  version: '0'
255
260
  requirements: []
256
- rubygems_version: 3.0.4
261
+ rubygems_version: 3.1.2
257
262
  signing_key:
258
263
  specification_version: 4
259
264
  summary: YNAB API Endpoints Ruby Gem
@@ -285,6 +290,7 @@ test_files:
285
290
  - spec/fixtures/vcr_cassettes/payee.yml
286
291
  - spec/fixtures/vcr_cassettes/payee_location.yml
287
292
  - spec/fixtures/vcr_cassettes/update_transactions.yml
293
+ - spec/fixtures/vcr_cassettes/import_transactions.yml
288
294
  - spec/fixtures/vcr_cassettes/bulk_transactions.yml
289
295
  - spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml
290
296
  - spec/fixtures/vcr_cassettes/payees.yml
@@ -300,4 +306,5 @@ test_files:
300
306
  - spec/fixtures/vcr_cassettes/month.yml
301
307
  - spec/fixtures/vcr_cassettes/categories_unauthorized.yml
302
308
  - spec/fixtures/vcr_cassettes/transactions_unauthorized.yml
309
+ - spec/models/transaction_detail_spec.rb
303
310
  - spec/spec_helper.rb