ynab 1.29.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +11 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +42 -0
- data/README.md +6 -6
- data/Rakefile +58 -0
- data/config.json +9 -0
- data/docs/Account.md +25 -0
- data/docs/AccountResponse.md +8 -0
- data/docs/AccountResponseData.md +8 -0
- data/docs/AccountType.md +7 -0
- data/docs/AccountWrapper.md +8 -0
- data/docs/AccountsApi.md +70 -0
- data/docs/AccountsResponse.md +8 -0
- data/docs/AccountsResponseData.md +9 -0
- data/docs/AccountsWrapper.md +9 -0
- data/docs/BudgetDetail.md +24 -0
- data/docs/BudgetDetailAllOf.md +17 -0
- data/docs/BudgetDetailResponse.md +8 -0
- data/docs/BudgetDetailResponseData.md +9 -0
- data/docs/BudgetDetailWrapper.md +9 -0
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsResponseData.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +15 -0
- data/docs/BudgetSummaryResponse.md +8 -0
- data/docs/BudgetSummaryResponseData.md +9 -0
- data/docs/BudgetSummaryWrapper.md +9 -0
- data/docs/BudgetsApi.md +68 -0
- data/docs/BulkIdWrapper.md +8 -0
- data/docs/BulkIds.md +9 -0
- data/docs/BulkResponse.md +8 -0
- data/docs/BulkResponseData.md +8 -0
- data/docs/BulkResponseDataBulk.md +9 -0
- data/docs/BulkTransactionCreateResponse.md +8 -0
- data/docs/BulkTransactionIds.md +8 -0
- data/docs/BulkTransactions.md +8 -0
- data/docs/CategoriesApi.md +94 -0
- data/docs/CategoriesResponse.md +8 -0
- data/docs/CategoriesResponseData.md +9 -0
- data/docs/Category.md +30 -0
- data/docs/CategoryGroup.md +11 -0
- data/docs/CategoryGroupWithCategories.md +12 -0
- data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
- data/docs/CategoryGroupsWrapper.md +9 -0
- data/docs/CategoryResponse.md +8 -0
- data/docs/CategoryResponseData.md +8 -0
- data/docs/CategoryWrapper.md +9 -0
- data/docs/CurrencyFormat.md +15 -0
- data/docs/DateFormat.md +8 -0
- data/docs/DeprecatedApi.md +28 -0
- data/docs/ErrorDetail.md +10 -0
- data/docs/ErrorResponse.md +8 -0
- data/docs/HybridTransaction.md +30 -0
- data/docs/HybridTransactionAllOf.md +12 -0
- data/docs/HybridTransactionsResponse.md +8 -0
- data/docs/HybridTransactionsResponseData.md +9 -0
- data/docs/HybridTransactionsWrapper.md +8 -0
- data/docs/LoanAccountPeriodicValue.md +7 -0
- data/docs/MonthDetail.md +16 -0
- data/docs/MonthDetailAllOf.md +8 -0
- data/docs/MonthDetailResponse.md +8 -0
- data/docs/MonthDetailResponseData.md +8 -0
- data/docs/MonthDetailWrapper.md +8 -0
- data/docs/MonthSummariesResponse.md +8 -0
- data/docs/MonthSummariesResponseData.md +9 -0
- data/docs/MonthSummariesWrapper.md +9 -0
- data/docs/MonthSummary.md +15 -0
- data/docs/MonthsApi.md +49 -0
- data/docs/PatchMonthCategoryWrapper.md +8 -0
- data/docs/PatchTransactionsWrapper.md +8 -0
- data/docs/Payee.md +11 -0
- data/docs/PayeeLocation.md +12 -0
- data/docs/PayeeLocationResponse.md +8 -0
- data/docs/PayeeLocationResponseData.md +8 -0
- data/docs/PayeeLocationWrapper.md +8 -0
- data/docs/PayeeLocationsApi.md +69 -0
- data/docs/PayeeLocationsResponse.md +8 -0
- data/docs/PayeeLocationsResponseData.md +8 -0
- data/docs/PayeeLocationsWrapper.md +8 -0
- data/docs/PayeeResponse.md +8 -0
- data/docs/PayeeResponseData.md +8 -0
- data/docs/PayeeWrapper.md +8 -0
- data/docs/PayeesApi.md +49 -0
- data/docs/PayeesResponse.md +8 -0
- data/docs/PayeesResponseData.md +9 -0
- data/docs/PayeesWrapper.md +9 -0
- data/docs/PostAccountWrapper.md +8 -0
- data/docs/PostTransactionsWrapper.md +9 -0
- data/docs/PutTransactionWrapper.md +8 -0
- data/docs/SaveAccount.md +10 -0
- data/docs/SaveAccountWrapper.md +8 -0
- data/docs/SaveCategoryResponse.md +8 -0
- data/docs/SaveCategoryResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +8 -0
- data/docs/SaveMonthCategoryWrapper.md +8 -0
- data/docs/SaveSubTransaction.md +12 -0
- data/docs/SaveTransaction.md +19 -0
- data/docs/SaveTransactionWithId.md +20 -0
- data/docs/SaveTransactionWithIdAllOf.md +8 -0
- data/docs/SaveTransactionWithOptionalFields.md +19 -0
- data/docs/SaveTransactionWrapper.md +8 -0
- data/docs/SaveTransactionsResponse.md +8 -0
- data/docs/SaveTransactionsResponseData.md +12 -0
- data/docs/SaveTransactionsWrapper.md +9 -0
- data/docs/ScheduledSubTransaction.md +15 -0
- data/docs/ScheduledTransactionDetail.md +23 -0
- data/docs/ScheduledTransactionDetailAllOf.md +11 -0
- data/docs/ScheduledTransactionResponse.md +8 -0
- data/docs/ScheduledTransactionResponseData.md +8 -0
- data/docs/ScheduledTransactionSummary.md +19 -0
- data/docs/ScheduledTransactionWrapper.md +8 -0
- data/docs/ScheduledTransactionsApi.md +49 -0
- data/docs/ScheduledTransactionsResponse.md +8 -0
- data/docs/ScheduledTransactionsResponseData.md +9 -0
- data/docs/ScheduledTransactionsWrapper.md +8 -0
- data/docs/SubTransaction.md +18 -0
- data/docs/TransactionDetail.md +29 -0
- data/docs/TransactionDetailAllOf.md +11 -0
- data/docs/TransactionResponse.md +8 -0
- data/docs/TransactionResponseData.md +8 -0
- data/docs/TransactionSummary.md +25 -0
- data/docs/TransactionWrapper.md +8 -0
- data/docs/TransactionsApi.md +228 -0
- data/docs/TransactionsImportResponse.md +8 -0
- data/docs/TransactionsImportResponseData.md +8 -0
- data/docs/TransactionsResponse.md +8 -0
- data/docs/TransactionsResponseData.md +9 -0
- data/docs/TransactionsWrapper.md +9 -0
- data/docs/UpdateTransaction.md +20 -0
- data/docs/UpdateTransactionsWrapper.md +8 -0
- data/docs/User.md +8 -0
- data/docs/UserApi.md +25 -0
- data/docs/UserResponse.md +8 -0
- data/docs/UserResponseData.md +8 -0
- data/docs/UserWrapper.md +8 -0
- data/examples/budget-list.rb +21 -0
- data/examples/budget-month.rb +33 -0
- data/examples/category-balance.rb +23 -0
- data/examples/create-multiple-transactions.rb +42 -0
- data/examples/create-transaction.rb +30 -0
- data/examples/update-category-budgeted.rb +25 -0
- data/examples/update-multiple-transactions.rb +20 -0
- data/lib/ynab/api/accounts_api.rb +79 -42
- data/lib/ynab/api/budgets_api.rb +69 -37
- data/lib/ynab/api/categories_api.rb +109 -61
- data/lib/ynab/api/deprecated_api.rb +33 -18
- data/lib/ynab/api/months_api.rb +50 -29
- data/lib/ynab/api/payee_locations_api.rb +74 -42
- data/lib/ynab/api/payees_api.rb +50 -29
- data/lib/ynab/api/scheduled_transactions_api.rb +50 -29
- data/lib/ynab/api/transactions_api.rb +269 -141
- data/lib/ynab/api/user_api.rb +23 -13
- data/lib/ynab/api_client.rb +98 -96
- data/lib/ynab/configuration.rb +103 -16
- data/lib/ynab/models/account.rb +118 -56
- data/lib/ynab/models/account_response.rb +54 -19
- data/lib/ynab/models/account_response_data.rb +54 -19
- data/lib/ynab/models/account_type.rb +31 -21
- data/lib/ynab/models/accounts_response.rb +54 -19
- data/lib/ynab/models/accounts_response_data.rb +55 -20
- data/lib/ynab/models/budget_detail.rb +81 -36
- data/lib/ynab/models/budget_detail_all_of.rb +320 -0
- data/lib/ynab/models/budget_detail_response.rb +54 -19
- data/lib/ynab/models/budget_detail_response_data.rb +55 -20
- data/lib/ynab/models/budget_settings.rb +57 -30
- data/lib/ynab/models/budget_settings_response.rb +54 -19
- data/lib/ynab/models/budget_settings_response_data.rb +54 -19
- data/lib/ynab/models/budget_summary.rb +64 -27
- data/lib/ynab/models/budget_summary_response.rb +54 -19
- data/lib/ynab/models/budget_summary_response_data.rb +55 -21
- data/lib/ynab/models/bulk_response.rb +54 -19
- data/lib/ynab/models/bulk_response_data.rb +54 -19
- data/lib/ynab/models/bulk_response_data_bulk.rb +55 -20
- data/lib/ynab/models/bulk_transactions.rb +54 -19
- data/lib/ynab/models/categories_response.rb +54 -19
- data/lib/ynab/models/categories_response_data.rb +55 -20
- data/lib/ynab/models/category.rb +111 -49
- data/lib/ynab/models/category_group.rb +59 -24
- data/lib/ynab/models/category_group_with_categories.rb +68 -25
- data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
- data/lib/ynab/models/category_response.rb +54 -19
- data/lib/ynab/models/category_response_data.rb +54 -19
- data/lib/ynab/models/currency_format.rb +63 -28
- data/lib/ynab/models/date_format.rb +54 -19
- data/lib/ynab/models/error_detail.rb +56 -21
- data/lib/ynab/models/error_response.rb +54 -19
- data/lib/ynab/models/hybrid_transaction.rb +120 -47
- data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
- data/lib/ynab/models/hybrid_transactions_response.rb +54 -19
- data/lib/ynab/models/hybrid_transactions_response_data.rb +55 -20
- data/lib/ynab/models/month_detail.rb +73 -28
- data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
- data/lib/ynab/models/month_detail_response.rb +54 -19
- data/lib/ynab/models/month_detail_response_data.rb +54 -19
- data/lib/ynab/models/month_summaries_response.rb +54 -19
- data/lib/ynab/models/month_summaries_response_data.rb +55 -20
- data/lib/ynab/models/month_summary.rb +64 -27
- data/lib/ynab/models/patch_month_category_wrapper.rb +54 -19
- data/lib/ynab/models/patch_transactions_wrapper.rb +54 -19
- data/lib/ynab/models/payee.rb +59 -23
- data/lib/ynab/models/payee_location.rb +59 -24
- data/lib/ynab/models/payee_location_response.rb +54 -19
- data/lib/ynab/models/payee_location_response_data.rb +54 -19
- data/lib/ynab/models/payee_locations_response.rb +54 -19
- data/lib/ynab/models/payee_locations_response_data.rb +54 -19
- data/lib/ynab/models/payee_response.rb +54 -19
- data/lib/ynab/models/payee_response_data.rb +54 -19
- data/lib/ynab/models/payees_response.rb +54 -19
- data/lib/ynab/models/payees_response_data.rb +55 -20
- data/lib/ynab/models/post_account_wrapper.rb +54 -19
- data/lib/ynab/models/post_transactions_wrapper.rb +55 -20
- data/lib/ynab/models/put_transaction_wrapper.rb +54 -19
- data/lib/ynab/models/save_account.rb +78 -21
- data/lib/ynab/models/save_category_response.rb +54 -19
- data/lib/ynab/models/save_category_response_data.rb +55 -20
- data/lib/ynab/models/save_month_category.rb +54 -19
- data/lib/ynab/models/save_sub_transaction.rb +62 -23
- data/lib/ynab/models/save_transaction.rb +89 -34
- data/lib/ynab/models/save_transaction_with_id.rb +103 -47
- data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +82 -34
- data/lib/ynab/models/save_transactions_response.rb +54 -19
- data/lib/ynab/models/save_transactions_response_data.rb +58 -24
- data/lib/ynab/models/scheduled_sub_transaction.rb +67 -28
- data/lib/ynab/models/scheduled_transaction_detail.rb +96 -37
- data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
- data/lib/ynab/models/scheduled_transaction_response.rb +54 -19
- data/lib/ynab/models/scheduled_transaction_response_data.rb +54 -19
- data/lib/ynab/models/scheduled_transaction_summary.rb +81 -33
- data/lib/ynab/models/scheduled_transactions_response.rb +54 -19
- data/lib/ynab/models/scheduled_transactions_response_data.rb +55 -20
- data/lib/ynab/models/sub_transaction.rb +72 -30
- data/lib/ynab/models/transaction_detail.rb +114 -45
- data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
- data/lib/ynab/models/transaction_response.rb +54 -19
- data/lib/ynab/models/transaction_response_data.rb +54 -19
- data/lib/ynab/models/transaction_summary.rb +99 -41
- data/lib/ynab/models/transactions_import_response.rb +54 -19
- data/lib/ynab/models/transactions_import_response_data.rb +54 -19
- data/lib/ynab/models/transactions_response.rb +54 -19
- data/lib/ynab/models/transactions_response_data.rb +55 -20
- data/lib/ynab/models/user.rb +54 -19
- data/lib/ynab/models/user_response.rb +54 -19
- data/lib/ynab/models/user_response_data.rb +54 -19
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +21 -16
- data/open_api_spec.yaml +3012 -0
- data/templates/api_client.mustache +274 -0
- data/templates/api_client_typhoeus_partial.mustache +156 -0
- data/templates/api_doc.mustache +44 -0
- data/templates/gem.mustache +84 -0
- data/templates/partial_model_generic_doc.mustache +9 -0
- data/ynab.gemspec +38 -0
- metadata +197 -90
- data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
- data/lib/ynab/models/save_account_wrapper.rb +0 -189
- data/lib/ynab/models/update_transaction.rb +0 -407
- data/spec/models/transaction_detail_spec.rb +0 -11
@@ -1,16 +1,16 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
3
|
|
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module YNAB
|
16
16
|
class CategoriesApi
|
@@ -21,7 +21,7 @@ module YNAB
|
|
21
21
|
end
|
22
22
|
# List categories
|
23
23
|
# Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
24
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
24
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
27
27
|
# @return [CategoriesResponse]
|
@@ -32,10 +32,10 @@ module YNAB
|
|
32
32
|
|
33
33
|
# List categories
|
34
34
|
# Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
35
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
35
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
36
36
|
# @param [Hash] opts the optional parameters
|
37
37
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
38
|
-
# @return [Array<(CategoriesResponse,
|
38
|
+
# @return [Array<(CategoriesResponse, Integer, Hash)>] CategoriesResponse data, response status code and response headers
|
39
39
|
def get_categories_with_http_info(budget_id, opts = {})
|
40
40
|
if @api_client.config.debugging
|
41
41
|
@api_client.config.logger.debug 'Calling API: CategoriesApi.get_categories ...'
|
@@ -45,39 +45,50 @@ module YNAB
|
|
45
45
|
fail ArgumentError, "Missing the required parameter 'budget_id' when calling CategoriesApi.get_categories"
|
46
46
|
end
|
47
47
|
# resource path
|
48
|
-
local_var_path = '/budgets/{budget_id}/categories'.sub('{' + 'budget_id' + '}', budget_id.to_s)
|
48
|
+
local_var_path = '/budgets/{budget_id}/categories'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
|
49
49
|
|
50
50
|
# query parameters
|
51
|
-
query_params = {}
|
51
|
+
query_params = opts[:query_params] || {}
|
52
52
|
query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
|
53
53
|
|
54
54
|
# header parameters
|
55
|
-
header_params = {}
|
55
|
+
header_params = opts[:header_params] || {}
|
56
56
|
# HTTP header 'Accept' (if needed)
|
57
57
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
58
58
|
|
59
59
|
# form parameters
|
60
|
-
form_params = {}
|
60
|
+
form_params = opts[:form_params] || {}
|
61
61
|
|
62
62
|
# http body (model)
|
63
|
-
post_body =
|
64
|
-
|
65
|
-
|
63
|
+
post_body = opts[:debug_body]
|
64
|
+
|
65
|
+
# return_type
|
66
|
+
return_type = opts[:debug_return_type] || 'CategoriesResponse'
|
67
|
+
|
68
|
+
# auth_names
|
69
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
70
|
+
|
71
|
+
new_options = opts.merge(
|
72
|
+
:operation => :"CategoriesApi.get_categories",
|
66
73
|
:header_params => header_params,
|
67
74
|
:query_params => query_params,
|
68
75
|
:form_params => form_params,
|
69
76
|
:body => post_body,
|
70
77
|
:auth_names => auth_names,
|
71
|
-
:return_type =>
|
78
|
+
:return_type => return_type
|
79
|
+
)
|
80
|
+
|
81
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
72
82
|
if @api_client.config.debugging
|
73
83
|
@api_client.config.logger.debug "API called: CategoriesApi#get_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
84
|
end
|
75
85
|
return data, status_code, headers
|
76
86
|
end
|
87
|
+
|
77
88
|
# Single category
|
78
89
|
# Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
79
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
80
|
-
# @param category_id The id of the category
|
90
|
+
# @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).
|
91
|
+
# @param category_id [String] The id of the category
|
81
92
|
# @param [Hash] opts the optional parameters
|
82
93
|
# @return [CategoryResponse]
|
83
94
|
def get_category_by_id(budget_id, category_id, opts = {})
|
@@ -87,10 +98,10 @@ module YNAB
|
|
87
98
|
|
88
99
|
# Single category
|
89
100
|
# Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
90
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
91
|
-
# @param category_id The id of the category
|
101
|
+
# @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).
|
102
|
+
# @param category_id [String] The id of the category
|
92
103
|
# @param [Hash] opts the optional parameters
|
93
|
-
# @return [Array<(CategoryResponse,
|
104
|
+
# @return [Array<(CategoryResponse, Integer, Hash)>] CategoryResponse data, response status code and response headers
|
94
105
|
def get_category_by_id_with_http_info(budget_id, category_id, opts = {})
|
95
106
|
if @api_client.config.debugging
|
96
107
|
@api_client.config.logger.debug 'Calling API: CategoriesApi.get_category_by_id ...'
|
@@ -104,39 +115,50 @@ module YNAB
|
|
104
115
|
fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoriesApi.get_category_by_id"
|
105
116
|
end
|
106
117
|
# resource path
|
107
|
-
local_var_path = '/budgets/{budget_id}/categories/{category_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s)
|
118
|
+
local_var_path = '/budgets/{budget_id}/categories/{category_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s))
|
108
119
|
|
109
120
|
# query parameters
|
110
|
-
query_params = {}
|
121
|
+
query_params = opts[:query_params] || {}
|
111
122
|
|
112
123
|
# header parameters
|
113
|
-
header_params = {}
|
124
|
+
header_params = opts[:header_params] || {}
|
114
125
|
# HTTP header 'Accept' (if needed)
|
115
126
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
116
127
|
|
117
128
|
# form parameters
|
118
|
-
form_params = {}
|
129
|
+
form_params = opts[:form_params] || {}
|
119
130
|
|
120
131
|
# http body (model)
|
121
|
-
post_body =
|
122
|
-
|
123
|
-
|
132
|
+
post_body = opts[:debug_body]
|
133
|
+
|
134
|
+
# return_type
|
135
|
+
return_type = opts[:debug_return_type] || 'CategoryResponse'
|
136
|
+
|
137
|
+
# auth_names
|
138
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
139
|
+
|
140
|
+
new_options = opts.merge(
|
141
|
+
:operation => :"CategoriesApi.get_category_by_id",
|
124
142
|
:header_params => header_params,
|
125
143
|
:query_params => query_params,
|
126
144
|
:form_params => form_params,
|
127
145
|
:body => post_body,
|
128
146
|
:auth_names => auth_names,
|
129
|
-
:return_type =>
|
147
|
+
:return_type => return_type
|
148
|
+
)
|
149
|
+
|
150
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
130
151
|
if @api_client.config.debugging
|
131
152
|
@api_client.config.logger.debug "API called: CategoriesApi#get_category_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
153
|
end
|
133
154
|
return data, status_code, headers
|
134
155
|
end
|
156
|
+
|
135
157
|
# Single category for a specific budget month
|
136
158
|
# Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
137
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
138
|
-
# @param month The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
139
|
-
# @param category_id The id of the category
|
159
|
+
# @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).
|
160
|
+
# @param month [Date] The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
161
|
+
# @param category_id [String] The id of the category
|
140
162
|
# @param [Hash] opts the optional parameters
|
141
163
|
# @return [CategoryResponse]
|
142
164
|
def get_month_category_by_id(budget_id, month, category_id, opts = {})
|
@@ -146,11 +168,11 @@ module YNAB
|
|
146
168
|
|
147
169
|
# Single category for a specific budget month
|
148
170
|
# Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
|
149
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
150
|
-
# @param month The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
151
|
-
# @param category_id The id of the category
|
171
|
+
# @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).
|
172
|
+
# @param month [Date] The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
173
|
+
# @param category_id [String] The id of the category
|
152
174
|
# @param [Hash] opts the optional parameters
|
153
|
-
# @return [Array<(CategoryResponse,
|
175
|
+
# @return [Array<(CategoryResponse, Integer, Hash)>] CategoryResponse data, response status code and response headers
|
154
176
|
def get_month_category_by_id_with_http_info(budget_id, month, category_id, opts = {})
|
155
177
|
if @api_client.config.debugging
|
156
178
|
@api_client.config.logger.debug 'Calling API: CategoriesApi.get_month_category_by_id ...'
|
@@ -168,40 +190,51 @@ module YNAB
|
|
168
190
|
fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoriesApi.get_month_category_by_id"
|
169
191
|
end
|
170
192
|
# resource path
|
171
|
-
local_var_path = '/budgets/{budget_id}/months/{month}/categories/{category_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'month' + '}', month.to_s).sub('{' + 'category_id' + '}', category_id.to_s)
|
193
|
+
local_var_path = '/budgets/{budget_id}/months/{month}/categories/{category_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'month' + '}', CGI.escape(month.to_s)).sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s))
|
172
194
|
|
173
195
|
# query parameters
|
174
|
-
query_params = {}
|
196
|
+
query_params = opts[:query_params] || {}
|
175
197
|
|
176
198
|
# header parameters
|
177
|
-
header_params = {}
|
199
|
+
header_params = opts[:header_params] || {}
|
178
200
|
# HTTP header 'Accept' (if needed)
|
179
201
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
180
202
|
|
181
203
|
# form parameters
|
182
|
-
form_params = {}
|
204
|
+
form_params = opts[:form_params] || {}
|
183
205
|
|
184
206
|
# http body (model)
|
185
|
-
post_body =
|
186
|
-
|
187
|
-
|
207
|
+
post_body = opts[:debug_body]
|
208
|
+
|
209
|
+
# return_type
|
210
|
+
return_type = opts[:debug_return_type] || 'CategoryResponse'
|
211
|
+
|
212
|
+
# auth_names
|
213
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
214
|
+
|
215
|
+
new_options = opts.merge(
|
216
|
+
:operation => :"CategoriesApi.get_month_category_by_id",
|
188
217
|
:header_params => header_params,
|
189
218
|
:query_params => query_params,
|
190
219
|
:form_params => form_params,
|
191
220
|
:body => post_body,
|
192
221
|
:auth_names => auth_names,
|
193
|
-
:return_type =>
|
222
|
+
:return_type => return_type
|
223
|
+
)
|
224
|
+
|
225
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
194
226
|
if @api_client.config.debugging
|
195
227
|
@api_client.config.logger.debug "API called: CategoriesApi#get_month_category_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
196
228
|
end
|
197
229
|
return data, status_code, headers
|
198
230
|
end
|
231
|
+
|
199
232
|
# Update a category for a specific month
|
200
233
|
# Update a category for a specific month. Only `budgeted` amount can be updated.
|
201
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
202
|
-
# @param month The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
203
|
-
# @param category_id The id of the category
|
204
|
-
# @param data The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
|
234
|
+
# @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).
|
235
|
+
# @param month [Date] The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
236
|
+
# @param category_id [String] The id of the category
|
237
|
+
# @param data [PatchMonthCategoryWrapper] The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
|
205
238
|
# @param [Hash] opts the optional parameters
|
206
239
|
# @return [SaveCategoryResponse]
|
207
240
|
def update_month_category(budget_id, month, category_id, data, opts = {})
|
@@ -211,12 +244,12 @@ module YNAB
|
|
211
244
|
|
212
245
|
# Update a category for a specific month
|
213
246
|
# Update a category for a specific month. Only `budgeted` amount can be updated.
|
214
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
215
|
-
# @param month The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
216
|
-
# @param category_id The id of the category
|
217
|
-
# @param data The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
|
247
|
+
# @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).
|
248
|
+
# @param month [Date] The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
249
|
+
# @param category_id [String] The id of the category
|
250
|
+
# @param data [PatchMonthCategoryWrapper] The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
|
218
251
|
# @param [Hash] opts the optional parameters
|
219
|
-
# @return [Array<(SaveCategoryResponse,
|
252
|
+
# @return [Array<(SaveCategoryResponse, Integer, Hash)>] SaveCategoryResponse data, response status code and response headers
|
220
253
|
def update_month_category_with_http_info(budget_id, month, category_id, data, opts = {})
|
221
254
|
if @api_client.config.debugging
|
222
255
|
@api_client.config.logger.debug 'Calling API: CategoriesApi.update_month_category ...'
|
@@ -238,29 +271,44 @@ module YNAB
|
|
238
271
|
fail ArgumentError, "Missing the required parameter 'data' when calling CategoriesApi.update_month_category"
|
239
272
|
end
|
240
273
|
# resource path
|
241
|
-
local_var_path = '/budgets/{budget_id}/months/{month}/categories/{category_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'month' + '}', month.to_s).sub('{' + 'category_id' + '}', category_id.to_s)
|
274
|
+
local_var_path = '/budgets/{budget_id}/months/{month}/categories/{category_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'month' + '}', CGI.escape(month.to_s)).sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s))
|
242
275
|
|
243
276
|
# query parameters
|
244
|
-
query_params = {}
|
277
|
+
query_params = opts[:query_params] || {}
|
245
278
|
|
246
279
|
# header parameters
|
247
|
-
header_params = {}
|
280
|
+
header_params = opts[:header_params] || {}
|
248
281
|
# HTTP header 'Accept' (if needed)
|
249
282
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
283
|
+
# HTTP header 'Content-Type'
|
284
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
285
|
+
if !content_type.nil?
|
286
|
+
header_params['Content-Type'] = content_type
|
287
|
+
end
|
250
288
|
|
251
289
|
# form parameters
|
252
|
-
form_params = {}
|
290
|
+
form_params = opts[:form_params] || {}
|
253
291
|
|
254
292
|
# http body (model)
|
255
|
-
post_body = @api_client.object_to_http_body(data)
|
256
|
-
|
257
|
-
|
293
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(data)
|
294
|
+
|
295
|
+
# return_type
|
296
|
+
return_type = opts[:debug_return_type] || 'SaveCategoryResponse'
|
297
|
+
|
298
|
+
# auth_names
|
299
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
300
|
+
|
301
|
+
new_options = opts.merge(
|
302
|
+
:operation => :"CategoriesApi.update_month_category",
|
258
303
|
:header_params => header_params,
|
259
304
|
:query_params => query_params,
|
260
305
|
:form_params => form_params,
|
261
306
|
:body => post_body,
|
262
307
|
:auth_names => auth_names,
|
263
|
-
:return_type =>
|
308
|
+
:return_type => return_type
|
309
|
+
)
|
310
|
+
|
311
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
264
312
|
if @api_client.config.debugging
|
265
313
|
@api_client.config.logger.debug "API called: CategoriesApi#update_month_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
266
314
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
3
|
|
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module YNAB
|
16
16
|
class DeprecatedApi
|
@@ -21,8 +21,8 @@ module YNAB
|
|
21
21
|
end
|
22
22
|
# Bulk create transactions
|
23
23
|
# Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.
|
24
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
25
|
-
# @param transactions The list of transactions to create
|
24
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
25
|
+
# @param transactions [BulkTransactions] The list of transactions to create
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [BulkResponse]
|
28
28
|
def bulk_create_transactions(budget_id, transactions, opts = {})
|
@@ -32,10 +32,10 @@ module YNAB
|
|
32
32
|
|
33
33
|
# Bulk create transactions
|
34
34
|
# Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.
|
35
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
36
|
-
# @param transactions The list of transactions to create
|
35
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
36
|
+
# @param transactions [BulkTransactions] The list of transactions to create
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [Array<(BulkResponse,
|
38
|
+
# @return [Array<(BulkResponse, Integer, Hash)>] BulkResponse data, response status code and response headers
|
39
39
|
def bulk_create_transactions_with_http_info(budget_id, transactions, opts = {})
|
40
40
|
if @api_client.config.debugging
|
41
41
|
@api_client.config.logger.debug 'Calling API: DeprecatedApi.bulk_create_transactions ...'
|
@@ -49,29 +49,44 @@ module YNAB
|
|
49
49
|
fail ArgumentError, "Missing the required parameter 'transactions' when calling DeprecatedApi.bulk_create_transactions"
|
50
50
|
end
|
51
51
|
# resource path
|
52
|
-
local_var_path = '/budgets/{budget_id}/transactions/bulk'.sub('{' + 'budget_id' + '}', budget_id.to_s)
|
52
|
+
local_var_path = '/budgets/{budget_id}/transactions/bulk'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
|
53
53
|
|
54
54
|
# query parameters
|
55
|
-
query_params = {}
|
55
|
+
query_params = opts[:query_params] || {}
|
56
56
|
|
57
57
|
# header parameters
|
58
|
-
header_params = {}
|
58
|
+
header_params = opts[:header_params] || {}
|
59
59
|
# HTTP header 'Accept' (if needed)
|
60
60
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
63
|
+
if !content_type.nil?
|
64
|
+
header_params['Content-Type'] = content_type
|
65
|
+
end
|
61
66
|
|
62
67
|
# form parameters
|
63
|
-
form_params = {}
|
68
|
+
form_params = opts[:form_params] || {}
|
64
69
|
|
65
70
|
# http body (model)
|
66
|
-
post_body = @api_client.object_to_http_body(transactions)
|
67
|
-
|
68
|
-
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions)
|
72
|
+
|
73
|
+
# return_type
|
74
|
+
return_type = opts[:debug_return_type] || 'BulkResponse'
|
75
|
+
|
76
|
+
# auth_names
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
78
|
+
|
79
|
+
new_options = opts.merge(
|
80
|
+
:operation => :"DeprecatedApi.bulk_create_transactions",
|
69
81
|
:header_params => header_params,
|
70
82
|
:query_params => query_params,
|
71
83
|
:form_params => form_params,
|
72
84
|
:body => post_body,
|
73
85
|
:auth_names => auth_names,
|
74
|
-
:return_type =>
|
86
|
+
:return_type => return_type
|
87
|
+
)
|
88
|
+
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
75
90
|
if @api_client.config.debugging
|
76
91
|
@api_client.config.logger.debug "API called: DeprecatedApi#bulk_create_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
77
92
|
end
|
data/lib/ynab/api/months_api.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
=begin
|
2
2
|
#YNAB API Endpoints
|
3
3
|
|
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.
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
7
|
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module YNAB
|
16
16
|
class MonthsApi
|
@@ -21,8 +21,8 @@ module YNAB
|
|
21
21
|
end
|
22
22
|
# Single budget month
|
23
23
|
# Returns a single budget month
|
24
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
25
|
-
# @param month The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
24
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
25
|
+
# @param month [Date] The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
26
26
|
# @param [Hash] opts the optional parameters
|
27
27
|
# @return [MonthDetailResponse]
|
28
28
|
def get_budget_month(budget_id, month, opts = {})
|
@@ -32,10 +32,10 @@ module YNAB
|
|
32
32
|
|
33
33
|
# Single budget month
|
34
34
|
# Returns a single budget month
|
35
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
36
|
-
# @param month The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
35
|
+
# @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget).
|
36
|
+
# @param month [Date] The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [Array<(MonthDetailResponse,
|
38
|
+
# @return [Array<(MonthDetailResponse, Integer, Hash)>] MonthDetailResponse data, response status code and response headers
|
39
39
|
def get_budget_month_with_http_info(budget_id, month, opts = {})
|
40
40
|
if @api_client.config.debugging
|
41
41
|
@api_client.config.logger.debug 'Calling API: MonthsApi.get_budget_month ...'
|
@@ -49,37 +49,48 @@ module YNAB
|
|
49
49
|
fail ArgumentError, "Missing the required parameter 'month' when calling MonthsApi.get_budget_month"
|
50
50
|
end
|
51
51
|
# resource path
|
52
|
-
local_var_path = '/budgets/{budget_id}/months/{month}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'month' + '}', month.to_s)
|
52
|
+
local_var_path = '/budgets/{budget_id}/months/{month}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'month' + '}', CGI.escape(month.to_s))
|
53
53
|
|
54
54
|
# query parameters
|
55
|
-
query_params = {}
|
55
|
+
query_params = opts[:query_params] || {}
|
56
56
|
|
57
57
|
# header parameters
|
58
|
-
header_params = {}
|
58
|
+
header_params = opts[:header_params] || {}
|
59
59
|
# HTTP header 'Accept' (if needed)
|
60
60
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
61
|
|
62
62
|
# form parameters
|
63
|
-
form_params = {}
|
63
|
+
form_params = opts[:form_params] || {}
|
64
64
|
|
65
65
|
# http body (model)
|
66
|
-
post_body =
|
67
|
-
|
68
|
-
|
66
|
+
post_body = opts[:debug_body]
|
67
|
+
|
68
|
+
# return_type
|
69
|
+
return_type = opts[:debug_return_type] || 'MonthDetailResponse'
|
70
|
+
|
71
|
+
# auth_names
|
72
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
73
|
+
|
74
|
+
new_options = opts.merge(
|
75
|
+
:operation => :"MonthsApi.get_budget_month",
|
69
76
|
:header_params => header_params,
|
70
77
|
:query_params => query_params,
|
71
78
|
:form_params => form_params,
|
72
79
|
:body => post_body,
|
73
80
|
:auth_names => auth_names,
|
74
|
-
:return_type =>
|
81
|
+
:return_type => return_type
|
82
|
+
)
|
83
|
+
|
84
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
75
85
|
if @api_client.config.debugging
|
76
86
|
@api_client.config.logger.debug "API called: MonthsApi#get_budget_month\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
77
87
|
end
|
78
88
|
return data, status_code, headers
|
79
89
|
end
|
90
|
+
|
80
91
|
# List budget months
|
81
92
|
# Returns all budget months
|
82
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
93
|
+
# @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).
|
83
94
|
# @param [Hash] opts the optional parameters
|
84
95
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
85
96
|
# @return [MonthSummariesResponse]
|
@@ -90,10 +101,10 @@ module YNAB
|
|
90
101
|
|
91
102
|
# List budget months
|
92
103
|
# Returns all budget months
|
93
|
-
# @param budget_id The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.
|
104
|
+
# @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).
|
94
105
|
# @param [Hash] opts the optional parameters
|
95
106
|
# @option opts [Integer] :last_knowledge_of_server The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
|
96
|
-
# @return [Array<(MonthSummariesResponse,
|
107
|
+
# @return [Array<(MonthSummariesResponse, Integer, Hash)>] MonthSummariesResponse data, response status code and response headers
|
97
108
|
def get_budget_months_with_http_info(budget_id, opts = {})
|
98
109
|
if @api_client.config.debugging
|
99
110
|
@api_client.config.logger.debug 'Calling API: MonthsApi.get_budget_months ...'
|
@@ -103,30 +114,40 @@ module YNAB
|
|
103
114
|
fail ArgumentError, "Missing the required parameter 'budget_id' when calling MonthsApi.get_budget_months"
|
104
115
|
end
|
105
116
|
# resource path
|
106
|
-
local_var_path = '/budgets/{budget_id}/months'.sub('{' + 'budget_id' + '}', budget_id.to_s)
|
117
|
+
local_var_path = '/budgets/{budget_id}/months'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s))
|
107
118
|
|
108
119
|
# query parameters
|
109
|
-
query_params = {}
|
120
|
+
query_params = opts[:query_params] || {}
|
110
121
|
query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
|
111
122
|
|
112
123
|
# header parameters
|
113
|
-
header_params = {}
|
124
|
+
header_params = opts[:header_params] || {}
|
114
125
|
# HTTP header 'Accept' (if needed)
|
115
126
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
116
127
|
|
117
128
|
# form parameters
|
118
|
-
form_params = {}
|
129
|
+
form_params = opts[:form_params] || {}
|
119
130
|
|
120
131
|
# http body (model)
|
121
|
-
post_body =
|
122
|
-
|
123
|
-
|
132
|
+
post_body = opts[:debug_body]
|
133
|
+
|
134
|
+
# return_type
|
135
|
+
return_type = opts[:debug_return_type] || 'MonthSummariesResponse'
|
136
|
+
|
137
|
+
# auth_names
|
138
|
+
auth_names = opts[:debug_auth_names] || ['bearer']
|
139
|
+
|
140
|
+
new_options = opts.merge(
|
141
|
+
:operation => :"MonthsApi.get_budget_months",
|
124
142
|
:header_params => header_params,
|
125
143
|
:query_params => query_params,
|
126
144
|
:form_params => form_params,
|
127
145
|
:body => post_body,
|
128
146
|
:auth_names => auth_names,
|
129
|
-
:return_type =>
|
147
|
+
:return_type => return_type
|
148
|
+
)
|
149
|
+
|
150
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
130
151
|
if @api_client.config.debugging
|
131
152
|
@api_client.config.logger.debug "API called: MonthsApi#get_budget_months\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
153
|
end
|