-
Notifications
You must be signed in to change notification settings - Fork 57
/
paymentInstrumentGroups.ts
39 lines (34 loc) · 1.7 KB
/
paymentInstrumentGroups.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import { ObjectSerializer, PaymentInstrumentGroup, PaymentInstrumentGroupInfo, TransactionRulesResponse } from "../../typings/balancePlatform/models";
import BalancePlatformResource from "../resource/balancePlaftformResource";
class PaymentInstrumentGroups extends Service {
public async create(request: PaymentInstrumentGroupInfo): Promise<PaymentInstrumentGroup> {
const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups`);
const response = await getJsonResponse<PaymentInstrumentGroupInfo, PaymentInstrumentGroup>(
resource,
request,
{ method: "POST" }
);
return ObjectSerializer.deserialize(response, "PaymentInstrumentGroup");
}
public async retrieve(id: string): Promise<PaymentInstrumentGroup> {
const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups/${id}`);
const response = await getJsonResponse<string, PaymentInstrumentGroup>(
resource,
"",
{ method: "GET" }
);
return ObjectSerializer.deserialize(response, "PaymentInstrumentGroup");
}
public async listTransactionRules(id: string): Promise<TransactionRulesResponse> {
const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups/${id}/transactionRules`);
const response = await getJsonResponse<string, TransactionRulesResponse>(
resource,
"",
{ method: "GET" }
);
return ObjectSerializer.deserialize(response, "TransactionRulesResponse");
}
}
export default PaymentInstrumentGroups;