ynab 3.2.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +2 -0
  4. data/Rakefile +6 -5
  5. data/config.yaml +11 -0
  6. data/docs/ExistingTransaction.md +1 -1
  7. data/docs/NewTransaction.md +1 -1
  8. data/docs/PostScheduledTransactionWrapper.md +8 -0
  9. data/docs/SaveScheduledTransaction.md +16 -0
  10. data/docs/SaveTransactionWithIdOrImportId.md +1 -1
  11. data/docs/SaveTransactionWithOptionalFields.md +1 -1
  12. data/docs/{SaveTransactionWithIdAllOf.md → ScheduledTransactionFrequency.md} +1 -2
  13. data/docs/ScheduledTransactionsApi.md +21 -0
  14. data/docs/TransactionsApi.md +25 -1
  15. data/lib/ynab/api/accounts_api.rb +1 -4
  16. data/lib/ynab/api/budgets_api.rb +1 -4
  17. data/lib/ynab/api/categories_api.rb +1 -4
  18. data/lib/ynab/api/months_api.rb +1 -4
  19. data/lib/ynab/api/payee_locations_api.rb +1 -4
  20. data/lib/ynab/api/payees_api.rb +1 -4
  21. data/lib/ynab/api/scheduled_transactions_api.rb +75 -4
  22. data/lib/ynab/api/transactions_api.rb +81 -6
  23. data/lib/ynab/api/user_api.rb +1 -4
  24. data/lib/ynab/api_client.rb +1 -4
  25. data/lib/ynab/api_error.rb +0 -12
  26. data/lib/ynab/configuration.rb +11 -4
  27. data/lib/ynab/models/account.rb +1 -4
  28. data/lib/ynab/models/account_response.rb +1 -4
  29. data/lib/ynab/models/account_response_data.rb +1 -4
  30. data/lib/ynab/models/account_type.rb +1 -4
  31. data/lib/ynab/models/accounts_response.rb +1 -4
  32. data/lib/ynab/models/accounts_response_data.rb +1 -4
  33. data/lib/ynab/models/budget_detail.rb +1 -4
  34. data/lib/ynab/models/budget_detail_response.rb +1 -4
  35. data/lib/ynab/models/budget_detail_response_data.rb +1 -4
  36. data/lib/ynab/models/budget_settings.rb +1 -4
  37. data/lib/ynab/models/budget_settings_response.rb +1 -4
  38. data/lib/ynab/models/budget_settings_response_data.rb +1 -4
  39. data/lib/ynab/models/budget_summary.rb +1 -4
  40. data/lib/ynab/models/budget_summary_response.rb +1 -4
  41. data/lib/ynab/models/budget_summary_response_data.rb +1 -4
  42. data/lib/ynab/models/bulk_response.rb +1 -4
  43. data/lib/ynab/models/bulk_response_data.rb +1 -4
  44. data/lib/ynab/models/bulk_response_data_bulk.rb +1 -4
  45. data/lib/ynab/models/bulk_transactions.rb +1 -4
  46. data/lib/ynab/models/categories_response.rb +1 -4
  47. data/lib/ynab/models/categories_response_data.rb +1 -4
  48. data/lib/ynab/models/category.rb +1 -4
  49. data/lib/ynab/models/category_group.rb +1 -4
  50. data/lib/ynab/models/category_group_with_categories.rb +1 -4
  51. data/lib/ynab/models/category_response.rb +1 -4
  52. data/lib/ynab/models/category_response_data.rb +1 -4
  53. data/lib/ynab/models/currency_format.rb +1 -4
  54. data/lib/ynab/models/date_format.rb +1 -4
  55. data/lib/ynab/models/error_detail.rb +1 -4
  56. data/lib/ynab/models/error_response.rb +1 -4
  57. data/lib/ynab/models/existing_transaction.rb +2 -5
  58. data/lib/ynab/models/hybrid_transaction.rb +1 -4
  59. data/lib/ynab/models/hybrid_transactions_response.rb +1 -4
  60. data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -4
  61. data/lib/ynab/models/month_detail.rb +1 -4
  62. data/lib/ynab/models/month_detail_response.rb +1 -4
  63. data/lib/ynab/models/month_detail_response_data.rb +1 -4
  64. data/lib/ynab/models/month_summaries_response.rb +1 -4
  65. data/lib/ynab/models/month_summaries_response_data.rb +1 -4
  66. data/lib/ynab/models/month_summary.rb +1 -4
  67. data/lib/ynab/models/new_transaction.rb +2 -5
  68. data/lib/ynab/models/patch_category_wrapper.rb +1 -4
  69. data/lib/ynab/models/patch_month_category_wrapper.rb +1 -4
  70. data/lib/ynab/models/patch_payee_wrapper.rb +1 -4
  71. data/lib/ynab/models/patch_transactions_wrapper.rb +1 -4
  72. data/lib/ynab/models/payee.rb +1 -4
  73. data/lib/ynab/models/payee_location.rb +1 -4
  74. data/lib/ynab/models/payee_location_response.rb +1 -4
  75. data/lib/ynab/models/payee_location_response_data.rb +1 -4
  76. data/lib/ynab/models/payee_locations_response.rb +1 -4
  77. data/lib/ynab/models/payee_locations_response_data.rb +1 -4
  78. data/lib/ynab/models/payee_response.rb +1 -4
  79. data/lib/ynab/models/payee_response_data.rb +1 -4
  80. data/lib/ynab/models/payees_response.rb +1 -4
  81. data/lib/ynab/models/payees_response_data.rb +1 -4
  82. data/lib/ynab/models/post_account_wrapper.rb +1 -4
  83. data/lib/ynab/models/{save_transaction_with_id_all_of.rb → post_scheduled_transaction_wrapper.rb} +23 -32
  84. data/lib/ynab/models/post_transactions_wrapper.rb +1 -4
  85. data/lib/ynab/models/put_transaction_wrapper.rb +1 -4
  86. data/lib/ynab/models/save_account.rb +1 -4
  87. data/lib/ynab/models/save_category.rb +1 -4
  88. data/lib/ynab/models/save_category_response.rb +1 -4
  89. data/lib/ynab/models/save_category_response_data.rb +1 -4
  90. data/lib/ynab/models/save_month_category.rb +1 -4
  91. data/lib/ynab/models/save_payee.rb +1 -4
  92. data/lib/ynab/models/save_payee_response.rb +1 -4
  93. data/lib/ynab/models/save_payee_response_data.rb +1 -4
  94. data/lib/ynab/models/{hybrid_transaction_all_of.rb → save_scheduled_transaction.rb} +99 -62
  95. data/lib/ynab/models/save_sub_transaction.rb +1 -4
  96. data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +2 -5
  97. data/lib/ynab/models/save_transaction_with_optional_fields.rb +2 -5
  98. data/lib/ynab/models/save_transactions_response.rb +1 -4
  99. data/lib/ynab/models/save_transactions_response_data.rb +1 -4
  100. data/lib/ynab/models/scheduled_sub_transaction.rb +1 -4
  101. data/lib/ynab/models/scheduled_transaction_detail.rb +1 -4
  102. data/lib/ynab/models/scheduled_transaction_frequency.rb +48 -0
  103. data/lib/ynab/models/scheduled_transaction_response.rb +1 -4
  104. data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -4
  105. data/lib/ynab/models/scheduled_transaction_summary.rb +1 -4
  106. data/lib/ynab/models/scheduled_transactions_response.rb +1 -4
  107. data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -4
  108. data/lib/ynab/models/sub_transaction.rb +1 -4
  109. data/lib/ynab/models/transaction_cleared_status.rb +1 -4
  110. data/lib/ynab/models/transaction_detail.rb +1 -4
  111. data/lib/ynab/models/transaction_flag_color.rb +1 -4
  112. data/lib/ynab/models/transaction_response.rb +1 -4
  113. data/lib/ynab/models/transaction_response_data.rb +1 -4
  114. data/lib/ynab/models/transaction_summary.rb +1 -4
  115. data/lib/ynab/models/transactions_import_response.rb +1 -4
  116. data/lib/ynab/models/transactions_import_response_data.rb +1 -4
  117. data/lib/ynab/models/transactions_response.rb +1 -4
  118. data/lib/ynab/models/transactions_response_data.rb +1 -4
  119. data/lib/ynab/models/user.rb +1 -4
  120. data/lib/ynab/models/user_response.rb +1 -4
  121. data/lib/ynab/models/user_response_data.rb +1 -4
  122. data/lib/ynab/overrides/transactions_api.rb +0 -12
  123. data/lib/ynab/version.rb +1 -13
  124. data/lib/ynab.rb +4 -4
  125. data/open_api_spec.yaml +190 -4
  126. data/spec/api/scheduled_transactions_spec.rb +20 -2
  127. data/spec/api/transactions_spec.rb +10 -0
  128. data/spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml +63 -0
  129. data/spec/fixtures/vcr_cassettes/month_transactions.yml +46 -0
  130. data/templates/README.md +3 -0
  131. data/templates/api_info.mustache +9 -0
  132. data/templates/gemspec.mustache +41 -0
  133. data/ynab.gemspec +3 -6
  134. metadata +50 -84
  135. data/docs/AccountWrapper.md +0 -8
  136. data/docs/AccountsWrapper.md +0 -9
  137. data/docs/BudgetDetailAllOf.md +0 -17
  138. data/docs/BudgetDetailWrapper.md +0 -9
  139. data/docs/BudgetSettingsWrapper.md +0 -8
  140. data/docs/BudgetSummaryWrapper.md +0 -9
  141. data/docs/BulkIdWrapper.md +0 -8
  142. data/docs/BulkIds.md +0 -9
  143. data/docs/BulkTransactionCreateResponse.md +0 -8
  144. data/docs/BulkTransactionIds.md +0 -8
  145. data/docs/CategoryGroupWithCategoriesAllOf.md +0 -8
  146. data/docs/CategoryGroupsWrapper.md +0 -9
  147. data/docs/CategoryWrapper.md +0 -9
  148. data/docs/DeprecatedApi.md +0 -28
  149. data/docs/HybridTransactionAllOf.md +0 -12
  150. data/docs/HybridTransactionsWrapper.md +0 -8
  151. data/docs/LoanAccountPeriodicValue.md +0 -7
  152. data/docs/MonthDetailAllOf.md +0 -8
  153. data/docs/MonthDetailWrapper.md +0 -8
  154. data/docs/MonthSummariesWrapper.md +0 -9
  155. data/docs/PayeeLocationWrapper.md +0 -8
  156. data/docs/PayeeLocationsWrapper.md +0 -8
  157. data/docs/PayeeWrapper.md +0 -8
  158. data/docs/PayeesWrapper.md +0 -9
  159. data/docs/SaveAccountWrapper.md +0 -8
  160. data/docs/SaveMonthCategoryWrapper.md +0 -8
  161. data/docs/SaveTransaction.md +0 -19
  162. data/docs/SaveTransactionWithId.md +0 -20
  163. data/docs/SaveTransactionWrapper.md +0 -8
  164. data/docs/SaveTransactionsWrapper.md +0 -9
  165. data/docs/ScheduledTransactionDetailAllOf.md +0 -11
  166. data/docs/ScheduledTransactionWrapper.md +0 -8
  167. data/docs/ScheduledTransactionsWrapper.md +0 -8
  168. data/docs/TransactionDetailAllOf.md +0 -11
  169. data/docs/TransactionWrapper.md +0 -8
  170. data/docs/TransactionsWrapper.md +0 -9
  171. data/docs/UpdateTransaction.md +0 -20
  172. data/docs/UpdateTransactionsWrapper.md +0 -8
  173. data/docs/UserWrapper.md +0 -8
  174. data/lib/ynab/models/budget_detail_all_of.rb +0 -320
  175. data/lib/ynab/models/category_group_with_categories_all_of.rb +0 -223
  176. data/lib/ynab/models/month_detail_all_of.rb +0 -223
  177. data/lib/ynab/models/save_transaction.rb +0 -401
  178. data/lib/ynab/models/save_transaction_with_id.rb +0 -411
  179. data/lib/ynab/models/scheduled_transaction_detail_all_of.rb +0 -254
  180. data/lib/ynab/models/transaction_detail_all_of.rb +0 -254
@@ -3,10 +3,7 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.70.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
6
+ Generated by: OpenAPI Generator (https://openapi-generator.tech)
10
7
 
11
8
  =end
12
9
 
@@ -3,10 +3,7 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.70.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
6
+ Generated by: OpenAPI Generator (https://openapi-generator.tech)
10
7
 
11
8
  =end
12
9
 
@@ -3,10 +3,7 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.70.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
6
+ Generated by: OpenAPI Generator (https://openapi-generator.tech)
10
7
 
11
8
  =end
12
9
 
@@ -1,15 +1,3 @@
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
1
  require 'uri'
14
2
  require 'ynab/api/deprecated_api'
15
3
 
data/lib/ynab/version.rb CHANGED
@@ -1,15 +1,3 @@
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
1
  module YNAB
14
- VERSION = '3.2.0'
2
+ VERSION = '3.4.0'
15
3
  end
data/lib/ynab.rb CHANGED
@@ -3,10 +3,7 @@
3
3
 
4
4
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
5
5
 
6
- The version of the OpenAPI document: 1.70.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
6
+ Generated by: OpenAPI Generator (https://openapi-generator.tech)
10
7
 
11
8
  =end
12
9
 
@@ -73,6 +70,7 @@ require 'ynab/models/payee_response_data'
73
70
  require 'ynab/models/payees_response'
74
71
  require 'ynab/models/payees_response_data'
75
72
  require 'ynab/models/post_account_wrapper'
73
+ require 'ynab/models/post_scheduled_transaction_wrapper'
76
74
  require 'ynab/models/post_transactions_wrapper'
77
75
  require 'ynab/models/put_transaction_wrapper'
78
76
  require 'ynab/models/save_account'
@@ -83,6 +81,7 @@ require 'ynab/models/save_month_category'
83
81
  require 'ynab/models/save_payee'
84
82
  require 'ynab/models/save_payee_response'
85
83
  require 'ynab/models/save_payee_response_data'
84
+ require 'ynab/models/save_scheduled_transaction'
86
85
  require 'ynab/models/save_sub_transaction'
87
86
  require 'ynab/models/save_transaction_with_id_or_import_id'
88
87
  require 'ynab/models/save_transaction_with_optional_fields'
@@ -90,6 +89,7 @@ require 'ynab/models/save_transactions_response'
90
89
  require 'ynab/models/save_transactions_response_data'
91
90
  require 'ynab/models/scheduled_sub_transaction'
92
91
  require 'ynab/models/scheduled_transaction_detail'
92
+ require 'ynab/models/scheduled_transaction_frequency'
93
93
  require 'ynab/models/scheduled_transaction_response'
94
94
  require 'ynab/models/scheduled_transaction_response_data'
95
95
  require 'ynab/models/scheduled_transaction_summary'
data/open_api_spec.yaml CHANGED
@@ -6,7 +6,7 @@ info:
6
6
  upon HTTPS for transport. We respond with meaningful HTTP response codes and
7
7
  if an error occurs, we include error details in the response body. API
8
8
  Documentation is at https://api.ynab.com
9
- version: 1.70.0
9
+ version: 1.72.0
10
10
  servers:
11
11
  - url: https://api.ynab.com/v1
12
12
  security:
@@ -959,8 +959,8 @@ paths:
959
959
  Creates a single transaction or multiple transactions. If you provide a
960
960
  body containing a `transaction` object, a single transaction will be
961
961
  created and if you provide a body containing a `transactions` array,
962
- multiple transactions will be created. Scheduled transactions cannot be
963
- created on this endpoint.
962
+ multiple transactions will be created. Scheduled transactions (transactions with a future date)
963
+ cannot be created on this endpoint.
964
964
  operationId: createTransaction
965
965
  parameters:
966
966
  - name: budget_id
@@ -1425,6 +1425,76 @@ paths:
1425
1425
  application/json:
1426
1426
  schema:
1427
1427
  $ref: "#/components/schemas/ErrorResponse"
1428
+ /budgets/{budget_id}/months/{month}/transactions:
1429
+ get:
1430
+ tags:
1431
+ - Transactions
1432
+ summary: List transactions in month, excluding any pending transactions
1433
+ description: Returns all transactions for a specified month
1434
+ operationId: getTransactionsByMonth
1435
+ parameters:
1436
+ - name: budget_id
1437
+ in: path
1438
+ description: >-
1439
+ The id of the budget. "last-used" can be used to specify the last
1440
+ used budget and "default" can be used if default budget selection is
1441
+ enabled (see: https://api.ynab.com/#oauth-default-budget).
1442
+ required: true
1443
+ schema:
1444
+ type: string
1445
+ - name: month
1446
+ in: path
1447
+ description: >-
1448
+ The budget month in ISO format (e.g. 2016-12-01) ("current" can also
1449
+ be used to specify the current calendar month (UTC))
1450
+ required: true
1451
+ schema:
1452
+ type: string
1453
+ - name: since_date
1454
+ in: query
1455
+ description: >-
1456
+ If specified, only transactions on or after this date will be
1457
+ included. The date should be ISO formatted (e.g. 2016-12-30).
1458
+ schema:
1459
+ type: string
1460
+ format: date
1461
+ - name: type
1462
+ in: query
1463
+ description: >-
1464
+ If specified, only transactions of the specified type will be
1465
+ included. "uncategorized" and "unapproved" are currently supported.
1466
+ schema:
1467
+ type: string
1468
+ enum:
1469
+ - uncategorized
1470
+ - unapproved
1471
+ - name: last_knowledge_of_server
1472
+ in: query
1473
+ description: >-
1474
+ The starting server knowledge. If provided, only entities that have
1475
+ changed since `last_knowledge_of_server` will be included.
1476
+ schema:
1477
+ type: integer
1478
+ format: int64
1479
+ responses:
1480
+ "200":
1481
+ description: The list of requested transactions
1482
+ content:
1483
+ application/json:
1484
+ schema:
1485
+ $ref: "#/components/schemas/HybridTransactionsResponse"
1486
+ "404":
1487
+ description: No transactions were found
1488
+ content:
1489
+ application/json:
1490
+ schema:
1491
+ $ref: "#/components/schemas/ErrorResponse"
1492
+ default:
1493
+ description: An error occurred
1494
+ content:
1495
+ application/json:
1496
+ schema:
1497
+ $ref: "#/components/schemas/ErrorResponse"
1428
1498
  /budgets/{budget_id}/scheduled_transactions:
1429
1499
  get:
1430
1500
  tags:
@@ -1469,6 +1539,47 @@ paths:
1469
1539
  application/json:
1470
1540
  schema:
1471
1541
  $ref: "#/components/schemas/ErrorResponse"
1542
+ post:
1543
+ tags:
1544
+ - Scheduled Transactions
1545
+ summary: Create a single scheduled transaction
1546
+ description: >-
1547
+ Creates a single scheduled transaction.
1548
+ operationId: createScheduledTransaction
1549
+ parameters:
1550
+ - name: budget_id
1551
+ in: path
1552
+ description: >-
1553
+ The id of the budget. "last-used" can be used to specify the last
1554
+ used budget and "default" can be used if default budget selection is
1555
+ enabled (see: https://api.ynab.com/#oauth-default-budget).
1556
+ required: true
1557
+ schema:
1558
+ type: string
1559
+ requestBody:
1560
+ description: >-
1561
+ The scheduled transaction to create
1562
+ content:
1563
+ "application/json":
1564
+ schema:
1565
+ $ref: "#/components/schemas/PostScheduledTransactionWrapper"
1566
+ required: true
1567
+ responses:
1568
+ "201":
1569
+ description: The scheduled transaction was successfully created
1570
+ content:
1571
+ application/json:
1572
+ schema:
1573
+ $ref: "#/components/schemas/ScheduledTransactionResponse"
1574
+ "400":
1575
+ description: >-
1576
+ The request could not be understood due to malformed syntax or
1577
+ validation error(s).
1578
+ content:
1579
+ application/json:
1580
+ schema:
1581
+ $ref: "#/components/schemas/ErrorResponse"
1582
+ x-codegen-request-body-name: data
1472
1583
  /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}:
1473
1584
  get:
1474
1585
  tags:
@@ -2401,7 +2512,7 @@ components:
2401
2512
  The payee for the transaction. To create a transfer between two
2402
2513
  accounts, use the account transfer payee pointing to the target
2403
2514
  account. Account transfer payees are specified as
2404
- `tranfer_payee_id` on the account resource.
2515
+ `transfer_payee_id` on the account resource.
2405
2516
  format: uuid
2406
2517
  payee_name:
2407
2518
  maxLength: 50
@@ -2875,6 +2986,64 @@ components:
2875
2986
  properties:
2876
2987
  scheduled_transaction:
2877
2988
  $ref: "#/components/schemas/ScheduledTransactionDetail"
2989
+ PostScheduledTransactionWrapper:
2990
+ required:
2991
+ - scheduled_transaction
2992
+ type: object
2993
+ properties:
2994
+ scheduled_transaction:
2995
+ $ref: "#/components/schemas/SaveScheduledTransaction"
2996
+ SaveScheduledTransaction:
2997
+ required:
2998
+ - account_id
2999
+ - date
3000
+ type: object
3001
+ properties:
3002
+ account_id:
3003
+ type: string
3004
+ format: uuid
3005
+ date:
3006
+ type: string
3007
+ description: >-
3008
+ The scheduled transaction date in ISO format (e.g. 2016-12-01).
3009
+ format: date
3010
+ amount:
3011
+ type: integer
3012
+ description: >-
3013
+ The scheduled transaction amount in milliunits format.
3014
+ format: int64
3015
+ payee_id:
3016
+ type: string
3017
+ nullable: true
3018
+ description: >-
3019
+ The payee for the scheduled transaction. To create a transfer between two
3020
+ accounts, use the account transfer payee pointing to the target
3021
+ account. Account transfer payees are specified as
3022
+ `transfer_payee_id` on the account resource.
3023
+ format: uuid
3024
+ payee_name:
3025
+ maxLength: 50
3026
+ type: string
3027
+ nullable: true
3028
+ description: >-
3029
+ The payee name for the the scheduled transaction. If a `payee_name` value is provided and `payee_id`
3030
+ has a null value, the `payee_name` value will be used to resolve the
3031
+ payee by either (1) a payee with the same name or (2) creation of a new payee.
3032
+ category_id:
3033
+ type: string
3034
+ nullable: true
3035
+ description: >-
3036
+ The category for the scheduled transaction. Credit Card Payment categories are not permitted.
3037
+ Creating a split scheduled transaction is not currently supported.
3038
+ format: uuid
3039
+ memo:
3040
+ maxLength: 200
3041
+ type: string
3042
+ nullable: true
3043
+ flag_color:
3044
+ $ref: "#/components/schemas/TransactionFlagColor"
3045
+ frequency:
3046
+ $ref: "#/components/schemas/ScheduledTransactionFrequency"
2878
3047
  ScheduledTransactionSummary:
2879
3048
  required:
2880
3049
  - account_id
@@ -3127,6 +3296,23 @@ components:
3127
3296
  - cleared
3128
3297
  - uncleared
3129
3298
  - reconciled
3299
+ ScheduledTransactionFrequency:
3300
+ type: string
3301
+ description: The scheduled transaction frequency
3302
+ enum:
3303
+ - never
3304
+ - daily
3305
+ - weekly
3306
+ - everyOtherWeek
3307
+ - twiceAMonth
3308
+ - every4Weeks
3309
+ - monthly
3310
+ - everyOtherMonth
3311
+ - every3Months
3312
+ - every4Months
3313
+ - twiceAYear
3314
+ - yearly
3315
+ - everyOtherYear
3130
3316
  securitySchemes:
3131
3317
  bearer:
3132
3318
  type: http
@@ -34,7 +34,7 @@ describe 'scheduled transactions' do
34
34
  end
35
35
  end
36
36
 
37
- describe 'GET /budgets/{budget_id}/transactions' do
37
+ describe 'GET /budgets/{budget_id}/scheduled_transactions' do
38
38
  it 'returns a list of transactions' do
39
39
  VCR.use_cassette("scheduled_transactions") do
40
40
  response = instance.get_scheduled_transactions(budget_id)
@@ -44,7 +44,7 @@ describe 'scheduled transactions' do
44
44
  end
45
45
  end
46
46
 
47
- describe 'GET /budgets/{budget_id}/transaction/{payee_id}' do
47
+ describe 'GET /budgets/{budget_id}/scheduled_transactions/{payee_id}' do
48
48
  it 'returns a payee' do
49
49
  VCR.use_cassette("scheduled_transaction") do
50
50
  response = instance.get_scheduled_transaction_by_id(budget_id, '1a8e4929-3ad1-4859-8443-2aeeab0684ab')
@@ -53,4 +53,22 @@ describe 'scheduled transactions' do
53
53
  end
54
54
  end
55
55
  end
56
+
57
+ describe 'POST /budgets/{budget_id}/scheduled_transactions' do
58
+ it 'creates a scheduled transaction' do
59
+ VCR.use_cassette("create_scheduled_transaction") do
60
+ response = instance.create_scheduled_transaction(budget_id, {
61
+ scheduled_transaction: {
62
+ date: "#{Time.now.year + 1}-01-01",
63
+ account_id: '49b0c987-7d2b-46ec-ba14-f8a7e79fb830',
64
+ amount: 20000,
65
+ frequency: 'weekly',
66
+ }
67
+ })
68
+ expect(client.last_request.response.options[:code]).to be 201
69
+ expect(response.data.scheduled_transaction).to be
70
+ expect(response.data.scheduled_transaction.amount).to eq 20000
71
+ end
72
+ end
73
+ end
56
74
  end
@@ -66,6 +66,16 @@ describe 'transactions' do
66
66
  end
67
67
  end
68
68
 
69
+ describe 'GET /budgets/{budget_id}/months/{month}/transactions' do
70
+ it 'returns a list of transactions for a month' do
71
+ VCR.use_cassette("month_transactions") do
72
+ response = instance.get_transactions_by_month(budget_id, "2024-07-01")
73
+ expect(client.last_request.response.options[:code]).to be 200
74
+ expect(response.data.transactions.length).to be 2
75
+ end
76
+ end
77
+ end
78
+
69
79
  describe 'GET /budgets/{budget_id}/transaction/{transaction_id}' do
70
80
  it 'returns a transaction' do
71
81
  VCR.use_cassette("transaction") do
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"scheduled_transaction":{"date":"2025-01-01","account_id":"49b0c987-7d2b-46ec-ba14-f8a7e79fb830","amount":20000,"frequency":"weekly"}}'
9
+ headers:
10
+ User-Agent:
11
+ - api_client/ruby/3.2.0
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ Authorization:
17
+ - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045
18
+ Expect:
19
+ - ''
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ x-frame-options:
26
+ - deny
27
+ x-xss-protection:
28
+ - '0'
29
+ x-content-type-options:
30
+ - nosniff
31
+ x-download-options:
32
+ - noopen
33
+ x-permitted-cross-domain-policies:
34
+ - none
35
+ referrer-policy:
36
+ - strict-origin-when-cross-origin
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ vary:
40
+ - Accept-Encoding, Origin
41
+ etag:
42
+ - W/"a2fe3b102465b2515af0f411970ca861"
43
+ cache-control:
44
+ - max-age=0, private, must-revalidate
45
+ x-request-id:
46
+ - 0ccaa271-1563-4ab8-a6ad-db09893e62db
47
+ x-runtime:
48
+ - '0.104987'
49
+ server-timing:
50
+ - start_processing.action_controller;dur=0.01, sql.active_record;dur=31.01,
51
+ instantiation.active_record;dur=0.56, cache_read.active_support;dur=0.21,
52
+ cache_fetch_hit.active_support;dur=0.00, transaction.active_record;dur=26.93,
53
+ render.active_model_serializers;dur=15.03, process_action.action_controller;dur=50.91
54
+ Content-Length:
55
+ - '463'
56
+ body:
57
+ encoding: ASCII-8BIT
58
+ string: '{"data":{"scheduled_transaction":{"id":"5901eada-db36-4d95-b737-c1a5cc43a915","date_first":"2025-01-01","date_next":"2025-01-01","frequency":"weekly","amount":20000,"memo":null,"flag_color":null,"flag_name":null,"account_id":"49b0c987-7d2b-46ec-ba14-f8a7e79fb830","account_name":"Checking","payee_id":null,"payee_name":null,"category_id":null,"category_name":"Uncategorized","transfer_account_id":null,"deleted":false,"subtransactions":[]},"server_knowledge":64}}'
59
+ http_version: '1.1'
60
+ adapter_metadata:
61
+ effective_url: http://localhost:3000/papi/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions
62
+ recorded_at: Mon, 08 Jul 2024 23:16:33 GMT
63
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months/2024-07-01/transactions
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - api_client/ruby/0.4.0
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ Authorization:
17
+ - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045
18
+ Expect:
19
+ - ''
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Vary:
28
+ - Accept-Encoding, Origin
29
+ ETag:
30
+ - W/"d2b4b29be1231be9847defe032df6712"
31
+ Cache-Control:
32
+ - max-age=0, private, must-revalidate
33
+ X-Request-Id:
34
+ - b79f3971-7666-4b04-8d8b-bd5258dd02bc
35
+ X-Runtime:
36
+ - '0.186443'
37
+ Transfer-Encoding:
38
+ - chunked
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"data":{"transactions":[{"type":"subtransaction","id":"008908a3-07c2-4684-b4c1-6f1024814f8d","parent_transaction_id":"910a79e1-29f5-4789-a2a0-2a69c2f94a2b","date":"2018-03-26","amount":-15000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"b457e34a-234e-40b2-992e-40055171e644","transfer_account_id":null,"import_id":null},{"type":"transaction","id":"d477e91a-1f2b-4df5-8069-6b61dee51259","parent_transaction_id":null,"date":"2018-03-27","amount":-13000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"84ffe61c-081c-44db-ad23-6ee809206c40","transfer_account_id":null,"import_id":null}]}}'
42
+ http_version: '1.1'
43
+ adapter_metadata:
44
+ effective_url: http://api.localhost:3000/v1/budgets/6e6aa585-8537-4afc-950f-93d55fac17fa/months/2024-07-01/transactions
45
+ recorded_at: Tue, 27 Mar 2018 17:03:22 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,3 @@
1
+ This directory contains override templates for generating Ruby code from the OpenAPI spec. They modify the default behavior or the generator.
2
+
3
+ The source for these are located at https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/ruby-client.
@@ -0,0 +1,9 @@
1
+ {{#appName}}
2
+ #{{{.}}}
3
+
4
+ {{/appName}}
5
+ {{#appDescription}}
6
+ #{{{.}}}
7
+ {{/appDescription}}
8
+ {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}}
9
+ Generated by: OpenAPI Generator (https://openapi-generator.tech)
@@ -0,0 +1,41 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ {{> api_info}}
5
+ =end
6
+
7
+ $:.push File.expand_path("../lib", __FILE__)
8
+ require "{{gemName}}/version"
9
+
10
+ Gem::Specification.new do |s|
11
+ s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}"
12
+ s.version = {{moduleName}}::VERSION
13
+ s.platform = Gem::Platform::RUBY
14
+ s.authors = ["{{gemAuthor}}{{^gemAuthor}}OpenAPI-Generator{{/gemAuthor}}"]
15
+ s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"]
16
+ s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://openapi-generator.tech{{/gemHomepage}}"
17
+ s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}"
18
+ s.description = "{{gemDescription}}{{^gemDescription}}{{{appDescription}}}{{^appDescription}}{{{appName}}} Ruby Gem{{/appDescription}}{{/gemDescription}} Generated from server specification version {{version}} using OpenAPI Generator version {{generatorVersion}}."
19
+ s.license = "{{{gemLicense}}}{{^gemLicense}}Unlicense{{/gemLicense}}"
20
+ s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 2.7{{/gemRequiredRubyVersion}}"
21
+ s.metadata = {{{gemMetadata}}}{{^gemMetadata}}{}{{/gemMetadata}}
22
+
23
+ {{#isFaraday}}
24
+ s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
25
+ s.add_runtime_dependency 'faraday-multipart'
26
+ s.add_runtime_dependency 'marcel'
27
+ {{/isFaraday}}
28
+ {{#isTyphoeus}}
29
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
30
+ {{/isTyphoeus}}
31
+ {{#isHttpx}}
32
+ s.add_runtime_dependency 'httpx', '~> 1.0', '>= 1.0.0'
33
+ {{/isHttpx}}
34
+
35
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
36
+
37
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
38
+ s.test_files = `find spec/*`.split("\n")
39
+ s.executables = []
40
+ s.require_paths = ["lib"]
41
+ end
data/ynab.gemspec CHANGED
@@ -5,10 +5,7 @@
5
5
 
6
6
  #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
7
7
 
8
- The version of the OpenAPI document: 1.70.0
9
-
10
- Generated by: https://openapi-generator.tech
11
- Generator version: 7.6.0
8
+ Generated by: OpenAPI Generator (https://openapi-generator.tech)
12
9
 
13
10
  =end
14
11
 
@@ -22,8 +19,8 @@ Gem::Specification.new do |s|
22
19
  s.authors = ["YNAB"]
23
20
  s.email = ["api@ynab.com"]
24
21
  s.homepage = "https://github.com/ynab/ynab-sdk-ruby"
25
- s.summary = "YNAB API Endpoints Ruby Gem"
26
- s.description = "Ruby gem wrapper for the YNAB API. Read the documentation at https://api.ynab.com"
22
+ s.summary = "YNAB API Client for Ruby"
23
+ s.description = "Ruby gem wrapper for the YNAB API. Generated from server specification version 1.72.0 using OpenAPI Generator version 7.7.0."
27
24
  s.license = "Apache-2.0"
28
25
  s.required_ruby_version = ">= 3.3"
29
26
  s.metadata = {}