forked from Increase/increase-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount-statements.ts
More file actions
135 lines (115 loc) · 3.85 KB
/
account-statements.ts
File metadata and controls
135 lines (115 loc) · 3.85 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
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
134
135
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as AccountStatementsAPI from './account-statements';
import { Page, type PageParams } from '../pagination';
export class AccountStatements extends APIResource {
/**
* Retrieve an Account Statement
*/
retrieve(accountStatementId: string, options?: Core.RequestOptions): Core.APIPromise<AccountStatement> {
return this._client.get(`/account_statements/${accountStatementId}`, options);
}
/**
* List Account Statements
*/
list(
query?: AccountStatementListParams,
options?: Core.RequestOptions,
): Core.PagePromise<AccountStatementsPage, AccountStatement>;
list(options?: Core.RequestOptions): Core.PagePromise<AccountStatementsPage, AccountStatement>;
list(
query: AccountStatementListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<AccountStatementsPage, AccountStatement> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/account_statements', AccountStatementsPage, { query, ...options });
}
}
export class AccountStatementsPage extends Page<AccountStatement> {}
/**
* Account Statements are generated monthly for every active Account. You can
* access the statement's data via the API or retrieve a PDF with its details via
* its associated File.
*/
export interface AccountStatement {
/**
* The Account Statement identifier.
*/
id: string;
/**
* The identifier for the Account this Account Statement belongs to.
*/
account_id: string;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Account
* Statement was created.
*/
created_at: string;
/**
* The Account's balance at the start of its statement period.
*/
ending_balance: number;
/**
* The identifier of the File containing a PDF of the statement.
*/
file_id: string;
/**
* The Account's balance at the start of its statement period.
*/
starting_balance: number;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end
* of the period the Account Statement covers.
*/
statement_period_end: string;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the
* start of the period the Account Statement covers.
*/
statement_period_start: string;
/**
* A constant representing the object's type. For this resource it will always be
* `account_statement`.
*/
type: 'account_statement';
}
export interface AccountStatementListParams extends PageParams {
/**
* Filter Account Statements to those belonging to the specified Account.
*/
account_id?: string;
statement_period_start?: AccountStatementListParams.StatementPeriodStart;
}
export namespace AccountStatementListParams {
export interface StatementPeriodStart {
/**
* Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
* timestamp.
*/
after?: string;
/**
* Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
* timestamp.
*/
before?: string;
/**
* Return results on or after this
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
*/
on_or_after?: string;
/**
* Return results on or before this
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
*/
on_or_before?: string;
}
}
export namespace AccountStatements {
export import AccountStatement = AccountStatementsAPI.AccountStatement;
export import AccountStatementsPage = AccountStatementsAPI.AccountStatementsPage;
export import AccountStatementListParams = AccountStatementsAPI.AccountStatementListParams;
}