forked from Increase/increase-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlockboxes.ts
More file actions
245 lines (210 loc) · 6.3 KB
/
lockboxes.ts
File metadata and controls
245 lines (210 loc) · 6.3 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
// 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 LockboxesAPI from './lockboxes';
import { Page, type PageParams } from '../pagination';
export class Lockboxes extends APIResource {
/**
* Create a Lockbox
*/
create(body: LockboxCreateParams, options?: Core.RequestOptions): Core.APIPromise<Lockbox> {
return this._client.post('/lockboxes', { body, ...options });
}
/**
* Retrieve a Lockbox
*/
retrieve(lockboxId: string, options?: Core.RequestOptions): Core.APIPromise<Lockbox> {
return this._client.get(`/lockboxes/${lockboxId}`, options);
}
/**
* Update a Lockbox
*/
update(
lockboxId: string,
body: LockboxUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Lockbox> {
return this._client.patch(`/lockboxes/${lockboxId}`, { body, ...options });
}
/**
* List Lockboxes
*/
list(query?: LockboxListParams, options?: Core.RequestOptions): Core.PagePromise<LockboxesPage, Lockbox>;
list(options?: Core.RequestOptions): Core.PagePromise<LockboxesPage, Lockbox>;
list(
query: LockboxListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<LockboxesPage, Lockbox> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/lockboxes', LockboxesPage, { query, ...options });
}
}
export class LockboxesPage extends Page<Lockbox> {}
/**
* Lockboxes are physical locations that can receive mail containing paper checks.
* Increase will automatically create a Check Deposit for checks received this way.
*/
export interface Lockbox {
/**
* The Lockbox identifier.
*/
id: string;
/**
* The identifier for the Account checks sent to this lockbox will be deposited
* into.
*/
account_id: string;
/**
* The mailing address for the Lockbox.
*/
address: Lockbox.Address;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Lockbox
* was created.
*/
created_at: string;
/**
* The description you choose for the Lockbox.
*/
description: string | null;
/**
* The idempotency key you chose for this object. This value is unique across
* Increase and is used to ensure that a request is only processed once. Learn more
* about [idempotency](https://increase.com/documentation/idempotency-keys).
*/
idempotency_key: string | null;
/**
* The recipient name you choose for the Lockbox.
*/
recipient_name: string | null;
/**
* This indicates if mail can be sent to this address.
*
* - `active` - This Lockbox is active. Checks mailed to it will be deposited
* automatically.
* - `inactive` - This Lockbox is inactive. Checks mailed to it will not be
* deposited.
*/
status: 'active' | 'inactive';
/**
* A constant representing the object's type. For this resource it will always be
* `lockbox`.
*/
type: 'lockbox';
}
export namespace Lockbox {
/**
* The mailing address for the Lockbox.
*/
export interface Address {
/**
* The city of the address.
*/
city: string;
/**
* The first line of the address.
*/
line1: string;
/**
* The second line of the address.
*/
line2: string;
/**
* The postal code of the address.
*/
postal_code: string;
/**
* The recipient line of the address. This will include the recipient name you
* provide when creating the address, as well as an ATTN suffix to help route the
* mail to your lockbox. Mail senders must include this ATTN line to receive mail
* at this Lockbox.
*/
recipient: string | null;
/**
* The two-letter United States Postal Service (USPS) abbreviation for the state of
* the address.
*/
state: string;
}
}
export interface LockboxCreateParams {
/**
* The Account checks sent to this Lockbox should be deposited into.
*/
account_id: string;
/**
* The description you choose for the Lockbox, for display purposes.
*/
description?: string;
/**
* The name of the recipient that will receive mail at this location.
*/
recipient_name?: string;
}
export interface LockboxUpdateParams {
/**
* The description you choose for the Lockbox.
*/
description?: string;
/**
* The recipient name you choose for the Lockbox.
*/
recipient_name?: string;
/**
* This indicates if checks can be sent to the Lockbox.
*
* - `active` - This Lockbox is active. Checks mailed to it will be deposited
* automatically.
* - `inactive` - This Lockbox is inactive. Checks mailed to it will not be
* deposited.
*/
status?: 'active' | 'inactive';
}
export interface LockboxListParams extends PageParams {
/**
* Filter Lockboxes to those associated with the provided Account.
*/
account_id?: string;
created_at?: LockboxListParams.CreatedAt;
/**
* Filter records to the one with the specified `idempotency_key` you chose for
* that object. This value is unique across Increase and is used to ensure that a
* request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
idempotency_key?: string;
}
export namespace LockboxListParams {
export interface CreatedAt {
/**
* 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 Lockboxes {
export import Lockbox = LockboxesAPI.Lockbox;
export import LockboxesPage = LockboxesAPI.LockboxesPage;
export import LockboxCreateParams = LockboxesAPI.LockboxCreateParams;
export import LockboxUpdateParams = LockboxesAPI.LockboxUpdateParams;
export import LockboxListParams = LockboxesAPI.LockboxListParams;
}