docspring-ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +56 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/LICENSE +7 -0
- package/api/PDFApi.ts +2867 -0
- package/api/apis.ts +14 -0
- package/api.ts +3 -0
- package/git_push.sh +57 -0
- package/model/addFieldsData.ts +31 -0
- package/model/addFieldsTemplateResponse.ts +49 -0
- package/model/authenticationError.ts +42 -0
- package/model/authenticationSuccessResponse.ts +36 -0
- package/model/combinedSubmission.ts +111 -0
- package/model/combinedSubmissionAction.ts +79 -0
- package/model/combinedSubmissionData.ts +55 -0
- package/model/copyTemplateData.ts +37 -0
- package/model/createCombinedSubmissionResponse.ts +50 -0
- package/model/createCustomFileResponse.ts +49 -0
- package/model/createFolderData.ts +32 -0
- package/model/createFolderDataFolder.ts +37 -0
- package/model/createHtmlTemplateData.ts +32 -0
- package/model/createSubmissionBatchResponse.ts +63 -0
- package/model/createSubmissionBatchSubmissionsResponse.ts +51 -0
- package/model/createSubmissionDataRequestData.ts +122 -0
- package/model/createSubmissionDataRequestTokenResponse.ts +50 -0
- package/model/createSubmissionDataRequestTokenResponseToken.ts +49 -0
- package/model/createSubmissionResponse.ts +50 -0
- package/model/createTemplateFromUploadData.ts +32 -0
- package/model/deleteTemplateResponse.ts +43 -0
- package/model/folder.ts +49 -0
- package/model/fullTemplate.ts +267 -0
- package/model/fullTemplateDefaults.ts +43 -0
- package/model/htmlTemplateData.ts +138 -0
- package/model/invalidRequest.ts +42 -0
- package/model/listSubmissionsResponse.ts +44 -0
- package/model/modelError.ts +42 -0
- package/model/models.ts +403 -0
- package/model/moveFolderData.ts +31 -0
- package/model/moveTemplateData.ts +31 -0
- package/model/pendingTemplate.ts +134 -0
- package/model/renameFolderData.ts +31 -0
- package/model/submission.ts +156 -0
- package/model/submissionAction.ts +79 -0
- package/model/submissionBatch.ts +87 -0
- package/model/submissionBatchData.ts +50 -0
- package/model/submissionData.ts +80 -0
- package/model/submissionDataBatchRequest.ts +61 -0
- package/model/submissionDataRequest.ts +174 -0
- package/model/template.ts +152 -0
- package/model/templateData.ts +128 -0
- package/model/updateDataRequestResponse.ts +50 -0
- package/model/updateSubmissionDataRequestData.ts +122 -0
- package/model/updateTemplateData.ts +32 -0
- package/model/updateTemplateResponse.ts +43 -0
- package/model/uploadTemplateData.ts +145 -0
- package/model/uploadTemplateDataDocument.ts +49 -0
- package/model/uploadTemplateDataDocumentMetadata.ts +48 -0
- package/package.json +29 -0
- package/tsconfig.json +25 -0
package/api/PDFApi.ts
ADDED
|
@@ -0,0 +1,2867 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API v1
|
|
3
|
+
* DocSpring is a service that helps you fill out and sign PDF templates.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: v1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import localVarRequest from 'request';
|
|
15
|
+
import http from 'http';
|
|
16
|
+
|
|
17
|
+
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { AddFieldsData } from '../model/addFieldsData';
|
|
19
|
+
import { AddFieldsTemplateResponse } from '../model/addFieldsTemplateResponse';
|
|
20
|
+
import { AuthenticationError } from '../model/authenticationError';
|
|
21
|
+
import { AuthenticationSuccessResponse } from '../model/authenticationSuccessResponse';
|
|
22
|
+
import { CombinedSubmission } from '../model/combinedSubmission';
|
|
23
|
+
import { CombinedSubmissionData } from '../model/combinedSubmissionData';
|
|
24
|
+
import { CopyTemplateData } from '../model/copyTemplateData';
|
|
25
|
+
import { CreateCombinedSubmissionResponse } from '../model/createCombinedSubmissionResponse';
|
|
26
|
+
import { CreateCustomFileResponse } from '../model/createCustomFileResponse';
|
|
27
|
+
import { CreateFolderData } from '../model/createFolderData';
|
|
28
|
+
import { CreateHtmlTemplateData } from '../model/createHtmlTemplateData';
|
|
29
|
+
import { CreateSubmissionBatchResponse } from '../model/createSubmissionBatchResponse';
|
|
30
|
+
import { CreateSubmissionDataRequestTokenResponse } from '../model/createSubmissionDataRequestTokenResponse';
|
|
31
|
+
import { CreateSubmissionResponse } from '../model/createSubmissionResponse';
|
|
32
|
+
import { CreateTemplateFromUploadData } from '../model/createTemplateFromUploadData';
|
|
33
|
+
import { DeleteTemplateResponse } from '../model/deleteTemplateResponse';
|
|
34
|
+
import { Folder } from '../model/folder';
|
|
35
|
+
import { FullTemplate } from '../model/fullTemplate';
|
|
36
|
+
import { InvalidRequest } from '../model/invalidRequest';
|
|
37
|
+
import { ListSubmissionsResponse } from '../model/listSubmissionsResponse';
|
|
38
|
+
import { ModelError } from '../model/modelError';
|
|
39
|
+
import { MoveFolderData } from '../model/moveFolderData';
|
|
40
|
+
import { MoveTemplateData } from '../model/moveTemplateData';
|
|
41
|
+
import { PendingTemplate } from '../model/pendingTemplate';
|
|
42
|
+
import { RenameFolderData } from '../model/renameFolderData';
|
|
43
|
+
import { Submission } from '../model/submission';
|
|
44
|
+
import { SubmissionBatch } from '../model/submissionBatch';
|
|
45
|
+
import { SubmissionBatchData } from '../model/submissionBatchData';
|
|
46
|
+
import { SubmissionData } from '../model/submissionData';
|
|
47
|
+
import { SubmissionDataRequest } from '../model/submissionDataRequest';
|
|
48
|
+
import { Template } from '../model/template';
|
|
49
|
+
import { UpdateDataRequestResponse } from '../model/updateDataRequestResponse';
|
|
50
|
+
import { UpdateSubmissionDataRequestData } from '../model/updateSubmissionDataRequestData';
|
|
51
|
+
import { UpdateTemplateData } from '../model/updateTemplateData';
|
|
52
|
+
import { UpdateTemplateResponse } from '../model/updateTemplateResponse';
|
|
53
|
+
|
|
54
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
55
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
56
|
+
|
|
57
|
+
import { HttpError, RequestFile } from './apis';
|
|
58
|
+
|
|
59
|
+
let defaultBasePath = 'https://api.docspring.com/api/v1';
|
|
60
|
+
|
|
61
|
+
// ===============================================
|
|
62
|
+
// This file is autogenerated - Please do not edit
|
|
63
|
+
// ===============================================
|
|
64
|
+
|
|
65
|
+
export enum PDFApiApiKeys {
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class PDFApi {
|
|
69
|
+
protected _basePath = defaultBasePath;
|
|
70
|
+
protected _defaultHeaders : any = {};
|
|
71
|
+
protected _useQuerystring : boolean = false;
|
|
72
|
+
|
|
73
|
+
protected authentications = {
|
|
74
|
+
'default': <Authentication>new VoidAuth(),
|
|
75
|
+
'api_token_basic': new HttpBasicAuth(),
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
protected interceptors: Interceptor[] = [];
|
|
79
|
+
|
|
80
|
+
constructor(basePath?: string);
|
|
81
|
+
constructor(username: string, password: string, basePath?: string);
|
|
82
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
83
|
+
if (password) {
|
|
84
|
+
this.username = basePathOrUsername;
|
|
85
|
+
this.password = password
|
|
86
|
+
if (basePath) {
|
|
87
|
+
this.basePath = basePath;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
if (basePathOrUsername) {
|
|
91
|
+
this.basePath = basePathOrUsername
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
set useQuerystring(value: boolean) {
|
|
97
|
+
this._useQuerystring = value;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
set basePath(basePath: string) {
|
|
101
|
+
this._basePath = basePath;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
105
|
+
this._defaultHeaders = defaultHeaders;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
get defaultHeaders() {
|
|
109
|
+
return this._defaultHeaders;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
get basePath() {
|
|
113
|
+
return this._basePath;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
117
|
+
this.authentications.default = auth;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public setApiKey(key: PDFApiApiKeys, value: string) {
|
|
121
|
+
(this.authentications as any)[PDFApiApiKeys[key]].apiKey = value;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
set username(username: string) {
|
|
125
|
+
this.authentications.api_token_basic.username = username;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
set password(password: string) {
|
|
129
|
+
this.authentications.api_token_basic.password = password;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
133
|
+
this.interceptors.push(interceptor);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @summary Add new fields to a Template
|
|
139
|
+
* @param templateId
|
|
140
|
+
* @param data
|
|
141
|
+
*/
|
|
142
|
+
public async addFieldsToTemplate (templateId: string, data: AddFieldsData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AddFieldsTemplateResponse; }> {
|
|
143
|
+
const localVarPath = this.basePath + '/templates/{template_id}/add_fields'
|
|
144
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
145
|
+
let localVarQueryParameters: any = {};
|
|
146
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
147
|
+
const produces = ['application/json'];
|
|
148
|
+
// give precedence to 'application/json'
|
|
149
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
150
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
151
|
+
} else {
|
|
152
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
153
|
+
}
|
|
154
|
+
let localVarFormParams: any = {};
|
|
155
|
+
|
|
156
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
157
|
+
if (templateId === null || templateId === undefined) {
|
|
158
|
+
throw new Error('Required parameter templateId was null or undefined when calling addFieldsToTemplate.');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// verify required parameter 'data' is not null or undefined
|
|
162
|
+
if (data === null || data === undefined) {
|
|
163
|
+
throw new Error('Required parameter data was null or undefined when calling addFieldsToTemplate.');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
167
|
+
|
|
168
|
+
let localVarUseFormData = false;
|
|
169
|
+
|
|
170
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
171
|
+
method: 'PUT',
|
|
172
|
+
qs: localVarQueryParameters,
|
|
173
|
+
headers: localVarHeaderParams,
|
|
174
|
+
uri: localVarPath,
|
|
175
|
+
useQuerystring: this._useQuerystring,
|
|
176
|
+
json: true,
|
|
177
|
+
body: ObjectSerializer.serialize(data, "AddFieldsData")
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
let authenticationPromise = Promise.resolve();
|
|
181
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
182
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
183
|
+
}
|
|
184
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
185
|
+
|
|
186
|
+
let interceptorPromise = authenticationPromise;
|
|
187
|
+
for (const interceptor of this.interceptors) {
|
|
188
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return interceptorPromise.then(() => {
|
|
192
|
+
if (Object.keys(localVarFormParams).length) {
|
|
193
|
+
if (localVarUseFormData) {
|
|
194
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
195
|
+
} else {
|
|
196
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return new Promise<{ response: http.IncomingMessage; body: AddFieldsTemplateResponse; }>((resolve, reject) => {
|
|
200
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
201
|
+
if (error) {
|
|
202
|
+
reject(error);
|
|
203
|
+
} else {
|
|
204
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
205
|
+
body = ObjectSerializer.deserialize(body, "AddFieldsTemplateResponse");
|
|
206
|
+
resolve({ response: response, body: body });
|
|
207
|
+
} else {
|
|
208
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
*
|
|
217
|
+
* @summary Generates multiple PDFs
|
|
218
|
+
* @param templateId
|
|
219
|
+
* @param data
|
|
220
|
+
*/
|
|
221
|
+
public async batchGeneratePdfV1 (templateId: string, data: Array<object>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<CreateSubmissionResponse>; }> {
|
|
222
|
+
const localVarPath = this.basePath + '/templates/{template_id}/submissions/batch'
|
|
223
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
224
|
+
let localVarQueryParameters: any = {};
|
|
225
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
226
|
+
const produces = ['application/json'];
|
|
227
|
+
// give precedence to 'application/json'
|
|
228
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
229
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
230
|
+
} else {
|
|
231
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
232
|
+
}
|
|
233
|
+
let localVarFormParams: any = {};
|
|
234
|
+
|
|
235
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
236
|
+
if (templateId === null || templateId === undefined) {
|
|
237
|
+
throw new Error('Required parameter templateId was null or undefined when calling batchGeneratePdfV1.');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// verify required parameter 'data' is not null or undefined
|
|
241
|
+
if (data === null || data === undefined) {
|
|
242
|
+
throw new Error('Required parameter data was null or undefined when calling batchGeneratePdfV1.');
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
246
|
+
|
|
247
|
+
let localVarUseFormData = false;
|
|
248
|
+
|
|
249
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
250
|
+
method: 'POST',
|
|
251
|
+
qs: localVarQueryParameters,
|
|
252
|
+
headers: localVarHeaderParams,
|
|
253
|
+
uri: localVarPath,
|
|
254
|
+
useQuerystring: this._useQuerystring,
|
|
255
|
+
json: true,
|
|
256
|
+
body: ObjectSerializer.serialize(data, "Array<object>")
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
let authenticationPromise = Promise.resolve();
|
|
260
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
261
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
262
|
+
}
|
|
263
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
264
|
+
|
|
265
|
+
let interceptorPromise = authenticationPromise;
|
|
266
|
+
for (const interceptor of this.interceptors) {
|
|
267
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return interceptorPromise.then(() => {
|
|
271
|
+
if (Object.keys(localVarFormParams).length) {
|
|
272
|
+
if (localVarUseFormData) {
|
|
273
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
274
|
+
} else {
|
|
275
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<CreateSubmissionResponse>; }>((resolve, reject) => {
|
|
279
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
280
|
+
if (error) {
|
|
281
|
+
reject(error);
|
|
282
|
+
} else {
|
|
283
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
284
|
+
body = ObjectSerializer.deserialize(body, "Array<CreateSubmissionResponse>");
|
|
285
|
+
resolve({ response: response, body: body });
|
|
286
|
+
} else {
|
|
287
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
*
|
|
296
|
+
* @summary Generates multiple PDFs
|
|
297
|
+
* @param data
|
|
298
|
+
*/
|
|
299
|
+
public async batchGeneratePdfs (data: SubmissionBatchData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSubmissionBatchResponse; }> {
|
|
300
|
+
const localVarPath = this.basePath + '/submissions/batches';
|
|
301
|
+
let localVarQueryParameters: any = {};
|
|
302
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
303
|
+
const produces = ['application/json'];
|
|
304
|
+
// give precedence to 'application/json'
|
|
305
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
306
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
307
|
+
} else {
|
|
308
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
309
|
+
}
|
|
310
|
+
let localVarFormParams: any = {};
|
|
311
|
+
|
|
312
|
+
// verify required parameter 'data' is not null or undefined
|
|
313
|
+
if (data === null || data === undefined) {
|
|
314
|
+
throw new Error('Required parameter data was null or undefined when calling batchGeneratePdfs.');
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
318
|
+
|
|
319
|
+
let localVarUseFormData = false;
|
|
320
|
+
|
|
321
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
322
|
+
method: 'POST',
|
|
323
|
+
qs: localVarQueryParameters,
|
|
324
|
+
headers: localVarHeaderParams,
|
|
325
|
+
uri: localVarPath,
|
|
326
|
+
useQuerystring: this._useQuerystring,
|
|
327
|
+
json: true,
|
|
328
|
+
body: ObjectSerializer.serialize(data, "SubmissionBatchData")
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
let authenticationPromise = Promise.resolve();
|
|
332
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
333
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
334
|
+
}
|
|
335
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
336
|
+
|
|
337
|
+
let interceptorPromise = authenticationPromise;
|
|
338
|
+
for (const interceptor of this.interceptors) {
|
|
339
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return interceptorPromise.then(() => {
|
|
343
|
+
if (Object.keys(localVarFormParams).length) {
|
|
344
|
+
if (localVarUseFormData) {
|
|
345
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
346
|
+
} else {
|
|
347
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateSubmissionBatchResponse; }>((resolve, reject) => {
|
|
351
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
352
|
+
if (error) {
|
|
353
|
+
reject(error);
|
|
354
|
+
} else {
|
|
355
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
356
|
+
body = ObjectSerializer.deserialize(body, "CreateSubmissionBatchResponse");
|
|
357
|
+
resolve({ response: response, body: body });
|
|
358
|
+
} else {
|
|
359
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
*
|
|
368
|
+
* @summary Merge submission PDFs, template PDFs, or custom files
|
|
369
|
+
* @param UNKNOWN_PARAM_NAME
|
|
370
|
+
*/
|
|
371
|
+
public async combinePdfs (UNKNOWN_PARAM_NAME: , options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCombinedSubmissionResponse; }> {
|
|
372
|
+
const localVarPath = this.basePath + '/combined_submissions?v=2';
|
|
373
|
+
let localVarQueryParameters: any = {};
|
|
374
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
375
|
+
const produces = ['application/json'];
|
|
376
|
+
// give precedence to 'application/json'
|
|
377
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
378
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
379
|
+
} else {
|
|
380
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
381
|
+
}
|
|
382
|
+
let localVarFormParams: any = {};
|
|
383
|
+
|
|
384
|
+
// verify required parameter 'UNKNOWN_PARAM_NAME' is not null or undefined
|
|
385
|
+
if (UNKNOWN_PARAM_NAME === null || UNKNOWN_PARAM_NAME === undefined) {
|
|
386
|
+
throw new Error('Required parameter UNKNOWN_PARAM_NAME was null or undefined when calling combinePdfs.');
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
390
|
+
|
|
391
|
+
let localVarUseFormData = false;
|
|
392
|
+
|
|
393
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
394
|
+
method: 'POST',
|
|
395
|
+
qs: localVarQueryParameters,
|
|
396
|
+
headers: localVarHeaderParams,
|
|
397
|
+
uri: localVarPath,
|
|
398
|
+
useQuerystring: this._useQuerystring,
|
|
399
|
+
json: true,
|
|
400
|
+
body: ObjectSerializer.serialize(UNKNOWN_PARAM_NAME, "")
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
let authenticationPromise = Promise.resolve();
|
|
404
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
405
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
406
|
+
}
|
|
407
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
408
|
+
|
|
409
|
+
let interceptorPromise = authenticationPromise;
|
|
410
|
+
for (const interceptor of this.interceptors) {
|
|
411
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return interceptorPromise.then(() => {
|
|
415
|
+
if (Object.keys(localVarFormParams).length) {
|
|
416
|
+
if (localVarUseFormData) {
|
|
417
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
418
|
+
} else {
|
|
419
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateCombinedSubmissionResponse; }>((resolve, reject) => {
|
|
423
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
424
|
+
if (error) {
|
|
425
|
+
reject(error);
|
|
426
|
+
} else {
|
|
427
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
428
|
+
body = ObjectSerializer.deserialize(body, "CreateCombinedSubmissionResponse");
|
|
429
|
+
resolve({ response: response, body: body });
|
|
430
|
+
} else {
|
|
431
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
*
|
|
440
|
+
* @summary Merge generated PDFs together
|
|
441
|
+
* @param data
|
|
442
|
+
*/
|
|
443
|
+
public async combineSubmissions (data: CombinedSubmissionData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCombinedSubmissionResponse; }> {
|
|
444
|
+
const localVarPath = this.basePath + '/combined_submissions';
|
|
445
|
+
let localVarQueryParameters: any = {};
|
|
446
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
447
|
+
const produces = ['application/json'];
|
|
448
|
+
// give precedence to 'application/json'
|
|
449
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
450
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
451
|
+
} else {
|
|
452
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
453
|
+
}
|
|
454
|
+
let localVarFormParams: any = {};
|
|
455
|
+
|
|
456
|
+
// verify required parameter 'data' is not null or undefined
|
|
457
|
+
if (data === null || data === undefined) {
|
|
458
|
+
throw new Error('Required parameter data was null or undefined when calling combineSubmissions.');
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
462
|
+
|
|
463
|
+
let localVarUseFormData = false;
|
|
464
|
+
|
|
465
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
466
|
+
method: 'POST',
|
|
467
|
+
qs: localVarQueryParameters,
|
|
468
|
+
headers: localVarHeaderParams,
|
|
469
|
+
uri: localVarPath,
|
|
470
|
+
useQuerystring: this._useQuerystring,
|
|
471
|
+
json: true,
|
|
472
|
+
body: ObjectSerializer.serialize(data, "CombinedSubmissionData")
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
let authenticationPromise = Promise.resolve();
|
|
476
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
477
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
478
|
+
}
|
|
479
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
480
|
+
|
|
481
|
+
let interceptorPromise = authenticationPromise;
|
|
482
|
+
for (const interceptor of this.interceptors) {
|
|
483
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return interceptorPromise.then(() => {
|
|
487
|
+
if (Object.keys(localVarFormParams).length) {
|
|
488
|
+
if (localVarUseFormData) {
|
|
489
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
490
|
+
} else {
|
|
491
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateCombinedSubmissionResponse; }>((resolve, reject) => {
|
|
495
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
496
|
+
if (error) {
|
|
497
|
+
reject(error);
|
|
498
|
+
} else {
|
|
499
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
500
|
+
body = ObjectSerializer.deserialize(body, "CreateCombinedSubmissionResponse");
|
|
501
|
+
resolve({ response: response, body: body });
|
|
502
|
+
} else {
|
|
503
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
*
|
|
512
|
+
* @summary Copy a Template
|
|
513
|
+
* @param templateId
|
|
514
|
+
* @param data
|
|
515
|
+
*/
|
|
516
|
+
public async copyTemplate (templateId: string, data?: CopyTemplateData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Template; }> {
|
|
517
|
+
const localVarPath = this.basePath + '/templates/{template_id}/copy'
|
|
518
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
519
|
+
let localVarQueryParameters: any = {};
|
|
520
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
521
|
+
const produces = ['application/json'];
|
|
522
|
+
// give precedence to 'application/json'
|
|
523
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
524
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
525
|
+
} else {
|
|
526
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
527
|
+
}
|
|
528
|
+
let localVarFormParams: any = {};
|
|
529
|
+
|
|
530
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
531
|
+
if (templateId === null || templateId === undefined) {
|
|
532
|
+
throw new Error('Required parameter templateId was null or undefined when calling copyTemplate.');
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
536
|
+
|
|
537
|
+
let localVarUseFormData = false;
|
|
538
|
+
|
|
539
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
540
|
+
method: 'POST',
|
|
541
|
+
qs: localVarQueryParameters,
|
|
542
|
+
headers: localVarHeaderParams,
|
|
543
|
+
uri: localVarPath,
|
|
544
|
+
useQuerystring: this._useQuerystring,
|
|
545
|
+
json: true,
|
|
546
|
+
body: ObjectSerializer.serialize(data, "CopyTemplateData")
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
let authenticationPromise = Promise.resolve();
|
|
550
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
551
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
552
|
+
}
|
|
553
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
554
|
+
|
|
555
|
+
let interceptorPromise = authenticationPromise;
|
|
556
|
+
for (const interceptor of this.interceptors) {
|
|
557
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return interceptorPromise.then(() => {
|
|
561
|
+
if (Object.keys(localVarFormParams).length) {
|
|
562
|
+
if (localVarUseFormData) {
|
|
563
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
564
|
+
} else {
|
|
565
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return new Promise<{ response: http.IncomingMessage; body: Template; }>((resolve, reject) => {
|
|
569
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
570
|
+
if (error) {
|
|
571
|
+
reject(error);
|
|
572
|
+
} else {
|
|
573
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
574
|
+
body = ObjectSerializer.deserialize(body, "Template");
|
|
575
|
+
resolve({ response: response, body: body });
|
|
576
|
+
} else {
|
|
577
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
*
|
|
586
|
+
* @summary Create a new custom file from a cached presign upload
|
|
587
|
+
* @param UNKNOWN_PARAM_NAME
|
|
588
|
+
*/
|
|
589
|
+
public async createCustomFileFromUpload (UNKNOWN_PARAM_NAME: , options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCustomFileResponse; }> {
|
|
590
|
+
const localVarPath = this.basePath + '/custom_files';
|
|
591
|
+
let localVarQueryParameters: any = {};
|
|
592
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
593
|
+
const produces = ['application/json'];
|
|
594
|
+
// give precedence to 'application/json'
|
|
595
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
596
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
597
|
+
} else {
|
|
598
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
599
|
+
}
|
|
600
|
+
let localVarFormParams: any = {};
|
|
601
|
+
|
|
602
|
+
// verify required parameter 'UNKNOWN_PARAM_NAME' is not null or undefined
|
|
603
|
+
if (UNKNOWN_PARAM_NAME === null || UNKNOWN_PARAM_NAME === undefined) {
|
|
604
|
+
throw new Error('Required parameter UNKNOWN_PARAM_NAME was null or undefined when calling createCustomFileFromUpload.');
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
608
|
+
|
|
609
|
+
let localVarUseFormData = false;
|
|
610
|
+
|
|
611
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
612
|
+
method: 'POST',
|
|
613
|
+
qs: localVarQueryParameters,
|
|
614
|
+
headers: localVarHeaderParams,
|
|
615
|
+
uri: localVarPath,
|
|
616
|
+
useQuerystring: this._useQuerystring,
|
|
617
|
+
json: true,
|
|
618
|
+
body: ObjectSerializer.serialize(UNKNOWN_PARAM_NAME, "")
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
let authenticationPromise = Promise.resolve();
|
|
622
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
623
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
624
|
+
}
|
|
625
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
626
|
+
|
|
627
|
+
let interceptorPromise = authenticationPromise;
|
|
628
|
+
for (const interceptor of this.interceptors) {
|
|
629
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return interceptorPromise.then(() => {
|
|
633
|
+
if (Object.keys(localVarFormParams).length) {
|
|
634
|
+
if (localVarUseFormData) {
|
|
635
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
636
|
+
} else {
|
|
637
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateCustomFileResponse; }>((resolve, reject) => {
|
|
641
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
642
|
+
if (error) {
|
|
643
|
+
reject(error);
|
|
644
|
+
} else {
|
|
645
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
646
|
+
body = ObjectSerializer.deserialize(body, "CreateCustomFileResponse");
|
|
647
|
+
resolve({ response: response, body: body });
|
|
648
|
+
} else {
|
|
649
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
*
|
|
658
|
+
* @summary Creates a new data request token for form authentication
|
|
659
|
+
* @param dataRequestId
|
|
660
|
+
*/
|
|
661
|
+
public async createDataRequestToken (dataRequestId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSubmissionDataRequestTokenResponse; }> {
|
|
662
|
+
const localVarPath = this.basePath + '/data_requests/{data_request_id}/tokens'
|
|
663
|
+
.replace('{' + 'data_request_id' + '}', encodeURIComponent(String(dataRequestId)));
|
|
664
|
+
let localVarQueryParameters: any = {};
|
|
665
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
666
|
+
const produces = ['application/json'];
|
|
667
|
+
// give precedence to 'application/json'
|
|
668
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
669
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
670
|
+
} else {
|
|
671
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
672
|
+
}
|
|
673
|
+
let localVarFormParams: any = {};
|
|
674
|
+
|
|
675
|
+
// verify required parameter 'dataRequestId' is not null or undefined
|
|
676
|
+
if (dataRequestId === null || dataRequestId === undefined) {
|
|
677
|
+
throw new Error('Required parameter dataRequestId was null or undefined when calling createDataRequestToken.');
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
681
|
+
|
|
682
|
+
let localVarUseFormData = false;
|
|
683
|
+
|
|
684
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
685
|
+
method: 'POST',
|
|
686
|
+
qs: localVarQueryParameters,
|
|
687
|
+
headers: localVarHeaderParams,
|
|
688
|
+
uri: localVarPath,
|
|
689
|
+
useQuerystring: this._useQuerystring,
|
|
690
|
+
json: true,
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
let authenticationPromise = Promise.resolve();
|
|
694
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
695
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
696
|
+
}
|
|
697
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
698
|
+
|
|
699
|
+
let interceptorPromise = authenticationPromise;
|
|
700
|
+
for (const interceptor of this.interceptors) {
|
|
701
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
return interceptorPromise.then(() => {
|
|
705
|
+
if (Object.keys(localVarFormParams).length) {
|
|
706
|
+
if (localVarUseFormData) {
|
|
707
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
708
|
+
} else {
|
|
709
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateSubmissionDataRequestTokenResponse; }>((resolve, reject) => {
|
|
713
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
714
|
+
if (error) {
|
|
715
|
+
reject(error);
|
|
716
|
+
} else {
|
|
717
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
718
|
+
body = ObjectSerializer.deserialize(body, "CreateSubmissionDataRequestTokenResponse");
|
|
719
|
+
resolve({ response: response, body: body });
|
|
720
|
+
} else {
|
|
721
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
});
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
*
|
|
730
|
+
* @summary Create a folder
|
|
731
|
+
* @param data
|
|
732
|
+
*/
|
|
733
|
+
public async createFolder (data: CreateFolderData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Folder; }> {
|
|
734
|
+
const localVarPath = this.basePath + '/folders/';
|
|
735
|
+
let localVarQueryParameters: any = {};
|
|
736
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
737
|
+
const produces = ['application/json'];
|
|
738
|
+
// give precedence to 'application/json'
|
|
739
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
740
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
741
|
+
} else {
|
|
742
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
743
|
+
}
|
|
744
|
+
let localVarFormParams: any = {};
|
|
745
|
+
|
|
746
|
+
// verify required parameter 'data' is not null or undefined
|
|
747
|
+
if (data === null || data === undefined) {
|
|
748
|
+
throw new Error('Required parameter data was null or undefined when calling createFolder.');
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
752
|
+
|
|
753
|
+
let localVarUseFormData = false;
|
|
754
|
+
|
|
755
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
756
|
+
method: 'POST',
|
|
757
|
+
qs: localVarQueryParameters,
|
|
758
|
+
headers: localVarHeaderParams,
|
|
759
|
+
uri: localVarPath,
|
|
760
|
+
useQuerystring: this._useQuerystring,
|
|
761
|
+
json: true,
|
|
762
|
+
body: ObjectSerializer.serialize(data, "CreateFolderData")
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
let authenticationPromise = Promise.resolve();
|
|
766
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
767
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
768
|
+
}
|
|
769
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
770
|
+
|
|
771
|
+
let interceptorPromise = authenticationPromise;
|
|
772
|
+
for (const interceptor of this.interceptors) {
|
|
773
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return interceptorPromise.then(() => {
|
|
777
|
+
if (Object.keys(localVarFormParams).length) {
|
|
778
|
+
if (localVarUseFormData) {
|
|
779
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
780
|
+
} else {
|
|
781
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return new Promise<{ response: http.IncomingMessage; body: Folder; }>((resolve, reject) => {
|
|
785
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
786
|
+
if (error) {
|
|
787
|
+
reject(error);
|
|
788
|
+
} else {
|
|
789
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
790
|
+
body = ObjectSerializer.deserialize(body, "Folder");
|
|
791
|
+
resolve({ response: response, body: body });
|
|
792
|
+
} else {
|
|
793
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
*
|
|
802
|
+
* @summary Create a new HTML template
|
|
803
|
+
* @param data
|
|
804
|
+
*/
|
|
805
|
+
public async createHTMLTemplate (data: CreateHtmlTemplateData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PendingTemplate; }> {
|
|
806
|
+
const localVarPath = this.basePath + '/templates?desc=html';
|
|
807
|
+
let localVarQueryParameters: any = {};
|
|
808
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
809
|
+
const produces = ['application/json'];
|
|
810
|
+
// give precedence to 'application/json'
|
|
811
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
812
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
813
|
+
} else {
|
|
814
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
815
|
+
}
|
|
816
|
+
let localVarFormParams: any = {};
|
|
817
|
+
|
|
818
|
+
// verify required parameter 'data' is not null or undefined
|
|
819
|
+
if (data === null || data === undefined) {
|
|
820
|
+
throw new Error('Required parameter data was null or undefined when calling createHTMLTemplate.');
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
824
|
+
|
|
825
|
+
let localVarUseFormData = false;
|
|
826
|
+
|
|
827
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
828
|
+
method: 'POST',
|
|
829
|
+
qs: localVarQueryParameters,
|
|
830
|
+
headers: localVarHeaderParams,
|
|
831
|
+
uri: localVarPath,
|
|
832
|
+
useQuerystring: this._useQuerystring,
|
|
833
|
+
json: true,
|
|
834
|
+
body: ObjectSerializer.serialize(data, "CreateHtmlTemplateData")
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
let authenticationPromise = Promise.resolve();
|
|
838
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
839
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
840
|
+
}
|
|
841
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
842
|
+
|
|
843
|
+
let interceptorPromise = authenticationPromise;
|
|
844
|
+
for (const interceptor of this.interceptors) {
|
|
845
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
return interceptorPromise.then(() => {
|
|
849
|
+
if (Object.keys(localVarFormParams).length) {
|
|
850
|
+
if (localVarUseFormData) {
|
|
851
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
852
|
+
} else {
|
|
853
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
return new Promise<{ response: http.IncomingMessage; body: PendingTemplate; }>((resolve, reject) => {
|
|
857
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
858
|
+
if (error) {
|
|
859
|
+
reject(error);
|
|
860
|
+
} else {
|
|
861
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
862
|
+
body = ObjectSerializer.deserialize(body, "PendingTemplate");
|
|
863
|
+
resolve({ response: response, body: body });
|
|
864
|
+
} else {
|
|
865
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
});
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
*
|
|
874
|
+
* @summary Create a new PDF template with a form POST file upload
|
|
875
|
+
* @param templateDocument
|
|
876
|
+
* @param templateName
|
|
877
|
+
* @param templateParentFolderId
|
|
878
|
+
*/
|
|
879
|
+
public async createPDFTemplate (templateDocument: RequestFile, templateName: string, templateParentFolderId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PendingTemplate; }> {
|
|
880
|
+
const localVarPath = this.basePath + '/templates';
|
|
881
|
+
let localVarQueryParameters: any = {};
|
|
882
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
883
|
+
const produces = ['application/json'];
|
|
884
|
+
// give precedence to 'application/json'
|
|
885
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
886
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
887
|
+
} else {
|
|
888
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
889
|
+
}
|
|
890
|
+
let localVarFormParams: any = {};
|
|
891
|
+
|
|
892
|
+
// verify required parameter 'templateDocument' is not null or undefined
|
|
893
|
+
if (templateDocument === null || templateDocument === undefined) {
|
|
894
|
+
throw new Error('Required parameter templateDocument was null or undefined when calling createPDFTemplate.');
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
// verify required parameter 'templateName' is not null or undefined
|
|
898
|
+
if (templateName === null || templateName === undefined) {
|
|
899
|
+
throw new Error('Required parameter templateName was null or undefined when calling createPDFTemplate.');
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
903
|
+
|
|
904
|
+
let localVarUseFormData = false;
|
|
905
|
+
|
|
906
|
+
if (templateDocument !== undefined) {
|
|
907
|
+
localVarFormParams['template[document]'] = templateDocument;
|
|
908
|
+
}
|
|
909
|
+
localVarUseFormData = true;
|
|
910
|
+
|
|
911
|
+
if (templateName !== undefined) {
|
|
912
|
+
localVarFormParams['template[name]'] = ObjectSerializer.serialize(templateName, "string");
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
if (templateParentFolderId !== undefined) {
|
|
916
|
+
localVarFormParams['template[parent_folder_id]'] = ObjectSerializer.serialize(templateParentFolderId, "string");
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
920
|
+
method: 'POST',
|
|
921
|
+
qs: localVarQueryParameters,
|
|
922
|
+
headers: localVarHeaderParams,
|
|
923
|
+
uri: localVarPath,
|
|
924
|
+
useQuerystring: this._useQuerystring,
|
|
925
|
+
json: true,
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
let authenticationPromise = Promise.resolve();
|
|
929
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
930
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
931
|
+
}
|
|
932
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
933
|
+
|
|
934
|
+
let interceptorPromise = authenticationPromise;
|
|
935
|
+
for (const interceptor of this.interceptors) {
|
|
936
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
return interceptorPromise.then(() => {
|
|
940
|
+
if (Object.keys(localVarFormParams).length) {
|
|
941
|
+
if (localVarUseFormData) {
|
|
942
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
943
|
+
} else {
|
|
944
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
return new Promise<{ response: http.IncomingMessage; body: PendingTemplate; }>((resolve, reject) => {
|
|
948
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
949
|
+
if (error) {
|
|
950
|
+
reject(error);
|
|
951
|
+
} else {
|
|
952
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
953
|
+
body = ObjectSerializer.deserialize(body, "PendingTemplate");
|
|
954
|
+
resolve({ response: response, body: body });
|
|
955
|
+
} else {
|
|
956
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
});
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
*
|
|
965
|
+
* @summary Create a new PDF template from a cached presign upload
|
|
966
|
+
* @param data
|
|
967
|
+
*/
|
|
968
|
+
public async createPDFTemplateFromUpload (data: CreateTemplateFromUploadData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PendingTemplate; }> {
|
|
969
|
+
const localVarPath = this.basePath + '/templates?desc=cached_upload';
|
|
970
|
+
let localVarQueryParameters: any = {};
|
|
971
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
972
|
+
const produces = ['application/json'];
|
|
973
|
+
// give precedence to 'application/json'
|
|
974
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
975
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
976
|
+
} else {
|
|
977
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
978
|
+
}
|
|
979
|
+
let localVarFormParams: any = {};
|
|
980
|
+
|
|
981
|
+
// verify required parameter 'data' is not null or undefined
|
|
982
|
+
if (data === null || data === undefined) {
|
|
983
|
+
throw new Error('Required parameter data was null or undefined when calling createPDFTemplateFromUpload.');
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
987
|
+
|
|
988
|
+
let localVarUseFormData = false;
|
|
989
|
+
|
|
990
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
991
|
+
method: 'POST',
|
|
992
|
+
qs: localVarQueryParameters,
|
|
993
|
+
headers: localVarHeaderParams,
|
|
994
|
+
uri: localVarPath,
|
|
995
|
+
useQuerystring: this._useQuerystring,
|
|
996
|
+
json: true,
|
|
997
|
+
body: ObjectSerializer.serialize(data, "CreateTemplateFromUploadData")
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
let authenticationPromise = Promise.resolve();
|
|
1001
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1002
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1003
|
+
}
|
|
1004
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1005
|
+
|
|
1006
|
+
let interceptorPromise = authenticationPromise;
|
|
1007
|
+
for (const interceptor of this.interceptors) {
|
|
1008
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
return interceptorPromise.then(() => {
|
|
1012
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1013
|
+
if (localVarUseFormData) {
|
|
1014
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1015
|
+
} else {
|
|
1016
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return new Promise<{ response: http.IncomingMessage; body: PendingTemplate; }>((resolve, reject) => {
|
|
1020
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1021
|
+
if (error) {
|
|
1022
|
+
reject(error);
|
|
1023
|
+
} else {
|
|
1024
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1025
|
+
body = ObjectSerializer.deserialize(body, "PendingTemplate");
|
|
1026
|
+
resolve({ response: response, body: body });
|
|
1027
|
+
} else {
|
|
1028
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
});
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
*
|
|
1037
|
+
* @summary Delete a folder
|
|
1038
|
+
* @param folderId
|
|
1039
|
+
*/
|
|
1040
|
+
public async deleteFolder (folderId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Folder; }> {
|
|
1041
|
+
const localVarPath = this.basePath + '/folders/{folder_id}'
|
|
1042
|
+
.replace('{' + 'folder_id' + '}', encodeURIComponent(String(folderId)));
|
|
1043
|
+
let localVarQueryParameters: any = {};
|
|
1044
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1045
|
+
const produces = ['application/json'];
|
|
1046
|
+
// give precedence to 'application/json'
|
|
1047
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1048
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1049
|
+
} else {
|
|
1050
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1051
|
+
}
|
|
1052
|
+
let localVarFormParams: any = {};
|
|
1053
|
+
|
|
1054
|
+
// verify required parameter 'folderId' is not null or undefined
|
|
1055
|
+
if (folderId === null || folderId === undefined) {
|
|
1056
|
+
throw new Error('Required parameter folderId was null or undefined when calling deleteFolder.');
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1060
|
+
|
|
1061
|
+
let localVarUseFormData = false;
|
|
1062
|
+
|
|
1063
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1064
|
+
method: 'DELETE',
|
|
1065
|
+
qs: localVarQueryParameters,
|
|
1066
|
+
headers: localVarHeaderParams,
|
|
1067
|
+
uri: localVarPath,
|
|
1068
|
+
useQuerystring: this._useQuerystring,
|
|
1069
|
+
json: true,
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
let authenticationPromise = Promise.resolve();
|
|
1073
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1074
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1075
|
+
}
|
|
1076
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1077
|
+
|
|
1078
|
+
let interceptorPromise = authenticationPromise;
|
|
1079
|
+
for (const interceptor of this.interceptors) {
|
|
1080
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
return interceptorPromise.then(() => {
|
|
1084
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1085
|
+
if (localVarUseFormData) {
|
|
1086
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1087
|
+
} else {
|
|
1088
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
return new Promise<{ response: http.IncomingMessage; body: Folder; }>((resolve, reject) => {
|
|
1092
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1093
|
+
if (error) {
|
|
1094
|
+
reject(error);
|
|
1095
|
+
} else {
|
|
1096
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1097
|
+
body = ObjectSerializer.deserialize(body, "Folder");
|
|
1098
|
+
resolve({ response: response, body: body });
|
|
1099
|
+
} else {
|
|
1100
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
});
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
*
|
|
1109
|
+
* @summary Delete a template
|
|
1110
|
+
* @param templateId
|
|
1111
|
+
*/
|
|
1112
|
+
public async deleteTemplate (templateId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DeleteTemplateResponse; }> {
|
|
1113
|
+
const localVarPath = this.basePath + '/templates/{template_id}'
|
|
1114
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
1115
|
+
let localVarQueryParameters: any = {};
|
|
1116
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1117
|
+
const produces = ['application/json'];
|
|
1118
|
+
// give precedence to 'application/json'
|
|
1119
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1120
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1121
|
+
} else {
|
|
1122
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1123
|
+
}
|
|
1124
|
+
let localVarFormParams: any = {};
|
|
1125
|
+
|
|
1126
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
1127
|
+
if (templateId === null || templateId === undefined) {
|
|
1128
|
+
throw new Error('Required parameter templateId was null or undefined when calling deleteTemplate.');
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1132
|
+
|
|
1133
|
+
let localVarUseFormData = false;
|
|
1134
|
+
|
|
1135
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1136
|
+
method: 'DELETE',
|
|
1137
|
+
qs: localVarQueryParameters,
|
|
1138
|
+
headers: localVarHeaderParams,
|
|
1139
|
+
uri: localVarPath,
|
|
1140
|
+
useQuerystring: this._useQuerystring,
|
|
1141
|
+
json: true,
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
let authenticationPromise = Promise.resolve();
|
|
1145
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1146
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1147
|
+
}
|
|
1148
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1149
|
+
|
|
1150
|
+
let interceptorPromise = authenticationPromise;
|
|
1151
|
+
for (const interceptor of this.interceptors) {
|
|
1152
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
return interceptorPromise.then(() => {
|
|
1156
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1157
|
+
if (localVarUseFormData) {
|
|
1158
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1159
|
+
} else {
|
|
1160
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
return new Promise<{ response: http.IncomingMessage; body: DeleteTemplateResponse; }>((resolve, reject) => {
|
|
1164
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1165
|
+
if (error) {
|
|
1166
|
+
reject(error);
|
|
1167
|
+
} else {
|
|
1168
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1169
|
+
body = ObjectSerializer.deserialize(body, "DeleteTemplateResponse");
|
|
1170
|
+
resolve({ response: response, body: body });
|
|
1171
|
+
} else {
|
|
1172
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
});
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
*
|
|
1181
|
+
* @summary Expire a combined submission
|
|
1182
|
+
* @param combinedSubmissionId
|
|
1183
|
+
*/
|
|
1184
|
+
public async expireCombinedSubmission (combinedSubmissionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CombinedSubmission; }> {
|
|
1185
|
+
const localVarPath = this.basePath + '/combined_submissions/{combined_submission_id}'
|
|
1186
|
+
.replace('{' + 'combined_submission_id' + '}', encodeURIComponent(String(combinedSubmissionId)));
|
|
1187
|
+
let localVarQueryParameters: any = {};
|
|
1188
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1189
|
+
const produces = ['application/json'];
|
|
1190
|
+
// give precedence to 'application/json'
|
|
1191
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1192
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1193
|
+
} else {
|
|
1194
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1195
|
+
}
|
|
1196
|
+
let localVarFormParams: any = {};
|
|
1197
|
+
|
|
1198
|
+
// verify required parameter 'combinedSubmissionId' is not null or undefined
|
|
1199
|
+
if (combinedSubmissionId === null || combinedSubmissionId === undefined) {
|
|
1200
|
+
throw new Error('Required parameter combinedSubmissionId was null or undefined when calling expireCombinedSubmission.');
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1204
|
+
|
|
1205
|
+
let localVarUseFormData = false;
|
|
1206
|
+
|
|
1207
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1208
|
+
method: 'DELETE',
|
|
1209
|
+
qs: localVarQueryParameters,
|
|
1210
|
+
headers: localVarHeaderParams,
|
|
1211
|
+
uri: localVarPath,
|
|
1212
|
+
useQuerystring: this._useQuerystring,
|
|
1213
|
+
json: true,
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
let authenticationPromise = Promise.resolve();
|
|
1217
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1218
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1219
|
+
}
|
|
1220
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1221
|
+
|
|
1222
|
+
let interceptorPromise = authenticationPromise;
|
|
1223
|
+
for (const interceptor of this.interceptors) {
|
|
1224
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
return interceptorPromise.then(() => {
|
|
1228
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1229
|
+
if (localVarUseFormData) {
|
|
1230
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1231
|
+
} else {
|
|
1232
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
return new Promise<{ response: http.IncomingMessage; body: CombinedSubmission; }>((resolve, reject) => {
|
|
1236
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1237
|
+
if (error) {
|
|
1238
|
+
reject(error);
|
|
1239
|
+
} else {
|
|
1240
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1241
|
+
body = ObjectSerializer.deserialize(body, "CombinedSubmission");
|
|
1242
|
+
resolve({ response: response, body: body });
|
|
1243
|
+
} else {
|
|
1244
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
});
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
*
|
|
1253
|
+
* @summary Expire a PDF submission
|
|
1254
|
+
* @param submissionId
|
|
1255
|
+
*/
|
|
1256
|
+
public async expireSubmission (submissionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Submission; }> {
|
|
1257
|
+
const localVarPath = this.basePath + '/submissions/{submission_id}'
|
|
1258
|
+
.replace('{' + 'submission_id' + '}', encodeURIComponent(String(submissionId)));
|
|
1259
|
+
let localVarQueryParameters: any = {};
|
|
1260
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1261
|
+
const produces = ['application/json'];
|
|
1262
|
+
// give precedence to 'application/json'
|
|
1263
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1264
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1265
|
+
} else {
|
|
1266
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1267
|
+
}
|
|
1268
|
+
let localVarFormParams: any = {};
|
|
1269
|
+
|
|
1270
|
+
// verify required parameter 'submissionId' is not null or undefined
|
|
1271
|
+
if (submissionId === null || submissionId === undefined) {
|
|
1272
|
+
throw new Error('Required parameter submissionId was null or undefined when calling expireSubmission.');
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1276
|
+
|
|
1277
|
+
let localVarUseFormData = false;
|
|
1278
|
+
|
|
1279
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1280
|
+
method: 'DELETE',
|
|
1281
|
+
qs: localVarQueryParameters,
|
|
1282
|
+
headers: localVarHeaderParams,
|
|
1283
|
+
uri: localVarPath,
|
|
1284
|
+
useQuerystring: this._useQuerystring,
|
|
1285
|
+
json: true,
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
let authenticationPromise = Promise.resolve();
|
|
1289
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1290
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1291
|
+
}
|
|
1292
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1293
|
+
|
|
1294
|
+
let interceptorPromise = authenticationPromise;
|
|
1295
|
+
for (const interceptor of this.interceptors) {
|
|
1296
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
return interceptorPromise.then(() => {
|
|
1300
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1301
|
+
if (localVarUseFormData) {
|
|
1302
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1303
|
+
} else {
|
|
1304
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
return new Promise<{ response: http.IncomingMessage; body: Submission; }>((resolve, reject) => {
|
|
1308
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1309
|
+
if (error) {
|
|
1310
|
+
reject(error);
|
|
1311
|
+
} else {
|
|
1312
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1313
|
+
body = ObjectSerializer.deserialize(body, "Submission");
|
|
1314
|
+
resolve({ response: response, body: body });
|
|
1315
|
+
} else {
|
|
1316
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
});
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
*
|
|
1325
|
+
* @summary Generates a new PDF
|
|
1326
|
+
* @param templateId
|
|
1327
|
+
* @param data
|
|
1328
|
+
*/
|
|
1329
|
+
public async generatePDF (templateId: string, data: SubmissionData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSubmissionResponse; }> {
|
|
1330
|
+
const localVarPath = this.basePath + '/templates/{template_id}/submissions'
|
|
1331
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
1332
|
+
let localVarQueryParameters: any = {};
|
|
1333
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1334
|
+
const produces = ['application/json'];
|
|
1335
|
+
// give precedence to 'application/json'
|
|
1336
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1337
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1338
|
+
} else {
|
|
1339
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1340
|
+
}
|
|
1341
|
+
let localVarFormParams: any = {};
|
|
1342
|
+
|
|
1343
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
1344
|
+
if (templateId === null || templateId === undefined) {
|
|
1345
|
+
throw new Error('Required parameter templateId was null or undefined when calling generatePDF.');
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// verify required parameter 'data' is not null or undefined
|
|
1349
|
+
if (data === null || data === undefined) {
|
|
1350
|
+
throw new Error('Required parameter data was null or undefined when calling generatePDF.');
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1354
|
+
|
|
1355
|
+
let localVarUseFormData = false;
|
|
1356
|
+
|
|
1357
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1358
|
+
method: 'POST',
|
|
1359
|
+
qs: localVarQueryParameters,
|
|
1360
|
+
headers: localVarHeaderParams,
|
|
1361
|
+
uri: localVarPath,
|
|
1362
|
+
useQuerystring: this._useQuerystring,
|
|
1363
|
+
json: true,
|
|
1364
|
+
body: ObjectSerializer.serialize(data, "SubmissionData")
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
let authenticationPromise = Promise.resolve();
|
|
1368
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1369
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1370
|
+
}
|
|
1371
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1372
|
+
|
|
1373
|
+
let interceptorPromise = authenticationPromise;
|
|
1374
|
+
for (const interceptor of this.interceptors) {
|
|
1375
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
return interceptorPromise.then(() => {
|
|
1379
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1380
|
+
if (localVarUseFormData) {
|
|
1381
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1382
|
+
} else {
|
|
1383
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateSubmissionResponse; }>((resolve, reject) => {
|
|
1387
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1388
|
+
if (error) {
|
|
1389
|
+
reject(error);
|
|
1390
|
+
} else {
|
|
1391
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1392
|
+
body = ObjectSerializer.deserialize(body, "CreateSubmissionResponse");
|
|
1393
|
+
resolve({ response: response, body: body });
|
|
1394
|
+
} else {
|
|
1395
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
});
|
|
1399
|
+
});
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
*
|
|
1404
|
+
* @summary Check the status of a combined submission (merged PDFs)
|
|
1405
|
+
* @param combinedSubmissionId
|
|
1406
|
+
*/
|
|
1407
|
+
public async getCombinedSubmission (combinedSubmissionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CombinedSubmission; }> {
|
|
1408
|
+
const localVarPath = this.basePath + '/combined_submissions/{combined_submission_id}'
|
|
1409
|
+
.replace('{' + 'combined_submission_id' + '}', encodeURIComponent(String(combinedSubmissionId)));
|
|
1410
|
+
let localVarQueryParameters: any = {};
|
|
1411
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1412
|
+
const produces = ['application/json'];
|
|
1413
|
+
// give precedence to 'application/json'
|
|
1414
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1415
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1416
|
+
} else {
|
|
1417
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1418
|
+
}
|
|
1419
|
+
let localVarFormParams: any = {};
|
|
1420
|
+
|
|
1421
|
+
// verify required parameter 'combinedSubmissionId' is not null or undefined
|
|
1422
|
+
if (combinedSubmissionId === null || combinedSubmissionId === undefined) {
|
|
1423
|
+
throw new Error('Required parameter combinedSubmissionId was null or undefined when calling getCombinedSubmission.');
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1427
|
+
|
|
1428
|
+
let localVarUseFormData = false;
|
|
1429
|
+
|
|
1430
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1431
|
+
method: 'GET',
|
|
1432
|
+
qs: localVarQueryParameters,
|
|
1433
|
+
headers: localVarHeaderParams,
|
|
1434
|
+
uri: localVarPath,
|
|
1435
|
+
useQuerystring: this._useQuerystring,
|
|
1436
|
+
json: true,
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
let authenticationPromise = Promise.resolve();
|
|
1440
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1441
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1442
|
+
}
|
|
1443
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1444
|
+
|
|
1445
|
+
let interceptorPromise = authenticationPromise;
|
|
1446
|
+
for (const interceptor of this.interceptors) {
|
|
1447
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
return interceptorPromise.then(() => {
|
|
1451
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1452
|
+
if (localVarUseFormData) {
|
|
1453
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1454
|
+
} else {
|
|
1455
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
return new Promise<{ response: http.IncomingMessage; body: CombinedSubmission; }>((resolve, reject) => {
|
|
1459
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1460
|
+
if (error) {
|
|
1461
|
+
reject(error);
|
|
1462
|
+
} else {
|
|
1463
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1464
|
+
body = ObjectSerializer.deserialize(body, "CombinedSubmission");
|
|
1465
|
+
resolve({ response: response, body: body });
|
|
1466
|
+
} else {
|
|
1467
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1471
|
+
});
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
*
|
|
1476
|
+
* @summary Look up a submission data request
|
|
1477
|
+
* @param dataRequestId
|
|
1478
|
+
*/
|
|
1479
|
+
public async getDataRequest (dataRequestId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SubmissionDataRequest; }> {
|
|
1480
|
+
const localVarPath = this.basePath + '/data_requests/{data_request_id}'
|
|
1481
|
+
.replace('{' + 'data_request_id' + '}', encodeURIComponent(String(dataRequestId)));
|
|
1482
|
+
let localVarQueryParameters: any = {};
|
|
1483
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1484
|
+
const produces = ['application/json'];
|
|
1485
|
+
// give precedence to 'application/json'
|
|
1486
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1487
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1488
|
+
} else {
|
|
1489
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1490
|
+
}
|
|
1491
|
+
let localVarFormParams: any = {};
|
|
1492
|
+
|
|
1493
|
+
// verify required parameter 'dataRequestId' is not null or undefined
|
|
1494
|
+
if (dataRequestId === null || dataRequestId === undefined) {
|
|
1495
|
+
throw new Error('Required parameter dataRequestId was null or undefined when calling getDataRequest.');
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1499
|
+
|
|
1500
|
+
let localVarUseFormData = false;
|
|
1501
|
+
|
|
1502
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1503
|
+
method: 'GET',
|
|
1504
|
+
qs: localVarQueryParameters,
|
|
1505
|
+
headers: localVarHeaderParams,
|
|
1506
|
+
uri: localVarPath,
|
|
1507
|
+
useQuerystring: this._useQuerystring,
|
|
1508
|
+
json: true,
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
let authenticationPromise = Promise.resolve();
|
|
1512
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1513
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1514
|
+
}
|
|
1515
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1516
|
+
|
|
1517
|
+
let interceptorPromise = authenticationPromise;
|
|
1518
|
+
for (const interceptor of this.interceptors) {
|
|
1519
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
return interceptorPromise.then(() => {
|
|
1523
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1524
|
+
if (localVarUseFormData) {
|
|
1525
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1526
|
+
} else {
|
|
1527
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
return new Promise<{ response: http.IncomingMessage; body: SubmissionDataRequest; }>((resolve, reject) => {
|
|
1531
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1532
|
+
if (error) {
|
|
1533
|
+
reject(error);
|
|
1534
|
+
} else {
|
|
1535
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1536
|
+
body = ObjectSerializer.deserialize(body, "SubmissionDataRequest");
|
|
1537
|
+
resolve({ response: response, body: body });
|
|
1538
|
+
} else {
|
|
1539
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
});
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
*
|
|
1548
|
+
* @summary Fetch the full template attributes
|
|
1549
|
+
* @param templateId
|
|
1550
|
+
*/
|
|
1551
|
+
public async getFullTemplate (templateId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FullTemplate; }> {
|
|
1552
|
+
const localVarPath = this.basePath + '/templates/{template_id}?full=true'
|
|
1553
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
1554
|
+
let localVarQueryParameters: any = {};
|
|
1555
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1556
|
+
const produces = ['application/json'];
|
|
1557
|
+
// give precedence to 'application/json'
|
|
1558
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1559
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1560
|
+
} else {
|
|
1561
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1562
|
+
}
|
|
1563
|
+
let localVarFormParams: any = {};
|
|
1564
|
+
|
|
1565
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
1566
|
+
if (templateId === null || templateId === undefined) {
|
|
1567
|
+
throw new Error('Required parameter templateId was null or undefined when calling getFullTemplate.');
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1571
|
+
|
|
1572
|
+
let localVarUseFormData = false;
|
|
1573
|
+
|
|
1574
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1575
|
+
method: 'GET',
|
|
1576
|
+
qs: localVarQueryParameters,
|
|
1577
|
+
headers: localVarHeaderParams,
|
|
1578
|
+
uri: localVarPath,
|
|
1579
|
+
useQuerystring: this._useQuerystring,
|
|
1580
|
+
json: true,
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
let authenticationPromise = Promise.resolve();
|
|
1584
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1585
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1586
|
+
}
|
|
1587
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1588
|
+
|
|
1589
|
+
let interceptorPromise = authenticationPromise;
|
|
1590
|
+
for (const interceptor of this.interceptors) {
|
|
1591
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
return interceptorPromise.then(() => {
|
|
1595
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1596
|
+
if (localVarUseFormData) {
|
|
1597
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1598
|
+
} else {
|
|
1599
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
return new Promise<{ response: http.IncomingMessage; body: FullTemplate; }>((resolve, reject) => {
|
|
1603
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1604
|
+
if (error) {
|
|
1605
|
+
reject(error);
|
|
1606
|
+
} else {
|
|
1607
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1608
|
+
body = ObjectSerializer.deserialize(body, "FullTemplate");
|
|
1609
|
+
resolve({ response: response, body: body });
|
|
1610
|
+
} else {
|
|
1611
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
});
|
|
1615
|
+
});
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
*
|
|
1620
|
+
* @summary Get a presigned URL so that you can upload a file to our AWS S3 bucket
|
|
1621
|
+
*/
|
|
1622
|
+
public async getPresignUrl (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
1623
|
+
const localVarPath = this.basePath + '/uploads/presign';
|
|
1624
|
+
let localVarQueryParameters: any = {};
|
|
1625
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1626
|
+
const produces = ['application/json'];
|
|
1627
|
+
// give precedence to 'application/json'
|
|
1628
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1629
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1630
|
+
} else {
|
|
1631
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1632
|
+
}
|
|
1633
|
+
let localVarFormParams: any = {};
|
|
1634
|
+
|
|
1635
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1636
|
+
|
|
1637
|
+
let localVarUseFormData = false;
|
|
1638
|
+
|
|
1639
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1640
|
+
method: 'GET',
|
|
1641
|
+
qs: localVarQueryParameters,
|
|
1642
|
+
headers: localVarHeaderParams,
|
|
1643
|
+
uri: localVarPath,
|
|
1644
|
+
useQuerystring: this._useQuerystring,
|
|
1645
|
+
json: true,
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
let authenticationPromise = Promise.resolve();
|
|
1649
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1650
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1651
|
+
}
|
|
1652
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1653
|
+
|
|
1654
|
+
let interceptorPromise = authenticationPromise;
|
|
1655
|
+
for (const interceptor of this.interceptors) {
|
|
1656
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
return interceptorPromise.then(() => {
|
|
1660
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1661
|
+
if (localVarUseFormData) {
|
|
1662
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1663
|
+
} else {
|
|
1664
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
1668
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1669
|
+
if (error) {
|
|
1670
|
+
reject(error);
|
|
1671
|
+
} else {
|
|
1672
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1673
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
1674
|
+
resolve({ response: response, body: body });
|
|
1675
|
+
} else {
|
|
1676
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
});
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
*
|
|
1685
|
+
* @summary Check the status of a PDF
|
|
1686
|
+
* @param submissionId
|
|
1687
|
+
* @param includeData
|
|
1688
|
+
*/
|
|
1689
|
+
public async getSubmission (submissionId: string, includeData?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Submission; }> {
|
|
1690
|
+
const localVarPath = this.basePath + '/submissions/{submission_id}'
|
|
1691
|
+
.replace('{' + 'submission_id' + '}', encodeURIComponent(String(submissionId)));
|
|
1692
|
+
let localVarQueryParameters: any = {};
|
|
1693
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1694
|
+
const produces = ['application/json'];
|
|
1695
|
+
// give precedence to 'application/json'
|
|
1696
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1697
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1698
|
+
} else {
|
|
1699
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1700
|
+
}
|
|
1701
|
+
let localVarFormParams: any = {};
|
|
1702
|
+
|
|
1703
|
+
// verify required parameter 'submissionId' is not null or undefined
|
|
1704
|
+
if (submissionId === null || submissionId === undefined) {
|
|
1705
|
+
throw new Error('Required parameter submissionId was null or undefined when calling getSubmission.');
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
if (includeData !== undefined) {
|
|
1709
|
+
localVarQueryParameters['include_data'] = ObjectSerializer.serialize(includeData, "boolean");
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1713
|
+
|
|
1714
|
+
let localVarUseFormData = false;
|
|
1715
|
+
|
|
1716
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1717
|
+
method: 'GET',
|
|
1718
|
+
qs: localVarQueryParameters,
|
|
1719
|
+
headers: localVarHeaderParams,
|
|
1720
|
+
uri: localVarPath,
|
|
1721
|
+
useQuerystring: this._useQuerystring,
|
|
1722
|
+
json: true,
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
let authenticationPromise = Promise.resolve();
|
|
1726
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1727
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1728
|
+
}
|
|
1729
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1730
|
+
|
|
1731
|
+
let interceptorPromise = authenticationPromise;
|
|
1732
|
+
for (const interceptor of this.interceptors) {
|
|
1733
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
return interceptorPromise.then(() => {
|
|
1737
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1738
|
+
if (localVarUseFormData) {
|
|
1739
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1740
|
+
} else {
|
|
1741
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
return new Promise<{ response: http.IncomingMessage; body: Submission; }>((resolve, reject) => {
|
|
1745
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1746
|
+
if (error) {
|
|
1747
|
+
reject(error);
|
|
1748
|
+
} else {
|
|
1749
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1750
|
+
body = ObjectSerializer.deserialize(body, "Submission");
|
|
1751
|
+
resolve({ response: response, body: body });
|
|
1752
|
+
} else {
|
|
1753
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1757
|
+
});
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
*
|
|
1762
|
+
* @summary Check the status of a submission batch job
|
|
1763
|
+
* @param submissionBatchId
|
|
1764
|
+
* @param includeSubmissions
|
|
1765
|
+
*/
|
|
1766
|
+
public async getSubmissionBatch (submissionBatchId: string, includeSubmissions?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SubmissionBatch; }> {
|
|
1767
|
+
const localVarPath = this.basePath + '/submissions/batches/{submission_batch_id}'
|
|
1768
|
+
.replace('{' + 'submission_batch_id' + '}', encodeURIComponent(String(submissionBatchId)));
|
|
1769
|
+
let localVarQueryParameters: any = {};
|
|
1770
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1771
|
+
const produces = ['application/json'];
|
|
1772
|
+
// give precedence to 'application/json'
|
|
1773
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1774
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1775
|
+
} else {
|
|
1776
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1777
|
+
}
|
|
1778
|
+
let localVarFormParams: any = {};
|
|
1779
|
+
|
|
1780
|
+
// verify required parameter 'submissionBatchId' is not null or undefined
|
|
1781
|
+
if (submissionBatchId === null || submissionBatchId === undefined) {
|
|
1782
|
+
throw new Error('Required parameter submissionBatchId was null or undefined when calling getSubmissionBatch.');
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
if (includeSubmissions !== undefined) {
|
|
1786
|
+
localVarQueryParameters['include_submissions'] = ObjectSerializer.serialize(includeSubmissions, "boolean");
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1790
|
+
|
|
1791
|
+
let localVarUseFormData = false;
|
|
1792
|
+
|
|
1793
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1794
|
+
method: 'GET',
|
|
1795
|
+
qs: localVarQueryParameters,
|
|
1796
|
+
headers: localVarHeaderParams,
|
|
1797
|
+
uri: localVarPath,
|
|
1798
|
+
useQuerystring: this._useQuerystring,
|
|
1799
|
+
json: true,
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
let authenticationPromise = Promise.resolve();
|
|
1803
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1804
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1805
|
+
}
|
|
1806
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1807
|
+
|
|
1808
|
+
let interceptorPromise = authenticationPromise;
|
|
1809
|
+
for (const interceptor of this.interceptors) {
|
|
1810
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
return interceptorPromise.then(() => {
|
|
1814
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1815
|
+
if (localVarUseFormData) {
|
|
1816
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1817
|
+
} else {
|
|
1818
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
return new Promise<{ response: http.IncomingMessage; body: SubmissionBatch; }>((resolve, reject) => {
|
|
1822
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1823
|
+
if (error) {
|
|
1824
|
+
reject(error);
|
|
1825
|
+
} else {
|
|
1826
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1827
|
+
body = ObjectSerializer.deserialize(body, "SubmissionBatch");
|
|
1828
|
+
resolve({ response: response, body: body });
|
|
1829
|
+
} else {
|
|
1830
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
});
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
*
|
|
1839
|
+
* @summary Check the status of an uploaded template
|
|
1840
|
+
* @param templateId
|
|
1841
|
+
*/
|
|
1842
|
+
public async getTemplate (templateId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Template; }> {
|
|
1843
|
+
const localVarPath = this.basePath + '/templates/{template_id}'
|
|
1844
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
1845
|
+
let localVarQueryParameters: any = {};
|
|
1846
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1847
|
+
const produces = ['application/json'];
|
|
1848
|
+
// give precedence to 'application/json'
|
|
1849
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1850
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1851
|
+
} else {
|
|
1852
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1853
|
+
}
|
|
1854
|
+
let localVarFormParams: any = {};
|
|
1855
|
+
|
|
1856
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
1857
|
+
if (templateId === null || templateId === undefined) {
|
|
1858
|
+
throw new Error('Required parameter templateId was null or undefined when calling getTemplate.');
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1862
|
+
|
|
1863
|
+
let localVarUseFormData = false;
|
|
1864
|
+
|
|
1865
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1866
|
+
method: 'GET',
|
|
1867
|
+
qs: localVarQueryParameters,
|
|
1868
|
+
headers: localVarHeaderParams,
|
|
1869
|
+
uri: localVarPath,
|
|
1870
|
+
useQuerystring: this._useQuerystring,
|
|
1871
|
+
json: true,
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
let authenticationPromise = Promise.resolve();
|
|
1875
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1876
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1877
|
+
}
|
|
1878
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1879
|
+
|
|
1880
|
+
let interceptorPromise = authenticationPromise;
|
|
1881
|
+
for (const interceptor of this.interceptors) {
|
|
1882
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
return interceptorPromise.then(() => {
|
|
1886
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1887
|
+
if (localVarUseFormData) {
|
|
1888
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1889
|
+
} else {
|
|
1890
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
return new Promise<{ response: http.IncomingMessage; body: Template; }>((resolve, reject) => {
|
|
1894
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1895
|
+
if (error) {
|
|
1896
|
+
reject(error);
|
|
1897
|
+
} else {
|
|
1898
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1899
|
+
body = ObjectSerializer.deserialize(body, "Template");
|
|
1900
|
+
resolve({ response: response, body: body });
|
|
1901
|
+
} else {
|
|
1902
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
});
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
*
|
|
1911
|
+
* @summary Fetch the JSON schema for a template
|
|
1912
|
+
* @param templateId
|
|
1913
|
+
*/
|
|
1914
|
+
public async getTemplateSchema (templateId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
1915
|
+
const localVarPath = this.basePath + '/templates/{template_id}/schema'
|
|
1916
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
1917
|
+
let localVarQueryParameters: any = {};
|
|
1918
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1919
|
+
const produces = ['application/json'];
|
|
1920
|
+
// give precedence to 'application/json'
|
|
1921
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1922
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1923
|
+
} else {
|
|
1924
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1925
|
+
}
|
|
1926
|
+
let localVarFormParams: any = {};
|
|
1927
|
+
|
|
1928
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
1929
|
+
if (templateId === null || templateId === undefined) {
|
|
1930
|
+
throw new Error('Required parameter templateId was null or undefined when calling getTemplateSchema.');
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1934
|
+
|
|
1935
|
+
let localVarUseFormData = false;
|
|
1936
|
+
|
|
1937
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1938
|
+
method: 'GET',
|
|
1939
|
+
qs: localVarQueryParameters,
|
|
1940
|
+
headers: localVarHeaderParams,
|
|
1941
|
+
uri: localVarPath,
|
|
1942
|
+
useQuerystring: this._useQuerystring,
|
|
1943
|
+
json: true,
|
|
1944
|
+
};
|
|
1945
|
+
|
|
1946
|
+
let authenticationPromise = Promise.resolve();
|
|
1947
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
1948
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
1949
|
+
}
|
|
1950
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1951
|
+
|
|
1952
|
+
let interceptorPromise = authenticationPromise;
|
|
1953
|
+
for (const interceptor of this.interceptors) {
|
|
1954
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
return interceptorPromise.then(() => {
|
|
1958
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1959
|
+
if (localVarUseFormData) {
|
|
1960
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1961
|
+
} else {
|
|
1962
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
1966
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1967
|
+
if (error) {
|
|
1968
|
+
reject(error);
|
|
1969
|
+
} else {
|
|
1970
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1971
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
1972
|
+
resolve({ response: response, body: body });
|
|
1973
|
+
} else {
|
|
1974
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
});
|
|
1978
|
+
});
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
*
|
|
1983
|
+
* @summary Get a list of all combined submissions
|
|
1984
|
+
* @param page Default: 1
|
|
1985
|
+
* @param perPage Default: 50
|
|
1986
|
+
*/
|
|
1987
|
+
public async listCombinedSubmissions (page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<CombinedSubmission>; }> {
|
|
1988
|
+
const localVarPath = this.basePath + '/combined_submissions';
|
|
1989
|
+
let localVarQueryParameters: any = {};
|
|
1990
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1991
|
+
const produces = ['application/json'];
|
|
1992
|
+
// give precedence to 'application/json'
|
|
1993
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1994
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1995
|
+
} else {
|
|
1996
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1997
|
+
}
|
|
1998
|
+
let localVarFormParams: any = {};
|
|
1999
|
+
|
|
2000
|
+
if (page !== undefined) {
|
|
2001
|
+
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
if (perPage !== undefined) {
|
|
2005
|
+
localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number");
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2009
|
+
|
|
2010
|
+
let localVarUseFormData = false;
|
|
2011
|
+
|
|
2012
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2013
|
+
method: 'GET',
|
|
2014
|
+
qs: localVarQueryParameters,
|
|
2015
|
+
headers: localVarHeaderParams,
|
|
2016
|
+
uri: localVarPath,
|
|
2017
|
+
useQuerystring: this._useQuerystring,
|
|
2018
|
+
json: true,
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
let authenticationPromise = Promise.resolve();
|
|
2022
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2023
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2024
|
+
}
|
|
2025
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2026
|
+
|
|
2027
|
+
let interceptorPromise = authenticationPromise;
|
|
2028
|
+
for (const interceptor of this.interceptors) {
|
|
2029
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
return interceptorPromise.then(() => {
|
|
2033
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2034
|
+
if (localVarUseFormData) {
|
|
2035
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2036
|
+
} else {
|
|
2037
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<CombinedSubmission>; }>((resolve, reject) => {
|
|
2041
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2042
|
+
if (error) {
|
|
2043
|
+
reject(error);
|
|
2044
|
+
} else {
|
|
2045
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2046
|
+
body = ObjectSerializer.deserialize(body, "Array<CombinedSubmission>");
|
|
2047
|
+
resolve({ response: response, body: body });
|
|
2048
|
+
} else {
|
|
2049
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
2053
|
+
});
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
*
|
|
2058
|
+
* @summary Get a list of all folders
|
|
2059
|
+
* @param parentFolderId Filter By Folder Id
|
|
2060
|
+
*/
|
|
2061
|
+
public async listFolders (parentFolderId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Folder>; }> {
|
|
2062
|
+
const localVarPath = this.basePath + '/folders/';
|
|
2063
|
+
let localVarQueryParameters: any = {};
|
|
2064
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2065
|
+
const produces = ['application/json'];
|
|
2066
|
+
// give precedence to 'application/json'
|
|
2067
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2068
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2069
|
+
} else {
|
|
2070
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2071
|
+
}
|
|
2072
|
+
let localVarFormParams: any = {};
|
|
2073
|
+
|
|
2074
|
+
if (parentFolderId !== undefined) {
|
|
2075
|
+
localVarQueryParameters['parent_folder_id'] = ObjectSerializer.serialize(parentFolderId, "string");
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2079
|
+
|
|
2080
|
+
let localVarUseFormData = false;
|
|
2081
|
+
|
|
2082
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2083
|
+
method: 'GET',
|
|
2084
|
+
qs: localVarQueryParameters,
|
|
2085
|
+
headers: localVarHeaderParams,
|
|
2086
|
+
uri: localVarPath,
|
|
2087
|
+
useQuerystring: this._useQuerystring,
|
|
2088
|
+
json: true,
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
let authenticationPromise = Promise.resolve();
|
|
2092
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2093
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2094
|
+
}
|
|
2095
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2096
|
+
|
|
2097
|
+
let interceptorPromise = authenticationPromise;
|
|
2098
|
+
for (const interceptor of this.interceptors) {
|
|
2099
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
return interceptorPromise.then(() => {
|
|
2103
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2104
|
+
if (localVarUseFormData) {
|
|
2105
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2106
|
+
} else {
|
|
2107
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<Folder>; }>((resolve, reject) => {
|
|
2111
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2112
|
+
if (error) {
|
|
2113
|
+
reject(error);
|
|
2114
|
+
} else {
|
|
2115
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2116
|
+
body = ObjectSerializer.deserialize(body, "Array<Folder>");
|
|
2117
|
+
resolve({ response: response, body: body });
|
|
2118
|
+
} else {
|
|
2119
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
});
|
|
2123
|
+
});
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
*
|
|
2128
|
+
* @summary List all submissions
|
|
2129
|
+
* @param cursor
|
|
2130
|
+
* @param limit
|
|
2131
|
+
* @param createdAfter
|
|
2132
|
+
* @param createdBefore
|
|
2133
|
+
* @param type
|
|
2134
|
+
* @param includeData
|
|
2135
|
+
*/
|
|
2136
|
+
public async listSubmissions (cursor?: string, limit?: number, createdAfter?: string, createdBefore?: string, type?: string, includeData?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListSubmissionsResponse; }> {
|
|
2137
|
+
const localVarPath = this.basePath + '/submissions';
|
|
2138
|
+
let localVarQueryParameters: any = {};
|
|
2139
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2140
|
+
const produces = ['application/json'];
|
|
2141
|
+
// give precedence to 'application/json'
|
|
2142
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2143
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2144
|
+
} else {
|
|
2145
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2146
|
+
}
|
|
2147
|
+
let localVarFormParams: any = {};
|
|
2148
|
+
|
|
2149
|
+
if (cursor !== undefined) {
|
|
2150
|
+
localVarQueryParameters['cursor'] = ObjectSerializer.serialize(cursor, "string");
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
if (limit !== undefined) {
|
|
2154
|
+
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
if (createdAfter !== undefined) {
|
|
2158
|
+
localVarQueryParameters['created_after'] = ObjectSerializer.serialize(createdAfter, "string");
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
if (createdBefore !== undefined) {
|
|
2162
|
+
localVarQueryParameters['created_before'] = ObjectSerializer.serialize(createdBefore, "string");
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
if (type !== undefined) {
|
|
2166
|
+
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
if (includeData !== undefined) {
|
|
2170
|
+
localVarQueryParameters['include_data'] = ObjectSerializer.serialize(includeData, "boolean");
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2174
|
+
|
|
2175
|
+
let localVarUseFormData = false;
|
|
2176
|
+
|
|
2177
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2178
|
+
method: 'GET',
|
|
2179
|
+
qs: localVarQueryParameters,
|
|
2180
|
+
headers: localVarHeaderParams,
|
|
2181
|
+
uri: localVarPath,
|
|
2182
|
+
useQuerystring: this._useQuerystring,
|
|
2183
|
+
json: true,
|
|
2184
|
+
};
|
|
2185
|
+
|
|
2186
|
+
let authenticationPromise = Promise.resolve();
|
|
2187
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2188
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2189
|
+
}
|
|
2190
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2191
|
+
|
|
2192
|
+
let interceptorPromise = authenticationPromise;
|
|
2193
|
+
for (const interceptor of this.interceptors) {
|
|
2194
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
return interceptorPromise.then(() => {
|
|
2198
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2199
|
+
if (localVarUseFormData) {
|
|
2200
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2201
|
+
} else {
|
|
2202
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
return new Promise<{ response: http.IncomingMessage; body: ListSubmissionsResponse; }>((resolve, reject) => {
|
|
2206
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2207
|
+
if (error) {
|
|
2208
|
+
reject(error);
|
|
2209
|
+
} else {
|
|
2210
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2211
|
+
body = ObjectSerializer.deserialize(body, "ListSubmissionsResponse");
|
|
2212
|
+
resolve({ response: response, body: body });
|
|
2213
|
+
} else {
|
|
2214
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
});
|
|
2218
|
+
});
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
/**
|
|
2222
|
+
*
|
|
2223
|
+
* @summary List all submissions for a given template
|
|
2224
|
+
* @param templateId
|
|
2225
|
+
* @param cursor
|
|
2226
|
+
* @param limit
|
|
2227
|
+
* @param createdAfter
|
|
2228
|
+
* @param createdBefore
|
|
2229
|
+
* @param type
|
|
2230
|
+
* @param includeData
|
|
2231
|
+
*/
|
|
2232
|
+
public async listSubmissions_1 (templateId: string, cursor?: string, limit?: number, createdAfter?: string, createdBefore?: string, type?: string, includeData?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListSubmissionsResponse; }> {
|
|
2233
|
+
const localVarPath = this.basePath + '/templates/{template_id}/submissions'
|
|
2234
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
2235
|
+
let localVarQueryParameters: any = {};
|
|
2236
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2237
|
+
const produces = ['application/json'];
|
|
2238
|
+
// give precedence to 'application/json'
|
|
2239
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2240
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2241
|
+
} else {
|
|
2242
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2243
|
+
}
|
|
2244
|
+
let localVarFormParams: any = {};
|
|
2245
|
+
|
|
2246
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
2247
|
+
if (templateId === null || templateId === undefined) {
|
|
2248
|
+
throw new Error('Required parameter templateId was null or undefined when calling listSubmissions_1.');
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
if (cursor !== undefined) {
|
|
2252
|
+
localVarQueryParameters['cursor'] = ObjectSerializer.serialize(cursor, "string");
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
if (limit !== undefined) {
|
|
2256
|
+
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
if (createdAfter !== undefined) {
|
|
2260
|
+
localVarQueryParameters['created_after'] = ObjectSerializer.serialize(createdAfter, "string");
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
if (createdBefore !== undefined) {
|
|
2264
|
+
localVarQueryParameters['created_before'] = ObjectSerializer.serialize(createdBefore, "string");
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
if (type !== undefined) {
|
|
2268
|
+
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
if (includeData !== undefined) {
|
|
2272
|
+
localVarQueryParameters['include_data'] = ObjectSerializer.serialize(includeData, "boolean");
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2276
|
+
|
|
2277
|
+
let localVarUseFormData = false;
|
|
2278
|
+
|
|
2279
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2280
|
+
method: 'GET',
|
|
2281
|
+
qs: localVarQueryParameters,
|
|
2282
|
+
headers: localVarHeaderParams,
|
|
2283
|
+
uri: localVarPath,
|
|
2284
|
+
useQuerystring: this._useQuerystring,
|
|
2285
|
+
json: true,
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
let authenticationPromise = Promise.resolve();
|
|
2289
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2290
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2291
|
+
}
|
|
2292
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2293
|
+
|
|
2294
|
+
let interceptorPromise = authenticationPromise;
|
|
2295
|
+
for (const interceptor of this.interceptors) {
|
|
2296
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
return interceptorPromise.then(() => {
|
|
2300
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2301
|
+
if (localVarUseFormData) {
|
|
2302
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2303
|
+
} else {
|
|
2304
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
return new Promise<{ response: http.IncomingMessage; body: ListSubmissionsResponse; }>((resolve, reject) => {
|
|
2308
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2309
|
+
if (error) {
|
|
2310
|
+
reject(error);
|
|
2311
|
+
} else {
|
|
2312
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2313
|
+
body = ObjectSerializer.deserialize(body, "ListSubmissionsResponse");
|
|
2314
|
+
resolve({ response: response, body: body });
|
|
2315
|
+
} else {
|
|
2316
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
});
|
|
2320
|
+
});
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
*
|
|
2325
|
+
* @summary Get a list of all templates
|
|
2326
|
+
* @param query Search By Name
|
|
2327
|
+
* @param parentFolderId Filter By Folder Id
|
|
2328
|
+
* @param page Default: 1
|
|
2329
|
+
* @param perPage Default: 50
|
|
2330
|
+
*/
|
|
2331
|
+
public async listTemplates (query?: string, parentFolderId?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Template>; }> {
|
|
2332
|
+
const localVarPath = this.basePath + '/templates';
|
|
2333
|
+
let localVarQueryParameters: any = {};
|
|
2334
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2335
|
+
const produces = ['application/json'];
|
|
2336
|
+
// give precedence to 'application/json'
|
|
2337
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2338
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2339
|
+
} else {
|
|
2340
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2341
|
+
}
|
|
2342
|
+
let localVarFormParams: any = {};
|
|
2343
|
+
|
|
2344
|
+
if (query !== undefined) {
|
|
2345
|
+
localVarQueryParameters['query'] = ObjectSerializer.serialize(query, "string");
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
if (parentFolderId !== undefined) {
|
|
2349
|
+
localVarQueryParameters['parent_folder_id'] = ObjectSerializer.serialize(parentFolderId, "string");
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
if (page !== undefined) {
|
|
2353
|
+
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
if (perPage !== undefined) {
|
|
2357
|
+
localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number");
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2361
|
+
|
|
2362
|
+
let localVarUseFormData = false;
|
|
2363
|
+
|
|
2364
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2365
|
+
method: 'GET',
|
|
2366
|
+
qs: localVarQueryParameters,
|
|
2367
|
+
headers: localVarHeaderParams,
|
|
2368
|
+
uri: localVarPath,
|
|
2369
|
+
useQuerystring: this._useQuerystring,
|
|
2370
|
+
json: true,
|
|
2371
|
+
};
|
|
2372
|
+
|
|
2373
|
+
let authenticationPromise = Promise.resolve();
|
|
2374
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2375
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2376
|
+
}
|
|
2377
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2378
|
+
|
|
2379
|
+
let interceptorPromise = authenticationPromise;
|
|
2380
|
+
for (const interceptor of this.interceptors) {
|
|
2381
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
return interceptorPromise.then(() => {
|
|
2385
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2386
|
+
if (localVarUseFormData) {
|
|
2387
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2388
|
+
} else {
|
|
2389
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<Template>; }>((resolve, reject) => {
|
|
2393
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2394
|
+
if (error) {
|
|
2395
|
+
reject(error);
|
|
2396
|
+
} else {
|
|
2397
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2398
|
+
body = ObjectSerializer.deserialize(body, "Array<Template>");
|
|
2399
|
+
resolve({ response: response, body: body });
|
|
2400
|
+
} else {
|
|
2401
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
});
|
|
2405
|
+
});
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
*
|
|
2410
|
+
* @summary Move a folder
|
|
2411
|
+
* @param folderId
|
|
2412
|
+
* @param data
|
|
2413
|
+
*/
|
|
2414
|
+
public async moveFolderToFolder (folderId: string, data: MoveFolderData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Folder; }> {
|
|
2415
|
+
const localVarPath = this.basePath + '/folders/{folder_id}/move'
|
|
2416
|
+
.replace('{' + 'folder_id' + '}', encodeURIComponent(String(folderId)));
|
|
2417
|
+
let localVarQueryParameters: any = {};
|
|
2418
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2419
|
+
const produces = ['application/json'];
|
|
2420
|
+
// give precedence to 'application/json'
|
|
2421
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2422
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2423
|
+
} else {
|
|
2424
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2425
|
+
}
|
|
2426
|
+
let localVarFormParams: any = {};
|
|
2427
|
+
|
|
2428
|
+
// verify required parameter 'folderId' is not null or undefined
|
|
2429
|
+
if (folderId === null || folderId === undefined) {
|
|
2430
|
+
throw new Error('Required parameter folderId was null or undefined when calling moveFolderToFolder.');
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
// verify required parameter 'data' is not null or undefined
|
|
2434
|
+
if (data === null || data === undefined) {
|
|
2435
|
+
throw new Error('Required parameter data was null or undefined when calling moveFolderToFolder.');
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2439
|
+
|
|
2440
|
+
let localVarUseFormData = false;
|
|
2441
|
+
|
|
2442
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2443
|
+
method: 'POST',
|
|
2444
|
+
qs: localVarQueryParameters,
|
|
2445
|
+
headers: localVarHeaderParams,
|
|
2446
|
+
uri: localVarPath,
|
|
2447
|
+
useQuerystring: this._useQuerystring,
|
|
2448
|
+
json: true,
|
|
2449
|
+
body: ObjectSerializer.serialize(data, "MoveFolderData")
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2452
|
+
let authenticationPromise = Promise.resolve();
|
|
2453
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2454
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2455
|
+
}
|
|
2456
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2457
|
+
|
|
2458
|
+
let interceptorPromise = authenticationPromise;
|
|
2459
|
+
for (const interceptor of this.interceptors) {
|
|
2460
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
return interceptorPromise.then(() => {
|
|
2464
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2465
|
+
if (localVarUseFormData) {
|
|
2466
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2467
|
+
} else {
|
|
2468
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
return new Promise<{ response: http.IncomingMessage; body: Folder; }>((resolve, reject) => {
|
|
2472
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2473
|
+
if (error) {
|
|
2474
|
+
reject(error);
|
|
2475
|
+
} else {
|
|
2476
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2477
|
+
body = ObjectSerializer.deserialize(body, "Folder");
|
|
2478
|
+
resolve({ response: response, body: body });
|
|
2479
|
+
} else {
|
|
2480
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
});
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
*
|
|
2489
|
+
* @summary Move Template to folder
|
|
2490
|
+
* @param templateId
|
|
2491
|
+
* @param data
|
|
2492
|
+
*/
|
|
2493
|
+
public async moveTemplateToFolder (templateId: string, data: MoveTemplateData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Template; }> {
|
|
2494
|
+
const localVarPath = this.basePath + '/templates/{template_id}/move'
|
|
2495
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
2496
|
+
let localVarQueryParameters: any = {};
|
|
2497
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2498
|
+
const produces = ['application/json'];
|
|
2499
|
+
// give precedence to 'application/json'
|
|
2500
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2501
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2502
|
+
} else {
|
|
2503
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2504
|
+
}
|
|
2505
|
+
let localVarFormParams: any = {};
|
|
2506
|
+
|
|
2507
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
2508
|
+
if (templateId === null || templateId === undefined) {
|
|
2509
|
+
throw new Error('Required parameter templateId was null or undefined when calling moveTemplateToFolder.');
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
// verify required parameter 'data' is not null or undefined
|
|
2513
|
+
if (data === null || data === undefined) {
|
|
2514
|
+
throw new Error('Required parameter data was null or undefined when calling moveTemplateToFolder.');
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2518
|
+
|
|
2519
|
+
let localVarUseFormData = false;
|
|
2520
|
+
|
|
2521
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2522
|
+
method: 'POST',
|
|
2523
|
+
qs: localVarQueryParameters,
|
|
2524
|
+
headers: localVarHeaderParams,
|
|
2525
|
+
uri: localVarPath,
|
|
2526
|
+
useQuerystring: this._useQuerystring,
|
|
2527
|
+
json: true,
|
|
2528
|
+
body: ObjectSerializer.serialize(data, "MoveTemplateData")
|
|
2529
|
+
};
|
|
2530
|
+
|
|
2531
|
+
let authenticationPromise = Promise.resolve();
|
|
2532
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2533
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2534
|
+
}
|
|
2535
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2536
|
+
|
|
2537
|
+
let interceptorPromise = authenticationPromise;
|
|
2538
|
+
for (const interceptor of this.interceptors) {
|
|
2539
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
return interceptorPromise.then(() => {
|
|
2543
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2544
|
+
if (localVarUseFormData) {
|
|
2545
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2546
|
+
} else {
|
|
2547
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
return new Promise<{ response: http.IncomingMessage; body: Template; }>((resolve, reject) => {
|
|
2551
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2552
|
+
if (error) {
|
|
2553
|
+
reject(error);
|
|
2554
|
+
} else {
|
|
2555
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2556
|
+
body = ObjectSerializer.deserialize(body, "Template");
|
|
2557
|
+
resolve({ response: response, body: body });
|
|
2558
|
+
} else {
|
|
2559
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
});
|
|
2563
|
+
});
|
|
2564
|
+
});
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
*
|
|
2568
|
+
* @summary Rename a folder
|
|
2569
|
+
* @param folderId
|
|
2570
|
+
* @param data
|
|
2571
|
+
*/
|
|
2572
|
+
public async renameFolder (folderId: string, data: RenameFolderData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
2573
|
+
const localVarPath = this.basePath + '/folders/{folder_id}/rename'
|
|
2574
|
+
.replace('{' + 'folder_id' + '}', encodeURIComponent(String(folderId)));
|
|
2575
|
+
let localVarQueryParameters: any = {};
|
|
2576
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2577
|
+
const produces = ['application/json'];
|
|
2578
|
+
// give precedence to 'application/json'
|
|
2579
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2580
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2581
|
+
} else {
|
|
2582
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2583
|
+
}
|
|
2584
|
+
let localVarFormParams: any = {};
|
|
2585
|
+
|
|
2586
|
+
// verify required parameter 'folderId' is not null or undefined
|
|
2587
|
+
if (folderId === null || folderId === undefined) {
|
|
2588
|
+
throw new Error('Required parameter folderId was null or undefined when calling renameFolder.');
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
// verify required parameter 'data' is not null or undefined
|
|
2592
|
+
if (data === null || data === undefined) {
|
|
2593
|
+
throw new Error('Required parameter data was null or undefined when calling renameFolder.');
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2597
|
+
|
|
2598
|
+
let localVarUseFormData = false;
|
|
2599
|
+
|
|
2600
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2601
|
+
method: 'POST',
|
|
2602
|
+
qs: localVarQueryParameters,
|
|
2603
|
+
headers: localVarHeaderParams,
|
|
2604
|
+
uri: localVarPath,
|
|
2605
|
+
useQuerystring: this._useQuerystring,
|
|
2606
|
+
json: true,
|
|
2607
|
+
body: ObjectSerializer.serialize(data, "RenameFolderData")
|
|
2608
|
+
};
|
|
2609
|
+
|
|
2610
|
+
let authenticationPromise = Promise.resolve();
|
|
2611
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2612
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2613
|
+
}
|
|
2614
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2615
|
+
|
|
2616
|
+
let interceptorPromise = authenticationPromise;
|
|
2617
|
+
for (const interceptor of this.interceptors) {
|
|
2618
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
return interceptorPromise.then(() => {
|
|
2622
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2623
|
+
if (localVarUseFormData) {
|
|
2624
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2625
|
+
} else {
|
|
2626
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
2630
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2631
|
+
if (error) {
|
|
2632
|
+
reject(error);
|
|
2633
|
+
} else {
|
|
2634
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2635
|
+
resolve({ response: response, body: body });
|
|
2636
|
+
} else {
|
|
2637
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
});
|
|
2641
|
+
});
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
/**
|
|
2645
|
+
*
|
|
2646
|
+
* @summary Test Authentication
|
|
2647
|
+
*/
|
|
2648
|
+
public async testAuthentication (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AuthenticationSuccessResponse; }> {
|
|
2649
|
+
const localVarPath = this.basePath + '/authentication';
|
|
2650
|
+
let localVarQueryParameters: any = {};
|
|
2651
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2652
|
+
const produces = ['application/json'];
|
|
2653
|
+
// give precedence to 'application/json'
|
|
2654
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2655
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2656
|
+
} else {
|
|
2657
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2658
|
+
}
|
|
2659
|
+
let localVarFormParams: any = {};
|
|
2660
|
+
|
|
2661
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2662
|
+
|
|
2663
|
+
let localVarUseFormData = false;
|
|
2664
|
+
|
|
2665
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2666
|
+
method: 'GET',
|
|
2667
|
+
qs: localVarQueryParameters,
|
|
2668
|
+
headers: localVarHeaderParams,
|
|
2669
|
+
uri: localVarPath,
|
|
2670
|
+
useQuerystring: this._useQuerystring,
|
|
2671
|
+
json: true,
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
let authenticationPromise = Promise.resolve();
|
|
2675
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2676
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2677
|
+
}
|
|
2678
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2679
|
+
|
|
2680
|
+
let interceptorPromise = authenticationPromise;
|
|
2681
|
+
for (const interceptor of this.interceptors) {
|
|
2682
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
return interceptorPromise.then(() => {
|
|
2686
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2687
|
+
if (localVarUseFormData) {
|
|
2688
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2689
|
+
} else {
|
|
2690
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
return new Promise<{ response: http.IncomingMessage; body: AuthenticationSuccessResponse; }>((resolve, reject) => {
|
|
2694
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2695
|
+
if (error) {
|
|
2696
|
+
reject(error);
|
|
2697
|
+
} else {
|
|
2698
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2699
|
+
body = ObjectSerializer.deserialize(body, "AuthenticationSuccessResponse");
|
|
2700
|
+
resolve({ response: response, body: body });
|
|
2701
|
+
} else {
|
|
2702
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
});
|
|
2706
|
+
});
|
|
2707
|
+
});
|
|
2708
|
+
}
|
|
2709
|
+
/**
|
|
2710
|
+
*
|
|
2711
|
+
* @summary Update a submission data request
|
|
2712
|
+
* @param dataRequestId
|
|
2713
|
+
* @param data
|
|
2714
|
+
*/
|
|
2715
|
+
public async updateDataRequest (dataRequestId: string, data: UpdateSubmissionDataRequestData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UpdateDataRequestResponse; }> {
|
|
2716
|
+
const localVarPath = this.basePath + '/data_requests/{data_request_id}'
|
|
2717
|
+
.replace('{' + 'data_request_id' + '}', encodeURIComponent(String(dataRequestId)));
|
|
2718
|
+
let localVarQueryParameters: any = {};
|
|
2719
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2720
|
+
const produces = ['application/json'];
|
|
2721
|
+
// give precedence to 'application/json'
|
|
2722
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2723
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2724
|
+
} else {
|
|
2725
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2726
|
+
}
|
|
2727
|
+
let localVarFormParams: any = {};
|
|
2728
|
+
|
|
2729
|
+
// verify required parameter 'dataRequestId' is not null or undefined
|
|
2730
|
+
if (dataRequestId === null || dataRequestId === undefined) {
|
|
2731
|
+
throw new Error('Required parameter dataRequestId was null or undefined when calling updateDataRequest.');
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
// verify required parameter 'data' is not null or undefined
|
|
2735
|
+
if (data === null || data === undefined) {
|
|
2736
|
+
throw new Error('Required parameter data was null or undefined when calling updateDataRequest.');
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2740
|
+
|
|
2741
|
+
let localVarUseFormData = false;
|
|
2742
|
+
|
|
2743
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2744
|
+
method: 'PUT',
|
|
2745
|
+
qs: localVarQueryParameters,
|
|
2746
|
+
headers: localVarHeaderParams,
|
|
2747
|
+
uri: localVarPath,
|
|
2748
|
+
useQuerystring: this._useQuerystring,
|
|
2749
|
+
json: true,
|
|
2750
|
+
body: ObjectSerializer.serialize(data, "UpdateSubmissionDataRequestData")
|
|
2751
|
+
};
|
|
2752
|
+
|
|
2753
|
+
let authenticationPromise = Promise.resolve();
|
|
2754
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2755
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2756
|
+
}
|
|
2757
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2758
|
+
|
|
2759
|
+
let interceptorPromise = authenticationPromise;
|
|
2760
|
+
for (const interceptor of this.interceptors) {
|
|
2761
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
return interceptorPromise.then(() => {
|
|
2765
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2766
|
+
if (localVarUseFormData) {
|
|
2767
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2768
|
+
} else {
|
|
2769
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
return new Promise<{ response: http.IncomingMessage; body: UpdateDataRequestResponse; }>((resolve, reject) => {
|
|
2773
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2774
|
+
if (error) {
|
|
2775
|
+
reject(error);
|
|
2776
|
+
} else {
|
|
2777
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2778
|
+
body = ObjectSerializer.deserialize(body, "UpdateDataRequestResponse");
|
|
2779
|
+
resolve({ response: response, body: body });
|
|
2780
|
+
} else {
|
|
2781
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
});
|
|
2785
|
+
});
|
|
2786
|
+
});
|
|
2787
|
+
}
|
|
2788
|
+
/**
|
|
2789
|
+
*
|
|
2790
|
+
* @summary Update a Template
|
|
2791
|
+
* @param templateId
|
|
2792
|
+
* @param data
|
|
2793
|
+
*/
|
|
2794
|
+
public async updateTemplate (templateId: string, data: UpdateTemplateData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UpdateTemplateResponse; }> {
|
|
2795
|
+
const localVarPath = this.basePath + '/templates/{template_id}'
|
|
2796
|
+
.replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId)));
|
|
2797
|
+
let localVarQueryParameters: any = {};
|
|
2798
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
2799
|
+
const produces = ['application/json'];
|
|
2800
|
+
// give precedence to 'application/json'
|
|
2801
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2802
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2803
|
+
} else {
|
|
2804
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2805
|
+
}
|
|
2806
|
+
let localVarFormParams: any = {};
|
|
2807
|
+
|
|
2808
|
+
// verify required parameter 'templateId' is not null or undefined
|
|
2809
|
+
if (templateId === null || templateId === undefined) {
|
|
2810
|
+
throw new Error('Required parameter templateId was null or undefined when calling updateTemplate.');
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2813
|
+
// verify required parameter 'data' is not null or undefined
|
|
2814
|
+
if (data === null || data === undefined) {
|
|
2815
|
+
throw new Error('Required parameter data was null or undefined when calling updateTemplate.');
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2819
|
+
|
|
2820
|
+
let localVarUseFormData = false;
|
|
2821
|
+
|
|
2822
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2823
|
+
method: 'PUT',
|
|
2824
|
+
qs: localVarQueryParameters,
|
|
2825
|
+
headers: localVarHeaderParams,
|
|
2826
|
+
uri: localVarPath,
|
|
2827
|
+
useQuerystring: this._useQuerystring,
|
|
2828
|
+
json: true,
|
|
2829
|
+
body: ObjectSerializer.serialize(data, "UpdateTemplateData")
|
|
2830
|
+
};
|
|
2831
|
+
|
|
2832
|
+
let authenticationPromise = Promise.resolve();
|
|
2833
|
+
if (this.authentications.api_token_basic.username && this.authentications.api_token_basic.password) {
|
|
2834
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.api_token_basic.applyToRequest(localVarRequestOptions));
|
|
2835
|
+
}
|
|
2836
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2837
|
+
|
|
2838
|
+
let interceptorPromise = authenticationPromise;
|
|
2839
|
+
for (const interceptor of this.interceptors) {
|
|
2840
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
return interceptorPromise.then(() => {
|
|
2844
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2845
|
+
if (localVarUseFormData) {
|
|
2846
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2847
|
+
} else {
|
|
2848
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
return new Promise<{ response: http.IncomingMessage; body: UpdateTemplateResponse; }>((resolve, reject) => {
|
|
2852
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2853
|
+
if (error) {
|
|
2854
|
+
reject(error);
|
|
2855
|
+
} else {
|
|
2856
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2857
|
+
body = ObjectSerializer.deserialize(body, "UpdateTemplateResponse");
|
|
2858
|
+
resolve({ response: response, body: body });
|
|
2859
|
+
} else {
|
|
2860
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
});
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
}
|