-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccounts.ts
133 lines (104 loc) · 2.7 KB
/
accounts.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import * as UsageAPI from './institutions/usage';
export class Accounts extends APIResource {
/**
* Get Accounts
*/
list(query: AccountListParams, options?: Core.RequestOptions): Core.APIPromise<Accounts> {
return this._client.get('/accounts', { query, ...options });
}
/**
* Delete Accounts
*/
delete(params: AccountDeleteParams, options?: Core.RequestOptions): Core.APIPromise<AccountDeleteResponse> {
const { accountId, provider, accessToken } = params;
return this._client.delete('/accounts', { query: { accountId, provider, accessToken }, ...options });
}
/**
* Get Account Balance
*/
balance(query: AccountBalanceParams, options?: Core.RequestOptions): Core.APIPromise<AccountBalance> {
return this._client.get('/accounts/balance', { query, ...options });
}
}
export interface AccountBalance {
data: AccountBalance.Data | null;
}
export namespace AccountBalance {
export interface Data {
amount: number;
currency: string;
}
}
export interface Accounts {
data: Array<Accounts.Data>;
}
export namespace Accounts {
export interface Data {
id: string;
balance: Data.Balance;
currency: string;
enrollment_id: string | null;
institution: UsageAPI.Institution;
name: string;
type: 'depository' | 'credit' | 'other_asset' | 'loan' | 'other_liability';
}
export namespace Data {
export interface Balance {
amount: number;
currency: string;
}
}
}
export interface AccountDeleteResponse {
success: boolean;
}
export interface AccountListParams {
provider: 'teller' | 'plaid' | 'gocardless';
/**
* GoCardLess reference id
*/
id?: string;
/**
* Teller or Plaid access token
*/
accessToken?: string;
/**
* Plaid institution id
*/
institutionId?: string;
}
export interface AccountDeleteParams {
/**
* Account id (GoCardLess)
*/
accountId: string;
provider: 'teller' | 'plaid' | 'gocardless';
/**
* Teller or Plaid access token
*/
accessToken?: string;
}
export interface AccountBalanceParams {
/**
* Account id
*/
id: string;
provider: 'teller' | 'plaid' | 'gocardless';
/**
* Teller or Plaid access token
*/
accessToken?: string;
}
export declare namespace Accounts {
export {
type AccountBalance as AccountBalance,
type Accounts as Accounts,
type AccountDeleteResponse as AccountDeleteResponse,
type AccountListParams as AccountListParams,
type AccountDeleteParams as AccountDeleteParams,
type AccountBalanceParams as AccountBalanceParams,
};
}