-
Notifications
You must be signed in to change notification settings - Fork 57
/
general.ts
29 lines (26 loc) · 1.28 KB
/
general.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
import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import { BalancePlatform, ObjectSerializer, PaginatedAccountHoldersResponse } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import BalancePlatformResource from "../resource/balancePlaftformResource";
class General extends Service {
public async retrieve(id: string): Promise<BalancePlatform> {
const resource = new BalancePlatformResource(this, `/balancePlatforms/${id}`);
const response = await getJsonResponse<string, BalancePlatform>(
resource,
'',
{ method: "GET" }
);
return ObjectSerializer.deserialize(response, "BalancePlatform");
}
public async listAccountHolders(id: string, requestOptions?: IRequest.Options): Promise<PaginatedAccountHoldersResponse> {
const resource = new BalancePlatformResource(this, `/balancePlatforms/${id}/accountHolders`);
const response = await getJsonResponse<string, PaginatedAccountHoldersResponse>(
resource,
'',
{ ...requestOptions, method: "GET" }
);
return ObjectSerializer.deserialize(response, "PaginatedAccountHoldersResponse");
}
}
export default General;