Skip to content

Commit 4257995

Browse files
authored
BalancePlatform TransferLimits: update order of path params for deletePendingTransferLimit and getSpecificTransferLimit (#1583)
* Invert order of parameters * Rename variables * Code format
1 parent f01a5b7 commit 4257995

File tree

4 files changed

+50
-53
lines changed

4 files changed

+50
-53
lines changed

src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalanceAccountLevelApi.java

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public TransferLimitsBalanceAccountLevelApi(Client client, String baseURL) {
6363
*
6464
* @param id {@link String } The unique identifier of the balance account. (required)
6565
* @param approveTransferLimitRequest {@link ApproveTransferLimitRequest } (required)
66-
* @param approveTransferLimitRequest {@link ApproveTransferLimitRequest } (required)
6766
* @throws ApiException if fails to make API call
6867
*/
6968
public void approvePendingTransferLimits(
@@ -104,7 +103,6 @@ public void approvePendingTransferLimits(
104103
*
105104
* @param id {@link String } The unique identifier of the balance account. (required)
106105
* @param createTransferLimitRequest {@link CreateTransferLimitRequest } (required)
107-
* @param createTransferLimitRequest {@link CreateTransferLimitRequest } (required)
108106
* @return {@link TransferLimit }
109107
* @throws ApiException if fails to make API call
110108
*/
@@ -147,37 +145,37 @@ public TransferLimit createTransferLimit(
147145
/**
148146
* Delete a scheduled or pending transfer limit
149147
*
150-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
151148
* @param id {@link String } The unique identifier of the balance account. (required)
149+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
152150
* @throws ApiException if fails to make API call
153151
*/
154-
public void deletePendingTransferLimit(String transferLimitId, String id)
152+
public void deletePendingTransferLimit(String id, String transferLimitId)
155153
throws ApiException, IOException {
156-
deletePendingTransferLimit(transferLimitId, id, null);
154+
deletePendingTransferLimit(id, transferLimitId, null);
157155
}
158156

159157
/**
160158
* Delete a scheduled or pending transfer limit
161159
*
162-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
163160
* @param id {@link String } The unique identifier of the balance account. (required)
161+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
164162
* @param requestOptions {@link RequestOptions } Object to store additional data such as
165163
* idempotency-keys (optional)
166164
* @throws ApiException if fails to make API call
167165
*/
168166
public void deletePendingTransferLimit(
169-
String transferLimitId, String id, RequestOptions requestOptions)
167+
String id, String transferLimitId, RequestOptions requestOptions)
170168
throws ApiException, IOException {
171169
// Add path params
172170
Map<String, String> pathParams = new HashMap<>();
173-
if (transferLimitId == null) {
174-
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
175-
}
176-
pathParams.put("transferLimitId", transferLimitId);
177171
if (id == null) {
178172
throw new IllegalArgumentException("Please provide the id path parameter");
179173
}
180174
pathParams.put("id", id);
175+
if (transferLimitId == null) {
176+
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
177+
}
178+
pathParams.put("transferLimitId", transferLimitId);
181179

182180
String requestBody = null;
183181
Resource resource =
@@ -245,39 +243,39 @@ public TransferLimitListResponse getCurrentTransferLimits(
245243
/**
246244
* Get the details of a transfer limit
247245
*
248-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
249246
* @param id {@link String } The unique identifier of the balance account. (required)
247+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
250248
* @return {@link TransferLimit }
251249
* @throws ApiException if fails to make API call
252250
*/
253-
public TransferLimit getSpecificTransferLimit(String transferLimitId, String id)
251+
public TransferLimit getSpecificTransferLimit(String id, String transferLimitId)
254252
throws ApiException, IOException {
255-
return getSpecificTransferLimit(transferLimitId, id, null);
253+
return getSpecificTransferLimit(id, transferLimitId, null);
256254
}
257255

258256
/**
259257
* Get the details of a transfer limit
260258
*
261-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
262259
* @param id {@link String } The unique identifier of the balance account. (required)
260+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
263261
* @param requestOptions {@link RequestOptions } Object to store additional data such as
264262
* idempotency-keys (optional)
265263
* @return {@link TransferLimit }
266264
* @throws ApiException if fails to make API call
267265
*/
268266
public TransferLimit getSpecificTransferLimit(
269-
String transferLimitId, String id, RequestOptions requestOptions)
267+
String id, String transferLimitId, RequestOptions requestOptions)
270268
throws ApiException, IOException {
271269
// Add path params
272270
Map<String, String> pathParams = new HashMap<>();
273-
if (transferLimitId == null) {
274-
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
275-
}
276-
pathParams.put("transferLimitId", transferLimitId);
277271
if (id == null) {
278272
throw new IllegalArgumentException("Please provide the id path parameter");
279273
}
280274
pathParams.put("id", id);
275+
if (transferLimitId == null) {
276+
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
277+
}
278+
pathParams.put("transferLimitId", transferLimitId);
281279

282280
String requestBody = null;
283281
Resource resource =

src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalancePlatformLevelApi.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public TransferLimitsBalancePlatformLevelApi(Client client, String baseURL) {
6363
*
6464
* @param id {@link String } The unique identifier of the balance platform. (required)
6565
* @param createTransferLimitRequest {@link CreateTransferLimitRequest } (required)
66-
* @param createTransferLimitRequest {@link CreateTransferLimitRequest } (required)
6766
* @return {@link TransferLimit }
6867
* @throws ApiException if fails to make API call
6968
*/
@@ -106,37 +105,37 @@ public TransferLimit createTransferLimit(
106105
/**
107106
* Delete a scheduled or pending transfer limit
108107
*
109-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
110108
* @param id {@link String } The unique identifier of the balance platform. (required)
109+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
111110
* @throws ApiException if fails to make API call
112111
*/
113-
public void deletePendingTransferLimit(String transferLimitId, String id)
112+
public void deletePendingTransferLimit(String id, String transferLimitId)
114113
throws ApiException, IOException {
115-
deletePendingTransferLimit(transferLimitId, id, null);
114+
deletePendingTransferLimit(id, transferLimitId, null);
116115
}
117116

118117
/**
119118
* Delete a scheduled or pending transfer limit
120119
*
121-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
122120
* @param id {@link String } The unique identifier of the balance platform. (required)
121+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
123122
* @param requestOptions {@link RequestOptions } Object to store additional data such as
124123
* idempotency-keys (optional)
125124
* @throws ApiException if fails to make API call
126125
*/
127126
public void deletePendingTransferLimit(
128-
String transferLimitId, String id, RequestOptions requestOptions)
127+
String id, String transferLimitId, RequestOptions requestOptions)
129128
throws ApiException, IOException {
130129
// Add path params
131130
Map<String, String> pathParams = new HashMap<>();
132-
if (transferLimitId == null) {
133-
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
134-
}
135-
pathParams.put("transferLimitId", transferLimitId);
136131
if (id == null) {
137132
throw new IllegalArgumentException("Please provide the id path parameter");
138133
}
139134
pathParams.put("id", id);
135+
if (transferLimitId == null) {
136+
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
137+
}
138+
pathParams.put("transferLimitId", transferLimitId);
140139

141140
String requestBody = null;
142141
Resource resource =
@@ -148,39 +147,39 @@ public void deletePendingTransferLimit(
148147
/**
149148
* Get the details of a transfer limit
150149
*
151-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
152150
* @param id {@link String } The unique identifier of the balance platform. (required)
151+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
153152
* @return {@link TransferLimit }
154153
* @throws ApiException if fails to make API call
155154
*/
156-
public TransferLimit getSpecificTransferLimit(String transferLimitId, String id)
155+
public TransferLimit getSpecificTransferLimit(String id, String transferLimitId)
157156
throws ApiException, IOException {
158-
return getSpecificTransferLimit(transferLimitId, id, null);
157+
return getSpecificTransferLimit(id, transferLimitId, null);
159158
}
160159

161160
/**
162161
* Get the details of a transfer limit
163162
*
164-
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
165163
* @param id {@link String } The unique identifier of the balance platform. (required)
164+
* @param transferLimitId {@link String } The unique identifier of the transfer limit. (required)
166165
* @param requestOptions {@link RequestOptions } Object to store additional data such as
167166
* idempotency-keys (optional)
168167
* @return {@link TransferLimit }
169168
* @throws ApiException if fails to make API call
170169
*/
171170
public TransferLimit getSpecificTransferLimit(
172-
String transferLimitId, String id, RequestOptions requestOptions)
171+
String id, String transferLimitId, RequestOptions requestOptions)
173172
throws ApiException, IOException {
174173
// Add path params
175174
Map<String, String> pathParams = new HashMap<>();
176-
if (transferLimitId == null) {
177-
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
178-
}
179-
pathParams.put("transferLimitId", transferLimitId);
180175
if (id == null) {
181176
throw new IllegalArgumentException("Please provide the id path parameter");
182177
}
183178
pathParams.put("id", id);
179+
if (transferLimitId == null) {
180+
throw new IllegalArgumentException("Please provide the transferLimitId path parameter");
181+
}
182+
pathParams.put("transferLimitId", transferLimitId);
184183

185184
String requestBody = null;
186185
Resource resource =

src/test/java/com/adyen/service/balanceplatform/TransferLimitsBalanceAccountLevelApiTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void deletePendingTransferLimitTest() throws Exception {
8585
String balanceAccountId = "BA12345677890";
8686
String transferLimitId = "TRLI00000000000000000000000001";
8787

88-
service.deletePendingTransferLimit(transferLimitId, balanceAccountId);
88+
service.deletePendingTransferLimit(balanceAccountId, transferLimitId);
8989
verify(client.getHttpClient())
9090
.request(
9191
"https://balanceplatform-api-test.adyen.com/bcl/v2/balanceAccounts/BA12345677890/transferLimits/TRLI00000000000000000000000001",
@@ -152,7 +152,7 @@ public void getSpecificTransferLimitTest() throws Exception {
152152
String transferLimitId = "TRLI00000000000000000000000001";
153153

154154
TransferLimit transferLimit =
155-
service.getSpecificTransferLimit(transferLimitId, balanceAccountId);
155+
service.getSpecificTransferLimit(balanceAccountId, transferLimitId);
156156

157157
verify(client.getHttpClient())
158158
.request(

src/test/java/com/adyen/service/balanceplatform/TransferLimitsBalancePlatformLevelApiTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void createTransferLimitTest() throws Exception {
3131
TransferLimitsBalancePlatformLevelApi service =
3232
new TransferLimitsBalancePlatformLevelApi(client);
3333

34-
String balanceAccountId = "BA12345677890";
34+
String balancePlatform = "MY_BALANCE_PLATFORM";
3535
CreateTransferLimitRequest createTransferLimitRequest =
3636
new CreateTransferLimitRequest()
3737
.amount(new Amount().value(10000L).currency("EUR"))
@@ -43,11 +43,11 @@ public void createTransferLimitTest() throws Exception {
4343
.transferType(TransferType.ALL);
4444

4545
TransferLimit transferLimit =
46-
service.createTransferLimit(balanceAccountId, createTransferLimitRequest);
46+
service.createTransferLimit(balancePlatform, createTransferLimitRequest);
4747

4848
verify(client.getHttpClient())
4949
.request(
50-
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/BA12345677890/transferLimits",
50+
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/MY_BALANCE_PLATFORM/transferLimits",
5151
createTransferLimitRequest.toJson(),
5252
client.getConfig(),
5353
false,
@@ -64,14 +64,14 @@ public void deletePendingTransferLimitTest() throws Exception {
6464

6565
TransferLimitsBalancePlatformLevelApi service =
6666
new TransferLimitsBalancePlatformLevelApi(client);
67+
String balancePlatform = "MY_BALANCE_PLATFORM";
6768
String transferLimitId = "TRLI00000000000000000000000001";
68-
String balanceAccountId = "BA12345677890";
6969

70-
service.deletePendingTransferLimit(transferLimitId, balanceAccountId);
70+
service.deletePendingTransferLimit(balancePlatform, transferLimitId);
7171

7272
verify(client.getHttpClient())
7373
.request(
74-
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/BA12345677890/transferLimits/TRLI00000000000000000000000001",
74+
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/MY_BALANCE_PLATFORM/transferLimits/TRLI00000000000000000000000001",
7575
null,
7676
client.getConfig(),
7777
false,
@@ -85,15 +85,15 @@ public void getSpecificTransferLimitTest() throws Exception {
8585
Client client = createMockClientFromFile("mocks/balancePlatform/TransferLimit.json");
8686
TransferLimitsBalancePlatformLevelApi service =
8787
new TransferLimitsBalancePlatformLevelApi(client);
88-
String balanceAccountId = "BA12345677890";
88+
String balancePlatform = "MY_BALANCE_PLATFORM";
8989
String transferLimitId = "TRLI00000000000000000000000001";
9090

9191
TransferLimit transferLimit =
92-
service.getSpecificTransferLimit(transferLimitId, balanceAccountId);
92+
service.getSpecificTransferLimit(balancePlatform, transferLimitId);
9393

9494
verify(client.getHttpClient())
9595
.request(
96-
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/BA12345677890/transferLimits/TRLI00000000000000000000000001",
96+
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/MY_BALANCE_PLATFORM/transferLimits/TRLI00000000000000000000000001",
9797
null,
9898
client.getConfig(),
9999
false,
@@ -109,13 +109,13 @@ public void getTransferLimitsTest() throws Exception {
109109
Client client = createMockClientFromFile("mocks/balancePlatform/TransferLimits.json");
110110
TransferLimitsBalancePlatformLevelApi service =
111111
new TransferLimitsBalancePlatformLevelApi(client);
112-
String balanceAccountId = "BA12345677890";
112+
String balancePlatform = "MY_BALANCE_PLATFORM";
113113

114-
TransferLimitListResponse transferLimits = service.getTransferLimits(balanceAccountId);
114+
TransferLimitListResponse transferLimits = service.getTransferLimits(balancePlatform);
115115

116116
verify(client.getHttpClient())
117117
.request(
118-
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/BA12345677890/transferLimits",
118+
"https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/MY_BALANCE_PLATFORM/transferLimits",
119119
null,
120120
client.getConfig(),
121121
false,

0 commit comments

Comments
 (0)