-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsupplemental-documents.ts
More file actions
125 lines (110 loc) · 3.6 KB
/
supplemental-documents.ts
File metadata and controls
125 lines (110 loc) · 3.6 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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { Page, type PageParams, PagePromise } from '../core/pagination';
import { RequestOptions } from '../internal/request-options';
export class SupplementalDocuments extends APIResource {
/**
* Create a supplemental document for an Entity
*
* @example
* ```ts
* const entitySupplementalDocument =
* await client.supplementalDocuments.create({
* entity_id: 'entity_n8y8tnk2p9339ti393yi',
* file_id: 'file_makxrc67oh9l6sg7w9yc',
* });
* ```
*/
create(
body: SupplementalDocumentCreateParams,
options?: RequestOptions,
): APIPromise<EntitySupplementalDocument> {
return this._client.post('/entity_supplemental_documents', { body, ...options });
}
/**
* List Entity Supplemental Document Submissions
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const entitySupplementalDocument of client.supplementalDocuments.list(
* { entity_id: 'entity_id' },
* )) {
* // ...
* }
* ```
*/
list(
query: SupplementalDocumentListParams,
options?: RequestOptions,
): PagePromise<EntitySupplementalDocumentsPage, EntitySupplementalDocument> {
return this._client.getAPIList('/entity_supplemental_documents', Page<EntitySupplementalDocument>, {
query,
...options,
});
}
}
export type EntitySupplementalDocumentsPage = Page<EntitySupplementalDocument>;
/**
* Supplemental Documents are uploaded files connected to an Entity during
* onboarding.
*/
export interface EntitySupplementalDocument {
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the
* Supplemental Document was created.
*/
created_at: string;
/**
* The Entity the supplemental document is attached to.
*/
entity_id: string;
/**
* The File containing the document.
*/
file_id: string;
/**
* 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;
/**
* A constant representing the object's type. For this resource it will always be
* `entity_supplemental_document`.
*/
type: 'entity_supplemental_document';
}
export interface SupplementalDocumentCreateParams {
/**
* The identifier of the Entity to associate with the supplemental document.
*/
entity_id: string;
/**
* The identifier of the File containing the document.
*/
file_id: string;
[k: string]: unknown;
}
export interface SupplementalDocumentListParams extends PageParams {
/**
* The identifier of the Entity to list supplemental documents for.
*/
entity_id: string;
/**
* 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 declare namespace SupplementalDocuments {
export {
type EntitySupplementalDocument as EntitySupplementalDocument,
type EntitySupplementalDocumentsPage as EntitySupplementalDocumentsPage,
type SupplementalDocumentCreateParams as SupplementalDocumentCreateParams,
type SupplementalDocumentListParams as SupplementalDocumentListParams,
};
}