ynab 1.16.0 → 1.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/ynab.rb +12 -8
- data/lib/ynab/api/accounts_api.rb +63 -5
- data/lib/ynab/api/budgets_api.rb +5 -5
- data/lib/ynab/api/categories_api.rb +9 -9
- data/lib/ynab/api/deprecated_api.rb +3 -3
- data/lib/ynab/api/months_api.rb +5 -5
- data/lib/ynab/api/payee_locations_api.rb +9 -9
- data/lib/ynab/api/payees_api.rb +7 -7
- data/lib/ynab/api/scheduled_transactions_api.rb +5 -5
- data/lib/ynab/api/transactions_api.rb +71 -19
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +3 -2
- data/lib/ynab/configuration.rb +2 -3
- data/lib/ynab/models/account.rb +25 -8
- data/lib/ynab/models/account_response.rb +4 -3
- data/lib/ynab/models/account_response_data.rb +4 -3
- data/lib/ynab/models/accounts_response.rb +4 -3
- data/lib/ynab/models/accounts_response_data.rb +4 -3
- data/lib/ynab/models/budget_detail.rb +4 -3
- data/lib/ynab/models/budget_detail_response.rb +4 -3
- data/lib/ynab/models/budget_detail_response_data.rb +4 -3
- data/lib/ynab/models/budget_settings.rb +4 -3
- data/lib/ynab/models/budget_settings_response.rb +4 -3
- data/lib/ynab/models/budget_settings_response_data.rb +4 -3
- data/lib/ynab/models/budget_summary.rb +4 -3
- data/lib/ynab/models/budget_summary_response.rb +4 -3
- data/lib/ynab/models/budget_summary_response_data.rb +4 -3
- data/lib/ynab/models/bulk_response.rb +4 -3
- data/lib/ynab/models/bulk_response_data.rb +4 -3
- data/lib/ynab/models/bulk_response_data_bulk.rb +4 -3
- data/lib/ynab/models/bulk_transactions.rb +4 -3
- data/lib/ynab/models/categories_response.rb +4 -3
- data/lib/ynab/models/categories_response_data.rb +4 -3
- data/lib/ynab/models/category.rb +46 -9
- data/lib/ynab/models/category_group.rb +4 -3
- data/lib/ynab/models/category_group_with_categories.rb +4 -3
- data/lib/ynab/models/category_response.rb +4 -3
- data/lib/ynab/models/category_response_data.rb +4 -3
- data/lib/ynab/models/currency_format.rb +4 -3
- data/lib/ynab/models/date_format.rb +4 -3
- data/lib/ynab/models/error_detail.rb +4 -3
- data/lib/ynab/models/error_response.rb +4 -3
- data/lib/ynab/models/hybrid_transaction.rb +4 -15
- data/lib/ynab/models/hybrid_transactions_response.rb +4 -3
- data/lib/ynab/models/hybrid_transactions_response_data.rb +4 -3
- data/lib/ynab/models/month_detail.rb +4 -3
- data/lib/ynab/models/month_detail_response.rb +4 -3
- data/lib/ynab/models/month_detail_response_data.rb +4 -3
- data/lib/ynab/models/month_summaries_response.rb +4 -3
- data/lib/ynab/models/month_summaries_response_data.rb +4 -3
- data/lib/ynab/models/month_summary.rb +4 -3
- data/lib/ynab/models/payee.rb +4 -3
- data/lib/ynab/models/payee_location.rb +4 -3
- data/lib/ynab/models/payee_location_response.rb +4 -3
- data/lib/ynab/models/payee_location_response_data.rb +4 -3
- data/lib/ynab/models/payee_locations_response.rb +4 -3
- data/lib/ynab/models/payee_locations_response_data.rb +4 -3
- data/lib/ynab/models/payee_response.rb +4 -3
- data/lib/ynab/models/payee_response_data.rb +4 -3
- data/lib/ynab/models/payees_response.rb +4 -3
- data/lib/ynab/models/payees_response_data.rb +4 -3
- data/lib/ynab/models/save_account.rb +250 -0
- data/lib/ynab/models/save_account_wrapper.rb +189 -0
- data/lib/ynab/models/save_category_response.rb +4 -3
- data/lib/ynab/models/save_category_response_data.rb +4 -3
- data/lib/ynab/models/save_month_category.rb +4 -3
- data/lib/ynab/models/save_month_category_wrapper.rb +4 -3
- data/lib/ynab/models/save_sub_transaction.rb +5 -4
- data/lib/ynab/models/save_transaction.rb +4 -11
- data/lib/ynab/models/save_transaction_wrapper.rb +4 -3
- data/lib/ynab/models/save_transactions_response.rb +4 -3
- data/lib/ynab/models/save_transactions_response_data.rb +4 -3
- data/lib/ynab/models/save_transactions_wrapper.rb +4 -3
- data/lib/ynab/models/scheduled_sub_transaction.rb +4 -3
- data/lib/ynab/models/scheduled_transaction_detail.rb +4 -11
- data/lib/ynab/models/scheduled_transaction_response.rb +4 -3
- data/lib/ynab/models/scheduled_transaction_response_data.rb +4 -3
- data/lib/ynab/models/scheduled_transaction_summary.rb +4 -11
- data/lib/ynab/models/scheduled_transactions_response.rb +4 -3
- data/lib/ynab/models/scheduled_transactions_response_data.rb +4 -3
- data/lib/ynab/models/sub_transaction.rb +15 -4
- data/lib/ynab/models/transaction_detail.rb +4 -11
- data/lib/ynab/models/transaction_response.rb +4 -3
- data/lib/ynab/models/transaction_response_data.rb +4 -3
- data/lib/ynab/models/transaction_summary.rb +4 -11
- data/lib/ynab/models/transactions_import_response.rb +189 -0
- data/lib/ynab/models/transactions_import_response_data.rb +192 -0
- data/lib/ynab/models/transactions_response.rb +4 -3
- data/lib/ynab/models/transactions_response_data.rb +4 -3
- data/lib/ynab/models/update_transaction.rb +8 -29
- data/lib/ynab/models/update_transactions_wrapper.rb +4 -3
- data/lib/ynab/models/user.rb +4 -3
- data/lib/ynab/models/user_response.rb +4 -3
- data/lib/ynab/models/user_response_data.rb +4 -3
- data/lib/ynab/version.rb +1 -1
- data/spec/api/accounts_spec.rb +19 -10
- data/spec/api/budgets_spec.rb +4 -4
- data/spec/api/categories_spec.rb +5 -5
- data/spec/api/months_spec.rb +4 -4
- data/spec/api/payee_locations_spec.rb +4 -4
- data/spec/api/payees_spec.rb +4 -4
- data/spec/api/scheduled_transactions_spec.rb +4 -4
- data/spec/api/transactions_spec.rb +23 -13
- data/spec/fixtures/vcr_cassettes/create_account.yml +51 -0
- data/spec/fixtures/vcr_cassettes/import_transactions.yml +50 -0
- data/spec/models/transaction_detail_spec.rb +11 -0
- metadata +12 -2
data/lib/ynab/api/payees_api.rb
CHANGED
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -20,8 +20,8 @@ module YNAB
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Single payee
|
23
|
-
# Returns single payee
|
24
|
-
# @param budget_id The id of the budget
|
23
|
+
# Returns a single payee
|
24
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
25
25
|
# @param payee_id The id of the payee
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [PayeeResponse]
|
@@ -31,8 +31,8 @@ module YNAB
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Single payee
|
34
|
-
# Returns single payee
|
35
|
-
# @param budget_id The id of the budget
|
34
|
+
# Returns a single payee
|
35
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
36
36
|
# @param payee_id The id of the payee
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @return [Array<(PayeeResponse, Fixnum, Hash)>] PayeeResponse data, response status code and response headers
|
@@ -79,7 +79,7 @@ module YNAB
|
|
79
79
|
end
|
80
80
|
# List payees
|
81
81
|
# Returns all payees
|
82
|
-
# @param budget_id The id of the budget
|
82
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
83
83
|
# @param [Hash] opts the optional parameters
|
84
84
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
85
85
|
# @return [PayeesResponse]
|
@@ -90,7 +90,7 @@ module YNAB
|
|
90
90
|
|
91
91
|
# List payees
|
92
92
|
# Returns all payees
|
93
|
-
# @param budget_id The id of the budget
|
93
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
94
94
|
# @param [Hash] opts the optional parameters
|
95
95
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
96
96
|
# @return [Array<(PayeesResponse, Fixnum, Hash)>] PayeesResponse data, response status code and response headers
|
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,7 +21,7 @@ module YNAB
|
|
21
21
|
end
|
22
22
|
# Single scheduled transaction
|
23
23
|
# Returns a single scheduled transaction
|
24
|
-
# @param budget_id The id of the budget
|
24
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
25
25
|
# @param scheduled_transaction_id The id of the scheduled transaction
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [ScheduledTransactionResponse]
|
@@ -32,7 +32,7 @@ module YNAB
|
|
32
32
|
|
33
33
|
# Single scheduled transaction
|
34
34
|
# Returns a single scheduled transaction
|
35
|
-
# @param budget_id The id of the budget
|
35
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
36
36
|
# @param scheduled_transaction_id The id of the scheduled transaction
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @return [Array<(ScheduledTransactionResponse, Fixnum, Hash)>] ScheduledTransactionResponse data, response status code and response headers
|
@@ -79,7 +79,7 @@ module YNAB
|
|
79
79
|
end
|
80
80
|
# List scheduled transactions
|
81
81
|
# Returns all scheduled transactions
|
82
|
-
# @param budget_id The id of the budget
|
82
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
83
83
|
# @param [Hash] opts the optional parameters
|
84
84
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
85
85
|
# @return [ScheduledTransactionsResponse]
|
@@ -90,7 +90,7 @@ module YNAB
|
|
90
90
|
|
91
91
|
# List scheduled transactions
|
92
92
|
# Returns all scheduled transactions
|
93
|
-
# @param budget_id The id of the budget
|
93
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
94
94
|
# @param [Hash] opts the optional parameters
|
95
95
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
96
96
|
# @return [Array<(ScheduledTransactionsResponse, Fixnum, Hash)>] ScheduledTransactionsResponse data, response status code and response headers
|
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,7 +21,7 @@ module YNAB
|
|
21
21
|
end
|
22
22
|
# Create a single transaction or multiple transactions
|
23
23
|
# Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
|
24
|
-
# @param budget_id The id of the budget
|
24
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
25
25
|
# @param data The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [SaveTransactionsResponse]
|
@@ -32,7 +32,7 @@ module YNAB
|
|
32
32
|
|
33
33
|
# Create a single transaction or multiple transactions
|
34
34
|
# Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
|
35
|
-
# @param budget_id The id of the budget
|
35
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
36
36
|
# @param data The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @return [Array<(SaveTransactionsResponse, Fixnum, Hash)>] SaveTransactionsResponse data, response status code and response headers
|
@@ -79,7 +79,7 @@ module YNAB
|
|
79
79
|
end
|
80
80
|
# Single transaction
|
81
81
|
# Returns a single transaction
|
82
|
-
# @param budget_id The id of the budget
|
82
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
83
83
|
# @param transaction_id The id of the transaction
|
84
84
|
# @param [Hash] opts the optional parameters
|
85
85
|
# @return [TransactionResponse]
|
@@ -90,7 +90,7 @@ module YNAB
|
|
90
90
|
|
91
91
|
# Single transaction
|
92
92
|
# Returns a single transaction
|
93
|
-
# @param budget_id The id of the budget
|
93
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
94
94
|
# @param transaction_id The id of the transaction
|
95
95
|
# @param [Hash] opts the optional parameters
|
96
96
|
# @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
|
@@ -137,7 +137,7 @@ module YNAB
|
|
137
137
|
end
|
138
138
|
# List transactions
|
139
139
|
# Returns budget transactions
|
140
|
-
# @param budget_id The id of the budget
|
140
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
141
141
|
# @param [Hash] opts the optional parameters
|
142
142
|
# @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).
|
143
143
|
# @option opts [String] :type If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
|
@@ -150,7 +150,7 @@ module YNAB
|
|
150
150
|
|
151
151
|
# List transactions
|
152
152
|
# Returns budget transactions
|
153
|
-
# @param budget_id The id of the budget
|
153
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
154
154
|
# @param [Hash] opts the optional parameters
|
155
155
|
# @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).
|
156
156
|
# @option opts [String] :type If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
|
@@ -201,7 +201,7 @@ module YNAB
|
|
201
201
|
end
|
202
202
|
# List account transactions
|
203
203
|
# Returns all transactions for a specified account
|
204
|
-
# @param budget_id The id of the budget
|
204
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
205
205
|
# @param account_id The id of the account
|
206
206
|
# @param [Hash] opts the optional parameters
|
207
207
|
# @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).
|
@@ -215,7 +215,7 @@ module YNAB
|
|
215
215
|
|
216
216
|
# List account transactions
|
217
217
|
# Returns all transactions for a specified account
|
218
|
-
# @param budget_id The id of the budget
|
218
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
219
219
|
# @param account_id The id of the account
|
220
220
|
# @param [Hash] opts the optional parameters
|
221
221
|
# @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).
|
@@ -271,7 +271,7 @@ module YNAB
|
|
271
271
|
end
|
272
272
|
# List category transactions
|
273
273
|
# Returns all transactions for a specified category
|
274
|
-
# @param budget_id The id of the budget
|
274
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
275
275
|
# @param category_id The id of the category
|
276
276
|
# @param [Hash] opts the optional parameters
|
277
277
|
# @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).
|
@@ -285,7 +285,7 @@ module YNAB
|
|
285
285
|
|
286
286
|
# List category transactions
|
287
287
|
# Returns all transactions for a specified category
|
288
|
-
# @param budget_id The id of the budget
|
288
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
289
289
|
# @param category_id The id of the category
|
290
290
|
# @param [Hash] opts the optional parameters
|
291
291
|
# @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).
|
@@ -341,7 +341,7 @@ module YNAB
|
|
341
341
|
end
|
342
342
|
# List payee transactions
|
343
343
|
# Returns all transactions for a specified payee
|
344
|
-
# @param budget_id The id of the budget
|
344
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
345
345
|
# @param payee_id The id of the payee
|
346
346
|
# @param [Hash] opts the optional parameters
|
347
347
|
# @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).
|
@@ -355,7 +355,7 @@ module YNAB
|
|
355
355
|
|
356
356
|
# List payee transactions
|
357
357
|
# Returns all transactions for a specified payee
|
358
|
-
# @param budget_id The id of the budget
|
358
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
359
359
|
# @param payee_id The id of the payee
|
360
360
|
# @param [Hash] opts the optional parameters
|
361
361
|
# @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).
|
@@ -409,9 +409,61 @@ module YNAB
|
|
409
409
|
end
|
410
410
|
return data, status_code, headers
|
411
411
|
end
|
412
|
+
# Import transactions
|
413
|
+
# Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
|
414
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
415
|
+
# @param [Hash] opts the optional parameters
|
416
|
+
# @return [TransactionsImportResponse]
|
417
|
+
def import_transactions(budget_id, opts = {})
|
418
|
+
data, _status_code, _headers = import_transactions_with_http_info(budget_id, opts)
|
419
|
+
data
|
420
|
+
end
|
421
|
+
|
422
|
+
# Import transactions
|
423
|
+
# Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
|
424
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
425
|
+
# @param [Hash] opts the optional parameters
|
426
|
+
# @return [Array<(TransactionsImportResponse, Fixnum, Hash)>] TransactionsImportResponse data, response status code and response headers
|
427
|
+
def import_transactions_with_http_info(budget_id, opts = {})
|
428
|
+
if @api_client.config.debugging
|
429
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.import_transactions ...'
|
430
|
+
end
|
431
|
+
# verify the required parameter 'budget_id' is set
|
432
|
+
if @api_client.config.client_side_validation && budget_id.nil?
|
433
|
+
fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.import_transactions"
|
434
|
+
end
|
435
|
+
# resource path
|
436
|
+
local_var_path = '/budgets/{budget_id}/transactions/import'.sub('{' + 'budget_id' + '}', budget_id.to_s)
|
437
|
+
|
438
|
+
# query parameters
|
439
|
+
query_params = {}
|
440
|
+
|
441
|
+
# header parameters
|
442
|
+
header_params = {}
|
443
|
+
# HTTP header 'Accept' (if needed)
|
444
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
445
|
+
|
446
|
+
# form parameters
|
447
|
+
form_params = {}
|
448
|
+
|
449
|
+
# http body (model)
|
450
|
+
post_body = nil
|
451
|
+
auth_names = ['bearer']
|
452
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
453
|
+
:header_params => header_params,
|
454
|
+
:query_params => query_params,
|
455
|
+
:form_params => form_params,
|
456
|
+
:body => post_body,
|
457
|
+
:auth_names => auth_names,
|
458
|
+
:return_type => 'TransactionsImportResponse')
|
459
|
+
if @api_client.config.debugging
|
460
|
+
@api_client.config.logger.debug "API called: TransactionsApi#import_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
461
|
+
end
|
462
|
+
return data, status_code, headers
|
463
|
+
end
|
412
464
|
# Updates an existing transaction
|
413
|
-
# Updates a transaction
|
414
|
-
# @param budget_id The id of the budget
|
465
|
+
# Updates a single transaction
|
466
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
415
467
|
# @param transaction_id The id of the transaction
|
416
468
|
# @param data The transaction to update
|
417
469
|
# @param [Hash] opts the optional parameters
|
@@ -422,8 +474,8 @@ module YNAB
|
|
422
474
|
end
|
423
475
|
|
424
476
|
# Updates an existing transaction
|
425
|
-
# Updates a transaction
|
426
|
-
# @param budget_id The id of the budget
|
477
|
+
# Updates a single transaction
|
478
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
427
479
|
# @param transaction_id The id of the transaction
|
428
480
|
# @param data The transaction to update
|
429
481
|
# @param [Hash] opts the optional parameters
|
@@ -475,7 +527,7 @@ module YNAB
|
|
475
527
|
end
|
476
528
|
# Update multiple transactions
|
477
529
|
# Updates multiple transactions, by `id` or `import_id`.
|
478
|
-
# @param budget_id The id of the budget
|
530
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
479
531
|
# @param data 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 their `import_id`. If an `id` is specified, it will always be used for lookup.
|
480
532
|
# @param [Hash] opts the optional parameters
|
481
533
|
# @return [SaveTransactionsResponse]
|
@@ -486,7 +538,7 @@ module YNAB
|
|
486
538
|
|
487
539
|
# Update multiple transactions
|
488
540
|
# Updates multiple transactions, by `id` or `import_id`.
|
489
|
-
# @param budget_id The id of the budget
|
541
|
+
# @param budget_id 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.youneedabudget.com/#oauth-default-budget).
|
490
542
|
# @param data 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 their `import_id`. If an `id` is specified, it will always be used for lookup.
|
491
543
|
# @param [Hash] opts the optional parameters
|
492
544
|
# @return [Array<(SaveTransactionsResponse, Fixnum, Hash)>] SaveTransactionsResponse data, response status code and response headers
|
data/lib/ynab/api/user_api.rb
CHANGED
data/lib/ynab/api_client.rb
CHANGED
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -267,7 +267,8 @@ module YNAB
|
|
267
267
|
def build_request_url(path)
|
268
268
|
# Add leading and trailing slashes to path
|
269
269
|
path = "/#{path}".gsub(/\/+/, '/')
|
270
|
-
URI.
|
270
|
+
URI.encode_www_form_component(path).gsub('+', '%20')
|
271
|
+
@config.base_url + path
|
271
272
|
end
|
272
273
|
|
273
274
|
# Builds the HTTP request body
|
data/lib/ynab/configuration.rb
CHANGED
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -174,8 +174,7 @@ module YNAB
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def base_url
|
177
|
-
|
178
|
-
URI.encode(url)
|
177
|
+
"#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
179
178
|
end
|
180
179
|
|
181
180
|
# Gets API key (with prefix if set).
|
data/lib/ynab/models/account.rb
CHANGED
@@ -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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -41,6 +41,12 @@ module YNAB
|
|
41
41
|
# The payee id which should be used when transferring to this account
|
42
42
|
attr_accessor :transfer_payee_id
|
43
43
|
|
44
|
+
# Whether or not the account is linked to a financial institution for automatic transaction import.
|
45
|
+
attr_accessor :direct_import_linked
|
46
|
+
|
47
|
+
# 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.
|
48
|
+
attr_accessor :direct_import_in_error
|
49
|
+
|
44
50
|
# Whether or not the account has been deleted. Deleted accounts will only be included in delta requests.
|
45
51
|
attr_accessor :deleted
|
46
52
|
|
@@ -79,6 +85,8 @@ module YNAB
|
|
79
85
|
:'cleared_balance' => :'cleared_balance',
|
80
86
|
:'uncleared_balance' => :'uncleared_balance',
|
81
87
|
:'transfer_payee_id' => :'transfer_payee_id',
|
88
|
+
:'direct_import_linked' => :'direct_import_linked',
|
89
|
+
:'direct_import_in_error' => :'direct_import_in_error',
|
82
90
|
:'deleted' => :'deleted'
|
83
91
|
}
|
84
92
|
end
|
@@ -96,6 +104,8 @@ module YNAB
|
|
96
104
|
:'cleared_balance' => :'Integer',
|
97
105
|
:'uncleared_balance' => :'Integer',
|
98
106
|
:'transfer_payee_id' => :'String',
|
107
|
+
:'direct_import_linked' => :'BOOLEAN',
|
108
|
+
:'direct_import_in_error' => :'BOOLEAN',
|
99
109
|
:'deleted' => :'BOOLEAN'
|
100
110
|
}
|
101
111
|
end
|
@@ -148,6 +158,14 @@ module YNAB
|
|
148
158
|
self.transfer_payee_id = attributes[:'transfer_payee_id']
|
149
159
|
end
|
150
160
|
|
161
|
+
if attributes.has_key?(:'direct_import_linked')
|
162
|
+
self.direct_import_linked = attributes[:'direct_import_linked']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'direct_import_in_error')
|
166
|
+
self.direct_import_in_error = attributes[:'direct_import_in_error']
|
167
|
+
end
|
168
|
+
|
151
169
|
if attributes.has_key?(:'deleted')
|
152
170
|
self.deleted = attributes[:'deleted']
|
153
171
|
end
|
@@ -221,10 +239,6 @@ module YNAB
|
|
221
239
|
# Custom attribute writer method checking allowed values (enum).
|
222
240
|
# @param [Object] type Object to be assigned
|
223
241
|
def type=(type)
|
224
|
-
validator = EnumAttributeValidator.new('String', ['checking', 'savings', 'cash', 'creditCard', 'lineOfCredit', 'otherAsset', 'otherLiability', 'payPal', 'merchantAccount', 'investmentAccount', 'mortgage'])
|
225
|
-
unless validator.valid?(type)
|
226
|
-
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
227
|
-
end
|
228
242
|
@type = type
|
229
243
|
end
|
230
244
|
|
@@ -243,6 +257,8 @@ module YNAB
|
|
243
257
|
cleared_balance == o.cleared_balance &&
|
244
258
|
uncleared_balance == o.uncleared_balance &&
|
245
259
|
transfer_payee_id == o.transfer_payee_id &&
|
260
|
+
direct_import_linked == o.direct_import_linked &&
|
261
|
+
direct_import_in_error == o.direct_import_in_error &&
|
246
262
|
deleted == o.deleted
|
247
263
|
end
|
248
264
|
|
@@ -255,9 +271,8 @@ module YNAB
|
|
255
271
|
# Calculates hash code according to all attributes.
|
256
272
|
# @return [Fixnum] Hash code
|
257
273
|
def hash
|
258
|
-
[id, name, type, on_budget, closed, note, balance, cleared_balance, uncleared_balance, transfer_payee_id, deleted].hash
|
274
|
+
[id, name, type, on_budget, closed, note, balance, cleared_balance, uncleared_balance, transfer_payee_id, direct_import_linked, direct_import_in_error, deleted].hash
|
259
275
|
end
|
260
|
-
|
261
276
|
# Builds the object from hash
|
262
277
|
# @param [Hash] attributes Model attributes in the form of hash
|
263
278
|
# @return [Object] Returns the model itself
|
@@ -265,7 +280,7 @@ module YNAB
|
|
265
280
|
return nil unless attributes.is_a?(Hash)
|
266
281
|
self.class.swagger_types.each_pair do |key, type|
|
267
282
|
if type =~ /\AArray<(.*)>/i
|
268
|
-
# check to ensure the input is an array given that the
|
283
|
+
# check to ensure the input is an array given that the attribute
|
269
284
|
# is documented as an array but the input is not
|
270
285
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
271
286
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -361,5 +376,7 @@ module YNAB
|
|
361
376
|
value
|
362
377
|
end
|
363
378
|
end
|
379
|
+
|
364
380
|
end
|
381
|
+
|
365
382
|
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.
|
9
|
+
Swagger Codegen version: 2.4.19
|
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
|
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
|