ynab 1.31.0 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +11 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +42 -0
  5. data/README.md +3 -3
  6. data/Rakefile +58 -0
  7. data/config.json +9 -0
  8. data/docs/Account.md +25 -0
  9. data/docs/AccountResponse.md +8 -0
  10. data/docs/AccountResponseData.md +8 -0
  11. data/docs/AccountType.md +7 -0
  12. data/docs/AccountWrapper.md +8 -0
  13. data/docs/AccountsApi.md +70 -0
  14. data/docs/AccountsResponse.md +8 -0
  15. data/docs/AccountsResponseData.md +9 -0
  16. data/docs/AccountsWrapper.md +9 -0
  17. data/docs/BudgetDetail.md +24 -0
  18. data/docs/BudgetDetailAllOf.md +17 -0
  19. data/docs/BudgetDetailResponse.md +8 -0
  20. data/docs/BudgetDetailResponseData.md +9 -0
  21. data/docs/BudgetDetailWrapper.md +9 -0
  22. data/docs/BudgetSettings.md +9 -0
  23. data/docs/BudgetSettingsResponse.md +8 -0
  24. data/docs/BudgetSettingsResponseData.md +8 -0
  25. data/docs/BudgetSettingsWrapper.md +8 -0
  26. data/docs/BudgetSummary.md +15 -0
  27. data/docs/BudgetSummaryResponse.md +8 -0
  28. data/docs/BudgetSummaryResponseData.md +9 -0
  29. data/docs/BudgetSummaryWrapper.md +9 -0
  30. data/docs/BudgetsApi.md +68 -0
  31. data/docs/BulkIdWrapper.md +8 -0
  32. data/docs/BulkIds.md +9 -0
  33. data/docs/BulkResponse.md +8 -0
  34. data/docs/BulkResponseData.md +8 -0
  35. data/docs/BulkResponseDataBulk.md +9 -0
  36. data/docs/BulkTransactionCreateResponse.md +8 -0
  37. data/docs/BulkTransactionIds.md +8 -0
  38. data/docs/BulkTransactions.md +8 -0
  39. data/docs/CategoriesApi.md +94 -0
  40. data/docs/CategoriesResponse.md +8 -0
  41. data/docs/CategoriesResponseData.md +9 -0
  42. data/docs/Category.md +30 -0
  43. data/docs/CategoryGroup.md +11 -0
  44. data/docs/CategoryGroupWithCategories.md +12 -0
  45. data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
  46. data/docs/CategoryGroupsWrapper.md +9 -0
  47. data/docs/CategoryResponse.md +8 -0
  48. data/docs/CategoryResponseData.md +8 -0
  49. data/docs/CategoryWrapper.md +9 -0
  50. data/docs/CurrencyFormat.md +15 -0
  51. data/docs/DateFormat.md +8 -0
  52. data/docs/DeprecatedApi.md +28 -0
  53. data/docs/ErrorDetail.md +10 -0
  54. data/docs/ErrorResponse.md +8 -0
  55. data/docs/HybridTransaction.md +30 -0
  56. data/docs/HybridTransactionAllOf.md +12 -0
  57. data/docs/HybridTransactionsResponse.md +8 -0
  58. data/docs/HybridTransactionsResponseData.md +9 -0
  59. data/docs/HybridTransactionsWrapper.md +8 -0
  60. data/docs/LoanAccountPeriodicValue.md +7 -0
  61. data/docs/MonthDetail.md +16 -0
  62. data/docs/MonthDetailAllOf.md +8 -0
  63. data/docs/MonthDetailResponse.md +8 -0
  64. data/docs/MonthDetailResponseData.md +8 -0
  65. data/docs/MonthDetailWrapper.md +8 -0
  66. data/docs/MonthSummariesResponse.md +8 -0
  67. data/docs/MonthSummariesResponseData.md +9 -0
  68. data/docs/MonthSummariesWrapper.md +9 -0
  69. data/docs/MonthSummary.md +15 -0
  70. data/docs/MonthsApi.md +49 -0
  71. data/docs/PatchMonthCategoryWrapper.md +8 -0
  72. data/docs/PatchTransactionsWrapper.md +8 -0
  73. data/docs/Payee.md +11 -0
  74. data/docs/PayeeLocation.md +12 -0
  75. data/docs/PayeeLocationResponse.md +8 -0
  76. data/docs/PayeeLocationResponseData.md +8 -0
  77. data/docs/PayeeLocationWrapper.md +8 -0
  78. data/docs/PayeeLocationsApi.md +69 -0
  79. data/docs/PayeeLocationsResponse.md +8 -0
  80. data/docs/PayeeLocationsResponseData.md +8 -0
  81. data/docs/PayeeLocationsWrapper.md +8 -0
  82. data/docs/PayeeResponse.md +8 -0
  83. data/docs/PayeeResponseData.md +8 -0
  84. data/docs/PayeeWrapper.md +8 -0
  85. data/docs/PayeesApi.md +49 -0
  86. data/docs/PayeesResponse.md +8 -0
  87. data/docs/PayeesResponseData.md +9 -0
  88. data/docs/PayeesWrapper.md +9 -0
  89. data/docs/PostAccountWrapper.md +8 -0
  90. data/docs/PostTransactionsWrapper.md +9 -0
  91. data/docs/PutTransactionWrapper.md +8 -0
  92. data/docs/SaveAccount.md +10 -0
  93. data/docs/SaveAccountWrapper.md +8 -0
  94. data/docs/SaveCategoryResponse.md +8 -0
  95. data/docs/SaveCategoryResponseData.md +9 -0
  96. data/docs/SaveMonthCategory.md +8 -0
  97. data/docs/SaveMonthCategoryWrapper.md +8 -0
  98. data/docs/SaveSubTransaction.md +12 -0
  99. data/docs/SaveTransaction.md +19 -0
  100. data/docs/SaveTransactionWithId.md +20 -0
  101. data/docs/SaveTransactionWithIdAllOf.md +8 -0
  102. data/docs/SaveTransactionWithOptionalFields.md +19 -0
  103. data/docs/SaveTransactionWrapper.md +8 -0
  104. data/docs/SaveTransactionsResponse.md +8 -0
  105. data/docs/SaveTransactionsResponseData.md +12 -0
  106. data/docs/SaveTransactionsWrapper.md +9 -0
  107. data/docs/ScheduledSubTransaction.md +15 -0
  108. data/docs/ScheduledTransactionDetail.md +23 -0
  109. data/docs/ScheduledTransactionDetailAllOf.md +11 -0
  110. data/docs/ScheduledTransactionResponse.md +8 -0
  111. data/docs/ScheduledTransactionResponseData.md +8 -0
  112. data/docs/ScheduledTransactionSummary.md +19 -0
  113. data/docs/ScheduledTransactionWrapper.md +8 -0
  114. data/docs/ScheduledTransactionsApi.md +49 -0
  115. data/docs/ScheduledTransactionsResponse.md +8 -0
  116. data/docs/ScheduledTransactionsResponseData.md +9 -0
  117. data/docs/ScheduledTransactionsWrapper.md +8 -0
  118. data/docs/SubTransaction.md +18 -0
  119. data/docs/TransactionDetail.md +29 -0
  120. data/docs/TransactionDetailAllOf.md +11 -0
  121. data/docs/TransactionResponse.md +8 -0
  122. data/docs/TransactionResponseData.md +8 -0
  123. data/docs/TransactionSummary.md +25 -0
  124. data/docs/TransactionWrapper.md +8 -0
  125. data/docs/TransactionsApi.md +228 -0
  126. data/docs/TransactionsImportResponse.md +8 -0
  127. data/docs/TransactionsImportResponseData.md +8 -0
  128. data/docs/TransactionsResponse.md +8 -0
  129. data/docs/TransactionsResponseData.md +9 -0
  130. data/docs/TransactionsWrapper.md +9 -0
  131. data/docs/UpdateTransaction.md +20 -0
  132. data/docs/UpdateTransactionsWrapper.md +8 -0
  133. data/docs/User.md +8 -0
  134. data/docs/UserApi.md +25 -0
  135. data/docs/UserResponse.md +8 -0
  136. data/docs/UserResponseData.md +8 -0
  137. data/docs/UserWrapper.md +8 -0
  138. data/examples/budget-list.rb +21 -0
  139. data/examples/budget-month.rb +33 -0
  140. data/examples/category-balance.rb +23 -0
  141. data/examples/create-multiple-transactions.rb +42 -0
  142. data/examples/create-transaction.rb +30 -0
  143. data/examples/update-category-budgeted.rb +25 -0
  144. data/examples/update-multiple-transactions.rb +20 -0
  145. data/lib/ynab/api/accounts_api.rb +78 -41
  146. data/lib/ynab/api/budgets_api.rb +68 -36
  147. data/lib/ynab/api/categories_api.rb +108 -60
  148. data/lib/ynab/api/deprecated_api.rb +32 -17
  149. data/lib/ynab/api/months_api.rb +49 -28
  150. data/lib/ynab/api/payee_locations_api.rb +73 -41
  151. data/lib/ynab/api/payees_api.rb +49 -28
  152. data/lib/ynab/api/scheduled_transactions_api.rb +49 -28
  153. data/lib/ynab/api/transactions_api.rb +268 -140
  154. data/lib/ynab/api/user_api.rb +22 -12
  155. data/lib/ynab/api_client.rb +97 -95
  156. data/lib/ynab/configuration.rb +101 -14
  157. data/lib/ynab/models/account.rb +117 -55
  158. data/lib/ynab/models/account_response.rb +53 -18
  159. data/lib/ynab/models/account_response_data.rb +53 -18
  160. data/lib/ynab/models/account_type.rb +30 -20
  161. data/lib/ynab/models/accounts_response.rb +53 -18
  162. data/lib/ynab/models/accounts_response_data.rb +54 -19
  163. data/lib/ynab/models/budget_detail.rb +80 -35
  164. data/lib/ynab/models/budget_detail_all_of.rb +320 -0
  165. data/lib/ynab/models/budget_detail_response.rb +53 -18
  166. data/lib/ynab/models/budget_detail_response_data.rb +54 -19
  167. data/lib/ynab/models/budget_settings.rb +56 -29
  168. data/lib/ynab/models/budget_settings_response.rb +53 -18
  169. data/lib/ynab/models/budget_settings_response_data.rb +53 -18
  170. data/lib/ynab/models/budget_summary.rb +63 -26
  171. data/lib/ynab/models/budget_summary_response.rb +53 -18
  172. data/lib/ynab/models/budget_summary_response_data.rb +54 -20
  173. data/lib/ynab/models/bulk_response.rb +53 -18
  174. data/lib/ynab/models/bulk_response_data.rb +53 -18
  175. data/lib/ynab/models/bulk_response_data_bulk.rb +54 -19
  176. data/lib/ynab/models/bulk_transactions.rb +53 -18
  177. data/lib/ynab/models/categories_response.rb +53 -18
  178. data/lib/ynab/models/categories_response_data.rb +54 -19
  179. data/lib/ynab/models/category.rb +110 -48
  180. data/lib/ynab/models/category_group.rb +58 -23
  181. data/lib/ynab/models/category_group_with_categories.rb +67 -24
  182. data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
  183. data/lib/ynab/models/category_response.rb +53 -18
  184. data/lib/ynab/models/category_response_data.rb +53 -18
  185. data/lib/ynab/models/currency_format.rb +62 -27
  186. data/lib/ynab/models/date_format.rb +53 -18
  187. data/lib/ynab/models/error_detail.rb +55 -20
  188. data/lib/ynab/models/error_response.rb +53 -18
  189. data/lib/ynab/models/hybrid_transaction.rb +118 -46
  190. data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
  191. data/lib/ynab/models/hybrid_transactions_response.rb +53 -18
  192. data/lib/ynab/models/hybrid_transactions_response_data.rb +54 -19
  193. data/lib/ynab/models/month_detail.rb +72 -27
  194. data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
  195. data/lib/ynab/models/month_detail_response.rb +53 -18
  196. data/lib/ynab/models/month_detail_response_data.rb +53 -18
  197. data/lib/ynab/models/month_summaries_response.rb +53 -18
  198. data/lib/ynab/models/month_summaries_response_data.rb +54 -19
  199. data/lib/ynab/models/month_summary.rb +63 -26
  200. data/lib/ynab/models/patch_month_category_wrapper.rb +53 -18
  201. data/lib/ynab/models/patch_transactions_wrapper.rb +53 -18
  202. data/lib/ynab/models/payee.rb +58 -22
  203. data/lib/ynab/models/payee_location.rb +58 -23
  204. data/lib/ynab/models/payee_location_response.rb +53 -18
  205. data/lib/ynab/models/payee_location_response_data.rb +53 -18
  206. data/lib/ynab/models/payee_locations_response.rb +53 -18
  207. data/lib/ynab/models/payee_locations_response_data.rb +53 -18
  208. data/lib/ynab/models/payee_response.rb +53 -18
  209. data/lib/ynab/models/payee_response_data.rb +53 -18
  210. data/lib/ynab/models/payees_response.rb +53 -18
  211. data/lib/ynab/models/payees_response_data.rb +54 -19
  212. data/lib/ynab/models/post_account_wrapper.rb +53 -18
  213. data/lib/ynab/models/post_transactions_wrapper.rb +54 -19
  214. data/lib/ynab/models/put_transaction_wrapper.rb +53 -18
  215. data/lib/ynab/models/save_account.rb +77 -20
  216. data/lib/ynab/models/save_category_response.rb +53 -18
  217. data/lib/ynab/models/save_category_response_data.rb +54 -19
  218. data/lib/ynab/models/save_month_category.rb +53 -18
  219. data/lib/ynab/models/save_sub_transaction.rb +61 -22
  220. data/lib/ynab/models/save_transaction.rb +88 -33
  221. data/lib/ynab/models/save_transaction_with_id.rb +102 -46
  222. data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
  223. data/lib/ynab/models/save_transaction_with_optional_fields.rb +81 -33
  224. data/lib/ynab/models/save_transactions_response.rb +53 -18
  225. data/lib/ynab/models/save_transactions_response_data.rb +57 -23
  226. data/lib/ynab/models/scheduled_sub_transaction.rb +66 -27
  227. data/lib/ynab/models/scheduled_transaction_detail.rb +94 -36
  228. data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
  229. data/lib/ynab/models/scheduled_transaction_response.rb +53 -18
  230. data/lib/ynab/models/scheduled_transaction_response_data.rb +53 -18
  231. data/lib/ynab/models/scheduled_transaction_summary.rb +80 -32
  232. data/lib/ynab/models/scheduled_transactions_response.rb +53 -18
  233. data/lib/ynab/models/scheduled_transactions_response_data.rb +54 -19
  234. data/lib/ynab/models/sub_transaction.rb +71 -29
  235. data/lib/ynab/models/transaction_detail.rb +112 -44
  236. data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
  237. data/lib/ynab/models/transaction_response.rb +53 -18
  238. data/lib/ynab/models/transaction_response_data.rb +53 -18
  239. data/lib/ynab/models/transaction_summary.rb +98 -40
  240. data/lib/ynab/models/transactions_import_response.rb +53 -18
  241. data/lib/ynab/models/transactions_import_response_data.rb +53 -18
  242. data/lib/ynab/models/transactions_response.rb +53 -18
  243. data/lib/ynab/models/transactions_response_data.rb +54 -19
  244. data/lib/ynab/models/user.rb +53 -18
  245. data/lib/ynab/models/user_response.rb +53 -18
  246. data/lib/ynab/models/user_response_data.rb +53 -18
  247. data/lib/ynab/version.rb +1 -1
  248. data/lib/ynab.rb +19 -14
  249. data/open_api_spec.yaml +3012 -0
  250. data/templates/api_client.mustache +274 -0
  251. data/templates/api_client_typhoeus_partial.mustache +156 -0
  252. data/templates/api_doc.mustache +44 -0
  253. data/templates/gem.mustache +84 -0
  254. data/templates/partial_model_generic_doc.mustache +9 -0
  255. data/ynab.gemspec +38 -0
  256. metadata +194 -87
  257. data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
  258. data/lib/ynab/models/save_account_wrapper.rb +0 -189
  259. data/lib/ynab/models/update_transaction.rb +0 -407
  260. data/spec/models/transaction_detail_spec.rb +0 -11
@@ -3,14 +3,14 @@
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
- OpenAPI spec version: 1.0.0
6
+ The version of the OpenAPI document: 1.0.0
7
7
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.6.0
10
10
 
11
11
  =end
12
12
 
13
- require 'uri'
13
+ require 'cgi'
14
14
 
15
15
  module YNAB
16
16
  class TransactionsApi
@@ -21,8 +21,8 @@ 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. \"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).
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.
24
+ # @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).
25
+ # @param data [PostTransactionsWrapper] 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]
28
28
  def create_transaction(budget_id, data, opts = {})
@@ -32,10 +32,10 @@ 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. \"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).
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.
35
+ # @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).
36
+ # @param data [PostTransactionsWrapper] 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
- # @return [Array<(SaveTransactionsResponse, Fixnum, Hash)>] SaveTransactionsResponse data, response status code and response headers
38
+ # @return [Array<(SaveTransactionsResponse, Integer, Hash)>] SaveTransactionsResponse data, response status code and response headers
39
39
  def create_transaction_with_http_info(budget_id, data, opts = {})
40
40
  if @api_client.config.debugging
41
41
  @api_client.config.logger.debug 'Calling API: TransactionsApi.create_transaction ...'
@@ -49,38 +49,54 @@ module YNAB
49
49
  fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.create_transaction"
50
50
  end
51
51
  # resource path
52
- local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s)
52
+ local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
53
53
 
54
54
  # query parameters
55
- query_params = {}
55
+ query_params = opts[:query_params] || {}
56
56
 
57
57
  # header parameters
58
- header_params = {}
58
+ header_params = opts[:header_params] || {}
59
59
  # HTTP header 'Accept' (if needed)
60
60
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
61
66
 
62
67
  # form parameters
63
- form_params = {}
68
+ form_params = opts[:form_params] || {}
64
69
 
65
70
  # http body (model)
66
- post_body = @api_client.object_to_http_body(data)
67
- auth_names = ['bearer']
68
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'SaveTransactionsResponse'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['bearer']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"TransactionsApi.create_transaction",
69
81
  :header_params => header_params,
70
82
  :query_params => query_params,
71
83
  :form_params => form_params,
72
84
  :body => post_body,
73
85
  :auth_names => auth_names,
74
- :return_type => 'SaveTransactionsResponse')
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
75
90
  if @api_client.config.debugging
76
91
  @api_client.config.logger.debug "API called: TransactionsApi#create_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
92
  end
78
93
  return data, status_code, headers
79
94
  end
95
+
80
96
  # Deletes an existing transaction
81
97
  # Deletes a transaction
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.ynab.com/#oauth-default-budget).
83
- # @param transaction_id The id of the transaction
98
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
99
+ # @param transaction_id [String] The id of the transaction
84
100
  # @param [Hash] opts the optional parameters
85
101
  # @return [TransactionResponse]
86
102
  def delete_transaction(budget_id, transaction_id, opts = {})
@@ -90,10 +106,10 @@ module YNAB
90
106
 
91
107
  # Deletes an existing transaction
92
108
  # Deletes a transaction
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.ynab.com/#oauth-default-budget).
94
- # @param transaction_id The id of the transaction
109
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
110
+ # @param transaction_id [String] The id of the transaction
95
111
  # @param [Hash] opts the optional parameters
96
- # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
112
+ # @return [Array<(TransactionResponse, Integer, Hash)>] TransactionResponse data, response status code and response headers
97
113
  def delete_transaction_with_http_info(budget_id, transaction_id, opts = {})
98
114
  if @api_client.config.debugging
99
115
  @api_client.config.logger.debug 'Calling API: TransactionsApi.delete_transaction ...'
@@ -107,38 +123,49 @@ module YNAB
107
123
  fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.delete_transaction"
108
124
  end
109
125
  # resource path
110
- local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
126
+ local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s))
111
127
 
112
128
  # query parameters
113
- query_params = {}
129
+ query_params = opts[:query_params] || {}
114
130
 
115
131
  # header parameters
116
- header_params = {}
132
+ header_params = opts[:header_params] || {}
117
133
  # HTTP header 'Accept' (if needed)
118
134
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
135
 
120
136
  # form parameters
121
- form_params = {}
137
+ form_params = opts[:form_params] || {}
122
138
 
123
139
  # http body (model)
124
- post_body = nil
125
- auth_names = ['bearer']
126
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
140
+ post_body = opts[:debug_body]
141
+
142
+ # return_type
143
+ return_type = opts[:debug_return_type] || 'TransactionResponse'
144
+
145
+ # auth_names
146
+ auth_names = opts[:debug_auth_names] || ['bearer']
147
+
148
+ new_options = opts.merge(
149
+ :operation => :"TransactionsApi.delete_transaction",
127
150
  :header_params => header_params,
128
151
  :query_params => query_params,
129
152
  :form_params => form_params,
130
153
  :body => post_body,
131
154
  :auth_names => auth_names,
132
- :return_type => 'TransactionResponse')
155
+ :return_type => return_type
156
+ )
157
+
158
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
133
159
  if @api_client.config.debugging
134
160
  @api_client.config.logger.debug "API called: TransactionsApi#delete_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
135
161
  end
136
162
  return data, status_code, headers
137
163
  end
164
+
138
165
  # Single transaction
139
166
  # Returns a single transaction
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.ynab.com/#oauth-default-budget).
141
- # @param transaction_id The id of the transaction
167
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
168
+ # @param transaction_id [String] The id of the transaction
142
169
  # @param [Hash] opts the optional parameters
143
170
  # @return [TransactionResponse]
144
171
  def get_transaction_by_id(budget_id, transaction_id, opts = {})
@@ -148,10 +175,10 @@ module YNAB
148
175
 
149
176
  # Single transaction
150
177
  # Returns a single transaction
151
- # @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.ynab.com/#oauth-default-budget).
152
- # @param transaction_id The id of the transaction
178
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
179
+ # @param transaction_id [String] The id of the transaction
153
180
  # @param [Hash] opts the optional parameters
154
- # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
181
+ # @return [Array<(TransactionResponse, Integer, Hash)>] TransactionResponse data, response status code and response headers
155
182
  def get_transaction_by_id_with_http_info(budget_id, transaction_id, opts = {})
156
183
  if @api_client.config.debugging
157
184
  @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transaction_by_id ...'
@@ -165,37 +192,48 @@ module YNAB
165
192
  fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.get_transaction_by_id"
166
193
  end
167
194
  # resource path
168
- local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
195
+ local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s))
169
196
 
170
197
  # query parameters
171
- query_params = {}
198
+ query_params = opts[:query_params] || {}
172
199
 
173
200
  # header parameters
174
- header_params = {}
201
+ header_params = opts[:header_params] || {}
175
202
  # HTTP header 'Accept' (if needed)
176
203
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
177
204
 
178
205
  # form parameters
179
- form_params = {}
206
+ form_params = opts[:form_params] || {}
180
207
 
181
208
  # http body (model)
182
- post_body = nil
183
- auth_names = ['bearer']
184
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
209
+ post_body = opts[:debug_body]
210
+
211
+ # return_type
212
+ return_type = opts[:debug_return_type] || 'TransactionResponse'
213
+
214
+ # auth_names
215
+ auth_names = opts[:debug_auth_names] || ['bearer']
216
+
217
+ new_options = opts.merge(
218
+ :operation => :"TransactionsApi.get_transaction_by_id",
185
219
  :header_params => header_params,
186
220
  :query_params => query_params,
187
221
  :form_params => form_params,
188
222
  :body => post_body,
189
223
  :auth_names => auth_names,
190
- :return_type => 'TransactionResponse')
224
+ :return_type => return_type
225
+ )
226
+
227
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
191
228
  if @api_client.config.debugging
192
229
  @api_client.config.logger.debug "API called: TransactionsApi#get_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
193
230
  end
194
231
  return data, status_code, headers
195
232
  end
233
+
196
234
  # List transactions
197
235
  # Returns budget transactions
198
- # @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.ynab.com/#oauth-default-budget).
236
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
199
237
  # @param [Hash] opts the optional parameters
200
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).
201
239
  # @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.
@@ -208,12 +246,12 @@ module YNAB
208
246
 
209
247
  # List transactions
210
248
  # Returns budget transactions
211
- # @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.ynab.com/#oauth-default-budget).
249
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
212
250
  # @param [Hash] opts the optional parameters
213
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).
214
252
  # @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.
215
253
  # @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.
216
- # @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
254
+ # @return [Array<(TransactionsResponse, Integer, Hash)>] TransactionsResponse data, response status code and response headers
217
255
  def get_transactions_with_http_info(budget_id, opts = {})
218
256
  if @api_client.config.debugging
219
257
  @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions ...'
@@ -222,45 +260,57 @@ module YNAB
222
260
  if @api_client.config.client_side_validation && budget_id.nil?
223
261
  fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.get_transactions"
224
262
  end
225
- if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
226
- fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
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}"
227
266
  end
228
267
  # resource path
229
- local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s)
268
+ local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
230
269
 
231
270
  # query parameters
232
- query_params = {}
271
+ query_params = opts[:query_params] || {}
233
272
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
234
273
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
235
274
  query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
236
275
 
237
276
  # header parameters
238
- header_params = {}
277
+ header_params = opts[:header_params] || {}
239
278
  # HTTP header 'Accept' (if needed)
240
279
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
241
280
 
242
281
  # form parameters
243
- form_params = {}
282
+ form_params = opts[:form_params] || {}
244
283
 
245
284
  # http body (model)
246
- post_body = nil
247
- auth_names = ['bearer']
248
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
285
+ post_body = opts[:debug_body]
286
+
287
+ # return_type
288
+ return_type = opts[:debug_return_type] || 'TransactionsResponse'
289
+
290
+ # auth_names
291
+ auth_names = opts[:debug_auth_names] || ['bearer']
292
+
293
+ new_options = opts.merge(
294
+ :operation => :"TransactionsApi.get_transactions",
249
295
  :header_params => header_params,
250
296
  :query_params => query_params,
251
297
  :form_params => form_params,
252
298
  :body => post_body,
253
299
  :auth_names => auth_names,
254
- :return_type => 'TransactionsResponse')
300
+ :return_type => return_type
301
+ )
302
+
303
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
255
304
  if @api_client.config.debugging
256
305
  @api_client.config.logger.debug "API called: TransactionsApi#get_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
257
306
  end
258
307
  return data, status_code, headers
259
308
  end
309
+
260
310
  # List account transactions
261
311
  # Returns all transactions for a specified account
262
- # @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.ynab.com/#oauth-default-budget).
263
- # @param account_id The id of the account
312
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
313
+ # @param account_id [String] The id of the account
264
314
  # @param [Hash] opts the optional parameters
265
315
  # @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).
266
316
  # @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.
@@ -273,13 +323,13 @@ module YNAB
273
323
 
274
324
  # List account transactions
275
325
  # Returns all transactions for a specified account
276
- # @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.ynab.com/#oauth-default-budget).
277
- # @param account_id The id of the account
326
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
327
+ # @param account_id [String] The id of the account
278
328
  # @param [Hash] opts the optional parameters
279
329
  # @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).
280
330
  # @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.
281
331
  # @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.
282
- # @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
332
+ # @return [Array<(TransactionsResponse, Integer, Hash)>] TransactionsResponse data, response status code and response headers
283
333
  def get_transactions_by_account_with_http_info(budget_id, account_id, opts = {})
284
334
  if @api_client.config.debugging
285
335
  @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_account ...'
@@ -292,45 +342,57 @@ module YNAB
292
342
  if @api_client.config.client_side_validation && account_id.nil?
293
343
  fail ArgumentError, "Missing the required parameter 'account_id' when calling TransactionsApi.get_transactions_by_account"
294
344
  end
295
- if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
296
- fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
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}"
297
348
  end
298
349
  # resource path
299
- local_var_path = '/budgets/{budget_id}/accounts/{account_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'account_id' + '}', account_id.to_s)
350
+ 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))
300
351
 
301
352
  # query parameters
302
- query_params = {}
353
+ query_params = opts[:query_params] || {}
303
354
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
304
355
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
305
356
  query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
306
357
 
307
358
  # header parameters
308
- header_params = {}
359
+ header_params = opts[:header_params] || {}
309
360
  # HTTP header 'Accept' (if needed)
310
361
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
311
362
 
312
363
  # form parameters
313
- form_params = {}
364
+ form_params = opts[:form_params] || {}
314
365
 
315
366
  # http body (model)
316
- post_body = nil
317
- auth_names = ['bearer']
318
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
367
+ post_body = opts[:debug_body]
368
+
369
+ # return_type
370
+ return_type = opts[:debug_return_type] || 'TransactionsResponse'
371
+
372
+ # auth_names
373
+ auth_names = opts[:debug_auth_names] || ['bearer']
374
+
375
+ new_options = opts.merge(
376
+ :operation => :"TransactionsApi.get_transactions_by_account",
319
377
  :header_params => header_params,
320
378
  :query_params => query_params,
321
379
  :form_params => form_params,
322
380
  :body => post_body,
323
381
  :auth_names => auth_names,
324
- :return_type => 'TransactionsResponse')
382
+ :return_type => return_type
383
+ )
384
+
385
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
325
386
  if @api_client.config.debugging
326
387
  @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
327
388
  end
328
389
  return data, status_code, headers
329
390
  end
391
+
330
392
  # List category transactions
331
393
  # Returns all transactions for a specified category
332
- # @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.ynab.com/#oauth-default-budget).
333
- # @param category_id The id of the category
394
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
395
+ # @param category_id [String] The id of the category
334
396
  # @param [Hash] opts the optional parameters
335
397
  # @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).
336
398
  # @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.
@@ -343,13 +405,13 @@ module YNAB
343
405
 
344
406
  # List category transactions
345
407
  # Returns all transactions for a specified category
346
- # @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.ynab.com/#oauth-default-budget).
347
- # @param category_id The id of the category
408
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
409
+ # @param category_id [String] The id of the category
348
410
  # @param [Hash] opts the optional parameters
349
411
  # @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).
350
412
  # @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.
351
413
  # @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.
352
- # @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
414
+ # @return [Array<(HybridTransactionsResponse, Integer, Hash)>] HybridTransactionsResponse data, response status code and response headers
353
415
  def get_transactions_by_category_with_http_info(budget_id, category_id, opts = {})
354
416
  if @api_client.config.debugging
355
417
  @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_category ...'
@@ -362,45 +424,57 @@ module YNAB
362
424
  if @api_client.config.client_side_validation && category_id.nil?
363
425
  fail ArgumentError, "Missing the required parameter 'category_id' when calling TransactionsApi.get_transactions_by_category"
364
426
  end
365
- if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
366
- fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
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}"
367
430
  end
368
431
  # resource path
369
- local_var_path = '/budgets/{budget_id}/categories/{category_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s)
432
+ 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))
370
433
 
371
434
  # query parameters
372
- query_params = {}
435
+ query_params = opts[:query_params] || {}
373
436
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
374
437
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
375
438
  query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
376
439
 
377
440
  # header parameters
378
- header_params = {}
441
+ header_params = opts[:header_params] || {}
379
442
  # HTTP header 'Accept' (if needed)
380
443
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
381
444
 
382
445
  # form parameters
383
- form_params = {}
446
+ form_params = opts[:form_params] || {}
384
447
 
385
448
  # http body (model)
386
- post_body = nil
387
- auth_names = ['bearer']
388
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
449
+ post_body = opts[:debug_body]
450
+
451
+ # return_type
452
+ return_type = opts[:debug_return_type] || 'HybridTransactionsResponse'
453
+
454
+ # auth_names
455
+ auth_names = opts[:debug_auth_names] || ['bearer']
456
+
457
+ new_options = opts.merge(
458
+ :operation => :"TransactionsApi.get_transactions_by_category",
389
459
  :header_params => header_params,
390
460
  :query_params => query_params,
391
461
  :form_params => form_params,
392
462
  :body => post_body,
393
463
  :auth_names => auth_names,
394
- :return_type => 'HybridTransactionsResponse')
464
+ :return_type => return_type
465
+ )
466
+
467
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
395
468
  if @api_client.config.debugging
396
469
  @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
397
470
  end
398
471
  return data, status_code, headers
399
472
  end
473
+
400
474
  # List payee transactions
401
475
  # Returns all transactions for a specified payee
402
- # @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.ynab.com/#oauth-default-budget).
403
- # @param payee_id The id of the payee
476
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
477
+ # @param payee_id [String] The id of the payee
404
478
  # @param [Hash] opts the optional parameters
405
479
  # @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).
406
480
  # @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.
@@ -413,13 +487,13 @@ module YNAB
413
487
 
414
488
  # List payee transactions
415
489
  # Returns all transactions for a specified payee
416
- # @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.ynab.com/#oauth-default-budget).
417
- # @param payee_id The id of the payee
490
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
491
+ # @param payee_id [String] The id of the payee
418
492
  # @param [Hash] opts the optional parameters
419
493
  # @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).
420
494
  # @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.
421
495
  # @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.
422
- # @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
496
+ # @return [Array<(HybridTransactionsResponse, Integer, Hash)>] HybridTransactionsResponse data, response status code and response headers
423
497
  def get_transactions_by_payee_with_http_info(budget_id, payee_id, opts = {})
424
498
  if @api_client.config.debugging
425
499
  @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_payee ...'
@@ -432,44 +506,56 @@ module YNAB
432
506
  if @api_client.config.client_side_validation && payee_id.nil?
433
507
  fail ArgumentError, "Missing the required parameter 'payee_id' when calling TransactionsApi.get_transactions_by_payee"
434
508
  end
435
- if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
436
- fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
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}"
437
512
  end
438
513
  # resource path
439
- local_var_path = '/budgets/{budget_id}/payees/{payee_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'payee_id' + '}', payee_id.to_s)
514
+ 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))
440
515
 
441
516
  # query parameters
442
- query_params = {}
517
+ query_params = opts[:query_params] || {}
443
518
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
444
519
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
445
520
  query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
446
521
 
447
522
  # header parameters
448
- header_params = {}
523
+ header_params = opts[:header_params] || {}
449
524
  # HTTP header 'Accept' (if needed)
450
525
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
451
526
 
452
527
  # form parameters
453
- form_params = {}
528
+ form_params = opts[:form_params] || {}
454
529
 
455
530
  # http body (model)
456
- post_body = nil
457
- auth_names = ['bearer']
458
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
531
+ post_body = opts[:debug_body]
532
+
533
+ # return_type
534
+ return_type = opts[:debug_return_type] || 'HybridTransactionsResponse'
535
+
536
+ # auth_names
537
+ auth_names = opts[:debug_auth_names] || ['bearer']
538
+
539
+ new_options = opts.merge(
540
+ :operation => :"TransactionsApi.get_transactions_by_payee",
459
541
  :header_params => header_params,
460
542
  :query_params => query_params,
461
543
  :form_params => form_params,
462
544
  :body => post_body,
463
545
  :auth_names => auth_names,
464
- :return_type => 'HybridTransactionsResponse')
546
+ :return_type => return_type
547
+ )
548
+
549
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
465
550
  if @api_client.config.debugging
466
551
  @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_payee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
467
552
  end
468
553
  return data, status_code, headers
469
554
  end
555
+
470
556
  # Import transactions
471
557
  # 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.
472
- # @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.ynab.com/#oauth-default-budget).
558
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
473
559
  # @param [Hash] opts the optional parameters
474
560
  # @return [TransactionsImportResponse]
475
561
  def import_transactions(budget_id, opts = {})
@@ -479,9 +565,9 @@ module YNAB
479
565
 
480
566
  # Import transactions
481
567
  # 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 \&quot;Import\&quot; on each account in the web application or tapping the \&quot;New Transactions\&quot; banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
482
- # @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.ynab.com/#oauth-default-budget).
568
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
483
569
  # @param [Hash] opts the optional parameters
484
- # @return [Array<(TransactionsImportResponse, Fixnum, Hash)>] TransactionsImportResponse data, response status code and response headers
570
+ # @return [Array<(TransactionsImportResponse, Integer, Hash)>] TransactionsImportResponse data, response status code and response headers
485
571
  def import_transactions_with_http_info(budget_id, opts = {})
486
572
  if @api_client.config.debugging
487
573
  @api_client.config.logger.debug 'Calling API: TransactionsApi.import_transactions ...'
@@ -491,39 +577,50 @@ module YNAB
491
577
  fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.import_transactions"
492
578
  end
493
579
  # resource path
494
- local_var_path = '/budgets/{budget_id}/transactions/import'.sub('{' + 'budget_id' + '}', budget_id.to_s)
580
+ local_var_path = '/budgets/{budget_id}/transactions/import'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
495
581
 
496
582
  # query parameters
497
- query_params = {}
583
+ query_params = opts[:query_params] || {}
498
584
 
499
585
  # header parameters
500
- header_params = {}
586
+ header_params = opts[:header_params] || {}
501
587
  # HTTP header 'Accept' (if needed)
502
588
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
503
589
 
504
590
  # form parameters
505
- form_params = {}
591
+ form_params = opts[:form_params] || {}
506
592
 
507
593
  # http body (model)
508
- post_body = nil
509
- auth_names = ['bearer']
510
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
594
+ post_body = opts[:debug_body]
595
+
596
+ # return_type
597
+ return_type = opts[:debug_return_type] || 'TransactionsImportResponse'
598
+
599
+ # auth_names
600
+ auth_names = opts[:debug_auth_names] || ['bearer']
601
+
602
+ new_options = opts.merge(
603
+ :operation => :"TransactionsApi.import_transactions",
511
604
  :header_params => header_params,
512
605
  :query_params => query_params,
513
606
  :form_params => form_params,
514
607
  :body => post_body,
515
608
  :auth_names => auth_names,
516
- :return_type => 'TransactionsImportResponse')
609
+ :return_type => return_type
610
+ )
611
+
612
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
517
613
  if @api_client.config.debugging
518
614
  @api_client.config.logger.debug "API called: TransactionsApi#import_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
519
615
  end
520
616
  return data, status_code, headers
521
617
  end
618
+
522
619
  # Updates an existing transaction
523
620
  # Updates a single transaction
524
- # @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.ynab.com/#oauth-default-budget).
525
- # @param transaction_id The id of the transaction
526
- # @param data The transaction to update
621
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
622
+ # @param transaction_id [String] The id of the transaction
623
+ # @param data [PutTransactionWrapper] The transaction to update
527
624
  # @param [Hash] opts the optional parameters
528
625
  # @return [TransactionResponse]
529
626
  def update_transaction(budget_id, transaction_id, data, opts = {})
@@ -533,11 +630,11 @@ module YNAB
533
630
 
534
631
  # Updates an existing transaction
535
632
  # Updates a single transaction
536
- # @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.ynab.com/#oauth-default-budget).
537
- # @param transaction_id The id of the transaction
538
- # @param data The transaction to update
633
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
634
+ # @param transaction_id [String] The id of the transaction
635
+ # @param data [PutTransactionWrapper] The transaction to update
539
636
  # @param [Hash] opts the optional parameters
540
- # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
637
+ # @return [Array<(TransactionResponse, Integer, Hash)>] TransactionResponse data, response status code and response headers
541
638
  def update_transaction_with_http_info(budget_id, transaction_id, data, opts = {})
542
639
  if @api_client.config.debugging
543
640
  @api_client.config.logger.debug 'Calling API: TransactionsApi.update_transaction ...'
@@ -555,38 +652,54 @@ module YNAB
555
652
  fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.update_transaction"
556
653
  end
557
654
  # resource path
558
- local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'transaction_id' + '}', transaction_id.to_s)
655
+ local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s))
559
656
 
560
657
  # query parameters
561
- query_params = {}
658
+ query_params = opts[:query_params] || {}
562
659
 
563
660
  # header parameters
564
- header_params = {}
661
+ header_params = opts[:header_params] || {}
565
662
  # HTTP header 'Accept' (if needed)
566
663
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
664
+ # HTTP header 'Content-Type'
665
+ content_type = @api_client.select_header_content_type(['application/json'])
666
+ if !content_type.nil?
667
+ header_params['Content-Type'] = content_type
668
+ end
567
669
 
568
670
  # form parameters
569
- form_params = {}
671
+ form_params = opts[:form_params] || {}
570
672
 
571
673
  # http body (model)
572
- post_body = @api_client.object_to_http_body(data)
573
- auth_names = ['bearer']
574
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
674
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
675
+
676
+ # return_type
677
+ return_type = opts[:debug_return_type] || 'TransactionResponse'
678
+
679
+ # auth_names
680
+ auth_names = opts[:debug_auth_names] || ['bearer']
681
+
682
+ new_options = opts.merge(
683
+ :operation => :"TransactionsApi.update_transaction",
575
684
  :header_params => header_params,
576
685
  :query_params => query_params,
577
686
  :form_params => form_params,
578
687
  :body => post_body,
579
688
  :auth_names => auth_names,
580
- :return_type => 'TransactionResponse')
689
+ :return_type => return_type
690
+ )
691
+
692
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
581
693
  if @api_client.config.debugging
582
694
  @api_client.config.logger.debug "API called: TransactionsApi#update_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
583
695
  end
584
696
  return data, status_code, headers
585
697
  end
698
+
586
699
  # Update multiple transactions
587
700
  # Updates multiple transactions, by `id` or `import_id`.
588
- # @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.ynab.com/#oauth-default-budget).
589
- # @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.
701
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
702
+ # @param data [PatchTransactionsWrapper] 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.
590
703
  # @param [Hash] opts the optional parameters
591
704
  # @return [SaveTransactionsResponse]
592
705
  def update_transactions(budget_id, data, opts = {})
@@ -596,10 +709,10 @@ module YNAB
596
709
 
597
710
  # Update multiple transactions
598
711
  # Updates multiple transactions, by &#x60;id&#x60; or &#x60;import_id&#x60;.
599
- # @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.ynab.com/#oauth-default-budget).
600
- # @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.
712
+ # @param budget_id [String] 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.ynab.com/#oauth-default-budget).
713
+ # @param data [PatchTransactionsWrapper] 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.
601
714
  # @param [Hash] opts the optional parameters
602
- # @return [Array<(SaveTransactionsResponse, Fixnum, Hash)>] SaveTransactionsResponse data, response status code and response headers
715
+ # @return [Array<(SaveTransactionsResponse, Integer, Hash)>] SaveTransactionsResponse data, response status code and response headers
603
716
  def update_transactions_with_http_info(budget_id, data, opts = {})
604
717
  if @api_client.config.debugging
605
718
  @api_client.config.logger.debug 'Calling API: TransactionsApi.update_transactions ...'
@@ -613,29 +726,44 @@ module YNAB
613
726
  fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.update_transactions"
614
727
  end
615
728
  # resource path
616
- local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s)
729
+ local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
617
730
 
618
731
  # query parameters
619
- query_params = {}
732
+ query_params = opts[:query_params] || {}
620
733
 
621
734
  # header parameters
622
- header_params = {}
735
+ header_params = opts[:header_params] || {}
623
736
  # HTTP header 'Accept' (if needed)
624
737
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
738
+ # HTTP header 'Content-Type'
739
+ content_type = @api_client.select_header_content_type(['application/json'])
740
+ if !content_type.nil?
741
+ header_params['Content-Type'] = content_type
742
+ end
625
743
 
626
744
  # form parameters
627
- form_params = {}
745
+ form_params = opts[:form_params] || {}
628
746
 
629
747
  # http body (model)
630
- post_body = @api_client.object_to_http_body(data)
631
- auth_names = ['bearer']
632
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
748
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
749
+
750
+ # return_type
751
+ return_type = opts[:debug_return_type] || 'SaveTransactionsResponse'
752
+
753
+ # auth_names
754
+ auth_names = opts[:debug_auth_names] || ['bearer']
755
+
756
+ new_options = opts.merge(
757
+ :operation => :"TransactionsApi.update_transactions",
633
758
  :header_params => header_params,
634
759
  :query_params => query_params,
635
760
  :form_params => form_params,
636
761
  :body => post_body,
637
762
  :auth_names => auth_names,
638
- :return_type => 'SaveTransactionsResponse')
763
+ :return_type => return_type
764
+ )
765
+
766
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
639
767
  if @api_client.config.debugging
640
768
  @api_client.config.logger.debug "API called: TransactionsApi#update_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
641
769
  end