ynab 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/Rakefile +9 -0
- data/config.json +2 -2
- data/docs/Account.md +1 -1
- data/docs/AccountResponse.md +1 -1
- data/docs/AccountWrapper.md +1 -1
- data/docs/AccountsApi.md +1 -1
- data/docs/AccountsResponse.md +1 -1
- data/docs/AccountsWrapper.md +1 -1
- data/docs/BudgetDetail.md +1 -1
- data/docs/BudgetDetailResponse.md +1 -1
- data/docs/BudgetDetailWrapper.md +1 -1
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +1 -1
- data/docs/BudgetSummaryResponse.md +1 -1
- data/docs/BudgetSummaryWrapper.md +1 -1
- data/docs/BudgetsApi.md +19 -1
- data/docs/BulkIdWrapper.md +1 -1
- data/docs/BulkIds.md +1 -1
- data/docs/BulkResponse.md +1 -1
- data/docs/BulkTransactionCreateResponse.md +2 -2
- data/docs/BulkTransactionIds.md +2 -2
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +1 -1
- data/docs/CategoriesResponse.md +1 -1
- data/docs/Category.md +2 -1
- data/docs/CategoryGroup.md +1 -1
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/CategoryGroupsWrapper.md +1 -1
- data/docs/CategoryResponse.md +1 -1
- data/docs/CategoryWrapper.md +1 -1
- data/docs/CurrencyFormat.md +1 -1
- data/docs/DateFormat.md +1 -1
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorResponse.md +1 -1
- data/docs/HybridTransaction.md +1 -1
- data/docs/HybridTransactionsResponse.md +1 -1
- data/docs/HybridTransactionsWrapper.md +1 -1
- data/docs/MonthDetail.md +1 -1
- data/docs/MonthDetailResponse.md +1 -1
- data/docs/MonthDetailWrapper.md +1 -1
- data/docs/MonthSummariesResponse.md +1 -1
- data/docs/MonthSummariesWrapper.md +1 -1
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +1 -1
- data/docs/Payee.md +1 -1
- data/docs/PayeeLocation.md +1 -1
- data/docs/PayeeLocationResponse.md +1 -1
- data/docs/PayeeLocationWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +1 -1
- data/docs/PayeeLocationsResponse.md +1 -1
- data/docs/PayeeLocationsWrapper.md +1 -1
- data/docs/PayeeResponse.md +1 -1
- data/docs/PayeeWrapper.md +1 -1
- data/docs/PayeesApi.md +1 -1
- data/docs/PayeesResponse.md +1 -1
- data/docs/PayeesWrapper.md +1 -1
- data/docs/SaveTransaction.md +2 -2
- data/docs/SaveTransactionWrapper.md +1 -1
- data/docs/ScheduledSubTransaction.md +1 -1
- data/docs/ScheduledTransactionDetail.md +1 -1
- data/docs/ScheduledTransactionResponse.md +1 -1
- data/docs/ScheduledTransactionSummary.md +1 -1
- data/docs/ScheduledTransactionWrapper.md +1 -1
- data/docs/ScheduledTransactionsApi.md +1 -1
- data/docs/ScheduledTransactionsResponse.md +1 -1
- data/docs/ScheduledTransactionsWrapper.md +1 -1
- data/docs/SubTransaction.md +1 -1
- data/docs/TransactionDetail.md +1 -1
- data/docs/TransactionResponse.md +1 -1
- data/docs/TransactionSummary.md +1 -1
- data/docs/TransactionWrapper.md +1 -1
- data/docs/TransactionsApi.md +5 -2
- data/docs/TransactionsResponse.md +1 -1
- data/docs/TransactionsWrapper.md +1 -1
- data/docs/User.md +1 -1
- data/docs/UserApi.md +1 -1
- data/docs/UserResponse.md +1 -1
- data/docs/UserWrapper.md +1 -1
- data/examples/budget-list.rb +1 -1
- data/examples/budget-month.rb +1 -1
- data/examples/category-balance.rb +1 -1
- data/lib/ynab.rb +27 -15
- data/lib/ynab/api/accounts_api.rb +1 -1
- data/lib/ynab/api/budgets_api.rb +53 -1
- data/lib/ynab/api/categories_api.rb +1 -1
- data/lib/ynab/api/months_api.rb +1 -1
- data/lib/ynab/api/payee_locations_api.rb +1 -1
- data/lib/ynab/api/payees_api.rb +1 -1
- data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
- data/lib/ynab/api/transactions_api.rb +21 -3
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/api_error.rb +1 -1
- data/lib/ynab/configuration.rb +1 -1
- data/lib/ynab/models/account.rb +2 -2
- data/lib/ynab/models/account_response.rb +2 -2
- data/lib/ynab/models/account_wrapper.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +2 -2
- data/lib/ynab/models/accounts_wrapper.rb +2 -2
- data/lib/ynab/models/budget_detail.rb +2 -2
- data/lib/ynab/models/budget_detail_response.rb +2 -2
- data/lib/ynab/models/budget_detail_wrapper.rb +2 -2
- data/lib/ynab/models/budget_settings.rb +202 -0
- data/lib/ynab/models/budget_settings_response.rb +188 -0
- data/lib/ynab/models/budget_settings_wrapper.rb +188 -0
- data/lib/ynab/models/budget_summary.rb +2 -2
- data/lib/ynab/models/budget_summary_response.rb +2 -2
- data/lib/ynab/models/budget_summary_wrapper.rb +2 -2
- data/lib/ynab/models/bulk_id_wrapper.rb +2 -2
- data/lib/ynab/models/bulk_ids.rb +2 -2
- data/lib/ynab/models/bulk_response.rb +2 -2
- data/lib/ynab/models/bulk_transaction_create_response.rb +2 -2
- data/lib/ynab/models/bulk_transaction_ids.rb +2 -2
- data/lib/ynab/models/bulk_transactions.rb +2 -2
- data/lib/ynab/models/categories_response.rb +2 -2
- data/lib/ynab/models/category.rb +13 -3
- data/lib/ynab/models/category_group.rb +2 -2
- data/lib/ynab/models/category_group_with_categories.rb +2 -2
- data/lib/ynab/models/category_groups_wrapper.rb +2 -2
- data/lib/ynab/models/category_response.rb +2 -2
- data/lib/ynab/models/category_wrapper.rb +2 -2
- data/lib/ynab/models/currency_format.rb +2 -2
- data/lib/ynab/models/date_format.rb +2 -2
- data/lib/ynab/models/error_detail.rb +2 -2
- data/lib/ynab/models/error_response.rb +2 -2
- data/lib/ynab/models/hybrid_transaction.rb +2 -2
- data/lib/ynab/models/hybrid_transactions_response.rb +2 -2
- data/lib/ynab/models/hybrid_transactions_wrapper.rb +2 -2
- data/lib/ynab/models/month_detail.rb +2 -2
- data/lib/ynab/models/month_detail_response.rb +2 -2
- data/lib/ynab/models/month_detail_wrapper.rb +2 -2
- data/lib/ynab/models/month_summaries_response.rb +2 -2
- data/lib/ynab/models/month_summaries_wrapper.rb +2 -2
- data/lib/ynab/models/month_summary.rb +2 -2
- data/lib/ynab/models/payee.rb +2 -2
- data/lib/ynab/models/payee_location.rb +2 -2
- data/lib/ynab/models/payee_location_response.rb +2 -2
- data/lib/ynab/models/payee_location_wrapper.rb +2 -2
- data/lib/ynab/models/payee_locations_response.rb +2 -2
- data/lib/ynab/models/payee_locations_wrapper.rb +2 -2
- data/lib/ynab/models/payee_response.rb +2 -2
- data/lib/ynab/models/payee_wrapper.rb +2 -2
- data/lib/ynab/models/payees_response.rb +2 -2
- data/lib/ynab/models/payees_wrapper.rb +2 -2
- data/lib/ynab/models/save_transaction.rb +3 -3
- data/lib/ynab/models/save_transaction_wrapper.rb +2 -2
- data/lib/ynab/models/scheduled_sub_transaction.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_detail.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_response.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_summary.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_wrapper.rb +2 -2
- data/lib/ynab/models/scheduled_transactions_response.rb +2 -2
- data/lib/ynab/models/scheduled_transactions_wrapper.rb +2 -2
- data/lib/ynab/models/sub_transaction.rb +2 -2
- data/lib/ynab/models/transaction_detail.rb +2 -2
- data/lib/ynab/models/transaction_response.rb +2 -2
- data/lib/ynab/models/transaction_summary.rb +2 -2
- data/lib/ynab/models/transaction_wrapper.rb +2 -2
- data/lib/ynab/models/transactions_response.rb +2 -2
- data/lib/ynab/models/transactions_wrapper.rb +2 -2
- data/lib/ynab/models/user.rb +2 -2
- data/lib/ynab/models/user_response.rb +2 -2
- data/lib/ynab/models/user_wrapper.rb +2 -2
- data/lib/ynab/version.rb +2 -2
- data/pkg/ynab-1.0.0.gem +0 -0
- data/pkg/ynab-1.1.0.gem +0 -0
- data/spec-v1-swagger.json +105 -3
- data/spec/api/accounts_spec.rb +13 -4
- data/spec/api/budgets_spec.rb +4 -4
- data/spec/api/categories_spec.rb +4 -4
- data/spec/api/months_spec.rb +4 -4
- data/spec/api/payee_locations_spec.rb +4 -4
- data/spec/api/payees_spec.rb +4 -4
- data/spec/api/scheduled_transactions_spec.rb +4 -4
- data/spec/api/transactions_spec.rb +4 -4
- data/swagger-templates/gem.mustache +83 -0
- data/ynab.gemspec +1 -1
- metadata +11 -2
data/lib/ynab/api/months_api.rb
CHANGED
data/lib/ynab/api/payees_api.rb
CHANGED
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'uri'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class TransactionsApi
|
17
17
|
attr_accessor :api_client
|
18
18
|
|
@@ -140,7 +140,7 @@ module YnabApi
|
|
140
140
|
# @param budget_id The ID of the Budget.
|
141
141
|
# @param [Hash] opts the optional parameters
|
142
142
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
143
|
-
# @option opts [String] :type Only return transactions of a certain type (
|
143
|
+
# @option opts [String] :type Only return transactions of a certain type ('uncategorized' and 'unapproved' are currently supported)
|
144
144
|
# @return [TransactionsResponse]
|
145
145
|
def get_transactions(budget_id, opts = {})
|
146
146
|
data, _status_code, _headers = get_transactions_with_http_info(budget_id, opts)
|
@@ -152,7 +152,7 @@ module YnabApi
|
|
152
152
|
# @param budget_id The ID of the Budget.
|
153
153
|
# @param [Hash] opts the optional parameters
|
154
154
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
155
|
-
# @option opts [String] :type Only return transactions of a certain type (
|
155
|
+
# @option opts [String] :type Only return transactions of a certain type ('uncategorized' and 'unapproved' are currently supported)
|
156
156
|
# @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
|
157
157
|
def get_transactions_with_http_info(budget_id, opts = {})
|
158
158
|
if @api_client.config.debugging
|
@@ -202,6 +202,7 @@ module YnabApi
|
|
202
202
|
# @param account_id The ID of the Account.
|
203
203
|
# @param [Hash] opts the optional parameters
|
204
204
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
205
|
+
# @option opts [String] :type Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')
|
205
206
|
# @return [TransactionsResponse]
|
206
207
|
def get_transactions_by_account(budget_id, account_id, opts = {})
|
207
208
|
data, _status_code, _headers = get_transactions_by_account_with_http_info(budget_id, account_id, opts)
|
@@ -214,6 +215,7 @@ module YnabApi
|
|
214
215
|
# @param account_id The ID of the Account.
|
215
216
|
# @param [Hash] opts the optional parameters
|
216
217
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
218
|
+
# @option opts [String] :type Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')
|
217
219
|
# @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
|
218
220
|
def get_transactions_by_account_with_http_info(budget_id, account_id, opts = {})
|
219
221
|
if @api_client.config.debugging
|
@@ -227,12 +229,16 @@ module YnabApi
|
|
227
229
|
if @api_client.config.client_side_validation && account_id.nil?
|
228
230
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling TransactionsApi.get_transactions_by_account"
|
229
231
|
end
|
232
|
+
if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
|
233
|
+
fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
|
234
|
+
end
|
230
235
|
# resource path
|
231
236
|
local_var_path = '/budgets/{budget_id}/accounts/{account_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'account_id' + '}', account_id.to_s)
|
232
237
|
|
233
238
|
# query parameters
|
234
239
|
query_params = {}
|
235
240
|
query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
|
241
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
236
242
|
|
237
243
|
# header parameters
|
238
244
|
header_params = {}
|
@@ -263,6 +269,7 @@ module YnabApi
|
|
263
269
|
# @param category_id The ID of the Category.
|
264
270
|
# @param [Hash] opts the optional parameters
|
265
271
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
272
|
+
# @option opts [String] :type Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')
|
266
273
|
# @return [HybridTransactionsResponse]
|
267
274
|
def get_transactions_by_category(budget_id, category_id, opts = {})
|
268
275
|
data, _status_code, _headers = get_transactions_by_category_with_http_info(budget_id, category_id, opts)
|
@@ -275,6 +282,7 @@ module YnabApi
|
|
275
282
|
# @param category_id The ID of the Category.
|
276
283
|
# @param [Hash] opts the optional parameters
|
277
284
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
285
|
+
# @option opts [String] :type Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')
|
278
286
|
# @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
|
279
287
|
def get_transactions_by_category_with_http_info(budget_id, category_id, opts = {})
|
280
288
|
if @api_client.config.debugging
|
@@ -288,12 +296,16 @@ module YnabApi
|
|
288
296
|
if @api_client.config.client_side_validation && category_id.nil?
|
289
297
|
fail ArgumentError, "Missing the required parameter 'category_id' when calling TransactionsApi.get_transactions_by_category"
|
290
298
|
end
|
299
|
+
if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
|
300
|
+
fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
|
301
|
+
end
|
291
302
|
# resource path
|
292
303
|
local_var_path = '/budgets/{budget_id}/categories/{category_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s)
|
293
304
|
|
294
305
|
# query parameters
|
295
306
|
query_params = {}
|
296
307
|
query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
|
308
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
297
309
|
|
298
310
|
# header parameters
|
299
311
|
header_params = {}
|
@@ -382,6 +394,7 @@ module YnabApi
|
|
382
394
|
# @param payee_id The ID of the Payee.
|
383
395
|
# @param [Hash] opts the optional parameters
|
384
396
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
397
|
+
# @option opts [String] :type Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')
|
385
398
|
# @return [HybridTransactionsResponse]
|
386
399
|
def get_transactions_by_payee(budget_id, payee_id, opts = {})
|
387
400
|
data, _status_code, _headers = get_transactions_by_payee_with_http_info(budget_id, payee_id, opts)
|
@@ -394,6 +407,7 @@ module YnabApi
|
|
394
407
|
# @param payee_id The ID of the Payee.
|
395
408
|
# @param [Hash] opts the optional parameters
|
396
409
|
# @option opts [Date] :since_date Only return transactions on or after this date.
|
410
|
+
# @option opts [String] :type Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved')
|
397
411
|
# @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
|
398
412
|
def get_transactions_by_payee_with_http_info(budget_id, payee_id, opts = {})
|
399
413
|
if @api_client.config.debugging
|
@@ -407,12 +421,16 @@ module YnabApi
|
|
407
421
|
if @api_client.config.client_side_validation && payee_id.nil?
|
408
422
|
fail ArgumentError, "Missing the required parameter 'payee_id' when calling TransactionsApi.get_transactions_by_payee"
|
409
423
|
end
|
424
|
+
if @api_client.config.client_side_validation && opts[:'type'] && !['uncategorized', 'unapproved'].include?(opts[:'type'])
|
425
|
+
fail ArgumentError, 'invalid value for "type", must be one of uncategorized, unapproved'
|
426
|
+
end
|
410
427
|
# resource path
|
411
428
|
local_var_path = '/budgets/{budget_id}/payees/{payee_id}/transactions'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'payee_id' + '}', payee_id.to_s)
|
412
429
|
|
413
430
|
# query parameters
|
414
431
|
query_params = {}
|
415
432
|
query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
|
433
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
416
434
|
|
417
435
|
# header parameters
|
418
436
|
header_params = {}
|
data/lib/ynab/api/user_api.rb
CHANGED
data/lib/ynab/api_client.rb
CHANGED
@@ -17,7 +17,7 @@ require 'tempfile'
|
|
17
17
|
require 'typhoeus'
|
18
18
|
require 'uri'
|
19
19
|
|
20
|
-
module
|
20
|
+
module YNAB
|
21
21
|
class ApiClient
|
22
22
|
# The Configuration object holding settings to be used in the API client.
|
23
23
|
attr_accessor :config
|
@@ -213,7 +213,7 @@ module YnabApi
|
|
213
213
|
end
|
214
214
|
else
|
215
215
|
# models, e.g. Pet
|
216
|
-
|
216
|
+
YNAB.const_get(return_type).new.tap do |model|
|
217
217
|
model.build_from_hash data
|
218
218
|
end
|
219
219
|
end
|
data/lib/ynab/api_error.rb
CHANGED
data/lib/ynab/configuration.rb
CHANGED
data/lib/ynab/models/account.rb
CHANGED
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class Account
|
17
17
|
attr_accessor :id
|
18
18
|
|
@@ -305,7 +305,7 @@ module YnabApi
|
|
305
305
|
end
|
306
306
|
end
|
307
307
|
else # model
|
308
|
-
temp_model =
|
308
|
+
temp_model = YNAB.const_get(type).new
|
309
309
|
temp_model.build_from_hash(value)
|
310
310
|
end
|
311
311
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class AccountResponse
|
17
17
|
attr_accessor :data
|
18
18
|
|
@@ -138,7 +138,7 @@ module YnabApi
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
else # model
|
141
|
-
temp_model =
|
141
|
+
temp_model = YNAB.const_get(type).new
|
142
142
|
temp_model.build_from_hash(value)
|
143
143
|
end
|
144
144
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class AccountWrapper
|
17
17
|
attr_accessor :account
|
18
18
|
|
@@ -138,7 +138,7 @@ module YnabApi
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
else # model
|
141
|
-
temp_model =
|
141
|
+
temp_model = YNAB.const_get(type).new
|
142
142
|
temp_model.build_from_hash(value)
|
143
143
|
end
|
144
144
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class AccountsResponse
|
17
17
|
attr_accessor :data
|
18
18
|
|
@@ -138,7 +138,7 @@ module YnabApi
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
else # model
|
141
|
-
temp_model =
|
141
|
+
temp_model = YNAB.const_get(type).new
|
142
142
|
temp_model.build_from_hash(value)
|
143
143
|
end
|
144
144
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class AccountsWrapper
|
17
17
|
attr_accessor :accounts
|
18
18
|
|
@@ -140,7 +140,7 @@ module YnabApi
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
else # model
|
143
|
-
temp_model =
|
143
|
+
temp_model = YNAB.const_get(type).new
|
144
144
|
temp_model.build_from_hash(value)
|
145
145
|
end
|
146
146
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class BudgetDetail
|
17
17
|
attr_accessor :id
|
18
18
|
|
@@ -290,7 +290,7 @@ module YnabApi
|
|
290
290
|
end
|
291
291
|
end
|
292
292
|
else # model
|
293
|
-
temp_model =
|
293
|
+
temp_model = YNAB.const_get(type).new
|
294
294
|
temp_model.build_from_hash(value)
|
295
295
|
end
|
296
296
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class BudgetDetailResponse
|
17
17
|
attr_accessor :data
|
18
18
|
|
@@ -138,7 +138,7 @@ module YnabApi
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
else # model
|
141
|
-
temp_model =
|
141
|
+
temp_model = YNAB.const_get(type).new
|
142
142
|
temp_model.build_from_hash(value)
|
143
143
|
end
|
144
144
|
end
|
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
|
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module
|
15
|
+
module YNAB
|
16
16
|
class BudgetDetailWrapper
|
17
17
|
attr_accessor :budget
|
18
18
|
|
@@ -153,7 +153,7 @@ module YnabApi
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
else # model
|
156
|
-
temp_model =
|
156
|
+
temp_model = YNAB.const_get(type).new
|
157
157
|
temp_model.build_from_hash(value)
|
158
158
|
end
|
159
159
|
end
|
@@ -0,0 +1,202 @@
|
|
1
|
+
=begin
|
2
|
+
#YNAB API Endpoints
|
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.youneedabudget.com
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module YNAB
|
16
|
+
class BudgetSettings
|
17
|
+
attr_accessor :date_format
|
18
|
+
|
19
|
+
attr_accessor :currency_format
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'date_format' => :'date_format',
|
25
|
+
:'currency_format' => :'currency_format'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'date_format' => :'DateFormat',
|
33
|
+
:'currency_format' => :'CurrencyFormat'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
if attributes.has_key?(:'date_format')
|
46
|
+
self.date_format = attributes[:'date_format']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.has_key?(:'currency_format')
|
50
|
+
self.currency_format = attributes[:'currency_format']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
55
|
+
# @return Array for valid properties with the reasons
|
56
|
+
def list_invalid_properties
|
57
|
+
invalid_properties = Array.new
|
58
|
+
if @date_format.nil?
|
59
|
+
invalid_properties.push('invalid value for "date_format", date_format cannot be nil.')
|
60
|
+
end
|
61
|
+
|
62
|
+
if @currency_format.nil?
|
63
|
+
invalid_properties.push('invalid value for "currency_format", currency_format cannot be nil.')
|
64
|
+
end
|
65
|
+
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
return false if @date_format.nil?
|
73
|
+
return false if @currency_format.nil?
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
# Checks equality by comparing each attribute.
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def ==(o)
|
80
|
+
return true if self.equal?(o)
|
81
|
+
self.class == o.class &&
|
82
|
+
date_format == o.date_format &&
|
83
|
+
currency_format == o.currency_format
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Fixnum] Hash code
|
94
|
+
def hash
|
95
|
+
[date_format, currency_format].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def build_from_hash(attributes)
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
103
|
+
self.class.swagger_types.each_pair do |key, type|
|
104
|
+
if type =~ /\AArray<(.*)>/i
|
105
|
+
# check to ensure the input is an array given that the the attribute
|
106
|
+
# is documented as an array but the input is not
|
107
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
108
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
109
|
+
end
|
110
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
111
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
112
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
|
118
|
+
# Deserializes the data based on type
|
119
|
+
# @param string type Data type
|
120
|
+
# @param string value Value to be deserialized
|
121
|
+
# @return [Object] Deserialized data
|
122
|
+
def _deserialize(type, value)
|
123
|
+
case type.to_sym
|
124
|
+
when :DateTime
|
125
|
+
DateTime.parse(value)
|
126
|
+
when :Date
|
127
|
+
Date.parse(value)
|
128
|
+
when :String
|
129
|
+
value.to_s
|
130
|
+
when :Integer
|
131
|
+
value.to_i
|
132
|
+
when :Float
|
133
|
+
value.to_f
|
134
|
+
when :BOOLEAN
|
135
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
136
|
+
true
|
137
|
+
else
|
138
|
+
false
|
139
|
+
end
|
140
|
+
when :Object
|
141
|
+
# generic object (usually a Hash), return directly
|
142
|
+
value
|
143
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
+
inner_type = Regexp.last_match[:inner_type]
|
145
|
+
value.map { |v| _deserialize(inner_type, v) }
|
146
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
+
k_type = Regexp.last_match[:k_type]
|
148
|
+
v_type = Regexp.last_match[:v_type]
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each do |k, v|
|
151
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
else # model
|
155
|
+
temp_model = YNAB.const_get(type).new
|
156
|
+
temp_model.build_from_hash(value)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the string representation of the object
|
161
|
+
# @return [String] String presentation of the object
|
162
|
+
def to_s
|
163
|
+
to_hash.to_s
|
164
|
+
end
|
165
|
+
|
166
|
+
# to_body is an alias to to_hash (backward compatibility)
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
168
|
+
def to_body
|
169
|
+
to_hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the object in the form of hash
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_hash
|
175
|
+
hash = {}
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
177
|
+
value = self.send(attr)
|
178
|
+
next if value.nil?
|
179
|
+
hash[param] = _to_hash(value)
|
180
|
+
end
|
181
|
+
hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Outputs non-array value in the form of hash
|
185
|
+
# For object, use to_hash. Otherwise, just return the value
|
186
|
+
# @param [Object] value Any valid value
|
187
|
+
# @return [Hash] Returns the value in the form of hash
|
188
|
+
def _to_hash(value)
|
189
|
+
if value.is_a?(Array)
|
190
|
+
value.compact.map { |v| _to_hash(v) }
|
191
|
+
elsif value.is_a?(Hash)
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
194
|
+
end
|
195
|
+
elsif value.respond_to? :to_hash
|
196
|
+
value.to_hash
|
197
|
+
else
|
198
|
+
value
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|