-
Notifications
You must be signed in to change notification settings - Fork 56
Code generation: update services and models #329
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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| 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 SCAAssociationManagementApi < Service | ||
| attr_accessor :service, :version | ||
|
|
||
| def initialize(client, version = DEFAULT_VERSION) | ||
| super(client, version, 'BalancePlatform') | ||
| end | ||
|
|
||
| # Approve a pending approval association | ||
| def approve_association(request, headers: {}) | ||
| endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s') | ||
|
Check failure on line 17 in lib/adyen/services/balancePlatform/sca_association_management_api.rb
|
||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint) | ||
|
|
||
|
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. |
||
| action = { method: 'patch', url: endpoint } | ||
| @client.call_adyen_api(@service, action, request, headers, @version) | ||
| end | ||
|
|
||
| # Get a list of devices associated with an entity | ||
| def list_associations(headers: {}, query_params: {}) | ||
| endpoint = '/scaAssociations'.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 | ||
|
|
||
| # Delete association to devices | ||
| def remove_association(request, headers: {}) | ||
| endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint) | ||
|
|
||
| action = { method: 'delete', 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,46 @@ | ||
| 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 SCADeviceManagementApi < Service | ||
| attr_accessor :service, :version | ||
|
|
||
| def initialize(client, version = DEFAULT_VERSION) | ||
| super(client, version, 'BalancePlatform') | ||
| end | ||
|
|
||
| # Begin SCA device registration | ||
| def begin_sca_device_registration(request, headers: {}) | ||
| endpoint = '/scaDevices'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint) | ||
|
Comment on lines
+17
to
+19
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. |
||
|
|
||
| action = { method: 'post', url: endpoint } | ||
| @client.call_adyen_api(@service, action, request, headers, @version) | ||
| end | ||
|
|
||
| # Finish registration process for a SCA device | ||
| def finish_sca_device_registration(request, device_id, headers: {}) | ||
| endpoint = '/scaDevices/{deviceId}'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint, device_id) | ||
|
Comment on lines
+27
to
+29
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. |
||
|
|
||
| action = { method: 'patch', url: endpoint } | ||
| @client.call_adyen_api(@service, action, request, headers, @version) | ||
| end | ||
|
|
||
| # Create a new SCA association for a device | ||
| def submit_sca_association(request, device_id, headers: {}) | ||
| endpoint = '/scaDevices/{deviceId}/scaAssociations'.gsub(/{.+?}/, '%s') | ||
| endpoint = endpoint.gsub(%r{^/}, '') | ||
| endpoint = format(endpoint, device_id) | ||
|
|
||
| action = { method: 'post', url: endpoint } | ||
| @client.call_adyen_api(@service, action, request, headers, @version) | ||
| end | ||
|
|
||
| end | ||
| end | ||
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.
The construction of the
endpointstring is overly complex for a static path. It can be simplified to a single string assignment, which improves readability and is more idiomatic in Ruby. This simplification can be applied to the other methods in this file (list_associationson lines 27-29 andremove_associationon lines 37-39) as well.