ynab 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -30
  3. data/lib/ynab.rb +4 -1
  4. data/lib/ynab/api/categories_api.rb +10 -10
  5. data/lib/ynab/api/deprecated_api.rb +81 -0
  6. data/lib/ynab/api/months_api.rb +2 -2
  7. data/lib/ynab/api/payee_locations_api.rb +2 -2
  8. data/lib/ynab/api/transactions_api.rb +12 -58
  9. data/lib/ynab/models/bulk_ids.rb +1 -1
  10. data/lib/ynab/models/category.rb +3 -3
  11. data/lib/ynab/models/category_group_with_categories.rb +1 -1
  12. data/lib/ynab/models/month_detail.rb +1 -1
  13. data/lib/ynab/models/transactions_wrapper.rb +19 -4
  14. data/lib/ynab/overrides/transactions_api.rb +44 -0
  15. data/lib/ynab/version.rb +1 -1
  16. data/spec/api/transactions_spec.rb +23 -1
  17. data/spec/fixtures/vcr_cassettes/create_transactions.yml +46 -0
  18. metadata +6 -105
  19. data/Gemfile +0 -7
  20. data/Gemfile.lock +0 -44
  21. data/Rakefile +0 -34
  22. data/config.json +0 -10
  23. data/docs/Account.md +0 -18
  24. data/docs/AccountResponse.md +0 -8
  25. data/docs/AccountWrapper.md +0 -8
  26. data/docs/AccountsApi.md +0 -45
  27. data/docs/AccountsResponse.md +0 -8
  28. data/docs/AccountsWrapper.md +0 -8
  29. data/docs/BudgetDetail.md +0 -22
  30. data/docs/BudgetDetailResponse.md +0 -8
  31. data/docs/BudgetDetailWrapper.md +0 -9
  32. data/docs/BudgetSettings.md +0 -9
  33. data/docs/BudgetSettingsResponse.md +0 -8
  34. data/docs/BudgetSettingsWrapper.md +0 -8
  35. data/docs/BudgetSummary.md +0 -12
  36. data/docs/BudgetSummaryResponse.md +0 -8
  37. data/docs/BudgetSummaryWrapper.md +0 -8
  38. data/docs/BudgetsApi.md +0 -60
  39. data/docs/BulkIdWrapper.md +0 -8
  40. data/docs/BulkIds.md +0 -9
  41. data/docs/BulkResponse.md +0 -8
  42. data/docs/BulkTransactionCreateResponse.md +0 -8
  43. data/docs/BulkTransactionIds.md +0 -8
  44. data/docs/BulkTransactions.md +0 -8
  45. data/docs/CategoriesApi.md +0 -86
  46. data/docs/CategoriesResponse.md +0 -8
  47. data/docs/Category.md +0 -22
  48. data/docs/CategoryGroup.md +0 -11
  49. data/docs/CategoryGroupWithCategories.md +0 -12
  50. data/docs/CategoryGroupsWrapper.md +0 -8
  51. data/docs/CategoryResponse.md +0 -8
  52. data/docs/CategoryWrapper.md +0 -8
  53. data/docs/CurrencyFormat.md +0 -15
  54. data/docs/DateFormat.md +0 -8
  55. data/docs/ErrorDetail.md +0 -10
  56. data/docs/ErrorResponse.md +0 -8
  57. data/docs/HybridTransaction.md +0 -26
  58. data/docs/HybridTransactionsResponse.md +0 -8
  59. data/docs/HybridTransactionsWrapper.md +0 -8
  60. data/docs/MonthDetail.md +0 -15
  61. data/docs/MonthDetailResponse.md +0 -8
  62. data/docs/MonthDetailWrapper.md +0 -8
  63. data/docs/MonthSummariesResponse.md +0 -8
  64. data/docs/MonthSummariesWrapper.md +0 -8
  65. data/docs/MonthSummary.md +0 -14
  66. data/docs/MonthsApi.md +0 -45
  67. data/docs/Payee.md +0 -11
  68. data/docs/PayeeLocation.md +0 -12
  69. data/docs/PayeeLocationResponse.md +0 -8
  70. data/docs/PayeeLocationWrapper.md +0 -8
  71. data/docs/PayeeLocationsApi.md +0 -64
  72. data/docs/PayeeLocationsResponse.md +0 -8
  73. data/docs/PayeeLocationsWrapper.md +0 -8
  74. data/docs/PayeeResponse.md +0 -8
  75. data/docs/PayeeWrapper.md +0 -8
  76. data/docs/PayeesApi.md +0 -45
  77. data/docs/PayeesResponse.md +0 -8
  78. data/docs/PayeesWrapper.md +0 -8
  79. data/docs/SaveMonthCategory.md +0 -8
  80. data/docs/SaveMonthCategoryWrapper.md +0 -8
  81. data/docs/SaveTransaction.md +0 -18
  82. data/docs/SaveTransactionWrapper.md +0 -8
  83. data/docs/SaveTransactionsResponse.md +0 -8
  84. data/docs/SaveTransactionsResponseData.md +0 -11
  85. data/docs/SaveTransactionsWrapper.md +0 -9
  86. data/docs/ScheduledSubTransaction.md +0 -15
  87. data/docs/ScheduledTransactionDetail.md +0 -23
  88. data/docs/ScheduledTransactionResponse.md +0 -8
  89. data/docs/ScheduledTransactionSummary.md +0 -19
  90. data/docs/ScheduledTransactionWrapper.md +0 -8
  91. data/docs/ScheduledTransactionsApi.md +0 -45
  92. data/docs/ScheduledTransactionsResponse.md +0 -8
  93. data/docs/ScheduledTransactionsWrapper.md +0 -8
  94. data/docs/SubTransaction.md +0 -15
  95. data/docs/TransactionDetail.md +0 -25
  96. data/docs/TransactionResponse.md +0 -8
  97. data/docs/TransactionSummary.md +0 -21
  98. data/docs/TransactionWrapper.md +0 -8
  99. data/docs/TransactionsApi.md +0 -168
  100. data/docs/TransactionsResponse.md +0 -8
  101. data/docs/TransactionsWrapper.md +0 -8
  102. data/docs/User.md +0 -8
  103. data/docs/UserApi.md +0 -23
  104. data/docs/UserResponse.md +0 -8
  105. data/docs/UserWrapper.md +0 -8
  106. data/examples/budget-list.rb +0 -24
  107. data/examples/budget-month.rb +0 -35
  108. data/examples/category-balance.rb +0 -26
  109. data/examples/create-multiple-transactions.rb +0 -44
  110. data/examples/create-transaction.rb +0 -31
  111. data/examples/update-category-budgeted.rb +0 -23
  112. data/pkg/ynab-1.0.0.gem +0 -0
  113. data/pkg/ynab-1.1.0.gem +0 -0
  114. data/pkg/ynab-1.3.0.gem +0 -0
  115. data/pkg/ynab-1.4.0.gem +0 -0
  116. data/spec-v1-swagger.json +0 -2729
  117. data/swagger-templates/api_client.mustache +0 -386
  118. data/swagger-templates/api_doc.mustache +0 -32
  119. data/swagger-templates/gem.mustache +0 -83
  120. data/swagger-templates/gemspec.mustache +0 -37
  121. data/ynab.gemspec +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b166573dcd75e698d3f7267aaae6c2f059df2548cfe1e40966c45a42d4acbca
4
- data.tar.gz: 76367dc36941d01aa034d733f38f219f68f94df529e8df20c9dfafacad49ecc0
3
+ metadata.gz: 184c45eef62ef7fe3ce74ab56a52517754b6a7f8026acabdb41ded7572d6b32f
4
+ data.tar.gz: 98743e9c122ea15137a02143068a3e9de387eb48aee07d00d9c6f16c20e0abf8
5
5
  SHA512:
6
- metadata.gz: ffc1e4b9eebd5dae1d5aebca1f84bfcf96b21b40175d9897c2b40d868ffa7d90a56d39fcde15b25fffb1dbe3aafdb2790fa102c281d17f7098b4a75671efe38a
7
- data.tar.gz: 0c1ce24d903f9926b0d5b069d589ad2c317572150fcd4d49f14891aaa538f90f4cbb312118f5d511a8b141ad88eb18f0cb2560c3a3ef0b8c184cc222f8733bce
6
+ metadata.gz: 370ad1f92f90a0195c4a06df4e4ab68fcab037e3d15f09457ff692bc88daef200e3fa7af94f01155f52b2b2d9957235bcbd33cb38092dbe7bcad973a6b483def
7
+ data.tar.gz: 88cbd706a7ae0b9fd42001c10a5a592e1fead640a02002f52ff8042112c5c32da7f43a1967f71ae90496555cdf9b57cc03254b4f2c3b9ea81e0ece2e42781474
data/README.md CHANGED
@@ -17,7 +17,6 @@ gem install ynab
17
17
  ```
18
18
 
19
19
  ## Usage
20
-
21
20
  To use this client you must
22
21
  [obtain an access token](https://api.youneedabudget.com/#authentication-overview) from
23
22
  your [My Account](https://app.youneedabudget.com/settings) page of the YNAB web
@@ -26,7 +25,8 @@ app.
26
25
  ```ruby
27
26
  require 'ynab'
28
27
 
29
- access_token = 'bf0cbb14b4330-not-real-3de12e66a389eaafe2'
28
+ access_token = ENV['YNAB_ACCESS_TOKEN']
29
+ puts "access_token = " + access_token
30
30
 
31
31
  ynab_api = YNAB::API.new(access_token)
32
32
 
@@ -46,34 +46,35 @@ See the [examples folder](https://github.com/ynab/ynab-sdk-ruby/tree/master/exam
46
46
 
47
47
  The following methods are available in this library.
48
48
 
49
- | | Method | Description | |
50
- |----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|---|
51
- | **User** | [user.get_user()](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/UserApi.md#get_user) | Returns authenticated user information | |
52
- | **Budgets** | [budgets.get_budgets()](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/BudgetsApi.md#get_budgets) | Returns budgets list with summary information | |
53
- | | [budgets.get_budget_by_id(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/BudgetsApi.md#get_budget_by_id) | Returns a single budget with all related entities | |
54
- | | [budgets.get_budget_settings_by_id(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/BudgetsApi.md#get_budget_settings_by_id) | Returns settings for a budget | |
55
- | **Accounts** | [accounts.get_accounts(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/AccountsApi.md#get_accounts) | Returns all accounts | |
56
- | | [accounts.get_account_by_id(budget_id, account_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/AccountsApi.md#get_account_by_id) | Returns a single account | |
57
- | **Categories** | [categories.get_categories(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/CategoriesApi.md#get_categories) | Returns all categories grouped by category group. | |
58
- | | [categories.get_category_by_id(budget_id, category_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/CategoriesApi.md#get_category_by_id) | Returns a single category | |
59
- | **Payees** | [payees.get_payees(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeesApi.md#get_payees) | Returns all payees | |
60
- | | [payees.get_payee_by_id(budget_id, payee_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeesApi.md#get_payee_by_id) | Returns single payee | |
61
- | **Payee Locations** | [payee_locations.get_payee_locations(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeeLocationsApi.md#get_payee_locations) | Returns all payee locations | |
62
- | | [payee_locations.get_payee_location_by_id(budget_id, payee_location_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeeLocationsApi.md#get_payee_location_by_id) | Returns a single payee location | |
63
- | | [payee_locations.get_payee_locations_by_payee(budget_id, payee_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeeLocationsApi.md#get_payee_locations_by_payee) | Returns all payee locations for the specified payee | |
64
- | **Months** | [months.get_budget_months(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#get_budget_months) | Returns all budget months | |
65
- | | [months.get_budget_month(budget_id, month)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#get_budget_month) | Returns a single budget month | |
66
- | | [months.get_month_category_by_id(budget_id, month, category_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#get_month_category_by_id) | Returns a single category for a specific budget month | |
67
- | | [months.update_month_category(budget_id, month, category_id, month_category)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#update_month_category) | Update an existing month category | |
68
- | **Transactions** | [transactions.get_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transactions) | Returns budget transactions | |
69
- | | [transactions.get_transactions_by_account(budget_id, account_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transactions_by_account) | Returns all transactions for a specified account | |
70
- | | [transactions.get_transactions_by_category(budget_id, category_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transactions_by_category) | Returns all transactions for a specified category | |
71
- | | [transactions.get_transaction_by_id(budget_id, transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transaction_by_id) | Returns a single transaction | |
72
- | | [transactions.update_transaction(budget_id, id, transaction)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#update_transaction) | Updates a transaction | |
73
- | | [transactions.create_transaction(budget_id, save_transactions)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#create_transaction) | Creates one or multiple transactions | |
74
- | | [transactions.bulk_create_transactions(budget_id, transactions)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#bulk_create_transactions) | Creates multiple transactions | |
75
- | **Scheduled Transactions** | [scheduled_transactions.get_scheduled_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#get_scheduled_transactions) | Returns all scheduled transactions | |
76
- | | [scheduled_transactions.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | Returns a single scheduled transaction | |
49
+ | | Method | Description |
50
+ |----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
51
+ | **User** | [user.get_user()](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/UserApi.md#get_user) | Returns authenticated user information |
52
+ | **Budgets** | [budgets.get_budgets()](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/BudgetsApi.md#get_budgets) | Returns budgets list with summary information |
53
+ | | [budgets.get_budget_by_id(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/BudgetsApi.md#get_budget_by_id) | Returns a single budget with all related entities |
54
+ | | [budgets.get_budget_settings_by_id(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/BudgetsApi.md#get_budget_settings_by_id) | Returns settings for a budget |
55
+ | **Accounts** | [accounts.get_accounts(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/AccountsApi.md#get_accounts) | Returns all accounts |
56
+ | | [accounts.get_account_by_id(budget_id, account_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/AccountsApi.md#get_account_by_id) | Returns a single account |
57
+ | **Categories** | [categories.get_categories(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/CategoriesApi.md#get_categories) | Returns all categories grouped by category group. |
58
+ | | [categories.get_category_by_id(budget_id, category_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/CategoriesApi.md#get_category_by_id) | Returns a single category |
59
+ | **Payees** | [payees.get_payees(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeesApi.md#get_payees) | Returns all payees |
60
+ | | [payees.get_payee_by_id(budget_id, payee_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeesApi.md#get_payee_by_id) | Returns single payee |
61
+ | **Payee Locations** | [payee_locations.get_payee_locations(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeeLocationsApi.md#get_payee_locations) | Returns all payee locations |
62
+ | | [payee_locations.get_payee_location_by_id(budget_id, payee_location_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeeLocationsApi.md#get_payee_location_by_id) | Returns a single payee location |
63
+ | | [payee_locations.get_payee_locations_by_payee(budget_id, payee_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeeLocationsApi.md#get_payee_locations_by_payee) | Returns all payee locations for the specified payee |
64
+ | **Months** | [months.get_budget_months(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#get_budget_months) | Returns all budget months |
65
+ | | [months.get_budget_month(budget_id, month)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#get_budget_month) | Returns a single budget month |
66
+ | | [months.get_month_category_by_id(budget_id, month, category_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#get_month_category_by_id) | Returns a single category for a specific budget month |
67
+ | | [months.update_month_category(budget_id, month, category_id, month_category)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/MonthsApi.md#update_month_category) | Update an existing month category |
68
+ | **Transactions** | [transactions.get_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transactions) | Returns budget transactions |
69
+ | | [transactions.get_transactions_by_account(budget_id, account_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transactions_by_account) | Returns all transactions for a specified account |
70
+ | | [transactions.get_transactions_by_category(budget_id, category_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transactions_by_category) | Returns all transactions for a specified category |
71
+ | | [transactions.get_transaction_by_id(budget_id, transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#get_transaction_by_id) | Returns a single transaction |
72
+ | | [transactions.update_transaction(budget_id, id, transaction)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#update_transaction) | Updates a transaction |
73
+ | | [transactions.create_transaction(budget_id, save_transactions)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#create_transaction) | Creates one transaction |
74
+ | | [transactions.create_transactions(budget_id, save_transactions)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#create_transaction) | Creates multiple transactions |
75
+ | | [transactions.bulk_create_transactions(budget_id, transactions)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#bulk_create_transactions) | Creates multiple transactions |
76
+ | **Scheduled Transactions** | [scheduled_transactions.get_scheduled_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#get_scheduled_transactions) | Returns all scheduled transactions |
77
+ | | [scheduled_transactions.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | Returns a single scheduled transaction |
77
78
 
78
79
 
79
80
 
@@ -94,6 +94,7 @@ require 'ynab/models/transaction_detail'
94
94
  require 'ynab/api/accounts_api'
95
95
  require 'ynab/api/budgets_api'
96
96
  require 'ynab/api/categories_api'
97
+ require 'ynab/api/deprecated_api'
97
98
  require 'ynab/api/months_api'
98
99
  require 'ynab/api/payee_locations_api'
99
100
  require 'ynab/api/payees_api'
@@ -101,6 +102,8 @@ require 'ynab/api/scheduled_transactions_api'
101
102
  require 'ynab/api/transactions_api'
102
103
  require 'ynab/api/user_api'
103
104
 
105
+ require 'ynab/overrides/transactions_api'
106
+
104
107
  module YNAB
105
108
  class API
106
109
  def initialize(access_token, host = 'api.youneedabudget.com', useHttps = true)
@@ -143,7 +146,7 @@ module YNAB
143
146
  end
144
147
 
145
148
  def transactions
146
- TransactionsApi.new(@client)
149
+ YNAB::Overrides::TransactionsApi.new(@client)
147
150
  end
148
151
 
149
152
  def scheduled_transactions
@@ -20,7 +20,7 @@ module YNAB
20
20
  @api_client = api_client
21
21
  end
22
22
  # List categories
23
- # Returns all categories grouped by category group
23
+ # Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
24
24
  # @param budget_id The id of the budget (\"last-used\" can also be used to specify the last used budget)
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [CategoriesResponse]
@@ -30,7 +30,7 @@ module YNAB
30
30
  end
31
31
 
32
32
  # List categories
33
- # Returns all categories grouped by category group
33
+ # Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
34
34
  # @param budget_id The id of the budget (\"last-used\" can also be used to specify the last used budget)
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(CategoriesResponse, Fixnum, Hash)>] CategoriesResponse data, response status code and response headers
@@ -72,7 +72,7 @@ module YNAB
72
72
  return data, status_code, headers
73
73
  end
74
74
  # Single category
75
- # Returns a single category
75
+ # Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
76
76
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
77
77
  # @param category_id The id of the category
78
78
  # @param [Hash] opts the optional parameters
@@ -83,7 +83,7 @@ module YNAB
83
83
  end
84
84
 
85
85
  # Single category
86
- # Returns a single category
86
+ # Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
87
87
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
88
88
  # @param category_id The id of the category
89
89
  # @param [Hash] opts the optional parameters
@@ -130,9 +130,9 @@ module YNAB
130
130
  return data, status_code, headers
131
131
  end
132
132
  # Single category for a specific budget month
133
- # Returns a single category for a specific budget month
133
+ # Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
134
134
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
135
- # @param month the budget month in ISO format (e.g. 2016-12-30). (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
135
+ # @param month The budget month in ISO format (e.g. 2016-12-30) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
136
136
  # @param category_id The id of the category
137
137
  # @param [Hash] opts the optional parameters
138
138
  # @return [CategoryResponse]
@@ -142,9 +142,9 @@ module YNAB
142
142
  end
143
143
 
144
144
  # Single category for a specific budget month
145
- # Returns a single category for a specific budget month
145
+ # Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
146
146
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
147
- # @param month the budget month in ISO format (e.g. 2016-12-30). (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
147
+ # @param month The budget month in ISO format (e.g. 2016-12-30) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
148
148
  # @param category_id The id of the category
149
149
  # @param [Hash] opts the optional parameters
150
150
  # @return [Array<(CategoryResponse, Fixnum, Hash)>] CategoryResponse data, response status code and response headers
@@ -196,7 +196,7 @@ module YNAB
196
196
  # Update an existing month category
197
197
  # Update an existing month category
198
198
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
199
- # @param month the budget month in ISO format (e.g. 2016-12-01). \&quot;current\&quot; can also be used to specify the current calendar month (UTC).
199
+ # @param month The budget month in ISO format (e.g. 2016-12-30) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
200
200
  # @param category_id The id of the category
201
201
  # @param month_category The month category to update
202
202
  # @param [Hash] opts the optional parameters
@@ -209,7 +209,7 @@ module YNAB
209
209
  # Update an existing month category
210
210
  # Update an existing month category
211
211
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
212
- # @param month the budget month in ISO format (e.g. 2016-12-01). \&quot;current\&quot; can also be used to specify the current calendar month (UTC).
212
+ # @param month The budget month in ISO format (e.g. 2016-12-30) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
213
213
  # @param category_id The id of the category
214
214
  # @param month_category The month category to update
215
215
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,81 @@
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 'uri'
14
+
15
+ module YNAB
16
+ class DeprecatedApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Bulk create transactions
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 (\&quot;last-used\&quot; can also be used to specify the last used budget)
25
+ # @param transactions The list of transactions to create
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [BulkResponse]
28
+ def bulk_create_transactions(budget_id, transactions, opts = {})
29
+ data, _status_code, _headers = bulk_create_transactions_with_http_info(budget_id, transactions, opts)
30
+ data
31
+ end
32
+
33
+ # Bulk create transactions
34
+ # Creates multiple transactions. Although this endpoint is still supported, it is recommended to use &#39;POST /budgets/{budget_id}/transactions&#39; to create multiple transactions.
35
+ # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
36
+ # @param transactions The list of transactions to create
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(BulkResponse, Fixnum, Hash)>] BulkResponse data, response status code and response headers
39
+ def bulk_create_transactions_with_http_info(budget_id, transactions, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: DeprecatedApi.bulk_create_transactions ...'
42
+ end
43
+ # verify the required parameter 'budget_id' is set
44
+ if @api_client.config.client_side_validation && budget_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'budget_id' when calling DeprecatedApi.bulk_create_transactions"
46
+ end
47
+ # verify the required parameter 'transactions' is set
48
+ if @api_client.config.client_side_validation && transactions.nil?
49
+ fail ArgumentError, "Missing the required parameter 'transactions' when calling DeprecatedApi.bulk_create_transactions"
50
+ end
51
+ # resource path
52
+ local_var_path = '/budgets/{budget_id}/transactions/bulk'.sub('{' + 'budget_id' + '}', budget_id.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+
57
+ # header parameters
58
+ header_params = {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = {}
64
+
65
+ # http body (model)
66
+ post_body = @api_client.object_to_http_body(transactions)
67
+ auth_names = ['bearer']
68
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => 'BulkResponse')
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug "API called: DeprecatedApi#bulk_create_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
+ end
78
+ return data, status_code, headers
79
+ end
80
+ end
81
+ end
@@ -22,7 +22,7 @@ module YNAB
22
22
  # Single budget month
23
23
  # Returns a single budget month
24
24
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
25
- # @param month the budget month in ISO format (e.g. 2016-12-01). \&quot;current\&quot; can also be used to specify the current calendar month (UTC).
25
+ # @param month The budget month in ISO format (e.g. 2016-12-30) (\&quot;current\&quot; 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 = {})
@@ -33,7 +33,7 @@ module YNAB
33
33
  # Single budget month
34
34
  # Returns a single budget month
35
35
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
36
- # @param month the budget month in ISO format (e.g. 2016-12-01). \&quot;current\&quot; can also be used to specify the current calendar month (UTC).
36
+ # @param month The budget month in ISO format (e.g. 2016-12-30) (\&quot;current\&quot; can also be used to specify the current calendar month (UTC))
37
37
  # @param [Hash] opts the optional parameters
38
38
  # @return [Array<(MonthDetailResponse, Fixnum, Hash)>] MonthDetailResponse data, response status code and response headers
39
39
  def get_budget_month_with_http_info(budget_id, month, opts = {})
@@ -22,7 +22,7 @@ module YNAB
22
22
  # Single payee location
23
23
  # Returns a single payee location
24
24
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
25
- # @param payee_location_id ID of payee location
25
+ # @param payee_location_id id of payee location
26
26
  # @param [Hash] opts the optional parameters
27
27
  # @return [PayeeLocationResponse]
28
28
  def get_payee_location_by_id(budget_id, payee_location_id, opts = {})
@@ -33,7 +33,7 @@ module YNAB
33
33
  # Single payee location
34
34
  # Returns a single payee location
35
35
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
36
- # @param payee_location_id ID of payee location
36
+ # @param payee_location_id id of payee location
37
37
  # @param [Hash] opts the optional parameters
38
38
  # @return [Array<(PayeeLocationResponse, Fixnum, Hash)>] PayeeLocationResponse data, response status code and response headers
39
39
  def get_payee_location_by_id_with_http_info(budget_id, payee_location_id, opts = {})
@@ -19,64 +19,6 @@ module YNAB
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Bulk create transactions
23
- # Creates multiple transactions
24
- # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
25
- # @param transactions The list of transactions to create
26
- # @param [Hash] opts the optional parameters
27
- # @return [BulkResponse]
28
- def bulk_create_transactions(budget_id, transactions, opts = {})
29
- data, _status_code, _headers = bulk_create_transactions_with_http_info(budget_id, transactions, opts)
30
- data
31
- end
32
-
33
- # Bulk create transactions
34
- # Creates multiple transactions
35
- # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
36
- # @param transactions The list of transactions to create
37
- # @param [Hash] opts the optional parameters
38
- # @return [Array<(BulkResponse, Fixnum, Hash)>] BulkResponse data, response status code and response headers
39
- def bulk_create_transactions_with_http_info(budget_id, transactions, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: TransactionsApi.bulk_create_transactions ...'
42
- end
43
- # verify the required parameter 'budget_id' is set
44
- if @api_client.config.client_side_validation && budget_id.nil?
45
- fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.bulk_create_transactions"
46
- end
47
- # verify the required parameter 'transactions' is set
48
- if @api_client.config.client_side_validation && transactions.nil?
49
- fail ArgumentError, "Missing the required parameter 'transactions' when calling TransactionsApi.bulk_create_transactions"
50
- end
51
- # resource path
52
- local_var_path = '/budgets/{budget_id}/transactions/bulk'.sub('{' + 'budget_id' + '}', budget_id.to_s)
53
-
54
- # query parameters
55
- query_params = {}
56
-
57
- # header parameters
58
- header_params = {}
59
- # HTTP header 'Accept' (if needed)
60
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
-
62
- # form parameters
63
- form_params = {}
64
-
65
- # http body (model)
66
- post_body = @api_client.object_to_http_body(transactions)
67
- auth_names = ['bearer']
68
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
69
- :header_params => header_params,
70
- :query_params => query_params,
71
- :form_params => form_params,
72
- :body => post_body,
73
- :auth_names => auth_names,
74
- :return_type => 'BulkResponse')
75
- if @api_client.config.debugging
76
- @api_client.config.logger.debug "API called: TransactionsApi#bulk_create_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
- end
78
- return data, status_code, headers
79
- end
80
22
  # Create a single transaction or multiple transactions
81
23
  # Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created.
82
24
  # @param budget_id The id of the budget (\&quot;last-used\&quot; can also be used to specify the last used budget)
@@ -199,6 +141,7 @@ module YNAB
199
141
  # @param [Hash] opts the optional parameters
200
142
  # @option opts [Date] :since_date Only return transactions on or after this date
201
143
  # @option opts [String] :type Only return transactions of a certain type (&#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported)
144
+ # @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.
202
145
  # @return [TransactionsResponse]
203
146
  def get_transactions(budget_id, opts = {})
204
147
  data, _status_code, _headers = get_transactions_with_http_info(budget_id, opts)
@@ -211,6 +154,7 @@ module YNAB
211
154
  # @param [Hash] opts the optional parameters
212
155
  # @option opts [Date] :since_date Only return transactions on or after this date
213
156
  # @option opts [String] :type Only return transactions of a certain type (&#39;uncategorized&#39; and &#39;unapproved&#39; are currently supported)
157
+ # @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.
214
158
  # @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
215
159
  def get_transactions_with_http_info(budget_id, opts = {})
216
160
  if @api_client.config.debugging
@@ -230,6 +174,7 @@ module YNAB
230
174
  query_params = {}
231
175
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
232
176
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
177
+ query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
233
178
 
234
179
  # header parameters
235
180
  header_params = {}
@@ -261,6 +206,7 @@ module YNAB
261
206
  # @param [Hash] opts the optional parameters
262
207
  # @option opts [Date] :since_date Only return transactions on or after this date
263
208
  # @option opts [String] :type Only return transactions of a certain type (i.e. &#39;uncategorized&#39;, &#39;unapproved&#39;)
209
+ # @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.
264
210
  # @return [TransactionsResponse]
265
211
  def get_transactions_by_account(budget_id, account_id, opts = {})
266
212
  data, _status_code, _headers = get_transactions_by_account_with_http_info(budget_id, account_id, opts)
@@ -274,6 +220,7 @@ module YNAB
274
220
  # @param [Hash] opts the optional parameters
275
221
  # @option opts [Date] :since_date Only return transactions on or after this date
276
222
  # @option opts [String] :type Only return transactions of a certain type (i.e. &#39;uncategorized&#39;, &#39;unapproved&#39;)
223
+ # @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.
277
224
  # @return [Array<(TransactionsResponse, Fixnum, Hash)>] TransactionsResponse data, response status code and response headers
278
225
  def get_transactions_by_account_with_http_info(budget_id, account_id, opts = {})
279
226
  if @api_client.config.debugging
@@ -297,6 +244,7 @@ module YNAB
297
244
  query_params = {}
298
245
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
299
246
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
247
+ query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
300
248
 
301
249
  # header parameters
302
250
  header_params = {}
@@ -328,6 +276,7 @@ module YNAB
328
276
  # @param [Hash] opts the optional parameters
329
277
  # @option opts [Date] :since_date Only return transactions on or after this date
330
278
  # @option opts [String] :type Only return transactions of a certain type (i.e. &#39;uncategorized&#39;, &#39;unapproved&#39;)
279
+ # @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.
331
280
  # @return [HybridTransactionsResponse]
332
281
  def get_transactions_by_category(budget_id, category_id, opts = {})
333
282
  data, _status_code, _headers = get_transactions_by_category_with_http_info(budget_id, category_id, opts)
@@ -341,6 +290,7 @@ module YNAB
341
290
  # @param [Hash] opts the optional parameters
342
291
  # @option opts [Date] :since_date Only return transactions on or after this date
343
292
  # @option opts [String] :type Only return transactions of a certain type (i.e. &#39;uncategorized&#39;, &#39;unapproved&#39;)
293
+ # @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.
344
294
  # @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
345
295
  def get_transactions_by_category_with_http_info(budget_id, category_id, opts = {})
346
296
  if @api_client.config.debugging
@@ -364,6 +314,7 @@ module YNAB
364
314
  query_params = {}
365
315
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
366
316
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
317
+ query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
367
318
 
368
319
  # header parameters
369
320
  header_params = {}
@@ -395,6 +346,7 @@ module YNAB
395
346
  # @param [Hash] opts the optional parameters
396
347
  # @option opts [Date] :since_date Only return transactions on or after this date
397
348
  # @option opts [String] :type Only return transactions of a certain type (i.e. &#39;uncategorized&#39;, &#39;unapproved&#39;)
349
+ # @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.
398
350
  # @return [HybridTransactionsResponse]
399
351
  def get_transactions_by_payee(budget_id, payee_id, opts = {})
400
352
  data, _status_code, _headers = get_transactions_by_payee_with_http_info(budget_id, payee_id, opts)
@@ -408,6 +360,7 @@ module YNAB
408
360
  # @param [Hash] opts the optional parameters
409
361
  # @option opts [Date] :since_date Only return transactions on or after this date
410
362
  # @option opts [String] :type Only return transactions of a certain type (i.e. &#39;uncategorized&#39;, &#39;unapproved&#39;)
363
+ # @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.
411
364
  # @return [Array<(HybridTransactionsResponse, Fixnum, Hash)>] HybridTransactionsResponse data, response status code and response headers
412
365
  def get_transactions_by_payee_with_http_info(budget_id, payee_id, opts = {})
413
366
  if @api_client.config.debugging
@@ -431,6 +384,7 @@ module YNAB
431
384
  query_params = {}
432
385
  query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil?
433
386
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
387
+ query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil?
434
388
 
435
389
  # header parameters
436
390
  header_params = {}