Skip to content

Commit 9b6645b

Browse files
committed
Generate from server version 1.74.0
-New PUT and DELETE (update and delete) endpoints for scheduled_transactions. -payee_name and category_name fields have been added to subtransactions objects in scheduled transaction responses. -The goal_target amount for a category can now be updated.
1 parent e8dd3ef commit 9b6645b

20 files changed

+560
-17
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ docs/PayeesResponseData.md
6464
docs/PostAccountWrapper.md
6565
docs/PostScheduledTransactionWrapper.md
6666
docs/PostTransactionsWrapper.md
67+
docs/PutScheduledTransactionWrapper.md
6768
docs/PutTransactionWrapper.md
6869
docs/SaveAccount.md
6970
docs/SaveCategory.md
@@ -174,6 +175,7 @@ lib/ynab/models/payees_response_data.rb
174175
lib/ynab/models/post_account_wrapper.rb
175176
lib/ynab/models/post_scheduled_transaction_wrapper.rb
176177
lib/ynab/models/post_transactions_wrapper.rb
178+
lib/ynab/models/put_scheduled_transaction_wrapper.rb
177179
lib/ynab/models/put_transaction_wrapper.rb
178180
lib/ynab/models/save_account.rb
179181
lib/ynab/models/save_category.rb

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.7.0
1+
7.12.0

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
ynab (3.5.0)
4+
ynab (3.6.0)
55
typhoeus (~> 1.0, >= 1.0.1)
66

77
GEM
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# YNAB::PutScheduledTransactionWrapper
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **scheduled_transaction** | [**SaveScheduledTransaction**](SaveScheduledTransaction.md) | | |
8+

docs/SaveCategory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
| **name** | **String** | | [optional] |
88
| **note** | **String** | | [optional] |
99
| **category_group_id** | **String** | | [optional] |
10+
| **goal_target** | **Integer** | The goal target amount in milliunits format. This amount can only be changed if the category already has a configured goal (goal_type != null). | [optional] |
1011

docs/ScheduledSubTransaction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
| **amount** | **Integer** | The scheduled subtransaction amount in milliunits format | |
1010
| **memo** | **String** | | [optional] |
1111
| **payee_id** | **String** | | [optional] |
12+
| **payee_name** | **String** | | [optional] |
1213
| **category_id** | **String** | | [optional] |
14+
| **category_name** | **String** | | [optional] |
1315
| **transfer_account_id** | **String** | If a transfer, the account_id which the scheduled subtransaction transfers to | [optional] |
1416
| **deleted** | **Boolean** | Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. | |
1517

docs/ScheduledTransactionsApi.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ All URIs are relative to *https://api.ynab.com/v1*
55
| Method | HTTP request | Description |
66
| ------ | ------------ | ----------- |
77
| [**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /budgets/{budget_id}/scheduled_transactions | Create a single scheduled transaction |
8+
| [**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /budgets/{budget_id}/scheduled_transactions | Deletes an existing scheduled transaction |
89
| [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction |
910
| [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /budgets/{budget_id}/scheduled_transactions | List scheduled transactions |
11+
| [**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /budgets/{budget_id}/scheduled_transactions | Updates an existing scheduled transaction |
1012

1113

1214
## create_scheduled_transaction
@@ -29,6 +31,26 @@ Creates a single scheduled transaction (a transaction with a future date).
2931
[**ScheduledTransactionResponse**](ScheduledTransactionResponse.md)
3032

3133

34+
## delete_scheduled_transaction
35+
36+
> <ScheduledTransactionResponse> delete_scheduled_transaction(budget_id, scheduled_transaction_id)
37+
38+
Deletes an existing scheduled transaction
39+
40+
Deletes a scheduled transaction
41+
42+
### Parameters
43+
44+
| Name | Type | Description | Notes |
45+
| ---- | ---- | ----------- | ----- |
46+
| **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). | |
47+
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
48+
49+
### Return type
50+
51+
[**ScheduledTransactionResponse**](ScheduledTransactionResponse.md)
52+
53+
3254
## get_scheduled_transaction_by_id
3355

3456
> <ScheduledTransactionResponse> get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id)
@@ -68,3 +90,24 @@ Returns all scheduled transactions
6890

6991
[**ScheduledTransactionsResponse**](ScheduledTransactionsResponse.md)
7092

93+
94+
## update_scheduled_transaction
95+
96+
> <ScheduledTransactionResponse> update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper)
97+
98+
Updates an existing scheduled transaction
99+
100+
Updates a single scheduled transaction
101+
102+
### Parameters
103+
104+
| Name | Type | Description | Notes |
105+
| ---- | ---- | ----------- | ----- |
106+
| **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). | |
107+
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
108+
| **put_scheduled_transaction_wrapper** | [**PutScheduledTransactionWrapper**](PutScheduledTransactionWrapper.md) | The scheduled transaction to update | |
109+
110+
### Return type
111+
112+
[**ScheduledTransactionResponse**](ScheduledTransactionResponse.md)
113+

lib/ynab.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
require 'ynab/models/post_account_wrapper'
7373
require 'ynab/models/post_scheduled_transaction_wrapper'
7474
require 'ynab/models/post_transactions_wrapper'
75+
require 'ynab/models/put_scheduled_transaction_wrapper'
7576
require 'ynab/models/put_transaction_wrapper'
7677
require 'ynab/models/save_account'
7778
require 'ynab/models/save_category'

lib/ynab/api/scheduled_transactions_api.rb

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,75 @@ def create_scheduled_transaction_with_http_info(budget_id, data, opts = {})
9090
return data, status_code, headers
9191
end
9292

93+
# Deletes an existing scheduled transaction
94+
# Deletes a scheduled transaction
95+
# @param 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).
96+
# @param scheduled_transaction_id [String] The id of the scheduled transaction
97+
# @param [Hash] opts the optional parameters
98+
# @return [ScheduledTransactionResponse]
99+
def delete_scheduled_transaction(budget_id, scheduled_transaction_id, opts = {})
100+
data, _status_code, _headers = delete_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, opts)
101+
data
102+
end
103+
104+
# Deletes an existing scheduled transaction
105+
# Deletes a scheduled transaction
106+
# @param 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).
107+
# @param scheduled_transaction_id [String] The id of the scheduled transaction
108+
# @param [Hash] opts the optional parameters
109+
# @return [Array<(ScheduledTransactionResponse, Integer, Hash)>] ScheduledTransactionResponse data, response status code and response headers
110+
def delete_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, opts = {})
111+
if @api_client.config.debugging
112+
@api_client.config.logger.debug 'Calling API: ScheduledTransactionsApi.delete_scheduled_transaction ...'
113+
end
114+
# verify the required parameter 'budget_id' is set
115+
if @api_client.config.client_side_validation && budget_id.nil?
116+
fail ArgumentError, "Missing the required parameter 'budget_id' when calling ScheduledTransactionsApi.delete_scheduled_transaction"
117+
end
118+
# verify the required parameter 'scheduled_transaction_id' is set
119+
if @api_client.config.client_side_validation && scheduled_transaction_id.nil?
120+
fail ArgumentError, "Missing the required parameter 'scheduled_transaction_id' when calling ScheduledTransactionsApi.delete_scheduled_transaction"
121+
end
122+
# resource path
123+
local_var_path = '/budgets/{budget_id}/scheduled_transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'scheduled_transaction_id' + '}', CGI.escape(scheduled_transaction_id.to_s))
124+
125+
# query parameters
126+
query_params = opts[:query_params] || {}
127+
128+
# header parameters
129+
header_params = opts[:header_params] || {}
130+
# HTTP header 'Accept' (if needed)
131+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
132+
133+
# form parameters
134+
form_params = opts[:form_params] || {}
135+
136+
# http body (model)
137+
post_body = opts[:debug_body]
138+
139+
# return_type
140+
return_type = opts[:debug_return_type] || 'ScheduledTransactionResponse'
141+
142+
# auth_names
143+
auth_names = opts[:debug_auth_names] || ['bearer']
144+
145+
new_options = opts.merge(
146+
:operation => :"ScheduledTransactionsApi.delete_scheduled_transaction",
147+
:header_params => header_params,
148+
:query_params => query_params,
149+
:form_params => form_params,
150+
:body => post_body,
151+
:auth_names => auth_names,
152+
:return_type => return_type
153+
)
154+
155+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
156+
if @api_client.config.debugging
157+
@api_client.config.logger.debug "API called: ScheduledTransactionsApi#delete_scheduled_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
158+
end
159+
return data, status_code, headers
160+
end
161+
93162
# Single scheduled transaction
94163
# Returns a single scheduled transaction
95164
# @param 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).
@@ -224,5 +293,85 @@ def get_scheduled_transactions_with_http_info(budget_id, opts = {})
224293
end
225294
return data, status_code, headers
226295
end
296+
297+
# Updates an existing scheduled transaction
298+
# Updates a single scheduled transaction
299+
# @param 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).
300+
# @param scheduled_transaction_id [String] The id of the scheduled transaction
301+
# @param put_scheduled_transaction_wrapper [PutScheduledTransactionWrapper] The scheduled transaction to update
302+
# @param [Hash] opts the optional parameters
303+
# @return [ScheduledTransactionResponse]
304+
def update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, opts = {})
305+
data, _status_code, _headers = update_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, opts)
306+
data
307+
end
308+
309+
# Updates an existing scheduled transaction
310+
# Updates a single scheduled transaction
311+
# @param 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).
312+
# @param scheduled_transaction_id [String] The id of the scheduled transaction
313+
# @param put_scheduled_transaction_wrapper [PutScheduledTransactionWrapper] The scheduled transaction to update
314+
# @param [Hash] opts the optional parameters
315+
# @return [Array<(ScheduledTransactionResponse, Integer, Hash)>] ScheduledTransactionResponse data, response status code and response headers
316+
def update_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, opts = {})
317+
if @api_client.config.debugging
318+
@api_client.config.logger.debug 'Calling API: ScheduledTransactionsApi.update_scheduled_transaction ...'
319+
end
320+
# verify the required parameter 'budget_id' is set
321+
if @api_client.config.client_side_validation && budget_id.nil?
322+
fail ArgumentError, "Missing the required parameter 'budget_id' when calling ScheduledTransactionsApi.update_scheduled_transaction"
323+
end
324+
# verify the required parameter 'scheduled_transaction_id' is set
325+
if @api_client.config.client_side_validation && scheduled_transaction_id.nil?
326+
fail ArgumentError, "Missing the required parameter 'scheduled_transaction_id' when calling ScheduledTransactionsApi.update_scheduled_transaction"
327+
end
328+
# verify the required parameter 'put_scheduled_transaction_wrapper' is set
329+
if @api_client.config.client_side_validation && put_scheduled_transaction_wrapper.nil?
330+
fail ArgumentError, "Missing the required parameter 'put_scheduled_transaction_wrapper' when calling ScheduledTransactionsApi.update_scheduled_transaction"
331+
end
332+
# resource path
333+
local_var_path = '/budgets/{budget_id}/scheduled_transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'scheduled_transaction_id' + '}', CGI.escape(scheduled_transaction_id.to_s))
334+
335+
# query parameters
336+
query_params = opts[:query_params] || {}
337+
338+
# header parameters
339+
header_params = opts[:header_params] || {}
340+
# HTTP header 'Accept' (if needed)
341+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
342+
# HTTP header 'Content-Type'
343+
content_type = @api_client.select_header_content_type(['application/json'])
344+
if !content_type.nil?
345+
header_params['Content-Type'] = content_type
346+
end
347+
348+
# form parameters
349+
form_params = opts[:form_params] || {}
350+
351+
# http body (model)
352+
post_body = opts[:debug_body] || @api_client.object_to_http_body(put_scheduled_transaction_wrapper)
353+
354+
# return_type
355+
return_type = opts[:debug_return_type] || 'ScheduledTransactionResponse'
356+
357+
# auth_names
358+
auth_names = opts[:debug_auth_names] || ['bearer']
359+
360+
new_options = opts.merge(
361+
:operation => :"ScheduledTransactionsApi.update_scheduled_transaction",
362+
:header_params => header_params,
363+
:query_params => query_params,
364+
:form_params => form_params,
365+
:body => post_body,
366+
:auth_names => auth_names,
367+
:return_type => return_type
368+
)
369+
370+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
371+
if @api_client.config.debugging
372+
@api_client.config.logger.debug "API called: ScheduledTransactionsApi#update_scheduled_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
373+
end
374+
return data, status_code, headers
375+
end
227376
end
228377
end

lib/ynab/models/category.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def valid?
316316
return false if @budgeted.nil?
317317
return false if @activity.nil?
318318
return false if @balance.nil?
319-
goal_type_validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT", "null"])
319+
goal_type_validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT"])
320320
return false unless goal_type_validator.valid?(@goal_type)
321321
return false if @deleted.nil?
322322
true

0 commit comments

Comments
 (0)