ynab 3.9.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +4 -2
  4. data/README.md +47 -39
  5. data/Rakefile +3 -3
  6. data/docs/Account.md +3 -3
  7. data/docs/AccountsApi.md +12 -12
  8. data/docs/CategoriesApi.md +89 -25
  9. data/docs/Category.md +4 -3
  10. data/docs/CategoryGroupWithCategories.md +1 -1
  11. data/docs/ExistingCategory.md +12 -0
  12. data/docs/MoneyMovement.md +16 -0
  13. data/docs/MoneyMovementGroup.md +12 -0
  14. data/docs/MoneyMovementGroupsResponse.md +8 -0
  15. data/docs/MoneyMovementGroupsResponseData.md +9 -0
  16. data/docs/MoneyMovementsApi.md +89 -0
  17. data/docs/{BudgetSettingsResponse.md → MoneyMovementsResponse.md} +2 -2
  18. data/docs/MoneyMovementsResponseData.md +9 -0
  19. data/docs/MonthDetail.md +2 -2
  20. data/docs/MonthSummary.md +1 -1
  21. data/docs/MonthsApi.md +13 -13
  22. data/docs/NewCategory.md +12 -0
  23. data/docs/PatchCategoryGroupWrapper.md +8 -0
  24. data/docs/PatchCategoryWrapper.md +1 -1
  25. data/docs/PayeeLocationsApi.md +12 -12
  26. data/docs/PayeesApi.md +11 -11
  27. data/docs/{BudgetDetail.md → PlanDetail.md} +4 -4
  28. data/docs/PlanDetailResponse.md +8 -0
  29. data/docs/{BudgetDetailResponseData.md → PlanDetailResponseData.md} +2 -2
  30. data/docs/{BudgetSettings.md → PlanSettings.md} +1 -1
  31. data/docs/{BudgetDetailResponse.md → PlanSettingsResponse.md} +2 -2
  32. data/docs/PlanSettingsResponseData.md +8 -0
  33. data/docs/PlanSummary.md +15 -0
  34. data/docs/PlanSummaryResponse.md +8 -0
  35. data/docs/PlanSummaryResponseData.md +9 -0
  36. data/docs/PlansApi.md +68 -0
  37. data/docs/PostCategoryGroupWrapper.md +8 -0
  38. data/docs/PostCategoryWrapper.md +8 -0
  39. data/docs/SaveCategory.md +2 -1
  40. data/docs/SaveCategoryGroup.md +8 -0
  41. data/docs/SaveCategoryGroupResponse.md +8 -0
  42. data/docs/SaveCategoryGroupResponseData.md +9 -0
  43. data/docs/SaveMonthCategory.md +1 -1
  44. data/docs/ScheduledTransactionsApi.md +20 -20
  45. data/docs/TransactionsApi.md +48 -48
  46. data/docs/UserApi.md +2 -2
  47. data/examples/category-balance.rb +2 -2
  48. data/examples/create-multiple-transactions.rb +2 -2
  49. data/examples/create-transaction.rb +2 -2
  50. data/examples/{budget-list.rb → plan-list.rb} +6 -6
  51. data/examples/{budget-month.rb → plan-month.rb} +9 -10
  52. data/examples/update-category-budgeted.rb +2 -2
  53. data/examples/update-multiple-transactions.rb +3 -3
  54. data/lib/ynab/api/accounts_api.rb +33 -34
  55. data/lib/ynab/api/categories_api.rb +293 -66
  56. data/lib/ynab/api/deprecated_api.rb +11 -11
  57. data/lib/ynab/api/money_movements_api.rb +282 -0
  58. data/lib/ynab/api/months_api.rb +35 -36
  59. data/lib/ynab/api/payee_locations_api.rb +33 -34
  60. data/lib/ynab/api/payees_api.rb +31 -32
  61. data/lib/ynab/api/{budgets_api.rb → plans_api.rb} +55 -56
  62. data/lib/ynab/api/scheduled_transactions_api.rb +55 -56
  63. data/lib/ynab/api/transactions_api.rb +130 -131
  64. data/lib/ynab/api/user_api.rb +2 -3
  65. data/lib/ynab/api_client.rb +0 -2
  66. data/lib/ynab/api_model_base.rb +85 -0
  67. data/lib/ynab/models/account.rb +4 -81
  68. data/lib/ynab/models/account_response.rb +1 -75
  69. data/lib/ynab/models/account_response_data.rb +1 -75
  70. data/lib/ynab/models/accounts_response.rb +1 -75
  71. data/lib/ynab/models/accounts_response_data.rb +1 -75
  72. data/lib/ynab/models/bulk_response.rb +1 -75
  73. data/lib/ynab/models/bulk_response_data.rb +1 -75
  74. data/lib/ynab/models/bulk_response_data_bulk.rb +1 -75
  75. data/lib/ynab/models/bulk_transactions.rb +1 -75
  76. data/lib/ynab/models/categories_response.rb +1 -75
  77. data/lib/ynab/models/categories_response_data.rb +1 -75
  78. data/lib/ynab/models/category.rb +16 -79
  79. data/lib/ynab/models/category_group.rb +1 -75
  80. data/lib/ynab/models/category_group_with_categories.rb +2 -76
  81. data/lib/ynab/models/category_response.rb +1 -75
  82. data/lib/ynab/models/category_response_data.rb +1 -75
  83. data/lib/ynab/models/currency_format.rb +2 -76
  84. data/lib/ynab/models/date_format.rb +2 -76
  85. data/lib/ynab/models/error_detail.rb +1 -75
  86. data/lib/ynab/models/error_response.rb +1 -75
  87. data/lib/ynab/models/existing_category.rb +180 -0
  88. data/lib/ynab/models/existing_transaction.rb +1 -79
  89. data/lib/ynab/models/hybrid_transaction.rb +1 -85
  90. data/lib/ynab/models/hybrid_transactions_response.rb +1 -75
  91. data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -75
  92. data/lib/ynab/models/{budget_summary_response_data.rb → money_movement.rb} +95 -93
  93. data/lib/ynab/models/money_movement_group.rb +179 -0
  94. data/lib/ynab/models/{budget_summary_response.rb → money_movement_groups_response.rb} +4 -78
  95. data/lib/ynab/models/money_movement_groups_response_data.rb +149 -0
  96. data/lib/ynab/models/{budget_settings_response.rb → money_movements_response.rb} +4 -78
  97. data/lib/ynab/models/{budget_detail_response_data.rb → money_movements_response_data.rb} +13 -85
  98. data/lib/ynab/models/month_detail.rb +3 -79
  99. data/lib/ynab/models/month_detail_response.rb +1 -75
  100. data/lib/ynab/models/month_detail_response_data.rb +1 -75
  101. data/lib/ynab/models/month_summaries_response.rb +1 -75
  102. data/lib/ynab/models/month_summaries_response_data.rb +1 -75
  103. data/lib/ynab/models/month_summary.rb +2 -76
  104. data/lib/ynab/models/new_category.rb +180 -0
  105. data/lib/ynab/models/new_transaction.rb +1 -79
  106. data/lib/ynab/models/patch_category_group_wrapper.rb +136 -0
  107. data/lib/ynab/models/patch_category_wrapper.rb +2 -76
  108. data/lib/ynab/models/patch_month_category_wrapper.rb +1 -75
  109. data/lib/ynab/models/patch_payee_wrapper.rb +1 -75
  110. data/lib/ynab/models/patch_transactions_wrapper.rb +1 -75
  111. data/lib/ynab/models/payee.rb +1 -75
  112. data/lib/ynab/models/payee_location.rb +1 -75
  113. data/lib/ynab/models/payee_location_response.rb +1 -75
  114. data/lib/ynab/models/payee_location_response_data.rb +1 -75
  115. data/lib/ynab/models/payee_locations_response.rb +1 -75
  116. data/lib/ynab/models/payee_locations_response_data.rb +1 -75
  117. data/lib/ynab/models/payee_response.rb +1 -75
  118. data/lib/ynab/models/payee_response_data.rb +1 -75
  119. data/lib/ynab/models/payees_response.rb +1 -75
  120. data/lib/ynab/models/payees_response_data.rb +1 -75
  121. data/lib/ynab/models/{budget_detail.rb → plan_detail.rb} +7 -83
  122. data/lib/ynab/models/plan_detail_response.rb +136 -0
  123. data/lib/ynab/models/plan_detail_response_data.rb +147 -0
  124. data/lib/ynab/models/{budget_settings.rb → plan_settings.rb} +5 -79
  125. data/lib/ynab/models/{budget_detail_response.rb → plan_settings_response.rb} +4 -78
  126. data/lib/ynab/models/{budget_settings_response_data.rb → plan_settings_response_data.rb} +4 -78
  127. data/lib/ynab/models/{budget_summary.rb → plan_summary.rb} +7 -83
  128. data/lib/ynab/models/plan_summary_response.rb +136 -0
  129. data/lib/ynab/models/plan_summary_response_data.rb +147 -0
  130. data/lib/ynab/models/post_account_wrapper.rb +1 -75
  131. data/lib/ynab/models/post_category_group_wrapper.rb +136 -0
  132. data/lib/ynab/models/post_category_wrapper.rb +136 -0
  133. data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +1 -75
  134. data/lib/ynab/models/post_transactions_wrapper.rb +1 -75
  135. data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +1 -75
  136. data/lib/ynab/models/put_transaction_wrapper.rb +1 -75
  137. data/lib/ynab/models/save_account.rb +1 -75
  138. data/lib/ynab/models/save_category.rb +18 -81
  139. data/lib/ynab/models/save_category_group.rb +148 -0
  140. data/lib/ynab/models/save_category_group_response.rb +136 -0
  141. data/lib/ynab/models/save_category_group_response_data.rb +147 -0
  142. data/lib/ynab/models/save_category_response.rb +1 -75
  143. data/lib/ynab/models/save_category_response_data.rb +1 -75
  144. data/lib/ynab/models/save_month_category.rb +2 -76
  145. data/lib/ynab/models/save_payee.rb +1 -75
  146. data/lib/ynab/models/save_payee_response.rb +1 -75
  147. data/lib/ynab/models/save_payee_response_data.rb +1 -75
  148. data/lib/ynab/models/save_scheduled_transaction.rb +1 -75
  149. data/lib/ynab/models/save_sub_transaction.rb +1 -75
  150. data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +1 -79
  151. data/lib/ynab/models/save_transaction_with_optional_fields.rb +1 -75
  152. data/lib/ynab/models/save_transactions_response.rb +1 -75
  153. data/lib/ynab/models/save_transactions_response_data.rb +1 -75
  154. data/lib/ynab/models/scheduled_sub_transaction.rb +1 -75
  155. data/lib/ynab/models/scheduled_transaction_detail.rb +1 -80
  156. data/lib/ynab/models/scheduled_transaction_response.rb +1 -75
  157. data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -75
  158. data/lib/ynab/models/scheduled_transaction_summary.rb +1 -75
  159. data/lib/ynab/models/scheduled_transactions_response.rb +1 -75
  160. data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -75
  161. data/lib/ynab/models/sub_transaction.rb +1 -75
  162. data/lib/ynab/models/transaction_detail.rb +1 -85
  163. data/lib/ynab/models/transaction_response.rb +1 -75
  164. data/lib/ynab/models/transaction_response_data.rb +1 -75
  165. data/lib/ynab/models/transaction_summary.rb +1 -75
  166. data/lib/ynab/models/transactions_import_response.rb +1 -75
  167. data/lib/ynab/models/transactions_import_response_data.rb +1 -75
  168. data/lib/ynab/models/transactions_response.rb +1 -75
  169. data/lib/ynab/models/transactions_response_data.rb +1 -75
  170. data/lib/ynab/models/user.rb +1 -75
  171. data/lib/ynab/models/user_response.rb +1 -75
  172. data/lib/ynab/models/user_response_data.rb +1 -75
  173. data/lib/ynab/overrides/transactions_api.rb +6 -6
  174. data/lib/ynab/version.rb +1 -1
  175. data/lib/ynab.rb +28 -13
  176. data/open_api_spec.yaml +1161 -916
  177. data/spec/api/accounts_spec.rb +9 -9
  178. data/spec/api/categories_spec.rb +9 -9
  179. data/spec/api/months_spec.rb +7 -7
  180. data/spec/api/payee_locations_spec.rb +7 -7
  181. data/spec/api/payees_spec.rb +7 -7
  182. data/spec/api/plans_spec.rb +55 -0
  183. data/spec/api/scheduled_transactions_spec.rb +9 -9
  184. data/spec/api/transactions_spec.rb +27 -27
  185. data/spec/fixtures/vcr_cassettes/account.yml +2 -2
  186. data/spec/fixtures/vcr_cassettes/accounts.yml +2 -2
  187. data/spec/fixtures/vcr_cassettes/accounts_unauthorized.yml +2 -2
  188. data/spec/fixtures/vcr_cassettes/bulk_transactions.yml +2 -2
  189. data/spec/fixtures/vcr_cassettes/categories.yml +2 -2
  190. data/spec/fixtures/vcr_cassettes/categories_unauthorized.yml +2 -2
  191. data/spec/fixtures/vcr_cassettes/category.yml +2 -2
  192. data/spec/fixtures/vcr_cassettes/category_transactions.yml +2 -2
  193. data/spec/fixtures/vcr_cassettes/create_account.yml +2 -2
  194. data/spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml +2 -2
  195. data/spec/fixtures/vcr_cassettes/create_transaction.yml +2 -2
  196. data/spec/fixtures/vcr_cassettes/create_transactions.yml +2 -2
  197. data/spec/fixtures/vcr_cassettes/import_transactions.yml +2 -2
  198. data/spec/fixtures/vcr_cassettes/month.yml +2 -2
  199. data/spec/fixtures/vcr_cassettes/month_transactions.yml +2 -2
  200. data/spec/fixtures/vcr_cassettes/months.yml +2 -2
  201. data/spec/fixtures/vcr_cassettes/months_unauthorized.yml +2 -2
  202. data/spec/fixtures/vcr_cassettes/multiple_transactions.yml +2 -2
  203. data/spec/fixtures/vcr_cassettes/patch_month_category.yml +2 -2
  204. data/spec/fixtures/vcr_cassettes/payee.yml +2 -2
  205. data/spec/fixtures/vcr_cassettes/payee_location.yml +2 -2
  206. data/spec/fixtures/vcr_cassettes/payee_locations.yml +2 -2
  207. data/spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml +2 -2
  208. data/spec/fixtures/vcr_cassettes/payee_transactions.yml +2 -2
  209. data/spec/fixtures/vcr_cassettes/payees.yml +2 -2
  210. data/spec/fixtures/vcr_cassettes/payees_unauthorized.yml +2 -2
  211. data/spec/fixtures/vcr_cassettes/{budget.yml → plan.yml} +3 -3
  212. data/spec/fixtures/vcr_cassettes/{budgets.yml → plans.yml} +3 -3
  213. data/spec/fixtures/vcr_cassettes/{budgets_unauthorized.yml → plans_unauthorized.yml} +3 -3
  214. data/spec/fixtures/vcr_cassettes/scheduled_transaction.yml +2 -2
  215. data/spec/fixtures/vcr_cassettes/scheduled_transactions.yml +2 -2
  216. data/spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml +2 -2
  217. data/spec/fixtures/vcr_cassettes/transaction.yml +2 -2
  218. data/spec/fixtures/vcr_cassettes/transactions.yml +2 -2
  219. data/spec/fixtures/vcr_cassettes/transactions_invalid_flags.yml +2 -2
  220. data/spec/fixtures/vcr_cassettes/transactions_unauthorized.yml +2 -2
  221. data/spec/fixtures/vcr_cassettes/update_transaction.yml +2 -2
  222. data/spec/fixtures/vcr_cassettes/update_transactions.yml +2 -2
  223. data/templates/gem.mustache +3 -2
  224. data/templates/partial_model_generic.mustache +1 -1
  225. data/ynab.gemspec +1 -2
  226. metadata +64 -33
  227. data/docs/BudgetSettingsResponseData.md +0 -8
  228. data/docs/BudgetSummary.md +0 -15
  229. data/docs/BudgetSummaryResponse.md +0 -8
  230. data/docs/BudgetSummaryResponseData.md +0 -9
  231. data/docs/BudgetsApi.md +0 -68
  232. data/spec/api/budgets_spec.rb +0 -55
@@ -4,18 +4,18 @@ All URIs are relative to *https://api.ynab.com/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
- | [**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /budgets/{budget_id}/scheduled_transactions | Create a single scheduled transaction |
8
- | [**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Deletes an existing scheduled transaction |
9
- | [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction |
10
- | [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /budgets/{budget_id}/scheduled_transactions | List scheduled transactions |
11
- | [**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Updates an existing scheduled transaction |
7
+ | [**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /plans/{plan_id}/scheduled_transactions | Create a scheduled transaction |
8
+ | [**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Delete a scheduled transaction |
9
+ | [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Get a scheduled transaction |
10
+ | [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /plans/{plan_id}/scheduled_transactions | Get all scheduled transactions |
11
+ | [**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /plans/{plan_id}/scheduled_transactions/{scheduled_transaction_id} | Update a scheduled transaction |
12
12
 
13
13
 
14
14
  ## create_scheduled_transaction
15
15
 
16
- > <ScheduledTransactionResponse> create_scheduled_transaction(budget_id, data)
16
+ > <ScheduledTransactionResponse> create_scheduled_transaction(plan_id, data)
17
17
 
18
- Create a single scheduled transaction
18
+ Create a scheduled transaction
19
19
 
20
20
  Creates a single scheduled transaction (a transaction with a future date).
21
21
 
@@ -23,7 +23,7 @@ Creates a single scheduled transaction (a transaction with a future date).
23
23
 
24
24
  | Name | Type | Description | Notes |
25
25
  | ---- | ---- | ----------- | ----- |
26
- | **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). | |
26
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
27
27
  | **data** | [**PostScheduledTransactionWrapper**](PostScheduledTransactionWrapper.md) | The scheduled transaction to create | |
28
28
 
29
29
  ### Return type
@@ -33,9 +33,9 @@ Creates a single scheduled transaction (a transaction with a future date).
33
33
 
34
34
  ## delete_scheduled_transaction
35
35
 
36
- > <ScheduledTransactionResponse> delete_scheduled_transaction(budget_id, scheduled_transaction_id)
36
+ > <ScheduledTransactionResponse> delete_scheduled_transaction(plan_id, scheduled_transaction_id)
37
37
 
38
- Deletes an existing scheduled transaction
38
+ Delete a scheduled transaction
39
39
 
40
40
  Deletes a scheduled transaction
41
41
 
@@ -43,7 +43,7 @@ Deletes a scheduled transaction
43
43
 
44
44
  | Name | Type | Description | Notes |
45
45
  | ---- | ---- | ----------- | ----- |
46
- | **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). | |
46
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
47
47
  | **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
48
48
 
49
49
  ### Return type
@@ -53,9 +53,9 @@ Deletes a scheduled transaction
53
53
 
54
54
  ## get_scheduled_transaction_by_id
55
55
 
56
- > <ScheduledTransactionResponse> get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id)
56
+ > <ScheduledTransactionResponse> get_scheduled_transaction_by_id(plan_id, scheduled_transaction_id)
57
57
 
58
- Single scheduled transaction
58
+ Get a scheduled transaction
59
59
 
60
60
  Returns a single scheduled transaction
61
61
 
@@ -63,7 +63,7 @@ Returns a single scheduled transaction
63
63
 
64
64
  | Name | Type | Description | Notes |
65
65
  | ---- | ---- | ----------- | ----- |
66
- | **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). | |
66
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
67
67
  | **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
68
68
 
69
69
  ### Return type
@@ -73,9 +73,9 @@ Returns a single scheduled transaction
73
73
 
74
74
  ## get_scheduled_transactions
75
75
 
76
- > <ScheduledTransactionsResponse> get_scheduled_transactions(budget_id, opts)
76
+ > <ScheduledTransactionsResponse> get_scheduled_transactions(plan_id, opts)
77
77
 
78
- List scheduled transactions
78
+ Get all scheduled transactions
79
79
 
80
80
  Returns all scheduled transactions
81
81
 
@@ -83,7 +83,7 @@ Returns all scheduled transactions
83
83
 
84
84
  | Name | Type | Description | Notes |
85
85
  | ---- | ---- | ----------- | ----- |
86
- | **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). | |
86
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
87
87
  | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
88
88
 
89
89
  ### Return type
@@ -93,9 +93,9 @@ Returns all scheduled transactions
93
93
 
94
94
  ## update_scheduled_transaction
95
95
 
96
- > <ScheduledTransactionResponse> update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper)
96
+ > <ScheduledTransactionResponse> update_scheduled_transaction(plan_id, scheduled_transaction_id, put_scheduled_transaction_wrapper)
97
97
 
98
- Updates an existing scheduled transaction
98
+ Update a scheduled transaction
99
99
 
100
100
  Updates a single scheduled transaction
101
101
 
@@ -103,7 +103,7 @@ Updates a single scheduled transaction
103
103
 
104
104
  | Name | Type | Description | Notes |
105
105
  | ---- | ---- | ----------- | ----- |
106
- | **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). | |
106
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
107
107
  | **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
108
108
  | **put_scheduled_transaction_wrapper** | [**PutScheduledTransactionWrapper**](PutScheduledTransactionWrapper.md) | The scheduled transaction to update | |
109
109
 
@@ -4,22 +4,22 @@ All URIs are relative to *https://api.ynab.com/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
- | [**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /budgets/{budget_id}/transactions | Create a single transaction or multiple transactions |
8
- | [**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /budgets/{budget_id}/transactions/{transaction_id} | Deletes an existing transaction |
9
- | [**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /budgets/{budget_id}/transactions/{transaction_id} | Single transaction |
10
- | [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /budgets/{budget_id}/transactions | List transactions |
11
- | [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions |
12
- | [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions, excluding any pending transactions |
13
- | [**get_transactions_by_month**](TransactionsApi.md#get_transactions_by_month) | **GET** /budgets/{budget_id}/months/{month}/transactions | List transactions in month, excluding any pending transactions |
14
- | [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions, excluding any pending transactions |
15
- | [**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /budgets/{budget_id}/transactions/import | Import transactions |
16
- | [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction |
17
- | [**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /budgets/{budget_id}/transactions | Update multiple transactions |
7
+ | [**create_transaction**](TransactionsApi.md#create_transaction) | **POST** /plans/{plan_id}/transactions | Create a single transaction or multiple transactions |
8
+ | [**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /plans/{plan_id}/transactions/{transaction_id} | Delete a transaction |
9
+ | [**get_transaction_by_id**](TransactionsApi.md#get_transaction_by_id) | **GET** /plans/{plan_id}/transactions/{transaction_id} | Get a transaction |
10
+ | [**get_transactions**](TransactionsApi.md#get_transactions) | **GET** /plans/{plan_id}/transactions | Get all transactions |
11
+ | [**get_transactions_by_account**](TransactionsApi.md#get_transactions_by_account) | **GET** /plans/{plan_id}/accounts/{account_id}/transactions | Get all account transactions |
12
+ | [**get_transactions_by_category**](TransactionsApi.md#get_transactions_by_category) | **GET** /plans/{plan_id}/categories/{category_id}/transactions | Get all category transactions |
13
+ | [**get_transactions_by_month**](TransactionsApi.md#get_transactions_by_month) | **GET** /plans/{plan_id}/months/{month}/transactions | Get all plan month transactions |
14
+ | [**get_transactions_by_payee**](TransactionsApi.md#get_transactions_by_payee) | **GET** /plans/{plan_id}/payees/{payee_id}/transactions | Get all payee transactions |
15
+ | [**import_transactions**](TransactionsApi.md#import_transactions) | **POST** /plans/{plan_id}/transactions/import | Import transactions |
16
+ | [**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /plans/{plan_id}/transactions/{transaction_id} | Update a transaction |
17
+ | [**update_transactions**](TransactionsApi.md#update_transactions) | **PATCH** /plans/{plan_id}/transactions | Update multiple transactions |
18
18
 
19
19
 
20
20
  ## create_transaction
21
21
 
22
- > <SaveTransactionsResponse> create_transaction(budget_id, data)
22
+ > <SaveTransactionsResponse> create_transaction(plan_id, data)
23
23
 
24
24
  Create a single transaction or multiple transactions
25
25
 
@@ -29,7 +29,7 @@ Creates a single transaction or multiple transactions. If you provide a body co
29
29
 
30
30
  | Name | Type | Description | Notes |
31
31
  | ---- | ---- | ----------- | ----- |
32
- | **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). | |
32
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
33
33
  | **data** | [**PostTransactionsWrapper**](PostTransactionsWrapper.md) | 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. | |
34
34
 
35
35
  ### Return type
@@ -39,9 +39,9 @@ Creates a single transaction or multiple transactions. If you provide a body co
39
39
 
40
40
  ## delete_transaction
41
41
 
42
- > <TransactionResponse> delete_transaction(budget_id, transaction_id)
42
+ > <TransactionResponse> delete_transaction(plan_id, transaction_id)
43
43
 
44
- Deletes an existing transaction
44
+ Delete a transaction
45
45
 
46
46
  Deletes a transaction
47
47
 
@@ -49,7 +49,7 @@ Deletes a transaction
49
49
 
50
50
  | Name | Type | Description | Notes |
51
51
  | ---- | ---- | ----------- | ----- |
52
- | **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). | |
52
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
53
53
  | **transaction_id** | **String** | The id of the transaction | |
54
54
 
55
55
  ### Return type
@@ -59,9 +59,9 @@ Deletes a transaction
59
59
 
60
60
  ## get_transaction_by_id
61
61
 
62
- > <TransactionResponse> get_transaction_by_id(budget_id, transaction_id)
62
+ > <TransactionResponse> get_transaction_by_id(plan_id, transaction_id)
63
63
 
64
- Single transaction
64
+ Get a transaction
65
65
 
66
66
  Returns a single transaction
67
67
 
@@ -69,7 +69,7 @@ Returns a single transaction
69
69
 
70
70
  | Name | Type | Description | Notes |
71
71
  | ---- | ---- | ----------- | ----- |
72
- | **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). | |
72
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
73
73
  | **transaction_id** | **String** | The id of the transaction | |
74
74
 
75
75
  ### Return type
@@ -79,17 +79,17 @@ Returns a single transaction
79
79
 
80
80
  ## get_transactions
81
81
 
82
- > <TransactionsResponse> get_transactions(budget_id, opts)
82
+ > <TransactionsResponse> get_transactions(plan_id, opts)
83
83
 
84
- List transactions
84
+ Get all transactions
85
85
 
86
- Returns budget transactions, excluding any pending transactions
86
+ Returns plan transactions, excluding any pending transactions
87
87
 
88
88
  ### Parameters
89
89
 
90
90
  | Name | Type | Description | Notes |
91
91
  | ---- | ---- | ----------- | ----- |
92
- | **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). | |
92
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
93
93
  | **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
94
94
  | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
95
95
  | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
@@ -101,9 +101,9 @@ Returns budget transactions, excluding any pending transactions
101
101
 
102
102
  ## get_transactions_by_account
103
103
 
104
- > <TransactionsResponse> get_transactions_by_account(budget_id, account_id, opts)
104
+ > <TransactionsResponse> get_transactions_by_account(plan_id, account_id, opts)
105
105
 
106
- List account transactions
106
+ Get all account transactions
107
107
 
108
108
  Returns all transactions for a specified account, excluding any pending transactions
109
109
 
@@ -111,7 +111,7 @@ Returns all transactions for a specified account, excluding any pending transact
111
111
 
112
112
  | Name | Type | Description | Notes |
113
113
  | ---- | ---- | ----------- | ----- |
114
- | **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). | |
114
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
115
115
  | **account_id** | **String** | The id of the account | |
116
116
  | **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
117
117
  | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
@@ -124,17 +124,17 @@ Returns all transactions for a specified account, excluding any pending transact
124
124
 
125
125
  ## get_transactions_by_category
126
126
 
127
- > <HybridTransactionsResponse> get_transactions_by_category(budget_id, category_id, opts)
127
+ > <HybridTransactionsResponse> get_transactions_by_category(plan_id, category_id, opts)
128
128
 
129
- List category transactions, excluding any pending transactions
129
+ Get all category transactions
130
130
 
131
- Returns all transactions for a specified category
131
+ Returns all transactions for a specified category, excluding any pending transactions
132
132
 
133
133
  ### Parameters
134
134
 
135
135
  | Name | Type | Description | Notes |
136
136
  | ---- | ---- | ----------- | ----- |
137
- | **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). | |
137
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
138
138
  | **category_id** | **String** | The id of the category | |
139
139
  | **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
140
140
  | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
@@ -147,40 +147,40 @@ Returns all transactions for a specified category
147
147
 
148
148
  ## get_transactions_by_month
149
149
 
150
- > <HybridTransactionsResponse> get_transactions_by_month(budget_id, month, opts)
150
+ > <TransactionsResponse> get_transactions_by_month(plan_id, month, opts)
151
151
 
152
- List transactions in month, excluding any pending transactions
152
+ Get all plan month transactions
153
153
 
154
- Returns all transactions for a specified month
154
+ Returns all transactions for a specified month, excluding any pending transactions
155
155
 
156
156
  ### Parameters
157
157
 
158
158
  | Name | Type | Description | Notes |
159
159
  | ---- | ---- | ----------- | ----- |
160
- | **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). | |
161
- | **month** | **String** | 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)) | |
160
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
161
+ | **month** | **String** | The plan month in ISO format (e.g. 2016-12-01) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC)) | |
162
162
  | **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
163
163
  | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
164
164
  | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
165
165
 
166
166
  ### Return type
167
167
 
168
- [**HybridTransactionsResponse**](HybridTransactionsResponse.md)
168
+ [**TransactionsResponse**](TransactionsResponse.md)
169
169
 
170
170
 
171
171
  ## get_transactions_by_payee
172
172
 
173
- > <HybridTransactionsResponse> get_transactions_by_payee(budget_id, payee_id, opts)
173
+ > <HybridTransactionsResponse> get_transactions_by_payee(plan_id, payee_id, opts)
174
174
 
175
- List payee transactions, excluding any pending transactions
175
+ Get all payee transactions
176
176
 
177
- Returns all transactions for a specified payee
177
+ Returns all transactions for a specified payee, excluding any pending transactions
178
178
 
179
179
  ### Parameters
180
180
 
181
181
  | Name | Type | Description | Notes |
182
182
  | ---- | ---- | ----------- | ----- |
183
- | **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). | |
183
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
184
184
  | **payee_id** | **String** | The id of the payee | |
185
185
  | **since_date** | **Date** | If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30). | [optional] |
186
186
  | **type** | **String** | If specified, only transactions of the specified type will be included. \&quot;uncategorized\&quot; and \&quot;unapproved\&quot; are currently supported. | [optional] |
@@ -193,17 +193,17 @@ Returns all transactions for a specified payee
193
193
 
194
194
  ## import_transactions
195
195
 
196
- > <TransactionsImportResponse> import_transactions(budget_id)
196
+ > <TransactionsImportResponse> import_transactions(plan_id)
197
197
 
198
198
  Import transactions
199
199
 
200
- 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.
200
+ Imports available transactions on all linked accounts for the given plan. 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.
201
201
 
202
202
  ### Parameters
203
203
 
204
204
  | Name | Type | Description | Notes |
205
205
  | ---- | ---- | ----------- | ----- |
206
- | **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). | |
206
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
207
207
 
208
208
  ### Return type
209
209
 
@@ -212,9 +212,9 @@ Imports available transactions on all linked accounts for the given budget. Lin
212
212
 
213
213
  ## update_transaction
214
214
 
215
- > <TransactionResponse> update_transaction(budget_id, transaction_id, data)
215
+ > <TransactionResponse> update_transaction(plan_id, transaction_id, data)
216
216
 
217
- Updates an existing transaction
217
+ Update a transaction
218
218
 
219
219
  Updates a single transaction
220
220
 
@@ -222,7 +222,7 @@ Updates a single transaction
222
222
 
223
223
  | Name | Type | Description | Notes |
224
224
  | ---- | ---- | ----------- | ----- |
225
- | **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). | |
225
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
226
226
  | **transaction_id** | **String** | The id of the transaction | |
227
227
  | **data** | [**PutTransactionWrapper**](PutTransactionWrapper.md) | The transaction to update | |
228
228
 
@@ -233,7 +233,7 @@ Updates a single transaction
233
233
 
234
234
  ## update_transactions
235
235
 
236
- > <SaveTransactionsResponse> update_transactions(budget_id, data)
236
+ > <SaveTransactionsResponse> update_transactions(plan_id, data)
237
237
 
238
238
  Update multiple transactions
239
239
 
@@ -243,7 +243,7 @@ Updates multiple transactions, by `id` or `import_id`.
243
243
 
244
244
  | Name | Type | Description | Notes |
245
245
  | ---- | ---- | ----------- | ----- |
246
- | **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). | |
246
+ | **plan_id** | **String** | The id of the plan. \&quot;last-used\&quot; can be used to specify the last used plan and \&quot;default\&quot; can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan). | |
247
247
  | **data** | [**PatchTransactionsWrapper**](PatchTransactionsWrapper.md) | 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 its &#x60;import_id&#x60;. If an &#x60;id&#x60; is specified, it will always be used for lookup. You should not specify both &#x60;id&#x60; and &#x60;import_id&#x60;. Updating an &#x60;import_id&#x60; on an existing transaction is not allowed; if an &#x60;import_id&#x60; is specified, it will only be used to lookup the transaction. | |
248
248
 
249
249
  ### Return type
data/docs/UserApi.md CHANGED
@@ -4,14 +4,14 @@ All URIs are relative to *https://api.ynab.com/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
- | [**get_user**](UserApi.md#get_user) | **GET** /user | User info |
7
+ | [**get_user**](UserApi.md#get_user) | **GET** /user | Get user |
8
8
 
9
9
 
10
10
  ## get_user
11
11
 
12
12
  > <UserResponse> get_user
13
13
 
14
- User info
14
+ Get user
15
15
 
16
16
  Returns authenticated user information
17
17
 
@@ -3,13 +3,13 @@ require 'ynab'
3
3
  access_token = ENV['YNAB_ACCESS_TOKEN']
4
4
  ynab = YNAB::API.new(access_token)
5
5
 
6
- budget_id = ENV['YNAB_BUDGET_ID']
6
+ plan_id = ENV['YNAB_plan_id']
7
7
  category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
8
8
 
9
9
  begin
10
10
  puts 'Fetching category...'
11
11
 
12
- category_response = ynab.categories.get_category_by_id(budget_id, category_id)
12
+ category_response = ynab.categories.get_category_by_id(plan_id, category_id)
13
13
  category = category_response.data.category
14
14
 
15
15
  puts "==========="
@@ -4,7 +4,7 @@ require 'ynab'
4
4
  access_token = ENV['YNAB_ACCESS_TOKEN']
5
5
  ynab = YNAB::API.new(access_token)
6
6
 
7
- budget_id = ENV['YNAB_BUDGET_ID']
7
+ plan_id = ENV['YNAB_plan_id']
8
8
  account_id = 'f6fe07cb-c895-not-real-acfac0b7f026'
9
9
  category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
10
10
 
@@ -36,7 +36,7 @@ data = {
36
36
  }
37
37
 
38
38
  begin
39
- ynab.transactions.create_transaction(budget_id, data)
39
+ ynab.transactions.create_transaction(plan_id, data)
40
40
  rescue YNAB::ApiError => e
41
41
  puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
42
42
  end
@@ -4,7 +4,7 @@ require 'ynab'
4
4
  access_token = ENV['YNAB_ACCESS_TOKEN']
5
5
  ynab = YNAB::API.new(access_token)
6
6
 
7
- budget_id = ENV['YNAB_BUDGET_ID']
7
+ plan_id = ENV['YNAB_plan_id']
8
8
  account_id = 'f6fe07cb-c895-not-real-acfac0b7f026'
9
9
  category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
10
10
 
@@ -23,7 +23,7 @@ data = {
23
23
  }
24
24
 
25
25
  begin
26
- ynab.transactions.create_transaction(budget_id, data)
26
+ ynab.transactions.create_transaction(plan_id, data)
27
27
  rescue YNAB::ApiError => e
28
28
  puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
29
29
  end
@@ -4,17 +4,17 @@ access_token = ENV['YNAB_ACCESS_TOKEN']
4
4
  ynab = YNAB::API.new(access_token)
5
5
 
6
6
  begin
7
- puts 'Fetching budgets...'
7
+ puts 'Fetching plans...'
8
8
 
9
- budget_response = ynab.budgets.get_budgets
10
- budgets = budget_response.data.budgets
9
+ plan_response = ynab.plans.get_plans
10
+ plans = plan_response.data.budgets
11
11
 
12
12
  puts '==========='
13
- puts 'BUDGET LIST'
13
+ puts 'PLAN LIST'
14
14
  puts '==========='
15
15
 
16
- budgets.each do |budget|
17
- puts "[id: #{budget.id}, name: #{budget.name}]"
16
+ plans.each do |plan|
17
+ puts "[id: #{plan.id}, name: #{plan.name}]"
18
18
  end
19
19
  rescue YNAB::ApiError => e
20
20
  puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
@@ -4,24 +4,23 @@ require 'date'
4
4
  access_token = ENV['YNAB_ACCESS_TOKEN']
5
5
  ynab = YNAB::API.new(access_token)
6
6
 
7
- budget_id = ENV['YNAB_BUDGET_ID']
7
+ plan_id = ENV['YNAB_plan_id']
8
8
 
9
9
  begin
10
10
  puts 'Fetching month...'
11
11
 
12
12
  first_day_of_month_iso = Date.new(Date.today.year, Date.today.month, 1).iso8601
13
- current_date = Date.today
14
- first_day_of_month = Date.new(current_date.year, current_date.month, 1)
15
- month_response = ynab.months.get_budget_month(budget_id, first_day_of_month_iso)
16
- budget_month = month_response.data.month
13
+
14
+ month_response = ynab.months.get_plan_month(plan_id, first_day_of_month_iso)
15
+ plan_month = month_response.data.month
17
16
 
18
17
  puts "============"
19
- puts "BUDGET MONTH"
18
+ puts "PLAN MONTH"
20
19
  puts "============"
21
- puts " Month: #{budget_month.month}"
22
- puts " Note: #{budget_month.note}"
23
- puts "To Be Budgeted: #{budget_month.to_be_budgeted}"
24
- puts " Age of Money: #{budget_month.age_of_money}"
20
+ puts " Month: #{plan_month.month}"
21
+ puts " Note: #{plan_month.note}"
22
+ puts "To Be Budgeted: #{plan_month.to_be_budgeted}"
23
+ puts " Age of Money: #{plan_month.age_of_money}"
25
24
  puts " Categories: "
26
25
 
27
26
  budget_month.categories.each do |category|
@@ -4,7 +4,7 @@ require 'ynab'
4
4
  access_token = ENV['YNAB_ACCESS_TOKEN']
5
5
  ynab = YNAB::API.new(access_token)
6
6
 
7
- budget_id = ENV['YNAB_BUDGET_ID']
7
+ plan_id = ENV['YNAB_plan_id']
8
8
  category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe'
9
9
  month = '2019-01-01'
10
10
 
@@ -16,7 +16,7 @@ data = {
16
16
 
17
17
  begin
18
18
  # Update budgeted amount to 203.82 in 2018-09-01 for category_id
19
- response = ynab.categories.update_month_category(budget_id, month, category_id, data)
19
+ response = ynab.categories.update_month_category(plan_id, month, category_id, data)
20
20
  month_category_response = response.data.category
21
21
  puts "[budgeted: #{month_category_response.budgeted}, balance: #{month_category_response.balance}]"
22
22
  rescue YNAB::ApiError => e
@@ -3,18 +3,18 @@ require 'ynab'
3
3
  access_token = ENV['YNAB_ACCESS_TOKEN']
4
4
  ynab = YNAB::API.new(access_token)
5
5
 
6
- budget_id = ENV['YNAB_BUDGET_ID']
6
+ plan_id = ENV['YNAB_plan_id']
7
7
 
8
8
  begin
9
9
  # Fetch all unapproved transactions and update them all as approved
10
- unapproved_transaction_data = ynab.transactions.get_transactions(budget_id, { type: 'unapproved' }).data
10
+ unapproved_transaction_data = ynab.transactions.get_transactions(plan_id, { type: 'unapproved' }).data
11
11
 
12
12
  data = unapproved_transaction_data.clone
13
13
  data.transactions.each do |t|
14
14
  t.approved = true
15
15
  end
16
16
 
17
- ynab.transactions.update_transactions(budget_id, update_data)
17
+ ynab.transactions.update_transactions(plan_id, update_data)
18
18
  rescue YNAB::ApiError => e
19
19
  puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}"
20
20
  end