Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gemini/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
have_fun: false
code_review:
disable: true
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ docs/PayeesResponseData.md
docs/PostAccountWrapper.md
docs/PostScheduledTransactionWrapper.md
docs/PostTransactionsWrapper.md
docs/PutScheduledTransactionWrapper.md
docs/PutTransactionWrapper.md
docs/SaveAccount.md
docs/SaveCategory.md
Expand Down Expand Up @@ -174,6 +175,7 @@ lib/ynab/models/payees_response_data.rb
lib/ynab/models/post_account_wrapper.rb
lib/ynab/models/post_scheduled_transaction_wrapper.rb
lib/ynab/models/post_transactions_wrapper.rb
lib/ynab/models/put_scheduled_transaction_wrapper.rb
lib/ynab/models/put_transaction_wrapper.rb
lib/ynab/models/save_account.rb
lib/ynab/models/save_category.rb
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.7.0
7.12.0
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.3.1
ruby 3.4.1
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ynab (3.5.0)
ynab (3.6.0)
typhoeus (~> 1.0, >= 1.0.1)

GEM
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ The following methods are available in this library.
| **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. |
| | [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 |
| | [categories.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
| | [categories.update_category(budget_id, category_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/CategoriesApi.md#update_category) | Update an existing category
| | [categories.update_month_category(budget_id, month, category_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/CategoriesApi.md#update_month_category) | Update an existing month category
| **Payees** | [payees.get_payees(budget_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/PayeesApi.md#get_payees) | Returns all payees |
| | [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 |
| **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 |
Expand All @@ -78,6 +80,8 @@ The following methods are available in this library.
| **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 |
| | [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 |
| | [scheduled_transactions.create_scheduled_transaction(budget_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#create_scheduled_transaction) | Creates a single scheduled transaction |
| | [scheduled_transactions.update_scheduled_transaction(budget_id, scheduled_transaction_id, data)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#update_scheduled_transaction) | Updates a single scheduled transaction |
| | [scheduled_transactions.delete_scheduled_transaction(budget_id, scheduled_transaction_id)](https://github.com/ynab/ynab-sdk-ruby/blob/master/docs/ScheduledTransactionsApi.md#delete_scheduled_transaction) | Deletes a single scheduled transaction |

## Versioning

Expand Down
8 changes: 8 additions & 0 deletions docs/PutScheduledTransactionWrapper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# YNAB::PutScheduledTransactionWrapper

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **scheduled_transaction** | [**SaveScheduledTransaction**](SaveScheduledTransaction.md) | | |

1 change: 1 addition & 0 deletions docs/SaveCategory.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
| **name** | **String** | | [optional] |
| **note** | **String** | | [optional] |
| **category_group_id** | **String** | | [optional] |
| **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] |

2 changes: 2 additions & 0 deletions docs/ScheduledSubTransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
| **amount** | **Integer** | The scheduled subtransaction amount in milliunits format | |
| **memo** | **String** | | [optional] |
| **payee_id** | **String** | | [optional] |
| **payee_name** | **String** | | [optional] |
| **category_id** | **String** | | [optional] |
| **category_name** | **String** | | [optional] |
| **transfer_account_id** | **String** | If a transfer, the account_id which the scheduled subtransaction transfers to | [optional] |
| **deleted** | **Boolean** | Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. | |

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


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


## delete_scheduled_transaction

> <ScheduledTransactionResponse> delete_scheduled_transaction(budget_id, scheduled_transaction_id)

Deletes an existing scheduled transaction

Deletes a scheduled transaction

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **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). | |
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |

### Return type

[**ScheduledTransactionResponse**](ScheduledTransactionResponse.md)


## get_scheduled_transaction_by_id

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

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


## update_scheduled_transaction

> <ScheduledTransactionResponse> update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper)

Updates an existing scheduled transaction

Updates a single scheduled transaction

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **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). | |
| **scheduled_transaction_id** | **String** | The id of the scheduled transaction | |
| **put_scheduled_transaction_wrapper** | [**PutScheduledTransactionWrapper**](PutScheduledTransactionWrapper.md) | The scheduled transaction to update | |

### Return type

[**ScheduledTransactionResponse**](ScheduledTransactionResponse.md)

1 change: 1 addition & 0 deletions lib/ynab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
require 'ynab/models/post_account_wrapper'
require 'ynab/models/post_scheduled_transaction_wrapper'
require 'ynab/models/post_transactions_wrapper'
require 'ynab/models/put_scheduled_transaction_wrapper'
require 'ynab/models/put_transaction_wrapper'
require 'ynab/models/save_account'
require 'ynab/models/save_category'
Expand Down
149 changes: 149 additions & 0 deletions lib/ynab/api/scheduled_transactions_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,75 @@ def create_scheduled_transaction_with_http_info(budget_id, data, opts = {})
return data, status_code, headers
end

# Deletes an existing scheduled transaction
# Deletes a scheduled transaction
# @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).
# @param scheduled_transaction_id [String] The id of the scheduled transaction
# @param [Hash] opts the optional parameters
# @return [ScheduledTransactionResponse]
def delete_scheduled_transaction(budget_id, scheduled_transaction_id, opts = {})
data, _status_code, _headers = delete_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, opts)
data
end

# Deletes an existing scheduled transaction
# Deletes a scheduled transaction
# @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).
# @param scheduled_transaction_id [String] The id of the scheduled transaction
# @param [Hash] opts the optional parameters
# @return [Array<(ScheduledTransactionResponse, Integer, Hash)>] ScheduledTransactionResponse data, response status code and response headers
def delete_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ScheduledTransactionsApi.delete_scheduled_transaction ...'
end
# verify the required parameter 'budget_id' is set
if @api_client.config.client_side_validation && budget_id.nil?
fail ArgumentError, "Missing the required parameter 'budget_id' when calling ScheduledTransactionsApi.delete_scheduled_transaction"
end
# verify the required parameter 'scheduled_transaction_id' is set
if @api_client.config.client_side_validation && scheduled_transaction_id.nil?
fail ArgumentError, "Missing the required parameter 'scheduled_transaction_id' when calling ScheduledTransactionsApi.delete_scheduled_transaction"
end
# resource path
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))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The scheduled_transaction_id is being used in the path, but it's not actually being used in the path substitution. It should be /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} to properly delete a specific scheduled transaction.

      local_var_path = '/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'scheduled_transaction_id' + '}', CGI.escape(scheduled_transaction_id.to_s))


# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'ScheduledTransactionResponse'

# auth_names
auth_names = opts[:debug_auth_names] || ['bearer']

new_options = opts.merge(
:operation => :"ScheduledTransactionsApi.delete_scheduled_transaction",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: ScheduledTransactionsApi#delete_scheduled_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Single scheduled transaction
# Returns a single scheduled transaction
# @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).
Expand Down Expand Up @@ -224,5 +293,85 @@ def get_scheduled_transactions_with_http_info(budget_id, opts = {})
end
return data, status_code, headers
end

# Updates an existing scheduled transaction
# Updates a single scheduled transaction
# @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).
# @param scheduled_transaction_id [String] The id of the scheduled transaction
# @param put_scheduled_transaction_wrapper [PutScheduledTransactionWrapper] The scheduled transaction to update
# @param [Hash] opts the optional parameters
# @return [ScheduledTransactionResponse]
def update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, opts = {})
data, _status_code, _headers = update_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, opts)
data
end

# Updates an existing scheduled transaction
# Updates a single scheduled transaction
# @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).
# @param scheduled_transaction_id [String] The id of the scheduled transaction
# @param put_scheduled_transaction_wrapper [PutScheduledTransactionWrapper] The scheduled transaction to update
# @param [Hash] opts the optional parameters
# @return [Array<(ScheduledTransactionResponse, Integer, Hash)>] ScheduledTransactionResponse data, response status code and response headers
def update_scheduled_transaction_with_http_info(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ScheduledTransactionsApi.update_scheduled_transaction ...'
end
# verify the required parameter 'budget_id' is set
if @api_client.config.client_side_validation && budget_id.nil?
fail ArgumentError, "Missing the required parameter 'budget_id' when calling ScheduledTransactionsApi.update_scheduled_transaction"
end
# verify the required parameter 'scheduled_transaction_id' is set
if @api_client.config.client_side_validation && scheduled_transaction_id.nil?
fail ArgumentError, "Missing the required parameter 'scheduled_transaction_id' when calling ScheduledTransactionsApi.update_scheduled_transaction"
end
# verify the required parameter 'put_scheduled_transaction_wrapper' is set
if @api_client.config.client_side_validation && put_scheduled_transaction_wrapper.nil?
fail ArgumentError, "Missing the required parameter 'put_scheduled_transaction_wrapper' when calling ScheduledTransactionsApi.update_scheduled_transaction"
end
# resource path
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))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(put_scheduled_transaction_wrapper)

# return_type
return_type = opts[:debug_return_type] || 'ScheduledTransactionResponse'

# auth_names
auth_names = opts[:debug_auth_names] || ['bearer']

new_options = opts.merge(
:operation => :"ScheduledTransactionsApi.update_scheduled_transaction",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: ScheduledTransactionsApi#update_scheduled_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
2 changes: 1 addition & 1 deletion lib/ynab/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def valid?
return false if @budgeted.nil?
return false if @activity.nil?
return false if @balance.nil?
goal_type_validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT", "null"])
goal_type_validator = EnumAttributeValidator.new('String', ["TB", "TBD", "MF", "NEED", "DEBT"])
return false unless goal_type_validator.valid?(@goal_type)
return false if @deleted.nil?
true
Expand Down
2 changes: 1 addition & 1 deletion lib/ynab/models/hybrid_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def valid?
return false if @cleared.nil?
return false if @approved.nil?
return false if @account_id.nil?
debt_transaction_type_validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "balanceAdjustment", "credit", "charge", "null"])
debt_transaction_type_validator = EnumAttributeValidator.new('String', ["payment", "refund", "fee", "interest", "escrow", "balanceAdjustment", "credit", "charge"])
return false unless debt_transaction_type_validator.valid?(@debt_transaction_type)
return false if @deleted.nil?
return false if @type.nil?
Expand Down
Loading