-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbalances.ts
More file actions
55 lines (49 loc) · 1.74 KB
/
Copy pathbalances.ts
File metadata and controls
55 lines (49 loc) · 1.74 KB
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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as FinancialAccountsAPI from '../financial-accounts/financial-accounts';
import { FinancialAccountBalancesSinglePage } from '../financial-accounts/financial-accounts';
import { PagePromise, SinglePage } from '../../core/pagination';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Balances extends APIResource {
/**
* Get the balances for a given card.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const financialAccountBalance of client.cards.balances.list(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* )) {
* // ...
* }
* ```
*/
list(
cardToken: string,
query: BalanceListParams | null | undefined = {},
options?: RequestOptions,
): PagePromise<FinancialAccountBalancesSinglePage, FinancialAccountsAPI.FinancialAccountBalance> {
return this._client.getAPIList(
path`/v1/cards/${cardToken}/balances`,
SinglePage<FinancialAccountsAPI.FinancialAccountBalance>,
{ query, ...options },
);
}
}
export interface BalanceListParams {
/**
* UTC date of the balance to retrieve. Defaults to latest available balance
*/
balance_date?: string;
/**
* Balance after a given financial event occured. For example, passing the
* event_token of a $5 CARD_CLEARING financial event will return a balance
* decreased by $5
*/
last_transaction_event_token?: string;
}
export declare namespace Balances {
export { type BalanceListParams as BalanceListParams };
}
export { type FinancialAccountBalancesSinglePage };