ynab 1.13.0 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/ynab.rb +6 -1
  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 +3 -7
  17. data/lib/ynab/models/account_response.rb +3 -2
  18. data/lib/ynab/models/account_response_data.rb +3 -2
  19. data/lib/ynab/models/accounts_response.rb +3 -2
  20. data/lib/ynab/models/accounts_response_data.rb +3 -2
  21. data/lib/ynab/models/budget_detail.rb +3 -2
  22. data/lib/ynab/models/budget_detail_response.rb +3 -2
  23. data/lib/ynab/models/budget_detail_response_data.rb +3 -2
  24. data/lib/ynab/models/budget_settings.rb +3 -2
  25. data/lib/ynab/models/budget_settings_response.rb +3 -2
  26. data/lib/ynab/models/budget_settings_response_data.rb +3 -2
  27. data/lib/ynab/models/budget_summary.rb +19 -6
  28. data/lib/ynab/models/budget_summary_response.rb +3 -2
  29. data/lib/ynab/models/budget_summary_response_data.rb +3 -7
  30. data/lib/ynab/models/bulk_response.rb +3 -2
  31. data/lib/ynab/models/bulk_response_data.rb +3 -2
  32. data/lib/ynab/models/bulk_response_data_bulk.rb +4 -3
  33. data/lib/ynab/models/bulk_transactions.rb +3 -2
  34. data/lib/ynab/models/categories_response.rb +3 -2
  35. data/lib/ynab/models/categories_response_data.rb +3 -2
  36. data/lib/ynab/models/category.rb +7 -36
  37. data/lib/ynab/models/category_group.rb +3 -2
  38. data/lib/ynab/models/category_group_with_categories.rb +3 -2
  39. data/lib/ynab/models/category_response.rb +3 -2
  40. data/lib/ynab/models/category_response_data.rb +3 -2
  41. data/lib/ynab/models/currency_format.rb +3 -2
  42. data/lib/ynab/models/date_format.rb +3 -2
  43. data/lib/ynab/models/error_detail.rb +3 -2
  44. data/lib/ynab/models/error_response.rb +3 -2
  45. data/lib/ynab/models/hybrid_transaction.rb +4 -58
  46. data/lib/ynab/models/hybrid_transactions_response.rb +3 -2
  47. data/lib/ynab/models/hybrid_transactions_response_data.rb +3 -2
  48. data/lib/ynab/models/month_detail.rb +5 -14
  49. data/lib/ynab/models/month_detail_response.rb +3 -2
  50. data/lib/ynab/models/month_detail_response_data.rb +3 -2
  51. data/lib/ynab/models/month_summaries_response.rb +3 -2
  52. data/lib/ynab/models/month_summaries_response_data.rb +3 -2
  53. data/lib/ynab/models/month_summary.rb +5 -14
  54. data/lib/ynab/models/payee.rb +4 -8
  55. data/lib/ynab/models/payee_location.rb +3 -2
  56. data/lib/ynab/models/payee_location_response.rb +3 -2
  57. data/lib/ynab/models/payee_location_response_data.rb +3 -2
  58. data/lib/ynab/models/payee_locations_response.rb +3 -2
  59. data/lib/ynab/models/payee_locations_response_data.rb +3 -2
  60. data/lib/ynab/models/payee_response.rb +3 -2
  61. data/lib/ynab/models/payee_response_data.rb +3 -2
  62. data/lib/ynab/models/payees_response.rb +3 -2
  63. data/lib/ynab/models/payees_response_data.rb +3 -2
  64. data/lib/ynab/models/save_category_response.rb +3 -2
  65. data/lib/ynab/models/save_category_response_data.rb +3 -2
  66. data/lib/ynab/models/save_month_category.rb +3 -2
  67. data/lib/ynab/models/save_month_category_wrapper.rb +3 -2
  68. data/lib/ynab/models/save_sub_transaction.rb +259 -0
  69. data/lib/ynab/models/save_transaction.rb +23 -10
  70. data/lib/ynab/models/save_transaction_wrapper.rb +3 -2
  71. data/lib/ynab/models/save_transactions_response.rb +3 -2
  72. data/lib/ynab/models/save_transactions_response_data.rb +4 -3
  73. data/lib/ynab/models/save_transactions_wrapper.rb +3 -2
  74. data/lib/ynab/models/scheduled_sub_transaction.rb +3 -22
  75. data/lib/ynab/models/scheduled_transaction_detail.rb +3 -37
  76. data/lib/ynab/models/scheduled_transaction_response.rb +3 -2
  77. data/lib/ynab/models/scheduled_transaction_response_data.rb +3 -2
  78. data/lib/ynab/models/scheduled_transaction_summary.rb +3 -27
  79. data/lib/ynab/models/scheduled_transactions_response.rb +3 -2
  80. data/lib/ynab/models/scheduled_transactions_response_data.rb +3 -2
  81. data/lib/ynab/models/sub_transaction.rb +22 -23
  82. data/lib/ynab/models/transaction_detail.rb +3 -52
  83. data/lib/ynab/models/transaction_response.rb +3 -2
  84. data/lib/ynab/models/transaction_response_data.rb +3 -2
  85. data/lib/ynab/models/transaction_summary.rb +3 -42
  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 +3 -2
  89. data/lib/ynab/models/transactions_response_data.rb +3 -2
  90. data/lib/ynab/models/update_transaction.rb +415 -0
  91. data/lib/ynab/models/update_transactions_wrapper.rb +191 -0
  92. data/lib/ynab/models/user.rb +3 -2
  93. data/lib/ynab/models/user_response.rb +3 -2
  94. data/lib/ynab/models/user_response_data.rb +3 -2
  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. metadata +10 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6da546079c4883af6fa184f17467ae41764277c936c9788457514c325558d15
4
- data.tar.gz: 8a68512c9bb8bca7616ad7900cfbce34d52b8e3daa942c6f233e5261c21d34a5
3
+ metadata.gz: 5193151bd306e6a66a71f0c58b24ebb55d2ed1c16dc33120900672790d8fc9d1
4
+ data.tar.gz: 7cfd48f3711e1da5cdafecaf184122becb49cb87c09cc1dd57447d1720b06c07
5
5
  SHA512:
6
- metadata.gz: b070d8f263a20e3c344266cc8a1881adabe9c0e800b8d879c29e359716d8456f5a51a37164dff748a12b87e8f394fbcad1cc1fd73d40f3bb0c37f014754c2a9f
7
- data.tar.gz: 261141d695e12bafab8523a928616153303bb32b5a65c506daa25e3876156ed2223c1c3a447121b26770b045b201ef37860b524cd727e684aa667ba6dfdc651e
6
+ metadata.gz: 71d5b167f0c5f901bac07b64bc09724e99036aadaefd819fd257173f456665a20f382eefe36a14094c7868c562431336c060a18aae9ceb024580487809ce6c4f
7
+ data.tar.gz: 44e56b3b9b838aad74319bd0ffddec55122a4981437093fffe2bd67a09be46b671fc52af9c85bc57aab916e413ee44a3fa7bf179bf15910896e0f265567aa653
data/README.md CHANGED
@@ -71,6 +71,7 @@ The following methods are available in this library.
71
71
  | | [transactions.create_transactions(budget_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#create_transaction) | Creates multiple transactions |
72
72
  | | [transactions.update_transaction(budget_id, id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#update_transaction) | Updates a single transaction |
73
73
  | | [transactions.update_transactions(budget_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#update_transactions) | Updates multiple transactions |
74
+ | | [transactions.import_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#import_transactions) | Imports transactions |
74
75
  | **Scheduled Transactions** | [scheduled_transactions.get_scheduled_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#get_scheduled_transactions) | Returns all scheduled transactions |
75
76
  | | [scheduled_transactions.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | Returns a single scheduled transaction |
76
77
 
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -65,6 +65,7 @@ require 'ynab/models/save_category_response'
65
65
  require 'ynab/models/save_category_response_data'
66
66
  require 'ynab/models/save_month_category'
67
67
  require 'ynab/models/save_month_category_wrapper'
68
+ require 'ynab/models/save_sub_transaction'
68
69
  require 'ynab/models/save_transaction'
69
70
  require 'ynab/models/save_transaction_wrapper'
70
71
  require 'ynab/models/save_transactions_response'
@@ -80,8 +81,11 @@ require 'ynab/models/sub_transaction'
80
81
  require 'ynab/models/transaction_response'
81
82
  require 'ynab/models/transaction_response_data'
82
83
  require 'ynab/models/transaction_summary'
84
+ require 'ynab/models/transactions_import_response'
85
+ require 'ynab/models/transactions_import_response_data'
83
86
  require 'ynab/models/transactions_response'
84
87
  require 'ynab/models/transactions_response_data'
88
+ require 'ynab/models/update_transactions_wrapper'
85
89
  require 'ynab/models/user'
86
90
  require 'ynab/models/user_response'
87
91
  require 'ynab/models/user_response_data'
@@ -91,6 +95,7 @@ require 'ynab/models/hybrid_transaction'
91
95
  require 'ynab/models/month_detail'
92
96
  require 'ynab/models/scheduled_transaction_detail'
93
97
  require 'ynab/models/transaction_detail'
98
+ require 'ynab/models/update_transaction'
94
99
 
95
100
  # APIs
96
101
  require 'ynab/api/accounts_api'
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -81,7 +81,7 @@ module YNAB
81
81
  # Returns all accounts
82
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
- # @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.
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 [AccountsResponse]
86
86
  def get_accounts(budget_id, opts = {})
87
87
  data, _status_code, _headers = get_accounts_with_http_info(budget_id, opts)
@@ -92,7 +92,7 @@ module YNAB
92
92
  # Returns all accounts
93
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
- # @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.
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<(AccountsResponse, Fixnum, Hash)>] AccountsResponse data, response status code and response headers
97
97
  def get_accounts_with_http_info(budget_id, opts = {})
98
98
  if @api_client.config.debugging
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -23,7 +23,7 @@ module YNAB
23
23
  # Returns a single budget with all related entities. This resource is effectively a full budget export.
24
24
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
25
25
  # @param [Hash] opts the optional parameters
26
- # @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.
26
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
27
27
  # @return [BudgetDetailResponse]
28
28
  def get_budget_by_id(budget_id, opts = {})
29
29
  data, _status_code, _headers = get_budget_by_id_with_http_info(budget_id, opts)
@@ -34,7 +34,7 @@ module YNAB
34
34
  # Returns a single budget with all related entities. This resource is effectively a full budget export.
35
35
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
36
36
  # @param [Hash] opts the optional parameters
37
- # @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.
37
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
38
38
  # @return [Array<(BudgetDetailResponse, Fixnum, Hash)>] BudgetDetailResponse data, response status code and response headers
39
39
  def get_budget_by_id_with_http_info(budget_id, opts = {})
40
40
  if @api_client.config.debugging
@@ -129,6 +129,7 @@ module YNAB
129
129
  # List budgets
130
130
  # Returns budgets list with summary information
131
131
  # @param [Hash] opts the optional parameters
132
+ # @option opts [BOOLEAN] :include_accounts Whether to include the list of budget accounts
132
133
  # @return [BudgetSummaryResponse]
133
134
  def get_budgets(opts = {})
134
135
  data, _status_code, _headers = get_budgets_with_http_info(opts)
@@ -138,6 +139,7 @@ module YNAB
138
139
  # List budgets
139
140
  # Returns budgets list with summary information
140
141
  # @param [Hash] opts the optional parameters
142
+ # @option opts [BOOLEAN] :include_accounts Whether to include the list of budget accounts
141
143
  # @return [Array<(BudgetSummaryResponse, Fixnum, Hash)>] BudgetSummaryResponse data, response status code and response headers
142
144
  def get_budgets_with_http_info(opts = {})
143
145
  if @api_client.config.debugging
@@ -148,6 +150,7 @@ module YNAB
148
150
 
149
151
  # query parameters
150
152
  query_params = {}
153
+ query_params[:'include_accounts'] = opts[:'include_accounts'] if !opts[:'include_accounts'].nil?
151
154
 
152
155
  # header parameters
153
156
  header_params = {}
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -23,7 +23,7 @@ module YNAB
23
23
  # Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
24
24
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
25
25
  # @param [Hash] opts the optional parameters
26
- # @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.
26
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
27
27
  # @return [CategoriesResponse]
28
28
  def get_categories(budget_id, opts = {})
29
29
  data, _status_code, _headers = get_categories_with_http_info(budget_id, opts)
@@ -34,7 +34,7 @@ module YNAB
34
34
  # Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
35
35
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
36
36
  # @param [Hash] opts the optional parameters
37
- # @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.
37
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
38
38
  # @return [Array<(CategoriesResponse, Fixnum, Hash)>] CategoriesResponse data, response status code and response headers
39
39
  def get_categories_with_http_info(budget_id, opts = {})
40
40
  if @api_client.config.debugging
@@ -197,11 +197,11 @@ module YNAB
197
197
  return data, status_code, headers
198
198
  end
199
199
  # Update a category for a specific month
200
- # Update a category for a specific month
200
+ # Update a category for a specific month. Only `budgeted` amount can be updated.
201
201
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
202
202
  # @param month The budget month in ISO format (e.g. 2016-12-01) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
203
203
  # @param category_id The id of the category
204
- # @param data The category to update
204
+ # @param data The category to update. Only &#x60;budgeted&#x60; amount can be updated and any other fields specified will be ignored.
205
205
  # @param [Hash] opts the optional parameters
206
206
  # @return [SaveCategoryResponse]
207
207
  def update_month_category(budget_id, month, category_id, data, opts = {})
@@ -210,11 +210,11 @@ module YNAB
210
210
  end
211
211
 
212
212
  # Update a category for a specific month
213
- # Update a category for a specific month
213
+ # Update a category for a specific month. Only &#x60;budgeted&#x60; amount can be updated.
214
214
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
215
215
  # @param month The budget month in ISO format (e.g. 2016-12-01) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
216
216
  # @param category_id The id of the category
217
- # @param data The category to update
217
+ # @param data The category to update. Only &#x60;budgeted&#x60; amount can be updated and any other fields specified will be ignored.
218
218
  # @param [Hash] opts the optional parameters
219
219
  # @return [Array<(SaveCategoryResponse, Fixnum, Hash)>] SaveCategoryResponse data, response status code and response headers
220
220
  def update_month_category_with_http_info(budget_id, month, category_id, data, opts = {})
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -81,7 +81,7 @@ module YNAB
81
81
  # Returns all budget months
82
82
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @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.
84
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
85
85
  # @return [MonthSummariesResponse]
86
86
  def get_budget_months(budget_id, opts = {})
87
87
  data, _status_code, _headers = get_budget_months_with_http_info(budget_id, opts)
@@ -92,7 +92,7 @@ module YNAB
92
92
  # Returns all budget months
93
93
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @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.
95
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
96
96
  # @return [Array<(MonthSummariesResponse, Fixnum, Hash)>] MonthSummariesResponse data, response status code and response headers
97
97
  def get_budget_months_with_http_info(budget_id, opts = {})
98
98
  if @api_client.config.debugging
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -81,7 +81,7 @@ module YNAB
81
81
  # Returns all payees
82
82
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @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.
84
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
85
85
  # @return [PayeesResponse]
86
86
  def get_payees(budget_id, opts = {})
87
87
  data, _status_code, _headers = get_payees_with_http_info(budget_id, opts)
@@ -92,7 +92,7 @@ module YNAB
92
92
  # Returns all payees
93
93
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @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.
95
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
96
96
  # @return [Array<(PayeesResponse, Fixnum, Hash)>] PayeesResponse data, response status code and response headers
97
97
  def get_payees_with_http_info(budget_id, opts = {})
98
98
  if @api_client.config.debugging
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -81,7 +81,7 @@ module YNAB
81
81
  # Returns all scheduled transactions
82
82
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @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.
84
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
85
85
  # @return [ScheduledTransactionsResponse]
86
86
  def get_scheduled_transactions(budget_id, opts = {})
87
87
  data, _status_code, _headers = get_scheduled_transactions_with_http_info(budget_id, opts)
@@ -92,7 +92,7 @@ module YNAB
92
92
  # Returns all scheduled transactions
93
93
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @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.
95
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
96
96
  # @return [Array<(ScheduledTransactionsResponse, Fixnum, Hash)>] ScheduledTransactionsResponse data, response status code and response headers
97
97
  def get_scheduled_transactions_with_http_info(budget_id, opts = {})
98
98
  if @api_client.config.debugging
@@ -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.14
10
10
 
11
11
  =end
12
12
 
@@ -20,9 +20,9 @@ module YNAB
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create a single transaction or multiple transactions
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.
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
24
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
25
- # @param data The transaction or transactions to create. To create a single transaction you can specify a value for the &#39;transaction&#39; object and to create multiple transactions you can specify an array of &#39;transactions&#39;. It is expected that you will only provide a value for one of these objects.
25
+ # @param data The transaction or transactions to create. To create a single transaction you can specify a value for the &#x60;transaction&#x60; object and to create multiple transactions you can specify an array of &#x60;transactions&#x60;. 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]
28
28
  def create_transaction(budget_id, data, opts = {})
@@ -31,9 +31,9 @@ module YNAB
31
31
  end
32
32
 
33
33
  # Create a single transaction or multiple transactions
34
- # Creates a single transaction or multiple transactions. If you provide a body containing a &#39;transaction&#39; object, a single transaction will be created and if you provide a body containing a &#39;transactions&#39; array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
34
+ # Creates a single transaction or multiple transactions. If you provide a body containing a &#x60;transaction&#x60; object, a single transaction will be created and if you provide a body containing a &#x60;transactions&#x60; array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
35
35
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
36
- # @param data The transaction or transactions to create. To create a single transaction you can specify a value for the &#39;transaction&#39; object and to create multiple transactions you can specify an array of &#39;transactions&#39;. It is expected that you will only provide a value for one of these objects.
36
+ # @param data The transaction or transactions to create. To create a single transaction you can specify a value for the &#x60;transaction&#x60; object and to create multiple transactions you can specify an array of &#x60;transactions&#x60;. 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
39
39
  def create_transaction_with_http_info(budget_id, data, opts = {})
@@ -140,8 +140,8 @@ module YNAB
140
140
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
144
- # @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.
143
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
144
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
145
145
  # @return [TransactionsResponse]
146
146
  def get_transactions(budget_id, opts = {})
147
147
  data, _status_code, _headers = get_transactions_with_http_info(budget_id, opts)
@@ -153,8 +153,8 @@ module YNAB
153
153
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
157
- # @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.
156
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
157
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
158
158
  # @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
159
159
  def get_transactions_with_http_info(budget_id, opts = {})
160
160
  if @api_client.config.debugging
@@ -205,8 +205,8 @@ module YNAB
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).
208
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
209
- # @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.
208
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
209
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
210
210
  # @return [TransactionsResponse]
211
211
  def get_transactions_by_account(budget_id, account_id, opts = {})
212
212
  data, _status_code, _headers = get_transactions_by_account_with_http_info(budget_id, account_id, opts)
@@ -219,8 +219,8 @@ module YNAB
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).
222
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
223
- # @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.
222
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
223
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
224
224
  # @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
225
225
  def get_transactions_by_account_with_http_info(budget_id, account_id, opts = {})
226
226
  if @api_client.config.debugging
@@ -275,8 +275,8 @@ module YNAB
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).
278
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
279
- # @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.
278
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
279
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
280
280
  # @return [HybridTransactionsResponse]
281
281
  def get_transactions_by_category(budget_id, category_id, opts = {})
282
282
  data, _status_code, _headers = get_transactions_by_category_with_http_info(budget_id, category_id, opts)
@@ -289,8 +289,8 @@ module YNAB
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).
292
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
293
- # @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.
292
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
293
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
294
294
  # @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
295
295
  def get_transactions_by_category_with_http_info(budget_id, category_id, opts = {})
296
296
  if @api_client.config.debugging
@@ -345,8 +345,8 @@ module YNAB
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).
348
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
349
- # @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.
348
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
349
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
350
350
  # @return [HybridTransactionsResponse]
351
351
  def get_transactions_by_payee(budget_id, payee_id, opts = {})
352
352
  data, _status_code, _headers = get_transactions_by_payee_with_http_info(budget_id, payee_id, opts)
@@ -359,8 +359,8 @@ module YNAB
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).
362
- # @option opts [String] :type If specified, only transactions of the specified type will be included. &#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported.
363
- # @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.
362
+ # @option opts [String] :type If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported.
363
+ # @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.
364
364
  # @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
365
365
  def get_transactions_by_payee_with_http_info(budget_id, payee_id, opts = {})
366
366
  if @api_client.config.debugging
@@ -409,6 +409,58 @@ module YNAB
409
409
  end
410
410
  return data, status_code, headers
411
411
  end
412
+ # Import transactions
413
+ # Imports transactions.
414
+ # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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 transactions.
424
+ # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; 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
465
  # Updates a transaction
414
466
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
@@ -474,9 +526,9 @@ module YNAB
474
526
  return data, status_code, headers
475
527
  end
476
528
  # Update multiple transactions
477
- # Updates multiple transactions, by 'id' or 'import_id'.
529
+ # Updates multiple transactions, by `id` or `import_id`.
478
530
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
479
- # @param data The transactions to update. Optionally, transaction &#39;id&#39; value(s) can be specified as null and an &#39;import_id&#39; value can be provided which will allow transaction(s) to updated by their import_id.
531
+ # @param data The transactions to update. Each transaction must have either an &#x60;id&#x60; or &#x60;import_id&#x60; specified. If &#x60;id&#x60; is specified as null an &#x60;import_id&#x60; value can be provided which will allow transaction(s) to be updated by their &#x60;import_id&#x60;. If an &#x60;id&#x60; is specified, it will always be used for lookup.
480
532
  # @param [Hash] opts the optional parameters
481
533
  # @return [SaveTransactionsResponse]
482
534
  def update_transactions(budget_id, data, opts = {})
@@ -485,9 +537,9 @@ module YNAB
485
537
  end
486
538
 
487
539
  # Update multiple transactions
488
- # Updates multiple transactions, by &#39;id&#39; or &#39;import_id&#39;.
540
+ # Updates multiple transactions, by &#x60;id&#x60; or &#x60;import_id&#x60;.
489
541
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
490
- # @param data The transactions to update. Optionally, transaction &#39;id&#39; value(s) can be specified as null and an &#39;import_id&#39; value can be provided which will allow transaction(s) to updated by their import_id.
542
+ # @param data The transactions to update. Each transaction must have either an &#x60;id&#x60; or &#x60;import_id&#x60; specified. If &#x60;id&#x60; is specified as null an &#x60;import_id&#x60; value can be provided which will allow transaction(s) to be updated by their &#x60;import_id&#x60;. If an &#x60;id&#x60; 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
493
545
  def update_transactions_with_http_info(budget_id, data, opts = {})