forked from Increase/increase-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocuments.ts
More file actions
131 lines (112 loc) · 3.66 KB
/
documents.ts
File metadata and controls
131 lines (112 loc) · 3.66 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
// 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 DocumentsAPI from './documents';
import { Page, type PageParams } from '../pagination';
export class Documents extends APIResource {
/**
* Retrieve a Document
*/
retrieve(documentId: string, options?: Core.RequestOptions): Core.APIPromise<Document> {
return this._client.get(`/documents/${documentId}`, options);
}
/**
* List Documents
*/
list(query?: DocumentListParams, options?: Core.RequestOptions): Core.PagePromise<DocumentsPage, Document>;
list(options?: Core.RequestOptions): Core.PagePromise<DocumentsPage, Document>;
list(
query: DocumentListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<DocumentsPage, Document> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/documents', DocumentsPage, { query, ...options });
}
}
export class DocumentsPage extends Page<Document> {}
/**
* Increase generates certain documents / forms automatically for your application;
* they can be listed here.
*/
export interface Document {
/**
* The Document identifier.
*/
id: string;
/**
* The type of document.
*
* - `form_1099_int` - Internal Revenue Service Form 1099-INT.
* - `proof_of_authorization` - A document submitted in response to a proof of
* authorization request for an ACH transfer.
* - `company_information` - Company information, such a policies or procedures,
* typically submitted during our due diligence process.
*/
category: 'form_1099_int' | 'proof_of_authorization' | 'company_information';
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the
* Document was created.
*/
created_at: string;
/**
* The identifier of the Entity the document was generated for.
*/
entity_id: string | null;
/**
* The identifier of the File containing the Document's contents.
*/
file_id: string;
/**
* A constant representing the object's type. For this resource it will always be
* `document`.
*/
type: 'document';
}
export interface DocumentListParams extends PageParams {
category?: DocumentListParams.Category;
created_at?: DocumentListParams.CreatedAt;
/**
* Filter Documents to ones belonging to the specified Entity.
*/
entity_id?: string;
}
export namespace DocumentListParams {
export interface Category {
/**
* Filter Documents for those with the specified category or categories. For GET
* requests, this should be encoded as a comma-delimited string, such as
* `?in=one,two,three`.
*/
in?: Array<'form_1099_int' | 'proof_of_authorization' | 'company_information'>;
}
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 Documents {
export import Document = DocumentsAPI.Document;
export import DocumentsPage = DocumentsAPI.DocumentsPage;
export import DocumentListParams = DocumentsAPI.DocumentListParams;
}