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.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/README.md +47 -39
- data/Rakefile +1 -1
- data/docs/Account.md +3 -3
- data/docs/AccountsApi.md +12 -12
- data/docs/CategoriesApi.md +89 -25
- data/docs/Category.md +4 -3
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/ExistingCategory.md +12 -0
- data/docs/MoneyMovement.md +16 -0
- data/docs/MoneyMovementGroup.md +12 -0
- data/docs/MoneyMovementGroupsResponse.md +8 -0
- data/docs/MoneyMovementGroupsResponseData.md +9 -0
- data/docs/MoneyMovementsApi.md +89 -0
- data/docs/{BudgetSettingsResponse.md → MoneyMovementsResponse.md} +2 -2
- data/docs/MoneyMovementsResponseData.md +9 -0
- data/docs/MonthDetail.md +2 -2
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +13 -13
- data/docs/NewCategory.md +12 -0
- data/docs/PatchCategoryGroupWrapper.md +8 -0
- data/docs/PatchCategoryWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +12 -12
- data/docs/PayeesApi.md +11 -11
- data/docs/{BudgetDetail.md → PlanDetail.md} +4 -4
- data/docs/PlanDetailResponse.md +8 -0
- data/docs/{BudgetDetailResponseData.md → PlanDetailResponseData.md} +2 -2
- data/docs/{BudgetSettings.md → PlanSettings.md} +1 -1
- data/docs/{BudgetDetailResponse.md → PlanSettingsResponse.md} +2 -2
- data/docs/PlanSettingsResponseData.md +8 -0
- data/docs/PlanSummary.md +15 -0
- data/docs/PlanSummaryResponse.md +8 -0
- data/docs/PlanSummaryResponseData.md +9 -0
- data/docs/PlansApi.md +68 -0
- data/docs/PostCategoryGroupWrapper.md +8 -0
- data/docs/PostCategoryWrapper.md +8 -0
- data/docs/SaveCategory.md +2 -1
- data/docs/SaveCategoryGroup.md +8 -0
- data/docs/SaveCategoryGroupResponse.md +8 -0
- data/docs/SaveCategoryGroupResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +1 -1
- data/docs/ScheduledTransactionsApi.md +20 -20
- data/docs/TransactionsApi.md +48 -48
- data/docs/UserApi.md +2 -2
- data/examples/category-balance.rb +2 -2
- data/examples/create-multiple-transactions.rb +2 -2
- data/examples/create-transaction.rb +2 -2
- data/examples/{budget-list.rb → plan-list.rb} +6 -6
- data/examples/{budget-month.rb → plan-month.rb} +9 -10
- data/examples/update-category-budgeted.rb +2 -2
- data/examples/update-multiple-transactions.rb +3 -3
- data/lib/ynab/api/accounts_api.rb +33 -34
- data/lib/ynab/api/categories_api.rb +293 -66
- data/lib/ynab/api/deprecated_api.rb +11 -11
- data/lib/ynab/api/money_movements_api.rb +282 -0
- data/lib/ynab/api/months_api.rb +35 -36
- data/lib/ynab/api/payee_locations_api.rb +33 -34
- data/lib/ynab/api/payees_api.rb +31 -32
- data/lib/ynab/api/{budgets_api.rb → plans_api.rb} +54 -55
- data/lib/ynab/api/scheduled_transactions_api.rb +55 -56
- data/lib/ynab/api/transactions_api.rb +130 -131
- data/lib/ynab/api/user_api.rb +2 -3
- data/lib/ynab/api_client.rb +0 -2
- data/lib/ynab/api_model_base.rb +85 -0
- data/lib/ynab/models/account.rb +4 -81
- data/lib/ynab/models/account_response.rb +1 -75
- data/lib/ynab/models/account_response_data.rb +1 -75
- data/lib/ynab/models/accounts_response.rb +1 -75
- data/lib/ynab/models/accounts_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response.rb +1 -75
- data/lib/ynab/models/bulk_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response_data_bulk.rb +1 -75
- data/lib/ynab/models/bulk_transactions.rb +1 -75
- data/lib/ynab/models/categories_response.rb +1 -75
- data/lib/ynab/models/categories_response_data.rb +1 -75
- data/lib/ynab/models/category.rb +16 -79
- data/lib/ynab/models/category_group.rb +1 -75
- data/lib/ynab/models/category_group_with_categories.rb +2 -76
- data/lib/ynab/models/category_response.rb +1 -75
- data/lib/ynab/models/category_response_data.rb +1 -75
- data/lib/ynab/models/currency_format.rb +2 -76
- data/lib/ynab/models/date_format.rb +2 -76
- data/lib/ynab/models/error_detail.rb +1 -75
- data/lib/ynab/models/error_response.rb +1 -75
- data/lib/ynab/models/existing_category.rb +180 -0
- data/lib/ynab/models/existing_transaction.rb +1 -79
- data/lib/ynab/models/hybrid_transaction.rb +1 -85
- data/lib/ynab/models/hybrid_transactions_response.rb +1 -75
- data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -75
- data/lib/ynab/models/money_movement.rb +223 -0
- data/lib/ynab/models/money_movement_group.rb +179 -0
- data/lib/ynab/models/{budget_summary_response.rb → money_movement_groups_response.rb} +4 -78
- data/lib/ynab/models/money_movement_groups_response_data.rb +149 -0
- data/lib/ynab/models/{budget_settings_response.rb → money_movements_response.rb} +4 -78
- data/lib/ynab/models/money_movements_response_data.rb +149 -0
- data/lib/ynab/models/month_detail.rb +3 -79
- data/lib/ynab/models/month_detail_response.rb +1 -75
- data/lib/ynab/models/month_detail_response_data.rb +1 -75
- data/lib/ynab/models/month_summaries_response.rb +1 -75
- data/lib/ynab/models/month_summaries_response_data.rb +1 -75
- data/lib/ynab/models/month_summary.rb +2 -76
- data/lib/ynab/models/new_category.rb +180 -0
- data/lib/ynab/models/new_transaction.rb +1 -79
- data/lib/ynab/models/patch_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/patch_category_wrapper.rb +2 -76
- data/lib/ynab/models/patch_month_category_wrapper.rb +1 -75
- data/lib/ynab/models/patch_payee_wrapper.rb +1 -75
- data/lib/ynab/models/patch_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/payee.rb +1 -75
- data/lib/ynab/models/payee_location.rb +1 -75
- data/lib/ynab/models/payee_location_response.rb +1 -75
- data/lib/ynab/models/payee_location_response_data.rb +1 -75
- data/lib/ynab/models/payee_locations_response.rb +1 -75
- data/lib/ynab/models/payee_locations_response_data.rb +1 -75
- data/lib/ynab/models/payee_response.rb +1 -75
- data/lib/ynab/models/payee_response_data.rb +1 -75
- data/lib/ynab/models/payees_response.rb +1 -75
- data/lib/ynab/models/payees_response_data.rb +1 -75
- data/lib/ynab/models/{budget_detail.rb → plan_detail.rb} +7 -83
- data/lib/ynab/models/plan_detail_response.rb +136 -0
- data/lib/ynab/models/{budget_detail_response_data.rb → plan_detail_response_data.rb} +4 -78
- data/lib/ynab/models/{budget_settings.rb → plan_settings.rb} +5 -79
- data/lib/ynab/models/{budget_detail_response.rb → plan_settings_response.rb} +4 -78
- data/lib/ynab/models/{budget_settings_response_data.rb → plan_settings_response_data.rb} +4 -78
- data/lib/ynab/models/{budget_summary.rb → plan_summary.rb} +7 -83
- data/lib/ynab/models/plan_summary_response.rb +136 -0
- data/lib/ynab/models/{budget_summary_response_data.rb → plan_summary_response_data.rb} +5 -79
- data/lib/ynab/models/post_account_wrapper.rb +1 -75
- data/lib/ynab/models/post_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/post_category_wrapper.rb +136 -0
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/post_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/put_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/save_account.rb +1 -75
- data/lib/ynab/models/save_category.rb +18 -81
- data/lib/ynab/models/save_category_group.rb +148 -0
- data/lib/ynab/models/save_category_group_response.rb +136 -0
- data/lib/ynab/models/save_category_group_response_data.rb +147 -0
- data/lib/ynab/models/save_category_response.rb +1 -75
- data/lib/ynab/models/save_category_response_data.rb +1 -75
- data/lib/ynab/models/save_month_category.rb +2 -76
- data/lib/ynab/models/save_payee.rb +1 -75
- data/lib/ynab/models/save_payee_response.rb +1 -75
- data/lib/ynab/models/save_payee_response_data.rb +1 -75
- data/lib/ynab/models/save_scheduled_transaction.rb +1 -75
- data/lib/ynab/models/save_sub_transaction.rb +1 -75
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +1 -79
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +1 -75
- data/lib/ynab/models/save_transactions_response.rb +1 -75
- data/lib/ynab/models/save_transactions_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_sub_transaction.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_detail.rb +1 -80
- data/lib/ynab/models/scheduled_transaction_response.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_summary.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -75
- data/lib/ynab/models/sub_transaction.rb +1 -75
- data/lib/ynab/models/transaction_detail.rb +1 -85
- data/lib/ynab/models/transaction_response.rb +1 -75
- data/lib/ynab/models/transaction_response_data.rb +1 -75
- data/lib/ynab/models/transaction_summary.rb +1 -75
- data/lib/ynab/models/transactions_import_response.rb +1 -75
- data/lib/ynab/models/transactions_import_response_data.rb +1 -75
- data/lib/ynab/models/transactions_response.rb +1 -75
- data/lib/ynab/models/transactions_response_data.rb +1 -75
- data/lib/ynab/models/user.rb +1 -75
- data/lib/ynab/models/user_response.rb +1 -75
- data/lib/ynab/models/user_response_data.rb +1 -75
- data/lib/ynab/overrides/transactions_api.rb +6 -6
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +28 -13
- data/open_api_spec.yaml +1155 -910
- data/spec/api/accounts_spec.rb +9 -9
- data/spec/api/categories_spec.rb +9 -9
- data/spec/api/months_spec.rb +7 -7
- data/spec/api/payee_locations_spec.rb +7 -7
- data/spec/api/payees_spec.rb +7 -7
- data/spec/api/{budgets_spec.rb → plans_spec.rb} +12 -12
- data/spec/api/scheduled_transactions_spec.rb +9 -9
- data/spec/api/transactions_spec.rb +27 -27
- data/spec/fixtures/vcr_cassettes/plans.yml +49 -0
- data/spec/fixtures/vcr_cassettes/plans_unauthorized.yml +49 -0
- data/templates/gem.mustache +3 -2
- data/templates/partial_model_generic.mustache +1 -1
- data/ynab.gemspec +1 -2
- metadata +62 -27
- data/docs/BudgetSettingsResponseData.md +0 -8
- data/docs/BudgetSummary.md +0 -15
- data/docs/BudgetSummaryResponse.md +0 -8
- data/docs/BudgetSummaryResponseData.md +0 -9
- data/docs/BudgetsApi.md +0 -68
data/lib/ynab/api/payees_api.rb
CHANGED
|
@@ -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
|
-
#
|
|
18
|
+
# Get a payee
|
|
20
19
|
# Returns a single payee
|
|
21
|
-
# @param
|
|
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(
|
|
26
|
-
data, _status_code, _headers = get_payee_by_id_with_http_info(
|
|
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
|
-
#
|
|
29
|
+
# Get a payee
|
|
31
30
|
# Returns a single payee
|
|
32
|
-
# @param
|
|
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(
|
|
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 '
|
|
41
|
-
if @api_client.config.client_side_validation &&
|
|
42
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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/{
|
|
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
|
-
#
|
|
87
|
+
# Get all payees
|
|
89
88
|
# Returns all payees
|
|
90
|
-
# @param
|
|
89
|
+
# @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).
|
|
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 `last_knowledge_of_server` will be included.
|
|
93
92
|
# @return [PayeesResponse]
|
|
94
|
-
def get_payees(
|
|
95
|
-
data, _status_code, _headers = get_payees_with_http_info(
|
|
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
|
-
#
|
|
98
|
+
# Get all payees
|
|
100
99
|
# Returns all payees
|
|
101
|
-
# @param
|
|
100
|
+
# @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).
|
|
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 `last_knowledge_of_server` 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(
|
|
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 '
|
|
110
|
-
if @api_client.config.client_side_validation &&
|
|
111
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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/{
|
|
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
|
|
155
|
+
# @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).
|
|
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(
|
|
162
|
-
data, _status_code, _headers = update_payee_with_http_info(
|
|
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
|
|
167
|
+
# @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).
|
|
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(
|
|
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 '
|
|
178
|
-
if @api_client.config.client_side_validation &&
|
|
179
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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/{
|
|
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
|
|
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
|
-
#
|
|
20
|
-
# Returns a single
|
|
21
|
-
# @param
|
|
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. \"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 [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 `last_knowledge_of_server` will be included.
|
|
24
|
-
# @return [
|
|
25
|
-
def
|
|
26
|
-
data, _status_code, _headers =
|
|
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
|
-
#
|
|
31
|
-
# Returns a single
|
|
32
|
-
# @param
|
|
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. \"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 [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 `last_knowledge_of_server` will be included.
|
|
35
|
-
# @return [Array<(
|
|
36
|
-
def
|
|
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:
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: PlansApi.get_plan_by_id ...'
|
|
39
38
|
end
|
|
40
|
-
# verify the required parameter '
|
|
41
|
-
if @api_client.config.client_side_validation &&
|
|
42
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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/{
|
|
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] || '
|
|
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 => :"
|
|
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:
|
|
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
|
-
#
|
|
86
|
-
# Returns settings for a
|
|
87
|
-
# @param
|
|
84
|
+
# Get plan settings
|
|
85
|
+
# Returns settings for a plan
|
|
86
|
+
# @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).
|
|
88
87
|
# @param [Hash] opts the optional parameters
|
|
89
|
-
# @return [
|
|
90
|
-
def
|
|
91
|
-
data, _status_code, _headers =
|
|
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
|
-
#
|
|
96
|
-
# Returns settings for a
|
|
97
|
-
# @param
|
|
94
|
+
# Get plan settings
|
|
95
|
+
# Returns settings for a plan
|
|
96
|
+
# @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).
|
|
98
97
|
# @param [Hash] opts the optional parameters
|
|
99
|
-
# @return [Array<(
|
|
100
|
-
def
|
|
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:
|
|
101
|
+
@api_client.config.logger.debug 'Calling API: PlansApi.get_plan_settings_by_id ...'
|
|
103
102
|
end
|
|
104
|
-
# verify the required parameter '
|
|
105
|
-
if @api_client.config.client_side_validation &&
|
|
106
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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/{
|
|
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] || '
|
|
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 => :"
|
|
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:
|
|
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
|
-
#
|
|
149
|
-
# Returns
|
|
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
|
|
152
|
-
# @return [
|
|
153
|
-
def
|
|
154
|
-
data, _status_code, _headers =
|
|
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
|
-
#
|
|
159
|
-
# Returns
|
|
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
|
|
162
|
-
# @return [Array<(
|
|
163
|
-
def
|
|
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:
|
|
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] || '
|
|
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 => :"
|
|
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:
|
|
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
|