ynab 1.31.0 → 2.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/DEVELOPMENT.md +11 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +42 -0
  5. data/README.md +3 -3
  6. data/Rakefile +58 -0
  7. data/config.json +9 -0
  8. data/docs/Account.md +25 -0
  9. data/docs/AccountResponse.md +8 -0
  10. data/docs/AccountResponseData.md +8 -0
  11. data/docs/AccountType.md +7 -0
  12. data/docs/AccountWrapper.md +8 -0
  13. data/docs/AccountsApi.md +70 -0
  14. data/docs/AccountsResponse.md +8 -0
  15. data/docs/AccountsResponseData.md +9 -0
  16. data/docs/AccountsWrapper.md +9 -0
  17. data/docs/BudgetDetail.md +24 -0
  18. data/docs/BudgetDetailAllOf.md +17 -0
  19. data/docs/BudgetDetailResponse.md +8 -0
  20. data/docs/BudgetDetailResponseData.md +9 -0
  21. data/docs/BudgetDetailWrapper.md +9 -0
  22. data/docs/BudgetSettings.md +9 -0
  23. data/docs/BudgetSettingsResponse.md +8 -0
  24. data/docs/BudgetSettingsResponseData.md +8 -0
  25. data/docs/BudgetSettingsWrapper.md +8 -0
  26. data/docs/BudgetSummary.md +15 -0
  27. data/docs/BudgetSummaryResponse.md +8 -0
  28. data/docs/BudgetSummaryResponseData.md +9 -0
  29. data/docs/BudgetSummaryWrapper.md +9 -0
  30. data/docs/BudgetsApi.md +68 -0
  31. data/docs/BulkIdWrapper.md +8 -0
  32. data/docs/BulkIds.md +9 -0
  33. data/docs/BulkResponse.md +8 -0
  34. data/docs/BulkResponseData.md +8 -0
  35. data/docs/BulkResponseDataBulk.md +9 -0
  36. data/docs/BulkTransactionCreateResponse.md +8 -0
  37. data/docs/BulkTransactionIds.md +8 -0
  38. data/docs/BulkTransactions.md +8 -0
  39. data/docs/CategoriesApi.md +94 -0
  40. data/docs/CategoriesResponse.md +8 -0
  41. data/docs/CategoriesResponseData.md +9 -0
  42. data/docs/Category.md +30 -0
  43. data/docs/CategoryGroup.md +11 -0
  44. data/docs/CategoryGroupWithCategories.md +12 -0
  45. data/docs/CategoryGroupWithCategoriesAllOf.md +8 -0
  46. data/docs/CategoryGroupsWrapper.md +9 -0
  47. data/docs/CategoryResponse.md +8 -0
  48. data/docs/CategoryResponseData.md +8 -0
  49. data/docs/CategoryWrapper.md +9 -0
  50. data/docs/CurrencyFormat.md +15 -0
  51. data/docs/DateFormat.md +8 -0
  52. data/docs/DeprecatedApi.md +28 -0
  53. data/docs/ErrorDetail.md +10 -0
  54. data/docs/ErrorResponse.md +8 -0
  55. data/docs/HybridTransaction.md +30 -0
  56. data/docs/HybridTransactionAllOf.md +12 -0
  57. data/docs/HybridTransactionsResponse.md +8 -0
  58. data/docs/HybridTransactionsResponseData.md +9 -0
  59. data/docs/HybridTransactionsWrapper.md +8 -0
  60. data/docs/LoanAccountPeriodicValue.md +7 -0
  61. data/docs/MonthDetail.md +16 -0
  62. data/docs/MonthDetailAllOf.md +8 -0
  63. data/docs/MonthDetailResponse.md +8 -0
  64. data/docs/MonthDetailResponseData.md +8 -0
  65. data/docs/MonthDetailWrapper.md +8 -0
  66. data/docs/MonthSummariesResponse.md +8 -0
  67. data/docs/MonthSummariesResponseData.md +9 -0
  68. data/docs/MonthSummariesWrapper.md +9 -0
  69. data/docs/MonthSummary.md +15 -0
  70. data/docs/MonthsApi.md +49 -0
  71. data/docs/PatchMonthCategoryWrapper.md +8 -0
  72. data/docs/PatchTransactionsWrapper.md +8 -0
  73. data/docs/Payee.md +11 -0
  74. data/docs/PayeeLocation.md +12 -0
  75. data/docs/PayeeLocationResponse.md +8 -0
  76. data/docs/PayeeLocationResponseData.md +8 -0
  77. data/docs/PayeeLocationWrapper.md +8 -0
  78. data/docs/PayeeLocationsApi.md +69 -0
  79. data/docs/PayeeLocationsResponse.md +8 -0
  80. data/docs/PayeeLocationsResponseData.md +8 -0
  81. data/docs/PayeeLocationsWrapper.md +8 -0
  82. data/docs/PayeeResponse.md +8 -0
  83. data/docs/PayeeResponseData.md +8 -0
  84. data/docs/PayeeWrapper.md +8 -0
  85. data/docs/PayeesApi.md +49 -0
  86. data/docs/PayeesResponse.md +8 -0
  87. data/docs/PayeesResponseData.md +9 -0
  88. data/docs/PayeesWrapper.md +9 -0
  89. data/docs/PostAccountWrapper.md +8 -0
  90. data/docs/PostTransactionsWrapper.md +9 -0
  91. data/docs/PutTransactionWrapper.md +8 -0
  92. data/docs/SaveAccount.md +10 -0
  93. data/docs/SaveAccountWrapper.md +8 -0
  94. data/docs/SaveCategoryResponse.md +8 -0
  95. data/docs/SaveCategoryResponseData.md +9 -0
  96. data/docs/SaveMonthCategory.md +8 -0
  97. data/docs/SaveMonthCategoryWrapper.md +8 -0
  98. data/docs/SaveSubTransaction.md +12 -0
  99. data/docs/SaveTransaction.md +19 -0
  100. data/docs/SaveTransactionWithId.md +20 -0
  101. data/docs/SaveTransactionWithIdAllOf.md +8 -0
  102. data/docs/SaveTransactionWithOptionalFields.md +19 -0
  103. data/docs/SaveTransactionWrapper.md +8 -0
  104. data/docs/SaveTransactionsResponse.md +8 -0
  105. data/docs/SaveTransactionsResponseData.md +12 -0
  106. data/docs/SaveTransactionsWrapper.md +9 -0
  107. data/docs/ScheduledSubTransaction.md +15 -0
  108. data/docs/ScheduledTransactionDetail.md +23 -0
  109. data/docs/ScheduledTransactionDetailAllOf.md +11 -0
  110. data/docs/ScheduledTransactionResponse.md +8 -0
  111. data/docs/ScheduledTransactionResponseData.md +8 -0
  112. data/docs/ScheduledTransactionSummary.md +19 -0
  113. data/docs/ScheduledTransactionWrapper.md +8 -0
  114. data/docs/ScheduledTransactionsApi.md +49 -0
  115. data/docs/ScheduledTransactionsResponse.md +8 -0
  116. data/docs/ScheduledTransactionsResponseData.md +9 -0
  117. data/docs/ScheduledTransactionsWrapper.md +8 -0
  118. data/docs/SubTransaction.md +18 -0
  119. data/docs/TransactionDetail.md +29 -0
  120. data/docs/TransactionDetailAllOf.md +11 -0
  121. data/docs/TransactionResponse.md +8 -0
  122. data/docs/TransactionResponseData.md +8 -0
  123. data/docs/TransactionSummary.md +25 -0
  124. data/docs/TransactionWrapper.md +8 -0
  125. data/docs/TransactionsApi.md +228 -0
  126. data/docs/TransactionsImportResponse.md +8 -0
  127. data/docs/TransactionsImportResponseData.md +8 -0
  128. data/docs/TransactionsResponse.md +8 -0
  129. data/docs/TransactionsResponseData.md +9 -0
  130. data/docs/TransactionsWrapper.md +9 -0
  131. data/docs/UpdateTransaction.md +20 -0
  132. data/docs/UpdateTransactionsWrapper.md +8 -0
  133. data/docs/User.md +8 -0
  134. data/docs/UserApi.md +25 -0
  135. data/docs/UserResponse.md +8 -0
  136. data/docs/UserResponseData.md +8 -0
  137. data/docs/UserWrapper.md +8 -0
  138. data/examples/budget-list.rb +21 -0
  139. data/examples/budget-month.rb +33 -0
  140. data/examples/category-balance.rb +23 -0
  141. data/examples/create-multiple-transactions.rb +42 -0
  142. data/examples/create-transaction.rb +30 -0
  143. data/examples/update-category-budgeted.rb +25 -0
  144. data/examples/update-multiple-transactions.rb +20 -0
  145. data/lib/ynab/api/accounts_api.rb +78 -41
  146. data/lib/ynab/api/budgets_api.rb +68 -36
  147. data/lib/ynab/api/categories_api.rb +108 -60
  148. data/lib/ynab/api/deprecated_api.rb +32 -17
  149. data/lib/ynab/api/months_api.rb +49 -28
  150. data/lib/ynab/api/payee_locations_api.rb +73 -41
  151. data/lib/ynab/api/payees_api.rb +49 -28
  152. data/lib/ynab/api/scheduled_transactions_api.rb +49 -28
  153. data/lib/ynab/api/transactions_api.rb +268 -140
  154. data/lib/ynab/api/user_api.rb +22 -12
  155. data/lib/ynab/api_client.rb +97 -95
  156. data/lib/ynab/configuration.rb +101 -14
  157. data/lib/ynab/models/account.rb +117 -55
  158. data/lib/ynab/models/account_response.rb +53 -18
  159. data/lib/ynab/models/account_response_data.rb +53 -18
  160. data/lib/ynab/models/account_type.rb +30 -20
  161. data/lib/ynab/models/accounts_response.rb +53 -18
  162. data/lib/ynab/models/accounts_response_data.rb +54 -19
  163. data/lib/ynab/models/budget_detail.rb +80 -35
  164. data/lib/ynab/models/budget_detail_all_of.rb +320 -0
  165. data/lib/ynab/models/budget_detail_response.rb +53 -18
  166. data/lib/ynab/models/budget_detail_response_data.rb +54 -19
  167. data/lib/ynab/models/budget_settings.rb +56 -29
  168. data/lib/ynab/models/budget_settings_response.rb +53 -18
  169. data/lib/ynab/models/budget_settings_response_data.rb +53 -18
  170. data/lib/ynab/models/budget_summary.rb +63 -26
  171. data/lib/ynab/models/budget_summary_response.rb +53 -18
  172. data/lib/ynab/models/budget_summary_response_data.rb +54 -20
  173. data/lib/ynab/models/bulk_response.rb +53 -18
  174. data/lib/ynab/models/bulk_response_data.rb +53 -18
  175. data/lib/ynab/models/bulk_response_data_bulk.rb +54 -19
  176. data/lib/ynab/models/bulk_transactions.rb +53 -18
  177. data/lib/ynab/models/categories_response.rb +53 -18
  178. data/lib/ynab/models/categories_response_data.rb +54 -19
  179. data/lib/ynab/models/category.rb +110 -48
  180. data/lib/ynab/models/category_group.rb +58 -23
  181. data/lib/ynab/models/category_group_with_categories.rb +67 -24
  182. data/lib/ynab/models/{save_month_category_wrapper.rb → category_group_with_categories_all_of.rb} +67 -29
  183. data/lib/ynab/models/category_response.rb +53 -18
  184. data/lib/ynab/models/category_response_data.rb +53 -18
  185. data/lib/ynab/models/currency_format.rb +62 -27
  186. data/lib/ynab/models/date_format.rb +53 -18
  187. data/lib/ynab/models/error_detail.rb +55 -20
  188. data/lib/ynab/models/error_response.rb +53 -18
  189. data/lib/ynab/models/hybrid_transaction.rb +118 -46
  190. data/lib/ynab/models/hybrid_transaction_all_of.rb +304 -0
  191. data/lib/ynab/models/hybrid_transactions_response.rb +53 -18
  192. data/lib/ynab/models/hybrid_transactions_response_data.rb +54 -19
  193. data/lib/ynab/models/month_detail.rb +72 -27
  194. data/lib/ynab/models/{update_transactions_wrapper.rb → month_detail_all_of.rb} +66 -30
  195. data/lib/ynab/models/month_detail_response.rb +53 -18
  196. data/lib/ynab/models/month_detail_response_data.rb +53 -18
  197. data/lib/ynab/models/month_summaries_response.rb +53 -18
  198. data/lib/ynab/models/month_summaries_response_data.rb +54 -19
  199. data/lib/ynab/models/month_summary.rb +63 -26
  200. data/lib/ynab/models/patch_month_category_wrapper.rb +53 -18
  201. data/lib/ynab/models/patch_transactions_wrapper.rb +53 -18
  202. data/lib/ynab/models/payee.rb +58 -22
  203. data/lib/ynab/models/payee_location.rb +58 -23
  204. data/lib/ynab/models/payee_location_response.rb +53 -18
  205. data/lib/ynab/models/payee_location_response_data.rb +53 -18
  206. data/lib/ynab/models/payee_locations_response.rb +53 -18
  207. data/lib/ynab/models/payee_locations_response_data.rb +53 -18
  208. data/lib/ynab/models/payee_response.rb +53 -18
  209. data/lib/ynab/models/payee_response_data.rb +53 -18
  210. data/lib/ynab/models/payees_response.rb +53 -18
  211. data/lib/ynab/models/payees_response_data.rb +54 -19
  212. data/lib/ynab/models/post_account_wrapper.rb +53 -18
  213. data/lib/ynab/models/post_transactions_wrapper.rb +54 -19
  214. data/lib/ynab/models/put_transaction_wrapper.rb +53 -18
  215. data/lib/ynab/models/save_account.rb +77 -20
  216. data/lib/ynab/models/save_category_response.rb +53 -18
  217. data/lib/ynab/models/save_category_response_data.rb +54 -19
  218. data/lib/ynab/models/save_month_category.rb +53 -18
  219. data/lib/ynab/models/save_sub_transaction.rb +61 -22
  220. data/lib/ynab/models/save_transaction.rb +88 -33
  221. data/lib/ynab/models/save_transaction_with_id.rb +102 -46
  222. data/lib/ynab/models/{save_transactions_wrapper.rb → save_transaction_with_id_all_of.rb} +60 -36
  223. data/lib/ynab/models/save_transaction_with_optional_fields.rb +81 -33
  224. data/lib/ynab/models/save_transactions_response.rb +53 -18
  225. data/lib/ynab/models/save_transactions_response_data.rb +57 -23
  226. data/lib/ynab/models/scheduled_sub_transaction.rb +66 -27
  227. data/lib/ynab/models/scheduled_transaction_detail.rb +94 -36
  228. data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +262 -0
  229. data/lib/ynab/models/scheduled_transaction_response.rb +53 -18
  230. data/lib/ynab/models/scheduled_transaction_response_data.rb +53 -18
  231. data/lib/ynab/models/scheduled_transaction_summary.rb +80 -32
  232. data/lib/ynab/models/scheduled_transactions_response.rb +53 -18
  233. data/lib/ynab/models/scheduled_transactions_response_data.rb +54 -19
  234. data/lib/ynab/models/sub_transaction.rb +71 -29
  235. data/lib/ynab/models/transaction_detail.rb +112 -44
  236. data/lib/ynab/models/{save_transaction_wrapper.rb → transaction_detail_all_of.rb} +102 -29
  237. data/lib/ynab/models/transaction_response.rb +53 -18
  238. data/lib/ynab/models/transaction_response_data.rb +53 -18
  239. data/lib/ynab/models/transaction_summary.rb +98 -40
  240. data/lib/ynab/models/transactions_import_response.rb +53 -18
  241. data/lib/ynab/models/transactions_import_response_data.rb +53 -18
  242. data/lib/ynab/models/transactions_response.rb +53 -18
  243. data/lib/ynab/models/transactions_response_data.rb +54 -19
  244. data/lib/ynab/models/user.rb +53 -18
  245. data/lib/ynab/models/user_response.rb +53 -18
  246. data/lib/ynab/models/user_response_data.rb +53 -18
  247. data/lib/ynab/version.rb +1 -1
  248. data/lib/ynab.rb +19 -14
  249. data/open_api_spec.yaml +3012 -0
  250. data/templates/api_client.mustache +274 -0
  251. data/templates/api_client_typhoeus_partial.mustache +156 -0
  252. data/templates/api_doc.mustache +44 -0
  253. data/templates/gem.mustache +84 -0
  254. data/templates/partial_model_generic_doc.mustache +9 -0
  255. data/ynab.gemspec +38 -0
  256. metadata +194 -87
  257. data/lib/ynab/models/loan_account_periodic_value.rb +0 -175
  258. data/lib/ynab/models/save_account_wrapper.rb +0 -189
  259. data/lib/ynab/models/update_transaction.rb +0 -407
  260. data/spec/models/transaction_detail_spec.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3280dd5723553a1ad9685172f0313fa4d7e87bddc75a672c2af1187a84210725
4
- data.tar.gz: cc856de16494c1486302de6d0e94f1eea37621eb9651510f9a15544c88fcd811
3
+ metadata.gz: b9d748b2240c0fd89db37f5b2c4b0ddde93305d40f6f7b6671858cf92f9a1953
4
+ data.tar.gz: 4779f85e097034853bae07f72e464198d96ea4aa83fa8b19cc1edae4fd0be9a2
5
5
  SHA512:
6
- metadata.gz: dd147becc0dcef86e3db5a846674860ead9646a9cbe52863c1d2f0a85f146fedb22c69a910448e2449eef9774b41fd98e4df957cd3be799147840aa3e414c961
7
- data.tar.gz: bf9ed4869036b5622d4defa8914d3dc79f3d69d2670a7e131eb0a5cf20085d6cedcdba90987da14b9121e251e1e703ec10606643d17a49241c1a0532d00bc215
6
+ metadata.gz: e9c8cd0b451e406b52ed58e2762f55e389c3875aa9f23defbf777c4afa15650beb0cef56e54c7eba9b7e19a9c71fa05559b613d2adde9ce580b16fe6a4d5c390
7
+ data.tar.gz: 1ee8edb4021e5b12e97dd927f1f1281520f58a5ce222c01a1ca6e63a52b9e34af37bef6c5efcbcd9ec057ab575a1adea36a453326eaf770c72ddb6ca52dc714d
data/DEVELOPMENT.md ADDED
@@ -0,0 +1,11 @@
1
+ # Development
2
+
3
+ ## Setup
4
+
5
+ - Install dependencies: `bundle`
6
+ - Generate latest client based on swagger spec: `rake generate`
7
+ - Run tests: `rake spec` or `rspec`
8
+
9
+ ## Publishing
10
+
11
+ Run the "Publish" GitHub Actions workflow
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem "rake", ">= 12.3.3"
7
+ gem "vcr", ">=3.0.3"
8
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,42 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ynab (1.31.0)
5
+ typhoeus (~> 1.0, >= 1.0.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.3)
11
+ ethon (0.16.0)
12
+ ffi (>= 1.15.0)
13
+ ffi (1.15.5)
14
+ rake (13.0.1)
15
+ rspec (3.8.0)
16
+ rspec-core (~> 3.8.0)
17
+ rspec-expectations (~> 3.8.0)
18
+ rspec-mocks (~> 3.8.0)
19
+ rspec-core (3.8.0)
20
+ rspec-support (~> 3.8.0)
21
+ rspec-expectations (3.8.2)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.8.0)
24
+ rspec-mocks (3.8.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.8.0)
27
+ rspec-support (3.8.0)
28
+ typhoeus (1.4.0)
29
+ ethon (>= 0.9.0)
30
+ vcr (6.2.0)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ rake (>= 12.3.3)
37
+ rspec (~> 3.6, >= 3.6.0)
38
+ vcr (>= 3.0.3)
39
+ ynab!
40
+
41
+ BUNDLED WITH
42
+ 2.3.24
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # YNAB API Ruby Library
2
2
 
3
- [![Build Status](https://travis-ci.org/ynab/ynab-sdk-ruby.svg?branch=master)](https://travis-ci.org/ynab/ynab-sdk-ruby)
3
+ [![Continuous Integration](https://github.com/ynab/ynab-sdk-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/ynab/ynab-sdk-ruby/actions/workflows/ci.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/ynab.svg)](https://rubygems.org/gems/ynab)
5
5
 
6
6
  This is the Ruby client for the YNAB API.
@@ -71,8 +71,8 @@ The following methods are available in this library.
71
71
  | | [transactions.create_transactions(budget_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#create_transaction) | Creates multiple transactions |
72
72
  | | [transactions.update_transaction(budget_id, id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#update_transaction) | Updates a single transaction |
73
73
  | | [transactions.update_transactions(budget_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#update_transactions) | Updates multiple transactions |
74
- | | [transactions.delete_transaction(budget_id, transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#delete_transaction) | Imports transactions |
75
- | | [transactions.import_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#import_transactions) | Deletes a single transaction |
74
+ | | [transactions.delete_transaction(budget_id, transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#delete_transaction) | Deletes a single transaction |
75
+ | | [transactions.import_transactions(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/TransactionsApi.md#import_transactions) | Imports transactions |
76
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
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 |
78
78
 
data/Rakefile ADDED
@@ -0,0 +1,58 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+ require 'bundler/gem_tasks'
4
+ require 'lib/ynab/version'
5
+
6
+ RSpec::Core::RakeTask.new(:spec) do |t|
7
+ t.rspec_opts = "-fd"
8
+ end
9
+ rescue LoadError
10
+ # no rspec available
11
+ end
12
+
13
+ task :default => [:spec]
14
+
15
+ desc "Run Swagger Code Generator to update the client from the Swagger spec"
16
+ task :generate do
17
+ # Download latest swagger spec
18
+ spec_filename = 'open_api_spec.yaml'
19
+ sh "wget https://api.ynab.com/papi/#{spec_filename} -O ./#{spec_filename}"
20
+ sh "openapi-generator generate -i ./#{spec_filename} -g ruby -c config.json -t ./templates -o ./"
21
+ end
22
+
23
+ task :get_current_version do
24
+ puts YNAB::VERSION
25
+ end
26
+
27
+ task :bump_version_number, [:version_type] do |t, args|
28
+ current_version = YNAB::VERSION
29
+ new_version = current_version
30
+
31
+ # Increment version number
32
+ case args[:version_type]
33
+ when 'major'
34
+ new_version = current_version.split('.').tap { |v| v[0] = v[0].to_i + 1 }.join('.')
35
+ when 'minor'
36
+ new_version = current_version.split('.').tap { |v| v[1] = v[1].to_i + 1 }.join('.')
37
+ when 'patch'
38
+ new_version = current_version.split('.').tap { |v| v[2] = v[2].to_i + 1 }.join('.')
39
+ else
40
+ puts "Invalid version type: #{args[:version_type]}"
41
+ exit 1
42
+ end
43
+
44
+ version_file_path = 'lib/ynab/version.rb'
45
+ current_version_file_text = File.read(version_file_path)
46
+ new_version_file_text = current_version_file_text.gsub(current_version, new_version)
47
+ File.open(version_file_path, "w") {|file| file.puts new_version_file_text }
48
+
49
+ puts new_version
50
+ end
51
+
52
+ task :commit_version_bump do
53
+ sh "git add lib/ynab/version.rb Gemfile.lock && git diff-index --quiet HEAD || git commit -m 'Bumping version for release'"
54
+ end
55
+
56
+ desc "Bump version, run specs build a gem and release on RubyGems"
57
+ task :publish => ['spec', 'commit_version_bump', 'clobber', 'release']
58
+
data/config.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "gemName": "ynab",
3
+ "moduleName": "YNAB",
4
+ "gemDescription": "Ruby gem wrapper for the YNAB API. Read the documentation at https://api.ynab.com",
5
+ "gemHomepage": "https://github.com/ynab/ynab-sdk-ruby",
6
+ "gemLicense": "Apache-2.0",
7
+ "gemAuthor": "YNAB",
8
+ "gemAuthorEmail": "api@ynab.com"
9
+ }
data/docs/Account.md ADDED
@@ -0,0 +1,25 @@
1
+ # YNAB::Account
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **name** | **String** | | |
9
+ | **type** | [**AccountType**](AccountType.md) | | |
10
+ | **on_budget** | **Boolean** | Whether this account is on budget or not | |
11
+ | **closed** | **Boolean** | Whether this account is closed or not | |
12
+ | **note** | **String** | | [optional] |
13
+ | **balance** | **Integer** | The current balance of the account in milliunits format | |
14
+ | **cleared_balance** | **Integer** | The current cleared balance of the account in milliunits format | |
15
+ | **uncleared_balance** | **Integer** | The current uncleared balance of the account in milliunits format | |
16
+ | **transfer_payee_id** | **String** | The payee id which should be used when transferring to this account | |
17
+ | **direct_import_linked** | **Boolean** | Whether or not the account is linked to a financial institution for automatic transaction import. | [optional] |
18
+ | **direct_import_in_error** | **Boolean** | If an account linked to a financial institution (direct_import_linked&#x3D;true) and the linked connection is not in a healthy state, this will be true. | [optional] |
19
+ | **last_reconciled_at** | **Time** | A date/time specifying when the account was last reconciled. | [optional] |
20
+ | **debt_original_balance** | **Integer** | The original debt/loan account balance, specified in milliunits format. | [optional] |
21
+ | **debt_interest_rates** | **Hash&lt;String, Integer&gt;** | | [optional] |
22
+ | **debt_minimum_payments** | **Hash&lt;String, Integer&gt;** | | [optional] |
23
+ | **debt_escrow_amounts** | **Hash&lt;String, Integer&gt;** | | [optional] |
24
+ | **deleted** | **Boolean** | Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. | |
25
+
@@ -0,0 +1,8 @@
1
+ # YNAB::AccountResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**AccountResponseData**](AccountResponseData.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::AccountResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **account** | [**Account**](Account.md) | | |
8
+
@@ -0,0 +1,7 @@
1
+ # YNAB::AccountType
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
@@ -0,0 +1,8 @@
1
+ # YNAB::AccountWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **account** | [**Account**](Account.md) | |
7
+
8
+
@@ -0,0 +1,70 @@
1
+ # YNAB::AccountsApi
2
+
3
+ All URIs are relative to *https://api.ynab.com/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**create_account**](AccountsApi.md#create_account) | **POST** /budgets/{budget_id}/accounts | Create a new account |
8
+ | [**get_account_by_id**](AccountsApi.md#get_account_by_id) | **GET** /budgets/{budget_id}/accounts/{account_id} | Single account |
9
+ | [**get_accounts**](AccountsApi.md#get_accounts) | **GET** /budgets/{budget_id}/accounts | Account list |
10
+
11
+
12
+ ## create_account
13
+
14
+ > <AccountResponse> create_account(budget_id, data)
15
+
16
+ Create a new account
17
+
18
+ Creates a new account
19
+
20
+ ### Parameters
21
+
22
+ | Name | Type | Description | Notes |
23
+ | ---- | ---- | ----------- | ----- |
24
+ | **budget_id** | **String** | The id of the budget (\&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget) | |
25
+ | **data** | [**PostAccountWrapper**](PostAccountWrapper.md) | The account to create. | |
26
+
27
+ ### Return type
28
+
29
+ [**AccountResponse**](AccountResponse.md)
30
+
31
+
32
+ ## get_account_by_id
33
+
34
+ > <AccountResponse> get_account_by_id(budget_id, account_id)
35
+
36
+ Single account
37
+
38
+ Returns a single account
39
+
40
+ ### Parameters
41
+
42
+ | Name | Type | Description | Notes |
43
+ | ---- | ---- | ----------- | ----- |
44
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
45
+ | **account_id** | **String** | The id of the account | |
46
+
47
+ ### Return type
48
+
49
+ [**AccountResponse**](AccountResponse.md)
50
+
51
+
52
+ ## get_accounts
53
+
54
+ > <AccountsResponse> get_accounts(budget_id, opts)
55
+
56
+ Account list
57
+
58
+ Returns all accounts
59
+
60
+ ### Parameters
61
+
62
+ | Name | Type | Description | Notes |
63
+ | ---- | ---- | ----------- | ----- |
64
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
65
+ | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
66
+
67
+ ### Return type
68
+
69
+ [**AccountsResponse**](AccountsResponse.md)
70
+
@@ -0,0 +1,8 @@
1
+ # YNAB::AccountsResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**AccountsResponseData**](AccountsResponseData.md) | | |
8
+
@@ -0,0 +1,9 @@
1
+ # YNAB::AccountsResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **accounts** | [**Array&lt;Account&gt;**](Account.md) | | |
8
+ | **server_knowledge** | **Integer** | The knowledge of the server | |
9
+
@@ -0,0 +1,9 @@
1
+ # YNAB::AccountsWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **accounts** | [**Array&lt;Account&gt;**](Account.md) | |
7
+ **server_knowledge** | **Integer** | The knowledge of the server |
8
+
9
+
@@ -0,0 +1,24 @@
1
+ # YNAB::BudgetDetail
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **name** | **String** | | |
9
+ | **last_modified_on** | **Time** | The last time any changes were made to the budget from either a web or mobile client | [optional] |
10
+ | **first_month** | **Date** | The earliest budget month | [optional] |
11
+ | **last_month** | **Date** | The latest budget month | [optional] |
12
+ | **date_format** | [**DateFormat**](DateFormat.md) | | [optional] |
13
+ | **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] |
14
+ | **accounts** | [**Array&lt;Account&gt;**](Account.md) | | [optional] |
15
+ | **payees** | [**Array&lt;Payee&gt;**](Payee.md) | | [optional] |
16
+ | **payee_locations** | [**Array&lt;PayeeLocation&gt;**](PayeeLocation.md) | | [optional] |
17
+ | **category_groups** | [**Array&lt;CategoryGroup&gt;**](CategoryGroup.md) | | [optional] |
18
+ | **categories** | [**Array&lt;Category&gt;**](Category.md) | | [optional] |
19
+ | **months** | [**Array&lt;MonthDetail&gt;**](MonthDetail.md) | | [optional] |
20
+ | **transactions** | [**Array&lt;TransactionSummary&gt;**](TransactionSummary.md) | | [optional] |
21
+ | **subtransactions** | [**Array&lt;SubTransaction&gt;**](SubTransaction.md) | | [optional] |
22
+ | **scheduled_transactions** | [**Array&lt;ScheduledTransactionSummary&gt;**](ScheduledTransactionSummary.md) | | [optional] |
23
+ | **scheduled_subtransactions** | [**Array&lt;ScheduledSubTransaction&gt;**](ScheduledSubTransaction.md) | | [optional] |
24
+
@@ -0,0 +1,17 @@
1
+ # YNAB::BudgetDetailAllOf
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **accounts** | [**Array&lt;Account&gt;**](Account.md) | | [optional] |
8
+ | **payees** | [**Array&lt;Payee&gt;**](Payee.md) | | [optional] |
9
+ | **payee_locations** | [**Array&lt;PayeeLocation&gt;**](PayeeLocation.md) | | [optional] |
10
+ | **category_groups** | [**Array&lt;CategoryGroup&gt;**](CategoryGroup.md) | | [optional] |
11
+ | **categories** | [**Array&lt;Category&gt;**](Category.md) | | [optional] |
12
+ | **months** | [**Array&lt;MonthDetail&gt;**](MonthDetail.md) | | [optional] |
13
+ | **transactions** | [**Array&lt;TransactionSummary&gt;**](TransactionSummary.md) | | [optional] |
14
+ | **subtransactions** | [**Array&lt;SubTransaction&gt;**](SubTransaction.md) | | [optional] |
15
+ | **scheduled_transactions** | [**Array&lt;ScheduledTransactionSummary&gt;**](ScheduledTransactionSummary.md) | | [optional] |
16
+ | **scheduled_subtransactions** | [**Array&lt;ScheduledSubTransaction&gt;**](ScheduledSubTransaction.md) | | [optional] |
17
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BudgetDetailResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**BudgetDetailResponseData**](BudgetDetailResponseData.md) | | |
8
+
@@ -0,0 +1,9 @@
1
+ # YNAB::BudgetDetailResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **budget** | [**BudgetDetail**](BudgetDetail.md) | | |
8
+ | **server_knowledge** | **Integer** | The knowledge of the server | |
9
+
@@ -0,0 +1,9 @@
1
+ # YNAB::BudgetDetailWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **budget** | [**BudgetDetail**](BudgetDetail.md) | |
7
+ **server_knowledge** | **Integer** | The knowledge of the server |
8
+
9
+
@@ -0,0 +1,9 @@
1
+ # YNAB::BudgetSettings
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **date_format** | [**DateFormat**](DateFormat.md) | | |
8
+ | **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | |
9
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BudgetSettingsResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**BudgetSettingsResponseData**](BudgetSettingsResponseData.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BudgetSettingsResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **settings** | [**BudgetSettings**](BudgetSettings.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BudgetSettingsWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **settings** | [**BudgetSettings**](BudgetSettings.md) | |
7
+
8
+
@@ -0,0 +1,15 @@
1
+ # YNAB::BudgetSummary
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **name** | **String** | | |
9
+ | **last_modified_on** | **Time** | The last time any changes were made to the budget from either a web or mobile client | [optional] |
10
+ | **first_month** | **Date** | The earliest budget month | [optional] |
11
+ | **last_month** | **Date** | The latest budget month | [optional] |
12
+ | **date_format** | [**DateFormat**](DateFormat.md) | | [optional] |
13
+ | **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] |
14
+ | **accounts** | [**Array&lt;Account&gt;**](Account.md) | The budget accounts (only included if &#x60;include_accounts&#x3D;true&#x60; specified as query parameter) | [optional] |
15
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BudgetSummaryResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**BudgetSummaryResponseData**](BudgetSummaryResponseData.md) | | |
8
+
@@ -0,0 +1,9 @@
1
+ # YNAB::BudgetSummaryResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **budgets** | [**Array&lt;BudgetSummary&gt;**](BudgetSummary.md) | | |
8
+ | **default_budget** | [**BudgetSummary**](BudgetSummary.md) | | [optional] |
9
+
@@ -0,0 +1,9 @@
1
+ # YNAB::BudgetSummaryWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **budgets** | [**Array&lt;BudgetSummary&gt;**](BudgetSummary.md) | |
7
+ **default_budget** | [**BudgetSummary**](BudgetSummary.md) | The default budget, if the associated application is configured to support specifying it |
8
+
9
+
@@ -0,0 +1,68 @@
1
+ # YNAB::BudgetsApi
2
+
3
+ All URIs are relative to *https://api.ynab.com/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_budget_by_id**](BudgetsApi.md#get_budget_by_id) | **GET** /budgets/{budget_id} | Single budget |
8
+ | [**get_budget_settings_by_id**](BudgetsApi.md#get_budget_settings_by_id) | **GET** /budgets/{budget_id}/settings | Budget Settings |
9
+ | [**get_budgets**](BudgetsApi.md#get_budgets) | **GET** /budgets | List budgets |
10
+
11
+
12
+ ## get_budget_by_id
13
+
14
+ > <BudgetDetailResponse> get_budget_by_id(budget_id, opts)
15
+
16
+ Single budget
17
+
18
+ Returns a single budget with all related entities. This resource is effectively a full budget export.
19
+
20
+ ### Parameters
21
+
22
+ | Name | Type | Description | Notes |
23
+ | ---- | ---- | ----------- | ----- |
24
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
25
+ | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included. | [optional] |
26
+
27
+ ### Return type
28
+
29
+ [**BudgetDetailResponse**](BudgetDetailResponse.md)
30
+
31
+
32
+ ## get_budget_settings_by_id
33
+
34
+ > <BudgetSettingsResponse> get_budget_settings_by_id(budget_id)
35
+
36
+ Budget Settings
37
+
38
+ Returns settings for a budget
39
+
40
+ ### Parameters
41
+
42
+ | Name | Type | Description | Notes |
43
+ | ---- | ---- | ----------- | ----- |
44
+ | **budget_id** | **String** | The id of the budget. \&quot;last-used\&quot; can be used to specify the last used budget and \&quot;default\&quot; can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | |
45
+
46
+ ### Return type
47
+
48
+ [**BudgetSettingsResponse**](BudgetSettingsResponse.md)
49
+
50
+
51
+ ## get_budgets
52
+
53
+ > <BudgetSummaryResponse> get_budgets(opts)
54
+
55
+ List budgets
56
+
57
+ Returns budgets list with summary information
58
+
59
+ ### Parameters
60
+
61
+ | Name | Type | Description | Notes |
62
+ | ---- | ---- | ----------- | ----- |
63
+ | **include_accounts** | **Boolean** | Whether to include the list of budget accounts | [optional] |
64
+
65
+ ### Return type
66
+
67
+ [**BudgetSummaryResponse**](BudgetSummaryResponse.md)
68
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BulkIdWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **bulk** | [**BulkIds**](BulkIds.md) | |
7
+
8
+
data/docs/BulkIds.md ADDED
@@ -0,0 +1,9 @@
1
+ # YNAB::BulkIds
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **transaction_ids** | **Array&lt;String&gt;** | The list of Transaction ids that were created. |
7
+ **duplicate_import_ids** | **Array&lt;String&gt;** | If any Transactions were not created because they had an import_id matching a transaction already on the same account, the specified import_id(s) will be included in this list. |
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BulkResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**BulkResponseData**](BulkResponseData.md) | | |
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BulkResponseData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **bulk** | [**BulkResponseDataBulk**](BulkResponseDataBulk.md) | | |
8
+
@@ -0,0 +1,9 @@
1
+ # YNAB::BulkResponseDataBulk
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **transaction_ids** | **Array&lt;String&gt;** | The list of Transaction ids that were created. | |
8
+ | **duplicate_import_ids** | **Array&lt;String&gt;** | If any Transactions were not created because they had an &#x60;import_id&#x60; matching a transaction already on the same account, the specified import_id(s) will be included in this list. | |
9
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BulkTransactionCreateResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **data** | [**BulkTransactionIds**](BulkTransactionIds.md) | |
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BulkTransactionIds
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **transaction_ids** | **Array&lt;String&gt;** | |
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # YNAB::BulkTransactions
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **transactions** | [**Array&lt;SaveTransaction&gt;**](SaveTransaction.md) | | |
8
+