-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplatepdf.ts
More file actions
181 lines (148 loc) · 3.91 KB
/
templatepdf.ts
File metadata and controls
181 lines (148 loc) · 3.91 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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as DocumentAPI from '../document';
import * as FieldsAPI from './fields';
import { FieldCreateParams, FieldListResponse, Fields } from './fields';
import { APIPromise } from '../../core/api-promise';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Templatepdf extends APIResource {
fields: FieldsAPI.Fields = new FieldsAPI.Fields(this._client);
/**
* Upload a PDF document you want to send to be signed
*
* @example
* ```ts
* await client.templatepdf.create({
* group: '/api/v1/group/IK-GV--w1tvt/',
* pdf_file: 'U3RhaW5sZXNzIHJvY2tz',
* });
* ```
*/
create(body: TemplatepdfCreateParams, options?: RequestOptions): APIPromise<void> {
return this._client.post('/templatepdf/', {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* Get PDF template
*
* @example
* ```ts
* const templatePdf = await client.templatepdf.retrieve(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* );
* ```
*/
retrieve(pdfID: string, options?: RequestOptions): APIPromise<TemplatePdf> {
return this._client.get(path`/templatepdf/${pdfID}/`, options);
}
/**
* Get PDF templates
*
* @example
* ```ts
* const templatepdfs = await client.templatepdf.list();
* ```
*/
list(
query: TemplatepdfListParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<TemplatepdfListResponse> {
return this._client.get('/templatepdf/', { query, ...options });
}
/**
* Get PDF embeddable link
*
* @example
* ```ts
* const response = await client.templatepdf.getEditLink(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* );
* ```
*/
getEditLink(pdfID: string, options?: RequestOptions): APIPromise<string> {
return this._client.get(path`/templatepdf/${pdfID}/edit-link/`, options);
}
}
export interface TemplatePdf {
created?: string;
group?: string;
modified?: string;
page_count?: number;
/**
* JSON stringified array of document parties
*/
parties?: string;
resource_uri?: string;
signer_count?: number;
title?: string;
/**
* resource_uri for user
*/
user?: string;
/**
* id for pdf object
*/
uuid?: string;
/**
* Is able to be sent (if fields do not validate)
*/
valid?: boolean;
}
export interface TemplatepdfListResponse {
meta?: DocumentAPI.ListMeta;
objects?: Array<TemplatePdf>;
}
export type TemplatepdfGetEditLinkResponse = string;
export interface TemplatepdfCreateParams {
group: string;
/**
* base64 encoded PDF file data
*/
pdf_file: string;
/**
* archive PDF when sent
*/
archive_upon_send?: boolean;
process_tags?: boolean;
title?: string;
/**
* assign to group member if not api user
*/
user?: string;
}
export interface TemplatepdfListParams {
archive?: string;
/**
* can be full resource_uri or only id
*/
group?: string;
/**
* Length of dataset to return. Use with offset query to iterate through results.
*/
limit?: number;
/**
* Offset from start of dataset. Use with the limit query to iterate through
* dataset.
*/
offset?: number;
}
Templatepdf.Fields = Fields;
export declare namespace Templatepdf {
export {
type TemplatePdf as TemplatePdf,
type TemplatepdfListResponse as TemplatepdfListResponse,
type TemplatepdfGetEditLinkResponse as TemplatepdfGetEditLinkResponse,
type TemplatepdfCreateParams as TemplatepdfCreateParams,
type TemplatepdfListParams as TemplatepdfListParams,
};
export {
Fields as Fields,
type FieldListResponse as FieldListResponse,
type FieldCreateParams as FieldCreateParams,
};
}