-
Notifications
You must be signed in to change notification settings - Fork 57
[balanceplatform] Code generation: update services and models #350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,16 @@ def get_tax_form(id, headers: {}, query_params: {}) | |
| @client.call_adyen_api(@service, action, {}, headers, @version) | ||
| end | ||
|
|
||
| # Get summary of tax forms for an account holder | ||
| def get_tax_form_summary(id, headers: {}, query_params: {}) | ||
| endpoint = '/accountHolders/{id}/taxFormSummary'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint, id) | ||
| endpoint += create_query_string(query_params) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Suggested change in def create_query_string(params)
return '' if params.empty?
"?#{URI.encode_www_form(params)}"
end |
||
| action = { method: 'get', url: endpoint } | ||
| @client.call_adyen_api(@service, action, {}, headers, @version) | ||
| end | ||
|
|
||
| # Update an account holder | ||
| def update_account_holder(request, id, headers: {}) | ||
| endpoint = '/accountHolders/{id}'.gsub(/{.+?}/, '%s') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| require_relative '../service' | ||
| module Adyen | ||
|
|
||
| # NOTE: This class is auto generated by OpenAPI Generator | ||
| # Ref: https://openapi-generator.tech | ||
| # | ||
| # Do not edit the class manually. | ||
| class DirectDebitMandatesApi < Service | ||
| attr_accessor :service, :version | ||
|
|
||
| def initialize(client, version = DEFAULT_VERSION) | ||
| super(client, version, 'BalancePlatform') | ||
| end | ||
|
|
||
| # Cancel a mandate | ||
| def cancel_mandate(mandate_id, headers: {}) | ||
| endpoint = '/mandates/{mandateId}/cancel'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint, mandate_id) | ||
|
|
||
| action = { method: 'post', url: endpoint } | ||
| @client.call_adyen_api(@service, action, {}, headers, @version) | ||
| end | ||
|
|
||
| # Get a list of mandates | ||
| def get_list_of_mandates(headers: {}, query_params: {}) | ||
| endpoint = '/mandates'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint) | ||
| endpoint += create_query_string(query_params) | ||
| action = { method: 'get', url: endpoint } | ||
| @client.call_adyen_api(@service, action, {}, headers, @version) | ||
| end | ||
|
|
||
| # Get a specific mandate | ||
| def get_mandate_by_id(mandate_id, headers: {}) | ||
| endpoint = '/mandates/{mandateId}'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint, mandate_id) | ||
|
|
||
| action = { method: 'get', url: endpoint } | ||
| @client.call_adyen_api(@service, action, {}, headers, @version) | ||
| end | ||
|
|
||
| # Amend a mandate | ||
| def update_mandate(request, mandate_id, headers: {}) | ||
| endpoint = '/mandates/{mandateId}'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint, mandate_id) | ||
|
|
||
| action = { method: 'patch', url: endpoint } | ||
| @client.call_adyen_api(@service, action, request, headers, @version) | ||
| end | ||
|
|
||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "service": "balanceplatform", | ||
| "project": "ruby", | ||
| "generatedAt": "2026-04-13T10:15:50Z", | ||
| "openapiCommitSha": "ab42e887fd36d43b82acbd9ff6ea3f5957c43a2e", | ||
| "automationCommitSha": "855b6c5526cb5fae757e921687c38df66d31dc4b", | ||
| "libraryCommitSha": "ec1c835aada9f1a2fd35cd40bd3ef58f72156799" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern for building the endpoint URL is duplicated across several methods in this class (e.g.,
get_account_holder,get_tax_form). To improve maintainability and reduce redundancy, consider extracting this logic into a private helper method.For example:
This would allow you to simplify the implementation in this and other methods: