7
7
* Do not edit this class manually.
8
8
*/
9
9
10
+
10
11
import getJsonResponse from "../../helpers/getJsonResponse" ;
11
12
import Service from "../../service" ;
12
13
import Client from "../../client" ;
13
- import {
14
- BalanceAccount ,
15
- BalanceAccountInfo ,
16
- BalanceAccountUpdateRequest ,
17
- BalanceSweepConfigurationsResponse ,
18
- CreateSweepConfigurationV2 ,
19
- PaginatedPaymentInstrumentsResponse ,
20
- SweepConfigurationV2 ,
21
- TransactionRulesResponse ,
22
- UpdateSweepConfigurationV2 ,
23
- ObjectSerializer
24
- } from "../../typings/balancePlatform/models" ;
25
14
import { IRequest } from "../../typings/requestOptions" ;
26
15
import Resource from "../resource" ;
27
16
17
+ import { ObjectSerializer } from "../../typings/balancePlatform/objectSerializer" ;
18
+ import { BalanceAccount } from "../../typings/balancePlatform/models" ;
19
+ import { BalanceAccountInfo } from "../../typings/balancePlatform/models" ;
20
+ import { BalanceAccountUpdateRequest } from "../../typings/balancePlatform/models" ;
21
+ import { BalanceSweepConfigurationsResponse } from "../../typings/balancePlatform/models" ;
22
+ import { CreateSweepConfigurationV2 } from "../../typings/balancePlatform/models" ;
23
+ import { PaginatedPaymentInstrumentsResponse } from "../../typings/balancePlatform/models" ;
24
+ import { SweepConfigurationV2 } from "../../typings/balancePlatform/models" ;
25
+ import { TransactionRulesResponse } from "../../typings/balancePlatform/models" ;
26
+ import { UpdateSweepConfigurationV2 } from "../../typings/balancePlatform/models" ;
27
+
28
+ /**
29
+ * API handler for BalanceAccountsApi
30
+ */
28
31
export class BalanceAccountsApi extends Service {
29
32
30
33
private readonly API_BASEPATH : string = "https://balanceplatform-api-test.adyen.com/bcl/v2" ;
@@ -44,13 +47,15 @@ export class BalanceAccountsApi extends Service {
44
47
public async createBalanceAccount ( balanceAccountInfo : BalanceAccountInfo , requestOptions ?: IRequest . Options ) : Promise < BalanceAccount > {
45
48
const endpoint = `${ this . baseUrl } /balanceAccounts` ;
46
49
const resource = new Resource ( this , endpoint ) ;
47
- const request : BalanceAccountInfo = ObjectSerializer . serialize ( balanceAccountInfo , "BalanceAccountInfo" ) ;
50
+
51
+ const request : BalanceAccountInfo = ObjectSerializer . serialize ( balanceAccountInfo , "BalanceAccountInfo" , "" ) ;
48
52
const response = await getJsonResponse < BalanceAccountInfo , BalanceAccount > (
49
53
resource ,
50
54
request ,
51
55
{ ...requestOptions , method : "POST" }
52
56
) ;
53
- return ObjectSerializer . deserialize ( response , "BalanceAccount" ) ;
57
+
58
+ return ObjectSerializer . deserialize ( response , "BalanceAccount" , "" ) ;
54
59
}
55
60
56
61
/**
@@ -64,26 +69,30 @@ export class BalanceAccountsApi extends Service {
64
69
const endpoint = `${ this . baseUrl } /balanceAccounts/{balanceAccountId}/sweeps`
65
70
. replace ( "{" + "balanceAccountId" + "}" , encodeURIComponent ( String ( balanceAccountId ) ) ) ;
66
71
const resource = new Resource ( this , endpoint ) ;
67
- const request : CreateSweepConfigurationV2 = ObjectSerializer . serialize ( createSweepConfigurationV2 , "CreateSweepConfigurationV2" ) ;
72
+
73
+ const request : CreateSweepConfigurationV2 = ObjectSerializer . serialize ( createSweepConfigurationV2 , "CreateSweepConfigurationV2" , "" ) ;
68
74
const response = await getJsonResponse < CreateSweepConfigurationV2 , SweepConfigurationV2 > (
69
75
resource ,
70
76
request ,
71
77
{ ...requestOptions , method : "POST" }
72
78
) ;
73
- return ObjectSerializer . deserialize ( response , "SweepConfigurationV2" ) ;
79
+
80
+ return ObjectSerializer . deserialize ( response , "SweepConfigurationV2" , "" ) ;
74
81
}
75
82
76
83
/**
77
84
* @summary Delete a sweep
78
85
* @param balanceAccountId {@link string } The unique identifier of the balance account.
79
86
* @param sweepId {@link string } The unique identifier of the sweep.
80
87
* @param requestOptions {@link IRequest.Options }
88
+ * @return {@link void }
81
89
*/
82
90
public async deleteSweep ( balanceAccountId : string , sweepId : string , requestOptions ?: IRequest . Options ) : Promise < void > {
83
91
const endpoint = `${ this . baseUrl } /balanceAccounts/{balanceAccountId}/sweeps/{sweepId}`
84
92
. replace ( "{" + "balanceAccountId" + "}" , encodeURIComponent ( String ( balanceAccountId ) ) )
85
93
. replace ( "{" + "sweepId" + "}" , encodeURIComponent ( String ( sweepId ) ) ) ;
86
94
const resource = new Resource ( this , endpoint ) ;
95
+
87
96
await getJsonResponse < string , void > (
88
97
resource ,
89
98
"" ,
@@ -103,6 +112,7 @@ export class BalanceAccountsApi extends Service {
103
112
const endpoint = `${ this . baseUrl } /balanceAccounts/{balanceAccountId}/sweeps`
104
113
. replace ( "{" + "balanceAccountId" + "}" , encodeURIComponent ( String ( balanceAccountId ) ) ) ;
105
114
const resource = new Resource ( this , endpoint ) ;
115
+
106
116
const hasDefinedQueryParams = offset ?? limit ;
107
117
if ( hasDefinedQueryParams ) {
108
118
if ( ! requestOptions ) requestOptions = { } ;
@@ -115,7 +125,8 @@ export class BalanceAccountsApi extends Service {
115
125
"" ,
116
126
{ ...requestOptions , method : "GET" }
117
127
) ;
118
- return ObjectSerializer . deserialize ( response , "BalanceSweepConfigurationsResponse" ) ;
128
+
129
+ return ObjectSerializer . deserialize ( response , "BalanceSweepConfigurationsResponse" , "" ) ;
119
130
}
120
131
121
132
/**
@@ -128,12 +139,14 @@ export class BalanceAccountsApi extends Service {
128
139
const endpoint = `${ this . baseUrl } /balanceAccounts/{id}/transactionRules`
129
140
. replace ( "{" + "id" + "}" , encodeURIComponent ( String ( id ) ) ) ;
130
141
const resource = new Resource ( this , endpoint ) ;
142
+
131
143
const response = await getJsonResponse < string , TransactionRulesResponse > (
132
144
resource ,
133
145
"" ,
134
146
{ ...requestOptions , method : "GET" }
135
147
) ;
136
- return ObjectSerializer . deserialize ( response , "TransactionRulesResponse" ) ;
148
+
149
+ return ObjectSerializer . deserialize ( response , "TransactionRulesResponse" , "" ) ;
137
150
}
138
151
139
152
/**
@@ -146,12 +159,14 @@ export class BalanceAccountsApi extends Service {
146
159
const endpoint = `${ this . baseUrl } /balanceAccounts/{id}`
147
160
. replace ( "{" + "id" + "}" , encodeURIComponent ( String ( id ) ) ) ;
148
161
const resource = new Resource ( this , endpoint ) ;
162
+
149
163
const response = await getJsonResponse < string , BalanceAccount > (
150
164
resource ,
151
165
"" ,
152
166
{ ...requestOptions , method : "GET" }
153
167
) ;
154
- return ObjectSerializer . deserialize ( response , "BalanceAccount" ) ;
168
+
169
+ return ObjectSerializer . deserialize ( response , "BalanceAccount" , "" ) ;
155
170
}
156
171
157
172
/**
@@ -167,6 +182,7 @@ export class BalanceAccountsApi extends Service {
167
182
const endpoint = `${ this . baseUrl } /balanceAccounts/{id}/paymentInstruments`
168
183
. replace ( "{" + "id" + "}" , encodeURIComponent ( String ( id ) ) ) ;
169
184
const resource = new Resource ( this , endpoint ) ;
185
+
170
186
const hasDefinedQueryParams = offset ?? limit ?? status ;
171
187
if ( hasDefinedQueryParams ) {
172
188
if ( ! requestOptions ) requestOptions = { } ;
@@ -180,7 +196,8 @@ export class BalanceAccountsApi extends Service {
180
196
"" ,
181
197
{ ...requestOptions , method : "GET" }
182
198
) ;
183
- return ObjectSerializer . deserialize ( response , "PaginatedPaymentInstrumentsResponse" ) ;
199
+
200
+ return ObjectSerializer . deserialize ( response , "PaginatedPaymentInstrumentsResponse" , "" ) ;
184
201
}
185
202
186
203
/**
@@ -195,12 +212,14 @@ export class BalanceAccountsApi extends Service {
195
212
. replace ( "{" + "balanceAccountId" + "}" , encodeURIComponent ( String ( balanceAccountId ) ) )
196
213
. replace ( "{" + "sweepId" + "}" , encodeURIComponent ( String ( sweepId ) ) ) ;
197
214
const resource = new Resource ( this , endpoint ) ;
215
+
198
216
const response = await getJsonResponse < string , SweepConfigurationV2 > (
199
217
resource ,
200
218
"" ,
201
219
{ ...requestOptions , method : "GET" }
202
220
) ;
203
- return ObjectSerializer . deserialize ( response , "SweepConfigurationV2" ) ;
221
+
222
+ return ObjectSerializer . deserialize ( response , "SweepConfigurationV2" , "" ) ;
204
223
}
205
224
206
225
/**
@@ -214,13 +233,15 @@ export class BalanceAccountsApi extends Service {
214
233
const endpoint = `${ this . baseUrl } /balanceAccounts/{id}`
215
234
. replace ( "{" + "id" + "}" , encodeURIComponent ( String ( id ) ) ) ;
216
235
const resource = new Resource ( this , endpoint ) ;
217
- const request : BalanceAccountUpdateRequest = ObjectSerializer . serialize ( balanceAccountUpdateRequest , "BalanceAccountUpdateRequest" ) ;
236
+
237
+ const request : BalanceAccountUpdateRequest = ObjectSerializer . serialize ( balanceAccountUpdateRequest , "BalanceAccountUpdateRequest" , "" ) ;
218
238
const response = await getJsonResponse < BalanceAccountUpdateRequest , BalanceAccount > (
219
239
resource ,
220
240
request ,
221
241
{ ...requestOptions , method : "PATCH" }
222
242
) ;
223
- return ObjectSerializer . deserialize ( response , "BalanceAccount" ) ;
243
+
244
+ return ObjectSerializer . deserialize ( response , "BalanceAccount" , "" ) ;
224
245
}
225
246
226
247
/**
@@ -236,12 +257,15 @@ export class BalanceAccountsApi extends Service {
236
257
. replace ( "{" + "balanceAccountId" + "}" , encodeURIComponent ( String ( balanceAccountId ) ) )
237
258
. replace ( "{" + "sweepId" + "}" , encodeURIComponent ( String ( sweepId ) ) ) ;
238
259
const resource = new Resource ( this , endpoint ) ;
239
- const request : UpdateSweepConfigurationV2 = ObjectSerializer . serialize ( updateSweepConfigurationV2 , "UpdateSweepConfigurationV2" ) ;
260
+
261
+ const request : UpdateSweepConfigurationV2 = ObjectSerializer . serialize ( updateSweepConfigurationV2 , "UpdateSweepConfigurationV2" , "" ) ;
240
262
const response = await getJsonResponse < UpdateSweepConfigurationV2 , SweepConfigurationV2 > (
241
263
resource ,
242
264
request ,
243
265
{ ...requestOptions , method : "PATCH" }
244
266
) ;
245
- return ObjectSerializer . deserialize ( response , "SweepConfigurationV2" ) ;
267
+
268
+ return ObjectSerializer . deserialize ( response , "SweepConfigurationV2" , "" ) ;
246
269
}
270
+
247
271
}
0 commit comments