Skip to content

Commit 9e1c827

Browse files
committed
Generate and move small services
1 parent 8d130c4 commit 9e1c827

25 files changed

+626
-418
lines changed

lib/adyen/services/balanceControlService.rb

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
require_relative './service'
1+
require_relative 'balanceControlService/balance_control_api'
2+
23
module Adyen
34

45
# NOTE: This class is auto generated by OpenAPI Generator
56
# Ref: https://openapi-generator.tech
67
#
78
# Do not edit the class manually.
8-
class BalanceControlService < Service
9+
class BalanceControlService
910
attr_accessor :service, :version
1011

1112
DEFAULT_VERSION = 1
1213
def initialize(client, version = DEFAULT_VERSION)
13-
super(client, version, 'BalanceControlService')
14+
@service = 'BalanceControlService'
15+
@client = client
16+
@version = version
1417
end
1518

16-
# Start a balance transfer
17-
def balance_transfer(request, headers: {})
18-
endpoint = '/balanceTransfer'.gsub(/{.+?}/, '%s')
19-
endpoint = endpoint.gsub(%r{^/}, '')
20-
endpoint = format(endpoint)
21-
22-
action = { method: 'post', url: endpoint }
23-
@client.call_adyen_api(@service, action, request, headers, @version)
19+
def balance_control_api
20+
@balance_control_api ||= Adyen::BalanceControlApi.new(@client, @version)
2421
end
2522

2623
end

lib/adyen/services/binLookup.rb

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
1-
require_relative './service'
1+
require_relative 'binLookup/bin_lookup_api'
2+
23
module Adyen
34

45
# NOTE: This class is auto generated by OpenAPI Generator
56
# Ref: https://openapi-generator.tech
67
#
78
# Do not edit the class manually.
8-
class BinLookup < Service
9+
class BinLookup
910
attr_accessor :service, :version
1011

1112
DEFAULT_VERSION = 54
1213
def initialize(client, version = DEFAULT_VERSION)
13-
super(client, version, 'BinLookup')
14-
end
15-
16-
# Check if 3D Secure is available
17-
def get3ds_availability(request, headers: {})
18-
endpoint = '/get3dsAvailability'.gsub(/{.+?}/, '%s')
19-
endpoint = endpoint.gsub(%r{^/}, '')
20-
endpoint = format(endpoint)
21-
22-
action = { method: 'post', url: endpoint }
23-
@client.call_adyen_api(@service, action, request, headers, @version)
14+
@service = 'BinLookup'
15+
@client = client
16+
@version = version
2417
end
2518

26-
# Get a fees cost estimate
27-
def get_cost_estimate(request, headers: {})
28-
endpoint = '/getCostEstimate'.gsub(/{.+?}/, '%s')
29-
endpoint = endpoint.gsub(%r{^/}, '')
30-
endpoint = format(endpoint)
31-
32-
action = { method: 'post', url: endpoint }
33-
@client.call_adyen_api(@service, action, request, headers, @version)
19+
def bin_lookup_api
20+
@bin_lookup_api ||= Adyen::BinLookupApi.new(@client, @version)
3421
end
3522

3623
end
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
require_relative '../service'
2+
module Adyen
3+
4+
# NOTE: This class is auto generated by OpenAPI Generator
5+
# Ref: https://openapi-generator.tech
6+
#
7+
# Do not edit the class manually.
8+
class BinLookupApi < Service
9+
attr_accessor :service, :version
10+
11+
def initialize(client, version = DEFAULT_VERSION)
12+
super(client, version, 'BinLookup')
13+
end
14+
15+
# Check if 3D Secure is available
16+
def get3ds_availability(request, headers: {})
17+
endpoint = '/get3dsAvailability'.gsub(/{.+?}/, '%s')
18+
endpoint = endpoint.gsub(%r{^/}, '')
19+
endpoint = format(endpoint)
20+
21+
action = { method: 'post', url: endpoint }
22+
@client.call_adyen_api(@service, action, request, headers, @version)
23+
end
24+
25+
# Get a fees cost estimate
26+
def get_cost_estimate(request, headers: {})
27+
endpoint = '/getCostEstimate'.gsub(/{.+?}/, '%s')
28+
endpoint = endpoint.gsub(%r{^/}, '')
29+
endpoint = format(endpoint)
30+
31+
action = { method: 'post', url: endpoint }
32+
@client.call_adyen_api(@service, action, request, headers, @version)
33+
end
34+
35+
end
36+
end

lib/adyen/services/dataProtection.rb

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
require_relative './service'
1+
require_relative 'dataProtection/data_protection_api'
2+
23
module Adyen
34

45
# NOTE: This class is auto generated by OpenAPI Generator
56
# Ref: https://openapi-generator.tech
67
#
78
# Do not edit the class manually.
8-
class DataProtection < Service
9+
class DataProtection
910
attr_accessor :service, :version
1011

1112
DEFAULT_VERSION = 1
1213
def initialize(client, version = DEFAULT_VERSION)
13-
super(client, version, 'DataProtectionService')
14+
@service = 'DataProtection'
15+
@client = client
16+
@version = version
1417
end
1518

16-
# Submit a Subject Erasure Request.
17-
def request_subject_erasure(request, headers: {})
18-
endpoint = '/requestSubjectErasure'.gsub(/{.+?}/, '%s')
19-
endpoint = endpoint.gsub(%r{^/}, '')
20-
endpoint = format(endpoint)
21-
22-
action = { method: 'post', url: endpoint }
23-
@client.call_adyen_api(@service, action, request, headers, @version)
19+
def data_protection_api
20+
@data_protection_api ||= Adyen::DataProtectionApi.new(@client, @version)
2421
end
2522

2623
end
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require_relative '../service'
2+
module Adyen
3+
4+
# NOTE: This class is auto generated by OpenAPI Generator
5+
# Ref: https://openapi-generator.tech
6+
#
7+
# Do not edit the class manually.
8+
class DataProtectionApi < Service
9+
attr_accessor :service, :version
10+
11+
def initialize(client, version = DEFAULT_VERSION)
12+
super(client, version, 'DataProtection')
13+
end
14+
15+
# Submit a Subject Erasure Request.
16+
def request_subject_erasure(request, headers: {})
17+
endpoint = '/requestSubjectErasure'.gsub(/{.+?}/, '%s')
18+
endpoint = endpoint.gsub(%r{^/}, '')
19+
endpoint = format(endpoint)
20+
21+
action = { method: 'post', url: endpoint }
22+
@client.call_adyen_api(@service, action, request, headers, @version)
23+
end
24+
25+
end
26+
end

lib/adyen/services/disputes.rb

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,23 @@
1-
require_relative './service'
1+
require_relative 'disputes/disputes_api'
2+
23
module Adyen
34

45
# NOTE: This class is auto generated by OpenAPI Generator
56
# Ref: https://openapi-generator.tech
67
#
78
# Do not edit the class manually.
8-
class Disputes < Service
9+
class Disputes
910
attr_accessor :service, :version
1011

1112
DEFAULT_VERSION = 30
1213
def initialize(client, version = DEFAULT_VERSION)
13-
super(client, version, 'Disputes')
14-
end
15-
16-
# Accept a dispute
17-
def accept_dispute(request, headers: {})
18-
endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s')
19-
endpoint = endpoint.gsub(%r{^/}, '')
20-
endpoint = format(endpoint)
21-
22-
action = { method: 'post', url: endpoint }
23-
@client.call_adyen_api(@service, action, request, headers, @version)
24-
end
25-
26-
# Defend a dispute
27-
def defend_dispute(request, headers: {})
28-
endpoint = '/defendDispute'.gsub(/{.+?}/, '%s')
29-
endpoint = endpoint.gsub(%r{^/}, '')
30-
endpoint = format(endpoint)
31-
32-
action = { method: 'post', url: endpoint }
33-
@client.call_adyen_api(@service, action, request, headers, @version)
34-
end
35-
36-
# Delete a defense document
37-
def delete_dispute_defense_document(request, headers: {})
38-
endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s')
39-
endpoint = endpoint.gsub(%r{^/}, '')
40-
endpoint = format(endpoint)
41-
42-
action = { method: 'post', url: endpoint }
43-
@client.call_adyen_api(@service, action, request, headers, @version)
44-
end
45-
46-
# Get applicable defense reasons
47-
def retrieve_applicable_defense_reasons(request, headers: {})
48-
endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s')
49-
endpoint = endpoint.gsub(%r{^/}, '')
50-
endpoint = format(endpoint)
51-
52-
action = { method: 'post', url: endpoint }
53-
@client.call_adyen_api(@service, action, request, headers, @version)
14+
@service = 'Disputes'
15+
@client = client
16+
@version = version
5417
end
5518

56-
# Supply a defense document
57-
def supply_defense_document(request, headers: {})
58-
endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s')
59-
endpoint = endpoint.gsub(%r{^/}, '')
60-
endpoint = format(endpoint)
61-
62-
action = { method: 'post', url: endpoint }
63-
@client.call_adyen_api(@service, action, request, headers, @version)
19+
def disputes_api
20+
@disputes_api ||= Adyen::DisputesApi.new(@client, @version)
6421
end
6522

6623
end
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
require_relative '../service'
2+
module Adyen
3+
4+
# NOTE: This class is auto generated by OpenAPI Generator
5+
# Ref: https://openapi-generator.tech
6+
#
7+
# Do not edit the class manually.
8+
class DisputesApi < Service
9+
attr_accessor :service, :version
10+
11+
def initialize(client, version = DEFAULT_VERSION)
12+
super(client, version, 'Disputes')
13+
end
14+
15+
# Accept a dispute
16+
def accept_dispute(request, headers: {})
17+
endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s')
18+
endpoint = endpoint.gsub(%r{^/}, '')
19+
endpoint = format(endpoint)
20+
21+
action = { method: 'post', url: endpoint }
22+
@client.call_adyen_api(@service, action, request, headers, @version)
23+
end
24+
25+
# Defend a dispute
26+
def defend_dispute(request, headers: {})
27+
endpoint = '/defendDispute'.gsub(/{.+?}/, '%s')
28+
endpoint = endpoint.gsub(%r{^/}, '')
29+
endpoint = format(endpoint)
30+
31+
action = { method: 'post', url: endpoint }
32+
@client.call_adyen_api(@service, action, request, headers, @version)
33+
end
34+
35+
# Delete a defense document
36+
def delete_dispute_defense_document(request, headers: {})
37+
endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s')
38+
endpoint = endpoint.gsub(%r{^/}, '')
39+
endpoint = format(endpoint)
40+
41+
action = { method: 'post', url: endpoint }
42+
@client.call_adyen_api(@service, action, request, headers, @version)
43+
end
44+
45+
# Get applicable defense reasons
46+
def retrieve_applicable_defense_reasons(request, headers: {})
47+
endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s')
48+
endpoint = endpoint.gsub(%r{^/}, '')
49+
endpoint = format(endpoint)
50+
51+
action = { method: 'post', url: endpoint }
52+
@client.call_adyen_api(@service, action, request, headers, @version)
53+
end
54+
55+
# Supply a defense document
56+
def supply_defense_document(request, headers: {})
57+
endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s')
58+
endpoint = endpoint.gsub(%r{^/}, '')
59+
endpoint = format(endpoint)
60+
61+
action = { method: 'post', url: endpoint }
62+
@client.call_adyen_api(@service, action, request, headers, @version)
63+
end
64+
65+
end
66+
end

0 commit comments

Comments
 (0)