ynab 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +2 -2
  4. data/Rakefile +9 -0
  5. data/config.json +2 -2
  6. data/docs/Account.md +1 -1
  7. data/docs/AccountResponse.md +1 -1
  8. data/docs/AccountWrapper.md +1 -1
  9. data/docs/AccountsApi.md +1 -1
  10. data/docs/AccountsResponse.md +1 -1
  11. data/docs/AccountsWrapper.md +1 -1
  12. data/docs/BudgetDetail.md +1 -1
  13. data/docs/BudgetDetailResponse.md +1 -1
  14. data/docs/BudgetDetailWrapper.md +1 -1
  15. data/docs/BudgetSettings.md +9 -0
  16. data/docs/BudgetSettingsResponse.md +8 -0
  17. data/docs/BudgetSettingsWrapper.md +8 -0
  18. data/docs/BudgetSummary.md +1 -1
  19. data/docs/BudgetSummaryResponse.md +1 -1
  20. data/docs/BudgetSummaryWrapper.md +1 -1
  21. data/docs/BudgetsApi.md +19 -1
  22. data/docs/BulkIdWrapper.md +1 -1
  23. data/docs/BulkIds.md +1 -1
  24. data/docs/BulkResponse.md +1 -1
  25. data/docs/BulkTransactionCreateResponse.md +2 -2
  26. data/docs/BulkTransactionIds.md +2 -2
  27. data/docs/BulkTransactions.md +1 -1
  28. data/docs/CategoriesApi.md +1 -1
  29. data/docs/CategoriesResponse.md +1 -1
  30. data/docs/Category.md +2 -1
  31. data/docs/CategoryGroup.md +1 -1
  32. data/docs/CategoryGroupWithCategories.md +1 -1
  33. data/docs/CategoryGroupsWrapper.md +1 -1
  34. data/docs/CategoryResponse.md +1 -1
  35. data/docs/CategoryWrapper.md +1 -1
  36. data/docs/CurrencyFormat.md +1 -1
  37. data/docs/DateFormat.md +1 -1
  38. data/docs/ErrorDetail.md +1 -1
  39. data/docs/ErrorResponse.md +1 -1
  40. data/docs/HybridTransaction.md +1 -1
  41. data/docs/HybridTransactionsResponse.md +1 -1
  42. data/docs/HybridTransactionsWrapper.md +1 -1
  43. data/docs/MonthDetail.md +1 -1
  44. data/docs/MonthDetailResponse.md +1 -1
  45. data/docs/MonthDetailWrapper.md +1 -1
  46. data/docs/MonthSummariesResponse.md +1 -1
  47. data/docs/MonthSummariesWrapper.md +1 -1
  48. data/docs/MonthSummary.md +1 -1
  49. data/docs/MonthsApi.md +1 -1
  50. data/docs/Payee.md +1 -1
  51. data/docs/PayeeLocation.md +1 -1
  52. data/docs/PayeeLocationResponse.md +1 -1
  53. data/docs/PayeeLocationWrapper.md +1 -1
  54. data/docs/PayeeLocationsApi.md +1 -1
  55. data/docs/PayeeLocationsResponse.md +1 -1
  56. data/docs/PayeeLocationsWrapper.md +1 -1
  57. data/docs/PayeeResponse.md +1 -1
  58. data/docs/PayeeWrapper.md +1 -1
  59. data/docs/PayeesApi.md +1 -1
  60. data/docs/PayeesResponse.md +1 -1
  61. data/docs/PayeesWrapper.md +1 -1
  62. data/docs/SaveTransaction.md +2 -2
  63. data/docs/SaveTransactionWrapper.md +1 -1
  64. data/docs/ScheduledSubTransaction.md +1 -1
  65. data/docs/ScheduledTransactionDetail.md +1 -1
  66. data/docs/ScheduledTransactionResponse.md +1 -1
  67. data/docs/ScheduledTransactionSummary.md +1 -1
  68. data/docs/ScheduledTransactionWrapper.md +1 -1
  69. data/docs/ScheduledTransactionsApi.md +1 -1
  70. data/docs/ScheduledTransactionsResponse.md +1 -1
  71. data/docs/ScheduledTransactionsWrapper.md +1 -1
  72. data/docs/SubTransaction.md +1 -1
  73. data/docs/TransactionDetail.md +1 -1
  74. data/docs/TransactionResponse.md +1 -1
  75. data/docs/TransactionSummary.md +1 -1
  76. data/docs/TransactionWrapper.md +1 -1
  77. data/docs/TransactionsApi.md +5 -2
  78. data/docs/TransactionsResponse.md +1 -1
  79. data/docs/TransactionsWrapper.md +1 -1
  80. data/docs/User.md +1 -1
  81. data/docs/UserApi.md +1 -1
  82. data/docs/UserResponse.md +1 -1
  83. data/docs/UserWrapper.md +1 -1
  84. data/examples/budget-list.rb +1 -1
  85. data/examples/budget-month.rb +1 -1
  86. data/examples/category-balance.rb +1 -1
  87. data/lib/ynab.rb +27 -15
  88. data/lib/ynab/api/accounts_api.rb +1 -1
  89. data/lib/ynab/api/budgets_api.rb +53 -1
  90. data/lib/ynab/api/categories_api.rb +1 -1
  91. data/lib/ynab/api/months_api.rb +1 -1
  92. data/lib/ynab/api/payee_locations_api.rb +1 -1
  93. data/lib/ynab/api/payees_api.rb +1 -1
  94. data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
  95. data/lib/ynab/api/transactions_api.rb +21 -3
  96. data/lib/ynab/api/user_api.rb +1 -1
  97. data/lib/ynab/api_client.rb +2 -2
  98. data/lib/ynab/api_error.rb +1 -1
  99. data/lib/ynab/configuration.rb +1 -1
  100. data/lib/ynab/models/account.rb +2 -2
  101. data/lib/ynab/models/account_response.rb +2 -2
  102. data/lib/ynab/models/account_wrapper.rb +2 -2
  103. data/lib/ynab/models/accounts_response.rb +2 -2
  104. data/lib/ynab/models/accounts_wrapper.rb +2 -2
  105. data/lib/ynab/models/budget_detail.rb +2 -2
  106. data/lib/ynab/models/budget_detail_response.rb +2 -2
  107. data/lib/ynab/models/budget_detail_wrapper.rb +2 -2
  108. data/lib/ynab/models/budget_settings.rb +202 -0
  109. data/lib/ynab/models/budget_settings_response.rb +188 -0
  110. data/lib/ynab/models/budget_settings_wrapper.rb +188 -0
  111. data/lib/ynab/models/budget_summary.rb +2 -2
  112. data/lib/ynab/models/budget_summary_response.rb +2 -2
  113. data/lib/ynab/models/budget_summary_wrapper.rb +2 -2
  114. data/lib/ynab/models/bulk_id_wrapper.rb +2 -2
  115. data/lib/ynab/models/bulk_ids.rb +2 -2
  116. data/lib/ynab/models/bulk_response.rb +2 -2
  117. data/lib/ynab/models/bulk_transaction_create_response.rb +2 -2
  118. data/lib/ynab/models/bulk_transaction_ids.rb +2 -2
  119. data/lib/ynab/models/bulk_transactions.rb +2 -2
  120. data/lib/ynab/models/categories_response.rb +2 -2
  121. data/lib/ynab/models/category.rb +13 -3
  122. data/lib/ynab/models/category_group.rb +2 -2
  123. data/lib/ynab/models/category_group_with_categories.rb +2 -2
  124. data/lib/ynab/models/category_groups_wrapper.rb +2 -2
  125. data/lib/ynab/models/category_response.rb +2 -2
  126. data/lib/ynab/models/category_wrapper.rb +2 -2
  127. data/lib/ynab/models/currency_format.rb +2 -2
  128. data/lib/ynab/models/date_format.rb +2 -2
  129. data/lib/ynab/models/error_detail.rb +2 -2
  130. data/lib/ynab/models/error_response.rb +2 -2
  131. data/lib/ynab/models/hybrid_transaction.rb +2 -2
  132. data/lib/ynab/models/hybrid_transactions_response.rb +2 -2
  133. data/lib/ynab/models/hybrid_transactions_wrapper.rb +2 -2
  134. data/lib/ynab/models/month_detail.rb +2 -2
  135. data/lib/ynab/models/month_detail_response.rb +2 -2
  136. data/lib/ynab/models/month_detail_wrapper.rb +2 -2
  137. data/lib/ynab/models/month_summaries_response.rb +2 -2
  138. data/lib/ynab/models/month_summaries_wrapper.rb +2 -2
  139. data/lib/ynab/models/month_summary.rb +2 -2
  140. data/lib/ynab/models/payee.rb +2 -2
  141. data/lib/ynab/models/payee_location.rb +2 -2
  142. data/lib/ynab/models/payee_location_response.rb +2 -2
  143. data/lib/ynab/models/payee_location_wrapper.rb +2 -2
  144. data/lib/ynab/models/payee_locations_response.rb +2 -2
  145. data/lib/ynab/models/payee_locations_wrapper.rb +2 -2
  146. data/lib/ynab/models/payee_response.rb +2 -2
  147. data/lib/ynab/models/payee_wrapper.rb +2 -2
  148. data/lib/ynab/models/payees_response.rb +2 -2
  149. data/lib/ynab/models/payees_wrapper.rb +2 -2
  150. data/lib/ynab/models/save_transaction.rb +3 -3
  151. data/lib/ynab/models/save_transaction_wrapper.rb +2 -2
  152. data/lib/ynab/models/scheduled_sub_transaction.rb +2 -2
  153. data/lib/ynab/models/scheduled_transaction_detail.rb +2 -2
  154. data/lib/ynab/models/scheduled_transaction_response.rb +2 -2
  155. data/lib/ynab/models/scheduled_transaction_summary.rb +2 -2
  156. data/lib/ynab/models/scheduled_transaction_wrapper.rb +2 -2
  157. data/lib/ynab/models/scheduled_transactions_response.rb +2 -2
  158. data/lib/ynab/models/scheduled_transactions_wrapper.rb +2 -2
  159. data/lib/ynab/models/sub_transaction.rb +2 -2
  160. data/lib/ynab/models/transaction_detail.rb +2 -2
  161. data/lib/ynab/models/transaction_response.rb +2 -2
  162. data/lib/ynab/models/transaction_summary.rb +2 -2
  163. data/lib/ynab/models/transaction_wrapper.rb +2 -2
  164. data/lib/ynab/models/transactions_response.rb +2 -2
  165. data/lib/ynab/models/transactions_wrapper.rb +2 -2
  166. data/lib/ynab/models/user.rb +2 -2
  167. data/lib/ynab/models/user_response.rb +2 -2
  168. data/lib/ynab/models/user_wrapper.rb +2 -2
  169. data/lib/ynab/version.rb +2 -2
  170. data/pkg/ynab-1.0.0.gem +0 -0
  171. data/pkg/ynab-1.1.0.gem +0 -0
  172. data/spec-v1-swagger.json +105 -3
  173. data/spec/api/accounts_spec.rb +13 -4
  174. data/spec/api/budgets_spec.rb +4 -4
  175. data/spec/api/categories_spec.rb +4 -4
  176. data/spec/api/months_spec.rb +4 -4
  177. data/spec/api/payee_locations_spec.rb +4 -4
  178. data/spec/api/payees_spec.rb +4 -4
  179. data/spec/api/scheduled_transactions_spec.rb +4 -4
  180. data/spec/api/transactions_spec.rb +4 -4
  181. data/swagger-templates/gem.mustache +83 -0
  182. data/ynab.gemspec +1 -1
  183. metadata +11 -2
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class CategoriesApi
17
17
  attr_accessor :api_client
18
18
 
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class MonthsApi
17
17
  attr_accessor :api_client
18
18
 
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class PayeeLocationsApi
17
17
  attr_accessor :api_client
18
18
 
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class PayeesApi
17
17
  attr_accessor :api_client
18
18
 
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class ScheduledTransactionsApi
17
17
  attr_accessor :api_client
18
18
 
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
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 (i.e. 'uncategorized', 'unapproved')
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 (i.e. 'uncategorized', 'unapproved')
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. &#39;uncategorized&#39;, &#39;unapproved&#39;)
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. &#39;uncategorized&#39;, &#39;unapproved&#39;)
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. &#39;uncategorized&#39;, &#39;unapproved&#39;)
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. &#39;uncategorized&#39;, &#39;unapproved&#39;)
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. &#39;uncategorized&#39;, &#39;unapproved&#39;)
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. &#39;uncategorized&#39;, &#39;unapproved&#39;)
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 = {}
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class UserApi
17
17
  attr_accessor :api_client
18
18
 
@@ -17,7 +17,7 @@ require 'tempfile'
17
17
  require 'typhoeus'
18
18
  require 'uri'
19
19
 
20
- module YnabApi
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
- YnabApi.const_get(return_type).new.tap do |model|
216
+ YNAB.const_get(return_type).new.tap do |model|
217
217
  model.build_from_hash data
218
218
  end
219
219
  end
@@ -10,7 +10,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
- module YnabApi
13
+ module YNAB
14
14
  class ApiError < StandardError
15
15
  attr_reader :code, :response_headers, :response_body
16
16
 
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'uri'
14
14
 
15
- module YnabApi
15
+ module YNAB
16
16
  class Configuration
17
17
  # Defines url scheme
18
18
  attr_accessor :scheme
@@ -12,7 +12,7 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
12
12
 
13
13
  require 'date'
14
14
 
15
- module YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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 YnabApi
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 = YnabApi.const_get(type).new
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