ynab 3.9.0 → 4.9.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 (195) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +3 -1
  4. data/README.md +47 -39
  5. data/Rakefile +1 -1
  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} +54 -55
  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/money_movement.rb +223 -0
  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/money_movements_response_data.rb +149 -0
  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/{budget_detail_response_data.rb → plan_detail_response_data.rb} +4 -78
  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/{budget_summary_response_data.rb → plan_summary_response_data.rb} +5 -79
  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 +1155 -910
  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/{budgets_spec.rb → plans_spec.rb} +12 -12
  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/plans.yml +49 -0
  186. data/spec/fixtures/vcr_cassettes/plans_unauthorized.yml +49 -0
  187. data/templates/gem.mustache +3 -2
  188. data/templates/partial_model_generic.mustache +1 -1
  189. data/ynab.gemspec +1 -2
  190. metadata +62 -27
  191. data/docs/BudgetSettingsResponseData.md +0 -8
  192. data/docs/BudgetSummary.md +0 -15
  193. data/docs/BudgetSummaryResponse.md +0 -8
  194. data/docs/BudgetSummaryResponseData.md +0 -9
  195. data/docs/BudgetsApi.md +0 -68
@@ -4,7 +4,6 @@
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
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
-
8
7
  =end
9
8
 
10
9
  require 'cgi'
@@ -16,37 +15,37 @@ module YNAB
16
15
  def initialize(api_client = ApiClient.default)
17
16
  @api_client = api_client
18
17
  end
19
- # Single payee
18
+ # Get a payee
20
19
  # Returns a single payee
21
- # @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).
20
+ # @param plan_id [String] The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).
22
21
  # @param payee_id [String] The id of the payee
23
22
  # @param [Hash] opts the optional parameters
24
23
  # @return [PayeeResponse]
25
- def get_payee_by_id(budget_id, payee_id, opts = {})
26
- data, _status_code, _headers = get_payee_by_id_with_http_info(budget_id, payee_id, opts)
24
+ def get_payee_by_id(plan_id, payee_id, opts = {})
25
+ data, _status_code, _headers = get_payee_by_id_with_http_info(plan_id, payee_id, opts)
27
26
  data
28
27
  end
29
28
 
30
- # Single payee
29
+ # Get a payee
31
30
  # Returns a single payee
32
- # @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).
31
+ # @param plan_id [String] The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).
33
32
  # @param payee_id [String] The id of the payee
34
33
  # @param [Hash] opts the optional parameters
35
34
  # @return [Array<(PayeeResponse, Integer, Hash)>] PayeeResponse data, response status code and response headers
36
- def get_payee_by_id_with_http_info(budget_id, payee_id, opts = {})
35
+ def get_payee_by_id_with_http_info(plan_id, payee_id, opts = {})
37
36
  if @api_client.config.debugging
38
37
  @api_client.config.logger.debug 'Calling API: PayeesApi.get_payee_by_id ...'
39
38
  end
40
- # verify the required parameter 'budget_id' is set
41
- if @api_client.config.client_side_validation && budget_id.nil?
42
- fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeesApi.get_payee_by_id"
39
+ # verify the required parameter 'plan_id' is set
40
+ if @api_client.config.client_side_validation && plan_id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'plan_id' when calling PayeesApi.get_payee_by_id"
43
42
  end
44
43
  # verify the required parameter 'payee_id' is set
45
44
  if @api_client.config.client_side_validation && payee_id.nil?
46
45
  fail ArgumentError, "Missing the required parameter 'payee_id' when calling PayeesApi.get_payee_by_id"
47
46
  end
48
47
  # resource path
49
- local_var_path = '/budgets/{budget_id}/payees/{payee_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))
48
+ local_var_path = '/budgets/{plan_id}/payees/{payee_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))
50
49
 
51
50
  # query parameters
52
51
  query_params = opts[:query_params] || {}
@@ -85,33 +84,33 @@ module YNAB
85
84
  return data, status_code, headers
86
85
  end
87
86
 
88
- # List payees
87
+ # Get all payees
89
88
  # Returns all payees
90
- # @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).
89
+ # @param 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).
91
90
  # @param [Hash] opts the optional parameters
92
91
  # @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.
93
92
  # @return [PayeesResponse]
94
- def get_payees(budget_id, opts = {})
95
- data, _status_code, _headers = get_payees_with_http_info(budget_id, opts)
93
+ def get_payees(plan_id, opts = {})
94
+ data, _status_code, _headers = get_payees_with_http_info(plan_id, opts)
96
95
  data
97
96
  end
98
97
 
99
- # List payees
98
+ # Get all payees
100
99
  # Returns all payees
101
- # @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).
100
+ # @param 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).
102
101
  # @param [Hash] opts the optional parameters
103
102
  # @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.
104
103
  # @return [Array<(PayeesResponse, Integer, Hash)>] PayeesResponse data, response status code and response headers
105
- def get_payees_with_http_info(budget_id, opts = {})
104
+ def get_payees_with_http_info(plan_id, opts = {})
106
105
  if @api_client.config.debugging
107
106
  @api_client.config.logger.debug 'Calling API: PayeesApi.get_payees ...'
108
107
  end
109
- # verify the required parameter 'budget_id' is set
110
- if @api_client.config.client_side_validation && budget_id.nil?
111
- fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeesApi.get_payees"
108
+ # verify the required parameter 'plan_id' is set
109
+ if @api_client.config.client_side_validation && plan_id.nil?
110
+ fail ArgumentError, "Missing the required parameter 'plan_id' when calling PayeesApi.get_payees"
112
111
  end
113
112
  # resource path
114
- local_var_path = '/budgets/{budget_id}/payees'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
113
+ local_var_path = '/budgets/{plan_id}/payees'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s))
115
114
 
116
115
  # query parameters
117
116
  query_params = opts[:query_params] || {}
@@ -153,30 +152,30 @@ module YNAB
153
152
 
154
153
  # Update a payee
155
154
  # Update a payee
156
- # @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).
155
+ # @param 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).
157
156
  # @param payee_id [String] The id of the payee
158
157
  # @param data [PatchPayeeWrapper] The payee to update
159
158
  # @param [Hash] opts the optional parameters
160
159
  # @return [SavePayeeResponse]
161
- def update_payee(budget_id, payee_id, data, opts = {})
162
- data, _status_code, _headers = update_payee_with_http_info(budget_id, payee_id, data, opts)
160
+ def update_payee(plan_id, payee_id, data, opts = {})
161
+ data, _status_code, _headers = update_payee_with_http_info(plan_id, payee_id, data, opts)
163
162
  data
164
163
  end
165
164
 
166
165
  # Update a payee
167
166
  # Update a payee
168
- # @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).
167
+ # @param 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).
169
168
  # @param payee_id [String] The id of the payee
170
169
  # @param data [PatchPayeeWrapper] The payee to update
171
170
  # @param [Hash] opts the optional parameters
172
171
  # @return [Array<(SavePayeeResponse, Integer, Hash)>] SavePayeeResponse data, response status code and response headers
173
- def update_payee_with_http_info(budget_id, payee_id, data, opts = {})
172
+ def update_payee_with_http_info(plan_id, payee_id, data, opts = {})
174
173
  if @api_client.config.debugging
175
174
  @api_client.config.logger.debug 'Calling API: PayeesApi.update_payee ...'
176
175
  end
177
- # verify the required parameter 'budget_id' is set
178
- if @api_client.config.client_side_validation && budget_id.nil?
179
- fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeesApi.update_payee"
176
+ # verify the required parameter 'plan_id' is set
177
+ if @api_client.config.client_side_validation && plan_id.nil?
178
+ fail ArgumentError, "Missing the required parameter 'plan_id' when calling PayeesApi.update_payee"
180
179
  end
181
180
  # verify the required parameter 'payee_id' is set
182
181
  if @api_client.config.client_side_validation && payee_id.nil?
@@ -187,7 +186,7 @@ module YNAB
187
186
  fail ArgumentError, "Missing the required parameter 'data' when calling PayeesApi.update_payee"
188
187
  end
189
188
  # resource path
190
- local_var_path = '/budgets/{budget_id}/payees/{payee_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))
189
+ local_var_path = '/budgets/{plan_id}/payees/{payee_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))
191
190
 
192
191
  # query parameters
193
192
  query_params = opts[:query_params] || {}
@@ -4,45 +4,44 @@
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
6
  Generated by: OpenAPI Generator (https://openapi-generator.tech)
7
-
8
7
  =end
9
8
 
10
9
  require 'cgi'
11
10
 
12
11
  module YNAB
13
- class BudgetsApi
12
+ class PlansApi
14
13
  attr_accessor :api_client
15
14
 
16
15
  def initialize(api_client = ApiClient.default)
17
16
  @api_client = api_client
18
17
  end
19
- # Single budget
20
- # Returns a single budget with all related entities. This resource is effectively a full budget export.
21
- # @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).
18
+ # Get a plan
19
+ # Returns a single plan with all related entities. This resource is effectively a full plan export.
20
+ # @param 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).
22
21
  # @param [Hash] opts the optional parameters
23
22
  # @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.
24
- # @return [BudgetDetailResponse]
25
- def get_budget_by_id(budget_id, opts = {})
26
- data, _status_code, _headers = get_budget_by_id_with_http_info(budget_id, opts)
23
+ # @return [PlanDetailResponse]
24
+ def get_plan_by_id(plan_id, opts = {})
25
+ data, _status_code, _headers = get_plan_by_id_with_http_info(plan_id, opts)
27
26
  data
28
27
  end
29
28
 
30
- # Single budget
31
- # Returns a single budget with all related entities. This resource is effectively a full budget export.
32
- # @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).
29
+ # Get a plan
30
+ # Returns a single plan with all related entities. This resource is effectively a full plan export.
31
+ # @param 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
32
  # @param [Hash] opts the optional parameters
34
33
  # @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.
35
- # @return [Array<(BudgetDetailResponse, Integer, Hash)>] BudgetDetailResponse data, response status code and response headers
36
- def get_budget_by_id_with_http_info(budget_id, opts = {})
34
+ # @return [Array<(PlanDetailResponse, Integer, Hash)>] PlanDetailResponse data, response status code and response headers
35
+ def get_plan_by_id_with_http_info(plan_id, opts = {})
37
36
  if @api_client.config.debugging
38
- @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budget_by_id ...'
37
+ @api_client.config.logger.debug 'Calling API: PlansApi.get_plan_by_id ...'
39
38
  end
40
- # verify the required parameter 'budget_id' is set
41
- if @api_client.config.client_side_validation && budget_id.nil?
42
- fail ArgumentError, "Missing the required parameter 'budget_id' when calling BudgetsApi.get_budget_by_id"
39
+ # verify the required parameter 'plan_id' is set
40
+ if @api_client.config.client_side_validation && plan_id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'plan_id' when calling PlansApi.get_plan_by_id"
43
42
  end
44
43
  # resource path
45
- local_var_path = '/budgets/{budget_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
44
+ local_var_path = '/budgets/{plan_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s))
46
45
 
47
46
  # query parameters
48
47
  query_params = opts[:query_params] || {}
@@ -60,13 +59,13 @@ module YNAB
60
59
  post_body = opts[:debug_body]
61
60
 
62
61
  # return_type
63
- return_type = opts[:debug_return_type] || 'BudgetDetailResponse'
62
+ return_type = opts[:debug_return_type] || 'PlanDetailResponse'
64
63
 
65
64
  # auth_names
66
65
  auth_names = opts[:debug_auth_names] || ['bearer']
67
66
 
68
67
  new_options = opts.merge(
69
- :operation => :"BudgetsApi.get_budget_by_id",
68
+ :operation => :"PlansApi.get_plan_by_id",
70
69
  :header_params => header_params,
71
70
  :query_params => query_params,
72
71
  :form_params => form_params,
@@ -77,36 +76,36 @@ module YNAB
77
76
 
78
77
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
78
  if @api_client.config.debugging
80
- @api_client.config.logger.debug "API called: BudgetsApi#get_budget_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ @api_client.config.logger.debug "API called: PlansApi#get_plan_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
80
  end
82
81
  return data, status_code, headers
83
82
  end
84
83
 
85
- # Budget Settings
86
- # Returns settings for a budget
87
- # @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).
84
+ # Get plan settings
85
+ # Returns settings for a plan
86
+ # @param 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).
88
87
  # @param [Hash] opts the optional parameters
89
- # @return [BudgetSettingsResponse]
90
- def get_budget_settings_by_id(budget_id, opts = {})
91
- data, _status_code, _headers = get_budget_settings_by_id_with_http_info(budget_id, opts)
88
+ # @return [PlanSettingsResponse]
89
+ def get_plan_settings_by_id(plan_id, opts = {})
90
+ data, _status_code, _headers = get_plan_settings_by_id_with_http_info(plan_id, opts)
92
91
  data
93
92
  end
94
93
 
95
- # Budget Settings
96
- # Returns settings for a budget
97
- # @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).
94
+ # Get plan settings
95
+ # Returns settings for a plan
96
+ # @param 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).
98
97
  # @param [Hash] opts the optional parameters
99
- # @return [Array<(BudgetSettingsResponse, Integer, Hash)>] BudgetSettingsResponse data, response status code and response headers
100
- def get_budget_settings_by_id_with_http_info(budget_id, opts = {})
98
+ # @return [Array<(PlanSettingsResponse, Integer, Hash)>] PlanSettingsResponse data, response status code and response headers
99
+ def get_plan_settings_by_id_with_http_info(plan_id, opts = {})
101
100
  if @api_client.config.debugging
102
- @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budget_settings_by_id ...'
101
+ @api_client.config.logger.debug 'Calling API: PlansApi.get_plan_settings_by_id ...'
103
102
  end
104
- # verify the required parameter 'budget_id' is set
105
- if @api_client.config.client_side_validation && budget_id.nil?
106
- fail ArgumentError, "Missing the required parameter 'budget_id' when calling BudgetsApi.get_budget_settings_by_id"
103
+ # verify the required parameter 'plan_id' is set
104
+ if @api_client.config.client_side_validation && plan_id.nil?
105
+ fail ArgumentError, "Missing the required parameter 'plan_id' when calling PlansApi.get_plan_settings_by_id"
107
106
  end
108
107
  # resource path
109
- local_var_path = '/budgets/{budget_id}/settings'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
108
+ local_var_path = '/budgets/{plan_id}/settings'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s))
110
109
 
111
110
  # query parameters
112
111
  query_params = opts[:query_params] || {}
@@ -123,13 +122,13 @@ module YNAB
123
122
  post_body = opts[:debug_body]
124
123
 
125
124
  # return_type
126
- return_type = opts[:debug_return_type] || 'BudgetSettingsResponse'
125
+ return_type = opts[:debug_return_type] || 'PlanSettingsResponse'
127
126
 
128
127
  # auth_names
129
128
  auth_names = opts[:debug_auth_names] || ['bearer']
130
129
 
131
130
  new_options = opts.merge(
132
- :operation => :"BudgetsApi.get_budget_settings_by_id",
131
+ :operation => :"PlansApi.get_plan_settings_by_id",
133
132
  :header_params => header_params,
134
133
  :query_params => query_params,
135
134
  :form_params => form_params,
@@ -140,29 +139,29 @@ module YNAB
140
139
 
141
140
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
142
141
  if @api_client.config.debugging
143
- @api_client.config.logger.debug "API called: BudgetsApi#get_budget_settings_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
+ @api_client.config.logger.debug "API called: PlansApi#get_plan_settings_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
143
  end
145
144
  return data, status_code, headers
146
145
  end
147
146
 
148
- # List budgets
149
- # Returns budgets list with summary information
147
+ # Get all plans
148
+ # Returns plans list with summary information
150
149
  # @param [Hash] opts the optional parameters
151
- # @option opts [Boolean] :include_accounts Whether to include the list of budget accounts
152
- # @return [BudgetSummaryResponse]
153
- def get_budgets(opts = {})
154
- data, _status_code, _headers = get_budgets_with_http_info(opts)
150
+ # @option opts [Boolean] :include_accounts Whether to include the list of plan accounts
151
+ # @return [PlanSummaryResponse]
152
+ def get_plans(opts = {})
153
+ data, _status_code, _headers = get_plans_with_http_info(opts)
155
154
  data
156
155
  end
157
156
 
158
- # List budgets
159
- # Returns budgets list with summary information
157
+ # Get all plans
158
+ # Returns plans list with summary information
160
159
  # @param [Hash] opts the optional parameters
161
- # @option opts [Boolean] :include_accounts Whether to include the list of budget accounts
162
- # @return [Array<(BudgetSummaryResponse, Integer, Hash)>] BudgetSummaryResponse data, response status code and response headers
163
- def get_budgets_with_http_info(opts = {})
160
+ # @option opts [Boolean] :include_accounts Whether to include the list of plan accounts
161
+ # @return [Array<(PlanSummaryResponse, Integer, Hash)>] PlanSummaryResponse data, response status code and response headers
162
+ def get_plans_with_http_info(opts = {})
164
163
  if @api_client.config.debugging
165
- @api_client.config.logger.debug 'Calling API: BudgetsApi.get_budgets ...'
164
+ @api_client.config.logger.debug 'Calling API: PlansApi.get_plans ...'
166
165
  end
167
166
  # resource path
168
167
  local_var_path = '/budgets'
@@ -183,13 +182,13 @@ module YNAB
183
182
  post_body = opts[:debug_body]
184
183
 
185
184
  # return_type
186
- return_type = opts[:debug_return_type] || 'BudgetSummaryResponse'
185
+ return_type = opts[:debug_return_type] || 'PlanSummaryResponse'
187
186
 
188
187
  # auth_names
189
188
  auth_names = opts[:debug_auth_names] || ['bearer']
190
189
 
191
190
  new_options = opts.merge(
192
- :operation => :"BudgetsApi.get_budgets",
191
+ :operation => :"PlansApi.get_plans",
193
192
  :header_params => header_params,
194
193
  :query_params => query_params,
195
194
  :form_params => form_params,
@@ -200,7 +199,7 @@ module YNAB
200
199
 
201
200
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
201
  if @api_client.config.debugging
203
- @api_client.config.logger.debug "API called: BudgetsApi#get_budgets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ @api_client.config.logger.debug "API called: PlansApi#get_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
203
  end
205
204
  return data, status_code, headers
206
205
  end