ynab 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +6 -2
- data/Gemfile.lock +1 -1
- data/README.md +4 -2
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +22 -0
- data/docs/ExistingTransaction.md +18 -0
- data/docs/HybridTransaction.md +3 -2
- data/docs/NewTransaction.md +19 -0
- data/docs/PatchCategoryWrapper.md +8 -0
- data/docs/PatchPayeeWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +1 -1
- data/docs/PayeesApi.md +22 -0
- data/docs/PostTransactionsWrapper.md +2 -2
- data/docs/PutTransactionWrapper.md +1 -1
- data/docs/SaveCategory.md +10 -0
- data/docs/SavePayee.md +8 -0
- data/docs/SavePayeeResponse.md +8 -0
- data/docs/SavePayeeResponseData.md +9 -0
- data/docs/SaveTransactionWithIdOrImportId.md +20 -0
- data/docs/SaveTransactionWithOptionalFields.md +2 -3
- data/docs/ScheduledTransactionDetail.md +2 -1
- data/docs/ScheduledTransactionSummary.md +2 -1
- data/docs/TransactionClearedStatus.md +7 -0
- data/docs/TransactionDetail.md +3 -2
- data/docs/TransactionFlagColor.md +7 -0
- data/docs/TransactionSummary.md +3 -2
- data/docs/TransactionsApi.md +7 -7
- data/lib/ynab/api/accounts_api.rb +2 -2
- data/lib/ynab/api/budgets_api.rb +2 -2
- data/lib/ynab/api/categories_api.rb +82 -2
- data/lib/ynab/api/months_api.rb +2 -2
- data/lib/ynab/api/payee_locations_api.rb +2 -2
- data/lib/ynab/api/payees_api.rb +82 -2
- data/lib/ynab/api/scheduled_transactions_api.rb +2 -2
- data/lib/ynab/api/transactions_api.rb +12 -28
- data/lib/ynab/api/user_api.rb +2 -2
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/configuration.rb +14 -11
- data/lib/ynab/models/account.rb +13 -56
- data/lib/ynab/models/account_response.rb +13 -24
- data/lib/ynab/models/account_response_data.rb +13 -24
- data/lib/ynab/models/account_type.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +13 -24
- data/lib/ynab/models/accounts_response_data.rb +13 -28
- data/lib/ynab/models/budget_detail.rb +13 -29
- data/lib/ynab/models/budget_detail_response.rb +13 -24
- data/lib/ynab/models/budget_detail_response_data.rb +13 -28
- data/lib/ynab/models/budget_settings.rb +13 -20
- data/lib/ynab/models/budget_settings_response.rb +13 -24
- data/lib/ynab/models/budget_settings_response_data.rb +13 -24
- data/lib/ynab/models/budget_summary.rb +13 -28
- data/lib/ynab/models/budget_summary_response.rb +13 -24
- data/lib/ynab/models/budget_summary_response_data.rb +13 -24
- data/lib/ynab/models/bulk_response.rb +13 -24
- data/lib/ynab/models/bulk_response_data.rb +13 -24
- data/lib/ynab/models/bulk_response_data_bulk.rb +13 -28
- data/lib/ynab/models/bulk_transactions.rb +14 -25
- data/lib/ynab/models/categories_response.rb +13 -24
- data/lib/ynab/models/categories_response_data.rb +13 -28
- data/lib/ynab/models/category.rb +13 -56
- data/lib/ynab/models/category_group.rb +13 -36
- data/lib/ynab/models/category_group_with_categories.rb +14 -42
- data/lib/ynab/models/category_group_with_categories_all_of.rb +0 -4
- data/lib/ynab/models/category_response.rb +13 -24
- data/lib/ynab/models/category_response_data.rb +13 -24
- data/lib/ynab/models/currency_format.rb +13 -52
- data/lib/ynab/models/date_format.rb +13 -24
- data/lib/ynab/models/error_detail.rb +13 -32
- data/lib/ynab/models/error_response.rb +13 -24
- data/lib/ynab/models/existing_transaction.rb +359 -0
- data/lib/ynab/models/hybrid_transaction.rb +28 -95
- data/lib/ynab/models/hybrid_transaction_all_of.rb +0 -12
- data/lib/ynab/models/hybrid_transactions_response.rb +13 -24
- data/lib/ynab/models/hybrid_transactions_response_data.rb +13 -24
- data/lib/ynab/models/month_detail.rb +13 -49
- data/lib/ynab/models/month_detail_all_of.rb +0 -4
- data/lib/ynab/models/month_detail_response.rb +13 -24
- data/lib/ynab/models/month_detail_response_data.rb +13 -24
- data/lib/ynab/models/month_summaries_response.rb +13 -24
- data/lib/ynab/models/month_summaries_response_data.rb +13 -28
- data/lib/ynab/models/month_summary.rb +13 -44
- data/lib/ynab/models/new_transaction.rb +377 -0
- data/lib/ynab/models/patch_category_wrapper.rb +213 -0
- data/lib/ynab/models/patch_month_category_wrapper.rb +13 -24
- data/lib/ynab/models/patch_payee_wrapper.rb +213 -0
- data/lib/ynab/models/patch_transactions_wrapper.rb +14 -25
- data/lib/ynab/models/payee.rb +13 -32
- data/lib/ynab/models/payee_location.rb +13 -40
- data/lib/ynab/models/payee_location_response.rb +13 -24
- data/lib/ynab/models/payee_location_response_data.rb +13 -24
- data/lib/ynab/models/payee_locations_response.rb +13 -24
- data/lib/ynab/models/payee_locations_response_data.rb +13 -24
- data/lib/ynab/models/payee_response.rb +13 -24
- data/lib/ynab/models/payee_response_data.rb +13 -24
- data/lib/ynab/models/payees_response.rb +13 -24
- data/lib/ynab/models/payees_response_data.rb +13 -28
- data/lib/ynab/models/post_account_wrapper.rb +13 -24
- data/lib/ynab/models/post_transactions_wrapper.rb +15 -22
- data/lib/ynab/models/put_transaction_wrapper.rb +14 -25
- data/lib/ynab/models/save_account.rb +13 -32
- data/lib/ynab/models/save_category.rb +232 -0
- data/lib/ynab/models/save_category_response.rb +13 -24
- data/lib/ynab/models/save_category_response_data.rb +13 -28
- data/lib/ynab/models/save_month_category.rb +13 -24
- data/lib/ynab/models/save_payee.rb +220 -0
- data/lib/ynab/models/save_payee_response.rb +213 -0
- data/lib/ynab/models/save_payee_response_data.rb +224 -0
- data/lib/ynab/models/save_sub_transaction.rb +13 -40
- data/lib/ynab/models/save_transaction.rb +0 -32
- data/lib/ynab/models/save_transaction_with_id.rb +0 -32
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +388 -0
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +17 -91
- data/lib/ynab/models/save_transactions_response.rb +13 -24
- data/lib/ynab/models/save_transactions_response_data.rb +13 -28
- data/lib/ynab/models/scheduled_sub_transaction.rb +13 -36
- data/lib/ynab/models/scheduled_transaction_detail.rb +26 -76
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +0 -8
- data/lib/ynab/models/scheduled_transaction_response.rb +13 -24
- data/lib/ynab/models/scheduled_transaction_response_data.rb +13 -24
- data/lib/ynab/models/scheduled_transaction_summary.rb +26 -67
- data/lib/ynab/models/scheduled_transactions_response.rb +13 -24
- data/lib/ynab/models/scheduled_transactions_response_data.rb +13 -28
- data/lib/ynab/models/sub_transaction.rb +13 -36
- data/lib/ynab/models/transaction_cleared_status.rb +41 -0
- data/lib/ynab/models/transaction_detail.rb +28 -91
- data/lib/ynab/models/transaction_detail_all_of.rb +0 -8
- data/lib/ynab/models/transaction_flag_color.rb +45 -0
- data/lib/ynab/models/transaction_response.rb +13 -24
- data/lib/ynab/models/transaction_response_data.rb +13 -24
- data/lib/ynab/models/transaction_summary.rb +28 -82
- data/lib/ynab/models/transactions_import_response.rb +13 -24
- data/lib/ynab/models/transactions_import_response_data.rb +13 -24
- data/lib/ynab/models/transactions_response.rb +13 -24
- data/lib/ynab/models/transactions_response_data.rb +13 -28
- data/lib/ynab/models/user.rb +13 -24
- data/lib/ynab/models/user_response.rb +13 -24
- data/lib/ynab/models/user_response_data.rb +13 -24
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +13 -12
- data/open_api_spec.yaml +455 -343
- data/templates/api.mustache +213 -0
- data/templates/partial_model_generic.mustache +305 -0
- data/ynab.gemspec +4 -3
- metadata +31 -7
data/lib/ynab/api/payees_api.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -153,5 +153,85 @@ module YNAB
|
|
153
153
|
end
|
154
154
|
return data, status_code, headers
|
155
155
|
end
|
156
|
+
|
157
|
+
# Update a payee
|
158
|
+
# Update a payee
|
159
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
160
|
+
# @param payee_id [String] The id of the payee
|
161
|
+
# @param data [PatchPayeeWrapper] The payee to update
|
162
|
+
# @param [Hash] opts the optional parameters
|
163
|
+
# @return [SavePayeeResponse]
|
164
|
+
def update_payee(budget_id, payee_id, data, opts = {})
|
165
|
+
data, _status_code, _headers = update_payee_with_http_info(budget_id, payee_id, data, opts)
|
166
|
+
data
|
167
|
+
end
|
168
|
+
|
169
|
+
# Update a payee
|
170
|
+
# Update a payee
|
171
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
172
|
+
# @param payee_id [String] The id of the payee
|
173
|
+
# @param data [PatchPayeeWrapper] The payee to update
|
174
|
+
# @param [Hash] opts the optional parameters
|
175
|
+
# @return [Array<(SavePayeeResponse, Integer, Hash)>] SavePayeeResponse data, response status code and response headers
|
176
|
+
def update_payee_with_http_info(budget_id, payee_id, data, opts = {})
|
177
|
+
if @api_client.config.debugging
|
178
|
+
@api_client.config.logger.debug 'Calling API: PayeesApi.update_payee ...'
|
179
|
+
end
|
180
|
+
# verify the required parameter 'budget_id' is set
|
181
|
+
if @api_client.config.client_side_validation && budget_id.nil?
|
182
|
+
fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeesApi.update_payee"
|
183
|
+
end
|
184
|
+
# verify the required parameter 'payee_id' is set
|
185
|
+
if @api_client.config.client_side_validation && payee_id.nil?
|
186
|
+
fail ArgumentError, "Missing the required parameter 'payee_id' when calling PayeesApi.update_payee"
|
187
|
+
end
|
188
|
+
# verify the required parameter 'data' is set
|
189
|
+
if @api_client.config.client_side_validation && data.nil?
|
190
|
+
fail ArgumentError, "Missing the required parameter 'data' when calling PayeesApi.update_payee"
|
191
|
+
end
|
192
|
+
# resource path
|
193
|
+
local_var_path = '/budgets/{budget_id}/payees/{payee_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))
|
194
|
+
|
195
|
+
# query parameters
|
196
|
+
query_params = opts[:query_params] || {}
|
197
|
+
|
198
|
+
# header parameters
|
199
|
+
header_params = opts[:header_params] || {}
|
200
|
+
# HTTP header 'Accept' (if needed)
|
201
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
202
|
+
# HTTP header 'Content-Type'
|
203
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
204
|
+
if !content_type.nil?
|
205
|
+
header_params['Content-Type'] = content_type
|
206
|
+
end
|
207
|
+
|
208
|
+
# form parameters
|
209
|
+
form_params = opts[:form_params] || {}
|
210
|
+
|
211
|
+
# http body (model)
|
212
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
|
213
|
+
|
214
|
+
# return_type
|
215
|
+
return_type = opts[:debug_return_type] || 'SavePayeeResponse'
|
216
|
+
|
217
|
+
# auth_names
|
218
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
219
|
+
|
220
|
+
new_options = opts.merge(
|
221
|
+
:operation => :"PayeesApi.update_payee",
|
222
|
+
:header_params => header_params,
|
223
|
+
:query_params => query_params,
|
224
|
+
:form_params => form_params,
|
225
|
+
:body => post_body,
|
226
|
+
:auth_names => auth_names,
|
227
|
+
:return_type => return_type
|
228
|
+
)
|
229
|
+
|
230
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
231
|
+
if @api_client.config.debugging
|
232
|
+
@api_client.config.logger.debug "API called: PayeesApi#update_payee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
233
|
+
end
|
234
|
+
return data, status_code, headers
|
235
|
+
end
|
156
236
|
end
|
157
237
|
end
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -232,7 +232,7 @@ module YNAB
|
|
232
232
|
end
|
233
233
|
|
234
234
|
# List transactions
|
235
|
-
# Returns budget transactions
|
235
|
+
# Returns budget transactions, excluding any pending transactions
|
236
236
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
237
237
|
# @param [Hash] opts the optional parameters
|
238
238
|
# @option opts [Date] :since_date If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
|
@@ -245,7 +245,7 @@ module YNAB
|
|
245
245
|
end
|
246
246
|
|
247
247
|
# List transactions
|
248
|
-
# Returns budget transactions
|
248
|
+
# Returns budget transactions, excluding any pending transactions
|
249
249
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
250
250
|
# @param [Hash] opts the optional parameters
|
251
251
|
# @option opts [Date] :since_date If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
|
@@ -260,10 +260,6 @@ module YNAB
|
|
260
260
|
if @api_client.config.client_side_validation && budget_id.nil?
|
261
261
|
fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.get_transactions"
|
262
262
|
end
|
263
|
-
allowable_values = ["uncategorized", "unapproved"]
|
264
|
-
if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
|
265
|
-
fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
|
266
|
-
end
|
267
263
|
# resource path
|
268
264
|
local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
|
269
265
|
|
@@ -308,7 +304,7 @@ module YNAB
|
|
308
304
|
end
|
309
305
|
|
310
306
|
# List account transactions
|
311
|
-
# Returns all transactions for a specified account
|
307
|
+
# Returns all transactions for a specified account, excluding any pending transactions
|
312
308
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
313
309
|
# @param account_id [String] The id of the account
|
314
310
|
# @param [Hash] opts the optional parameters
|
@@ -322,7 +318,7 @@ module YNAB
|
|
322
318
|
end
|
323
319
|
|
324
320
|
# List account transactions
|
325
|
-
# Returns all transactions for a specified account
|
321
|
+
# Returns all transactions for a specified account, excluding any pending transactions
|
326
322
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
327
323
|
# @param account_id [String] The id of the account
|
328
324
|
# @param [Hash] opts the optional parameters
|
@@ -342,10 +338,6 @@ module YNAB
|
|
342
338
|
if @api_client.config.client_side_validation && account_id.nil?
|
343
339
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling TransactionsApi.get_transactions_by_account"
|
344
340
|
end
|
345
|
-
allowable_values = ["uncategorized", "unapproved"]
|
346
|
-
if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
|
347
|
-
fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
|
348
|
-
end
|
349
341
|
# resource path
|
350
342
|
local_var_path = '/budgets/{budget_id}/accounts/{account_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
351
343
|
|
@@ -389,7 +381,7 @@ module YNAB
|
|
389
381
|
return data, status_code, headers
|
390
382
|
end
|
391
383
|
|
392
|
-
# List category transactions
|
384
|
+
# List category transactions, excluding any pending transactions
|
393
385
|
# Returns all transactions for a specified category
|
394
386
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
395
387
|
# @param category_id [String] The id of the category
|
@@ -403,7 +395,7 @@ module YNAB
|
|
403
395
|
data
|
404
396
|
end
|
405
397
|
|
406
|
-
# List category transactions
|
398
|
+
# List category transactions, excluding any pending transactions
|
407
399
|
# Returns all transactions for a specified category
|
408
400
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
409
401
|
# @param category_id [String] The id of the category
|
@@ -424,10 +416,6 @@ module YNAB
|
|
424
416
|
if @api_client.config.client_side_validation && category_id.nil?
|
425
417
|
fail ArgumentError, "Missing the required parameter 'category_id' when calling TransactionsApi.get_transactions_by_category"
|
426
418
|
end
|
427
|
-
allowable_values = ["uncategorized", "unapproved"]
|
428
|
-
if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
|
429
|
-
fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
|
430
|
-
end
|
431
419
|
# resource path
|
432
420
|
local_var_path = '/budgets/{budget_id}/categories/{category_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s))
|
433
421
|
|
@@ -471,7 +459,7 @@ module YNAB
|
|
471
459
|
return data, status_code, headers
|
472
460
|
end
|
473
461
|
|
474
|
-
# List payee transactions
|
462
|
+
# List payee transactions, excluding any pending transactions
|
475
463
|
# Returns all transactions for a specified payee
|
476
464
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
477
465
|
# @param payee_id [String] The id of the payee
|
@@ -485,7 +473,7 @@ module YNAB
|
|
485
473
|
data
|
486
474
|
end
|
487
475
|
|
488
|
-
# List payee transactions
|
476
|
+
# List payee transactions, excluding any pending transactions
|
489
477
|
# Returns all transactions for a specified payee
|
490
478
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
491
479
|
# @param payee_id [String] The id of the payee
|
@@ -506,10 +494,6 @@ module YNAB
|
|
506
494
|
if @api_client.config.client_side_validation && payee_id.nil?
|
507
495
|
fail ArgumentError, "Missing the required parameter 'payee_id' when calling TransactionsApi.get_transactions_by_payee"
|
508
496
|
end
|
509
|
-
allowable_values = ["uncategorized", "unapproved"]
|
510
|
-
if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
|
511
|
-
fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
|
512
|
-
end
|
513
497
|
# resource path
|
514
498
|
local_var_path = '/budgets/{budget_id}/payees/{payee_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))
|
515
499
|
|
@@ -699,7 +683,7 @@ module YNAB
|
|
699
683
|
# Update multiple transactions
|
700
684
|
# Updates multiple transactions, by `id` or `import_id`.
|
701
685
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
702
|
-
# @param data [PatchTransactionsWrapper] The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by
|
686
|
+
# @param data [PatchTransactionsWrapper] The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction.
|
703
687
|
# @param [Hash] opts the optional parameters
|
704
688
|
# @return [SaveTransactionsResponse]
|
705
689
|
def update_transactions(budget_id, data, opts = {})
|
@@ -710,7 +694,7 @@ module YNAB
|
|
710
694
|
# Update multiple transactions
|
711
695
|
# Updates multiple transactions, by `id` or `import_id`.
|
712
696
|
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
713
|
-
# @param data [PatchTransactionsWrapper] The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by
|
697
|
+
# @param data [PatchTransactionsWrapper] The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by its `import_id`. If an `id` is specified, it will always be used for lookup. You should not specify both `id` and `import_id`. Updating an `import_id` on an existing transaction is not allowed; if an `import_id` is specified, it will only be used to lookup the transaction.
|
714
698
|
# @param [Hash] opts the optional parameters
|
715
699
|
# @return [Array<(SaveTransactionsResponse, Integer, Hash)>] SaveTransactionsResponse data, response status code and response headers
|
716
700
|
def update_transactions_with_http_info(budget_id, data, opts = {})
|
data/lib/ynab/api/user_api.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
data/lib/ynab/api_client.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
data/lib/ynab/configuration.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -152,7 +152,7 @@ module YNAB
|
|
152
152
|
@scheme = 'https'
|
153
153
|
@host = 'api.ynab.com'
|
154
154
|
@base_path = '/v1'
|
155
|
-
@server_index =
|
155
|
+
@server_index = nil
|
156
156
|
@server_operation_index = {}
|
157
157
|
@server_variables = {}
|
158
158
|
@server_operation_variables = {}
|
@@ -200,10 +200,12 @@ module YNAB
|
|
200
200
|
|
201
201
|
# Returns base URL for specified operation based on server settings
|
202
202
|
def base_url(operation = nil)
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
203
|
+
if operation_server_settings.key?(operation) then
|
204
|
+
index = server_operation_index.fetch(operation, server_index)
|
205
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
206
|
+
else
|
207
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
208
|
+
end
|
207
209
|
end
|
208
210
|
|
209
211
|
# Gets API key (with prefix if set).
|
@@ -220,8 +222,8 @@ module YNAB
|
|
220
222
|
|
221
223
|
# Gets access_token using access_token_getter or uses the static access_token
|
222
224
|
def access_token_with_refresh
|
223
|
-
|
224
|
-
|
225
|
+
return access_token if access_token_getter.nil?
|
226
|
+
access_token_getter.call
|
225
227
|
end
|
226
228
|
|
227
229
|
# Gets Basic Auth token string
|
@@ -265,8 +267,8 @@ module YNAB
|
|
265
267
|
servers = server_settings if servers == nil
|
266
268
|
|
267
269
|
# check array index out of bound
|
268
|
-
if (index < 0 || index >= servers.size)
|
269
|
-
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
270
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
271
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
270
272
|
end
|
271
273
|
|
272
274
|
server = servers[index]
|
@@ -291,5 +293,6 @@ module YNAB
|
|
291
293
|
url
|
292
294
|
end
|
293
295
|
|
296
|
+
|
294
297
|
end
|
295
298
|
end
|
data/lib/ynab/models/account.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -248,42 +248,6 @@ module YNAB
|
|
248
248
|
# @return Array for valid properties with the reasons
|
249
249
|
def list_invalid_properties
|
250
250
|
invalid_properties = Array.new
|
251
|
-
if @id.nil?
|
252
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
253
|
-
end
|
254
|
-
|
255
|
-
if @name.nil?
|
256
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
257
|
-
end
|
258
|
-
|
259
|
-
if @type.nil?
|
260
|
-
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
261
|
-
end
|
262
|
-
|
263
|
-
if @on_budget.nil?
|
264
|
-
invalid_properties.push('invalid value for "on_budget", on_budget cannot be nil.')
|
265
|
-
end
|
266
|
-
|
267
|
-
if @closed.nil?
|
268
|
-
invalid_properties.push('invalid value for "closed", closed cannot be nil.')
|
269
|
-
end
|
270
|
-
|
271
|
-
if @balance.nil?
|
272
|
-
invalid_properties.push('invalid value for "balance", balance cannot be nil.')
|
273
|
-
end
|
274
|
-
|
275
|
-
if @cleared_balance.nil?
|
276
|
-
invalid_properties.push('invalid value for "cleared_balance", cleared_balance cannot be nil.')
|
277
|
-
end
|
278
|
-
|
279
|
-
if @uncleared_balance.nil?
|
280
|
-
invalid_properties.push('invalid value for "uncleared_balance", uncleared_balance cannot be nil.')
|
281
|
-
end
|
282
|
-
|
283
|
-
if @deleted.nil?
|
284
|
-
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
285
|
-
end
|
286
|
-
|
287
251
|
invalid_properties
|
288
252
|
end
|
289
253
|
|
@@ -343,37 +307,30 @@ module YNAB
|
|
343
307
|
# @param [Hash] attributes Model attributes in the form of hash
|
344
308
|
# @return [Object] Returns the model itself
|
345
309
|
def self.build_from_hash(attributes)
|
346
|
-
new.build_from_hash(attributes)
|
347
|
-
end
|
348
|
-
|
349
|
-
# Builds the object from hash
|
350
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
351
|
-
# @return [Object] Returns the model itself
|
352
|
-
def build_from_hash(attributes)
|
353
310
|
return nil unless attributes.is_a?(Hash)
|
354
311
|
attributes = attributes.transform_keys(&:to_sym)
|
355
|
-
|
356
|
-
|
357
|
-
|
312
|
+
transformed_hash = {}
|
313
|
+
openapi_types.each_pair do |key, type|
|
314
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
315
|
+
transformed_hash["#{key}"] = nil
|
358
316
|
elsif type =~ /\AArray<(.*)>/i
|
359
317
|
# check to ensure the input is an array given that the attribute
|
360
318
|
# is documented as an array but the input is not
|
361
|
-
if attributes[
|
362
|
-
|
319
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
320
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
363
321
|
end
|
364
|
-
elsif !attributes[
|
365
|
-
|
322
|
+
elsif !attributes[attribute_map[key]].nil?
|
323
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
366
324
|
end
|
367
325
|
end
|
368
|
-
|
369
|
-
self
|
326
|
+
new(transformed_hash)
|
370
327
|
end
|
371
328
|
|
372
329
|
# Deserializes the data based on type
|
373
330
|
# @param string type Data type
|
374
331
|
# @param string value Value to be deserialized
|
375
332
|
# @return [Object] Deserialized data
|
376
|
-
def _deserialize(type, value)
|
333
|
+
def self._deserialize(type, value)
|
377
334
|
case type.to_sym
|
378
335
|
when :Time
|
379
336
|
Time.parse(value)
|
@@ -408,7 +365,7 @@ module YNAB
|
|
408
365
|
else # model
|
409
366
|
# models (e.g. Pet) or oneOf
|
410
367
|
klass = YNAB.const_get(type)
|
411
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
368
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
412
369
|
end
|
413
370
|
end
|
414
371
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,10 +66,6 @@ module YNAB
|
|
66
66
|
# @return Array for valid properties with the reasons
|
67
67
|
def list_invalid_properties
|
68
68
|
invalid_properties = Array.new
|
69
|
-
if @data.nil?
|
70
|
-
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
71
|
-
end
|
72
|
-
|
73
69
|
invalid_properties
|
74
70
|
end
|
75
71
|
|
@@ -104,37 +100,30 @@ module YNAB
|
|
104
100
|
# @param [Hash] attributes Model attributes in the form of hash
|
105
101
|
# @return [Object] Returns the model itself
|
106
102
|
def self.build_from_hash(attributes)
|
107
|
-
new.build_from_hash(attributes)
|
108
|
-
end
|
109
|
-
|
110
|
-
# Builds the object from hash
|
111
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
-
# @return [Object] Returns the model itself
|
113
|
-
def build_from_hash(attributes)
|
114
103
|
return nil unless attributes.is_a?(Hash)
|
115
104
|
attributes = attributes.transform_keys(&:to_sym)
|
116
|
-
|
117
|
-
|
118
|
-
|
105
|
+
transformed_hash = {}
|
106
|
+
openapi_types.each_pair do |key, type|
|
107
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash["#{key}"] = nil
|
119
109
|
elsif type =~ /\AArray<(.*)>/i
|
120
110
|
# check to ensure the input is an array given that the attribute
|
121
111
|
# is documented as an array but the input is not
|
122
|
-
if attributes[
|
123
|
-
|
112
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
113
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
114
|
end
|
125
|
-
elsif !attributes[
|
126
|
-
|
115
|
+
elsif !attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
117
|
end
|
128
118
|
end
|
129
|
-
|
130
|
-
self
|
119
|
+
new(transformed_hash)
|
131
120
|
end
|
132
121
|
|
133
122
|
# Deserializes the data based on type
|
134
123
|
# @param string type Data type
|
135
124
|
# @param string value Value to be deserialized
|
136
125
|
# @return [Object] Deserialized data
|
137
|
-
def _deserialize(type, value)
|
126
|
+
def self._deserialize(type, value)
|
138
127
|
case type.to_sym
|
139
128
|
when :Time
|
140
129
|
Time.parse(value)
|
@@ -169,7 +158,7 @@ module YNAB
|
|
169
158
|
else # model
|
170
159
|
# models (e.g. Pet) or oneOf
|
171
160
|
klass = YNAB.const_get(type)
|
172
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
161
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
162
|
end
|
174
163
|
end
|
175
164
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,10 +66,6 @@ module YNAB
|
|
66
66
|
# @return Array for valid properties with the reasons
|
67
67
|
def list_invalid_properties
|
68
68
|
invalid_properties = Array.new
|
69
|
-
if @account.nil?
|
70
|
-
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
71
|
-
end
|
72
|
-
|
73
69
|
invalid_properties
|
74
70
|
end
|
75
71
|
|
@@ -104,37 +100,30 @@ module YNAB
|
|
104
100
|
# @param [Hash] attributes Model attributes in the form of hash
|
105
101
|
# @return [Object] Returns the model itself
|
106
102
|
def self.build_from_hash(attributes)
|
107
|
-
new.build_from_hash(attributes)
|
108
|
-
end
|
109
|
-
|
110
|
-
# Builds the object from hash
|
111
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
-
# @return [Object] Returns the model itself
|
113
|
-
def build_from_hash(attributes)
|
114
103
|
return nil unless attributes.is_a?(Hash)
|
115
104
|
attributes = attributes.transform_keys(&:to_sym)
|
116
|
-
|
117
|
-
|
118
|
-
|
105
|
+
transformed_hash = {}
|
106
|
+
openapi_types.each_pair do |key, type|
|
107
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash["#{key}"] = nil
|
119
109
|
elsif type =~ /\AArray<(.*)>/i
|
120
110
|
# check to ensure the input is an array given that the attribute
|
121
111
|
# is documented as an array but the input is not
|
122
|
-
if attributes[
|
123
|
-
|
112
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
113
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
114
|
end
|
125
|
-
elsif !attributes[
|
126
|
-
|
115
|
+
elsif !attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
117
|
end
|
128
118
|
end
|
129
|
-
|
130
|
-
self
|
119
|
+
new(transformed_hash)
|
131
120
|
end
|
132
121
|
|
133
122
|
# Deserializes the data based on type
|
134
123
|
# @param string type Data type
|
135
124
|
# @param string value Value to be deserialized
|
136
125
|
# @return [Object] Deserialized data
|
137
|
-
def _deserialize(type, value)
|
126
|
+
def self._deserialize(type, value)
|
138
127
|
case type.to_sym
|
139
128
|
when :Time
|
140
129
|
Time.parse(value)
|
@@ -169,7 +158,7 @@ module YNAB
|
|
169
158
|
else # model
|
170
159
|
# models (e.g. Pet) or oneOf
|
171
160
|
klass = YNAB.const_get(type)
|
172
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
161
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
162
|
end
|
174
163
|
end
|
175
164
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
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.ynab.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.69.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|