docspring 3.3.0 → 4.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/AGENTS.md +79 -19
- package/README.md +65 -63
- package/dist/ApiClient.js +63 -28
- package/dist/RequestSchemas.js +2297 -0
- package/dist/RequestValidator.js +494 -0
- package/dist/api/Client.js +1346 -948
- package/dist/index.js +651 -154
- package/dist/model/AiFieldNamingLanguage.js +64 -0
- package/dist/model/{CreateWebhookData.js → AuthenticationCheck.js} +32 -28
- package/dist/model/BarcodeSymbology.js +89 -0
- package/dist/model/CheckCharacter.js +74 -0
- package/dist/model/CombinedFieldType.js +59 -0
- package/dist/model/CombinedPdf.js +294 -0
- package/dist/model/{MoveFolderData.js → CombinedPdfFiles.js} +27 -27
- package/dist/model/CombinedPdfList.js +132 -0
- package/dist/model/{ForbiddenErrorResponse.js → CombinedPdfSource.js} +59 -73
- package/dist/model/CombinedPdfSourceInput.js +270 -0
- package/dist/model/CombinedPdfSourcePdf.js +130 -0
- package/dist/model/CombinedPdfSourceType.js +74 -0
- package/dist/model/CombinedPdfState.js +74 -0
- package/dist/model/{CopyTemplateOptions.js → CopyTemplateRequest.js} +26 -22
- package/dist/model/{CombinePdfsData.js → CreateCombinedPdfRequest.js} +69 -53
- package/dist/model/{CreateCustomFileData.js → CreateCustomFileFromUploadRequest.js} +25 -23
- package/dist/model/{CreateFolderData.js → CreateFolderRequest.js} +47 -28
- package/dist/model/{TemplateDeleteResponse.js → CreateSignatureRequestEventRequest.js} +49 -74
- package/dist/model/CreateSignatureRequestTokenRequest.js +88 -0
- package/dist/model/{SubmissionBatchData.js → CreateSubmissionBatchRequest.js} +67 -42
- package/dist/model/CreateSubmissionRequest.js +212 -0
- package/dist/model/CreateTemplateRequest.js +545 -0
- package/dist/model/CreateWebhookRequest.js +234 -0
- package/dist/model/CustomFile.js +67 -16
- package/dist/model/CustomFileList.js +132 -0
- package/dist/model/CustomFileSourcePdf.js +130 -0
- package/dist/model/ErrorCode.js +154 -0
- package/dist/model/{CreateSubmissionResponse.js → ErrorDetail.js} +65 -75
- package/dist/model/ErrorInfo.js +211 -0
- package/dist/model/ErrorResponse.js +12 -41
- package/dist/model/ExpirationInterval.js +64 -0
- package/dist/model/FieldComparisonCondition.js +137 -0
- package/dist/model/FieldComparisonOperator.js +69 -0
- package/dist/model/FieldDisplayType.js +79 -0
- package/dist/model/{MultipleErrorsResponse.js → FieldEqualsCondition.js} +48 -52
- package/dist/model/FieldEqualsOperator.js +59 -0
- package/dist/model/{SuccessMultipleErrorsResponse.js → FieldInCondition.js} +54 -53
- package/dist/model/FieldOverride.js +722 -0
- package/dist/model/FieldPresenceCondition.js +126 -0
- package/dist/model/FieldPresenceOperator.js +59 -0
- package/dist/model/FieldRangeCondition.js +148 -0
- package/dist/model/FieldReimportState.js +69 -0
- package/dist/model/FieldSetupLogic.js +59 -0
- package/dist/model/FieldSetupNaming.js +59 -0
- package/dist/model/FieldSetupSource.js +64 -0
- package/dist/model/Folder.js +38 -11
- package/dist/model/FolderList.js +132 -0
- package/dist/model/GeneratedFile.js +214 -0
- package/dist/model/GeneratedFileState.js +64 -0
- package/dist/model/HtmlEngineOptions.js +230 -0
- package/dist/model/HtmlEngineOptionsInput.js +193 -0
- package/dist/model/ImageGravity.js +94 -0
- package/dist/model/ImageScaleType.js +64 -0
- package/dist/model/ModelCodeLanguage.js +94 -0
- package/dist/model/{UpdatePdfTemplate.js → MoveFolderRequest.js} +34 -28
- package/dist/model/{MoveTemplateData.js → MoveTemplateRequest.js} +25 -35
- package/dist/model/NumberConditionType.js +79 -0
- package/dist/model/PageFormat.js +114 -0
- package/dist/model/{PublishVersionData.js → PublishTemplateVersionRequest.js} +33 -33
- package/dist/model/{RenameFolderData.js → RenameFolderRequest.js} +25 -23
- package/dist/model/{RestoreVersionData.js → RestoreTemplateVersionRequest.js} +25 -23
- package/dist/model/ShapeType.js +79 -0
- package/dist/model/{SubmissionDataRequestShow.js → SignatureRequest.js} +165 -240
- package/dist/model/SignatureRequestAuthSecondFactorType.js +79 -0
- package/dist/model/SignatureRequestAuthType.js +84 -0
- package/dist/model/{SubmissionDataRequestEvent.js → SignatureRequestEvent.js} +67 -149
- package/dist/model/SignatureRequestEventType.js +79 -0
- package/dist/model/SignatureRequestInput.js +278 -0
- package/dist/model/SignatureRequestMessageType.js +94 -0
- package/dist/model/SignatureRequestState.js +64 -0
- package/dist/model/SignatureRequestToken.js +195 -0
- package/dist/model/SignatureRequestTokenType.js +59 -0
- package/dist/model/StringConditionType.js +74 -0
- package/dist/model/Submission.js +186 -345
- package/dist/model/SubmissionAction.js +30 -115
- package/dist/model/SubmissionActionState.js +69 -0
- package/dist/model/SubmissionActionType.js +84 -0
- package/dist/model/SubmissionBatch.js +74 -55
- package/dist/model/SubmissionBatchState.js +64 -0
- package/dist/model/SubmissionFiles.js +108 -0
- package/dist/model/SubmissionInput.js +204 -0
- package/dist/model/{ListSubmissionsResponse.js → SubmissionList.js} +35 -42
- package/dist/model/SubmissionSource.js +69 -0
- package/dist/model/SubmissionSourcePdf.js +130 -0
- package/dist/model/SubmissionState.js +114 -0
- package/dist/model/Template.js +310 -573
- package/dist/model/TemplateActor.js +171 -0
- package/dist/model/TemplateActorType.js +64 -0
- package/dist/model/TemplateDefaults.js +307 -0
- package/dist/model/TemplateDefaultsInput.js +305 -0
- package/dist/model/TemplateDocument.js +280 -0
- package/dist/model/TemplateDocumentState.js +74 -0
- package/dist/model/{CreatePdfSubmissionData.js → TemplateFieldDependency.js} +70 -89
- package/dist/model/TemplateFieldDependencyAction.js +64 -0
- package/dist/model/{TemplatePublishVersionResponse.js → TemplateFieldDependencyCondition.js} +51 -61
- package/dist/model/TemplateFieldDependencyConditionInput.js +304 -0
- package/dist/model/TemplateFieldDependencyInput.js +182 -0
- package/dist/model/TemplateFieldDependencyMatch.js +59 -0
- package/dist/model/TemplateFieldDependencyOperator.js +99 -0
- package/dist/model/TemplateFieldLogicStatus.js +74 -0
- package/dist/model/TemplateFormMode.js +64 -0
- package/dist/model/{TemplateModelCodeResponse.js → TemplateModelCode.js} +34 -86
- package/dist/model/TemplatePageAiError.js +69 -0
- package/dist/model/TemplatePageAiNamingStatus.js +59 -0
- package/dist/model/TemplatePageFieldsStatus.js +74 -0
- package/dist/model/TemplatePageImageStatus.js +59 -0
- package/dist/model/TemplatePageProcessingStatus.js +162 -0
- package/dist/model/{SubmissionDataRequestToken.js → TemplateSourcePdf.js} +52 -56
- package/dist/model/TemplateSummary.js +560 -0
- package/dist/model/{SuccessErrorResponse.js → TemplateSummaryList.js} +43 -55
- package/dist/model/TemplateType.js +59 -0
- package/dist/model/{Submission422Response.js → TemplateVersion.js} +60 -63
- package/dist/model/TemplateVersionType.js +64 -0
- package/dist/model/TextAlignment.js +69 -0
- package/dist/model/TextOverflow.js +59 -0
- package/dist/model/TextVerticalAlignment.js +64 -0
- package/dist/model/Typeface.js +134 -0
- package/dist/model/UpdateSignatureRequestRequest.js +183 -0
- package/dist/model/UpdateTemplateDocumentRequest.js +136 -0
- package/dist/model/UpdateTemplateRequest.js +450 -0
- package/dist/model/UpdateWebhookRequest.js +209 -0
- package/dist/model/UploadMethod.js +54 -0
- package/dist/model/{UploadPresignResponse.js → UploadPresign.js} +53 -58
- package/dist/model/{AddFieldsData.js → UrlSourcePdf.js} +49 -31
- package/dist/model/Webhook.js +58 -73
- package/dist/model/WebhookEventType.js +174 -0
- package/dist/model/WebhookList.js +132 -0
- package/dist/model/WebhookMode.js +59 -0
- package/package.json +1 -1
- package/dist/model/BatchGeneratePdfs201Response.js +0 -194
- package/dist/model/CombinedSubmission.js +0 -313
- package/dist/model/CombinedSubmissionAction.js +0 -268
- package/dist/model/CreateCombinedSubmissionResponse.js +0 -180
- package/dist/model/CreateCustomFileResponse.js +0 -167
- package/dist/model/CreateHtmlTemplate.js +0 -108
- package/dist/model/CreatePdfTemplate.js +0 -108
- package/dist/model/CreateSubmissionDataRequestData.js +0 -314
- package/dist/model/CreateSubmissionDataRequestEventRequest.js +0 -239
- package/dist/model/CreateSubmissionDataRequestEventResponse.js +0 -167
- package/dist/model/CreateSubmissionDataRequestResponse.js +0 -167
- package/dist/model/CreateSubmissionDataRequestTokenResponse.js +0 -167
- package/dist/model/ErrorOrMultipleErrorsResponse.js +0 -153
- package/dist/model/JsonSchema.js +0 -205
- package/dist/model/SubmissionBatchWithSubmissions.js +0 -228
- package/dist/model/SubmissionDataRequest.js +0 -496
- package/dist/model/SubmissionPreview.js +0 -509
- package/dist/model/TemplateAddFieldsResponse.js +0 -156
- package/dist/model/TemplatePreview.js +0 -796
- package/dist/model/UpdateHtmlTemplate.js +0 -108
- package/dist/model/UpdateSubmissionDataRequestData.js +0 -311
- package/dist/model/UpdateWebhookData.js +0 -108
|
@@ -1,509 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
-
var _SubmissionAction = _interopRequireDefault(require("./SubmissionAction"));
|
|
9
|
-
var _SubmissionDataRequest = _interopRequireDefault(require("./SubmissionDataRequest"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
-
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
20
|
-
* DocSpring API
|
|
21
|
-
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
|
|
22
|
-
*
|
|
23
|
-
* The version of the OpenAPI document: v1
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
-
* https://openapi-generator.tech
|
|
28
|
-
* Do not edit the class manually.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* The SubmissionPreview model module.
|
|
33
|
-
* @module model/SubmissionPreview
|
|
34
|
-
* @version 3.3.0
|
|
35
|
-
*/
|
|
36
|
-
var SubmissionPreview = /*#__PURE__*/function () {
|
|
37
|
-
/**
|
|
38
|
-
* Constructs a new <code>SubmissionPreview</code>.
|
|
39
|
-
* @alias module:model/SubmissionPreview
|
|
40
|
-
* @extends Object
|
|
41
|
-
* @param batch_id {String}
|
|
42
|
-
* @param data_requests {Array.<module:model/SubmissionDataRequest>}
|
|
43
|
-
* @param editable {Boolean}
|
|
44
|
-
* @param error_message {String}
|
|
45
|
-
* @param expired {Boolean}
|
|
46
|
-
* @param expires_at {String}
|
|
47
|
-
* @param id {String}
|
|
48
|
-
* @param json_schema_errors {Array.<String>}
|
|
49
|
-
* @param metadata {Object}
|
|
50
|
-
* @param password {String}
|
|
51
|
-
* @param processed_at {String}
|
|
52
|
-
* @param state {module:model/SubmissionPreview.StateEnum}
|
|
53
|
-
* @param template_id {String}
|
|
54
|
-
* @param template_type {module:model/SubmissionPreview.TemplateTypeEnum}
|
|
55
|
-
* @param template_version {String}
|
|
56
|
-
* @param test {Boolean}
|
|
57
|
-
* @param truncated_text {Object}
|
|
58
|
-
* @param pdf_hash {String}
|
|
59
|
-
* @param download_url {String}
|
|
60
|
-
* @param permanent_download_url {String}
|
|
61
|
-
* @param preview_download_url {String}
|
|
62
|
-
* @param preview_generated_at {String}
|
|
63
|
-
* @param audit_trail_download_url {String}
|
|
64
|
-
* @param actions {Array.<module:model/SubmissionAction>}
|
|
65
|
-
*/
|
|
66
|
-
function SubmissionPreview(batch_id, data_requests, editable, error_message, expired, expires_at, id, json_schema_errors, metadata, password, processed_at, state, template_id, template_type, template_version, test, truncated_text, pdf_hash, download_url, permanent_download_url, preview_download_url, preview_generated_at, audit_trail_download_url, actions) {
|
|
67
|
-
_classCallCheck(this, SubmissionPreview);
|
|
68
|
-
SubmissionPreview.initialize(this, batch_id, data_requests, editable, error_message, expired, expires_at, id, json_schema_errors, metadata, password, processed_at, state, template_id, template_type, template_version, test, truncated_text, pdf_hash, download_url, permanent_download_url, preview_download_url, preview_generated_at, audit_trail_download_url, actions);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Initializes the fields of this object.
|
|
73
|
-
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
74
|
-
* Only for internal use.
|
|
75
|
-
*/
|
|
76
|
-
return _createClass(SubmissionPreview, null, [{
|
|
77
|
-
key: "initialize",
|
|
78
|
-
value: function initialize(obj, batch_id, data_requests, editable, error_message, expired, expires_at, id, json_schema_errors, metadata, password, processed_at, state, template_id, template_type, template_version, test, truncated_text, pdf_hash, download_url, permanent_download_url, preview_download_url, preview_generated_at, audit_trail_download_url, actions) {
|
|
79
|
-
obj['batch_id'] = batch_id;
|
|
80
|
-
obj['data_requests'] = data_requests;
|
|
81
|
-
obj['editable'] = editable;
|
|
82
|
-
obj['error_message'] = error_message;
|
|
83
|
-
obj['expired'] = expired;
|
|
84
|
-
obj['expires_at'] = expires_at;
|
|
85
|
-
obj['id'] = id;
|
|
86
|
-
obj['json_schema_errors'] = json_schema_errors;
|
|
87
|
-
obj['metadata'] = metadata;
|
|
88
|
-
obj['password'] = password;
|
|
89
|
-
obj['processed_at'] = processed_at;
|
|
90
|
-
obj['state'] = state;
|
|
91
|
-
obj['template_id'] = template_id;
|
|
92
|
-
obj['template_type'] = template_type;
|
|
93
|
-
obj['template_version'] = template_version;
|
|
94
|
-
obj['test'] = test;
|
|
95
|
-
obj['truncated_text'] = truncated_text;
|
|
96
|
-
obj['pdf_hash'] = pdf_hash;
|
|
97
|
-
obj['download_url'] = download_url;
|
|
98
|
-
obj['permanent_download_url'] = permanent_download_url;
|
|
99
|
-
obj['preview_download_url'] = preview_download_url;
|
|
100
|
-
obj['preview_generated_at'] = preview_generated_at;
|
|
101
|
-
obj['audit_trail_download_url'] = audit_trail_download_url;
|
|
102
|
-
obj['actions'] = actions;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Constructs a <code>SubmissionPreview</code> from a plain JavaScript object, optionally creating a new instance.
|
|
107
|
-
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
108
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
109
|
-
* @param {module:model/SubmissionPreview} obj Optional instance to populate.
|
|
110
|
-
* @return {module:model/SubmissionPreview} The populated <code>SubmissionPreview</code> instance.
|
|
111
|
-
*/
|
|
112
|
-
}, {
|
|
113
|
-
key: "constructFromObject",
|
|
114
|
-
value: function constructFromObject(data, obj) {
|
|
115
|
-
if (data) {
|
|
116
|
-
obj = obj || new SubmissionPreview();
|
|
117
|
-
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
118
|
-
if (data.hasOwnProperty('batch_id')) {
|
|
119
|
-
obj['batch_id'] = _ApiClient["default"].convertToType(data['batch_id'], 'String');
|
|
120
|
-
}
|
|
121
|
-
if (data.hasOwnProperty('data_requests')) {
|
|
122
|
-
obj['data_requests'] = _ApiClient["default"].convertToType(data['data_requests'], [_SubmissionDataRequest["default"]]);
|
|
123
|
-
}
|
|
124
|
-
if (data.hasOwnProperty('editable')) {
|
|
125
|
-
obj['editable'] = _ApiClient["default"].convertToType(data['editable'], 'Boolean');
|
|
126
|
-
}
|
|
127
|
-
if (data.hasOwnProperty('error_message')) {
|
|
128
|
-
obj['error_message'] = _ApiClient["default"].convertToType(data['error_message'], 'String');
|
|
129
|
-
}
|
|
130
|
-
if (data.hasOwnProperty('expired')) {
|
|
131
|
-
obj['expired'] = _ApiClient["default"].convertToType(data['expired'], 'Boolean');
|
|
132
|
-
}
|
|
133
|
-
if (data.hasOwnProperty('expires_at')) {
|
|
134
|
-
obj['expires_at'] = _ApiClient["default"].convertToType(data['expires_at'], 'String');
|
|
135
|
-
}
|
|
136
|
-
if (data.hasOwnProperty('id')) {
|
|
137
|
-
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
|
|
138
|
-
}
|
|
139
|
-
if (data.hasOwnProperty('json_schema_errors')) {
|
|
140
|
-
obj['json_schema_errors'] = _ApiClient["default"].convertToType(data['json_schema_errors'], ['String']);
|
|
141
|
-
}
|
|
142
|
-
if (data.hasOwnProperty('metadata')) {
|
|
143
|
-
obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
|
|
144
|
-
}
|
|
145
|
-
if (data.hasOwnProperty('password')) {
|
|
146
|
-
obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
|
|
147
|
-
}
|
|
148
|
-
if (data.hasOwnProperty('processed_at')) {
|
|
149
|
-
obj['processed_at'] = _ApiClient["default"].convertToType(data['processed_at'], 'String');
|
|
150
|
-
}
|
|
151
|
-
if (data.hasOwnProperty('state')) {
|
|
152
|
-
obj['state'] = _ApiClient["default"].convertToType(data['state'], 'String');
|
|
153
|
-
}
|
|
154
|
-
if (data.hasOwnProperty('template_id')) {
|
|
155
|
-
obj['template_id'] = _ApiClient["default"].convertToType(data['template_id'], 'String');
|
|
156
|
-
}
|
|
157
|
-
if (data.hasOwnProperty('template_type')) {
|
|
158
|
-
obj['template_type'] = _ApiClient["default"].convertToType(data['template_type'], 'String');
|
|
159
|
-
}
|
|
160
|
-
if (data.hasOwnProperty('template_version')) {
|
|
161
|
-
obj['template_version'] = _ApiClient["default"].convertToType(data['template_version'], 'String');
|
|
162
|
-
}
|
|
163
|
-
if (data.hasOwnProperty('test')) {
|
|
164
|
-
obj['test'] = _ApiClient["default"].convertToType(data['test'], 'Boolean');
|
|
165
|
-
}
|
|
166
|
-
if (data.hasOwnProperty('truncated_text')) {
|
|
167
|
-
obj['truncated_text'] = _ApiClient["default"].convertToType(data['truncated_text'], Object);
|
|
168
|
-
}
|
|
169
|
-
if (data.hasOwnProperty('pdf_hash')) {
|
|
170
|
-
obj['pdf_hash'] = _ApiClient["default"].convertToType(data['pdf_hash'], 'String');
|
|
171
|
-
}
|
|
172
|
-
if (data.hasOwnProperty('download_url')) {
|
|
173
|
-
obj['download_url'] = _ApiClient["default"].convertToType(data['download_url'], 'String');
|
|
174
|
-
}
|
|
175
|
-
if (data.hasOwnProperty('permanent_download_url')) {
|
|
176
|
-
obj['permanent_download_url'] = _ApiClient["default"].convertToType(data['permanent_download_url'], 'String');
|
|
177
|
-
}
|
|
178
|
-
if (data.hasOwnProperty('preview_download_url')) {
|
|
179
|
-
obj['preview_download_url'] = _ApiClient["default"].convertToType(data['preview_download_url'], 'String');
|
|
180
|
-
}
|
|
181
|
-
if (data.hasOwnProperty('preview_generated_at')) {
|
|
182
|
-
obj['preview_generated_at'] = _ApiClient["default"].convertToType(data['preview_generated_at'], 'String');
|
|
183
|
-
}
|
|
184
|
-
if (data.hasOwnProperty('audit_trail_download_url')) {
|
|
185
|
-
obj['audit_trail_download_url'] = _ApiClient["default"].convertToType(data['audit_trail_download_url'], 'String');
|
|
186
|
-
}
|
|
187
|
-
if (data.hasOwnProperty('actions')) {
|
|
188
|
-
obj['actions'] = _ApiClient["default"].convertToType(data['actions'], [_SubmissionAction["default"]]);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return obj;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Validates the JSON data with respect to <code>SubmissionPreview</code>.
|
|
196
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
197
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SubmissionPreview</code>.
|
|
198
|
-
*/
|
|
199
|
-
}, {
|
|
200
|
-
key: "validateJSON",
|
|
201
|
-
value: function validateJSON(data) {
|
|
202
|
-
// check to make sure all required properties are present in the JSON string
|
|
203
|
-
var _iterator = _createForOfIteratorHelper(SubmissionPreview.RequiredProperties),
|
|
204
|
-
_step;
|
|
205
|
-
try {
|
|
206
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
207
|
-
var property = _step.value;
|
|
208
|
-
if (!data.hasOwnProperty(property)) {
|
|
209
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// ensure the json data is a string
|
|
213
|
-
} catch (err) {
|
|
214
|
-
_iterator.e(err);
|
|
215
|
-
} finally {
|
|
216
|
-
_iterator.f();
|
|
217
|
-
}
|
|
218
|
-
if (data['batch_id'] && !(typeof data['batch_id'] === 'string' || data['batch_id'] instanceof String)) {
|
|
219
|
-
throw new Error("Expected the field `batch_id` to be a primitive type in the JSON string but got " + data['batch_id']);
|
|
220
|
-
}
|
|
221
|
-
// ensure the json data is an array
|
|
222
|
-
if (!Array.isArray(data['data_requests'])) {
|
|
223
|
-
throw new Error("Expected the field `data_requests` to be an array in the JSON data but got " + data['data_requests']);
|
|
224
|
-
}
|
|
225
|
-
// ensure the json data is a string
|
|
226
|
-
if (data['error_message'] && !(typeof data['error_message'] === 'string' || data['error_message'] instanceof String)) {
|
|
227
|
-
throw new Error("Expected the field `error_message` to be a primitive type in the JSON string but got " + data['error_message']);
|
|
228
|
-
}
|
|
229
|
-
// ensure the json data is a string
|
|
230
|
-
if (data['expires_at'] && !(typeof data['expires_at'] === 'string' || data['expires_at'] instanceof String)) {
|
|
231
|
-
throw new Error("Expected the field `expires_at` to be a primitive type in the JSON string but got " + data['expires_at']);
|
|
232
|
-
}
|
|
233
|
-
// ensure the json data is a string
|
|
234
|
-
if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
|
|
235
|
-
throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
|
|
236
|
-
}
|
|
237
|
-
// ensure the json data is an array
|
|
238
|
-
if (!Array.isArray(data['json_schema_errors'])) {
|
|
239
|
-
throw new Error("Expected the field `json_schema_errors` to be an array in the JSON data but got " + data['json_schema_errors']);
|
|
240
|
-
}
|
|
241
|
-
// ensure the json data is a string
|
|
242
|
-
if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
|
|
243
|
-
throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
|
|
244
|
-
}
|
|
245
|
-
// ensure the json data is a string
|
|
246
|
-
if (data['processed_at'] && !(typeof data['processed_at'] === 'string' || data['processed_at'] instanceof String)) {
|
|
247
|
-
throw new Error("Expected the field `processed_at` to be a primitive type in the JSON string but got " + data['processed_at']);
|
|
248
|
-
}
|
|
249
|
-
// ensure the json data is a string
|
|
250
|
-
if (data['state'] && !(typeof data['state'] === 'string' || data['state'] instanceof String)) {
|
|
251
|
-
throw new Error("Expected the field `state` to be a primitive type in the JSON string but got " + data['state']);
|
|
252
|
-
}
|
|
253
|
-
// ensure the json data is a string
|
|
254
|
-
if (data['template_id'] && !(typeof data['template_id'] === 'string' || data['template_id'] instanceof String)) {
|
|
255
|
-
throw new Error("Expected the field `template_id` to be a primitive type in the JSON string but got " + data['template_id']);
|
|
256
|
-
}
|
|
257
|
-
// ensure the json data is a string
|
|
258
|
-
if (data['template_type'] && !(typeof data['template_type'] === 'string' || data['template_type'] instanceof String)) {
|
|
259
|
-
throw new Error("Expected the field `template_type` to be a primitive type in the JSON string but got " + data['template_type']);
|
|
260
|
-
}
|
|
261
|
-
// ensure the json data is a string
|
|
262
|
-
if (data['template_version'] && !(typeof data['template_version'] === 'string' || data['template_version'] instanceof String)) {
|
|
263
|
-
throw new Error("Expected the field `template_version` to be a primitive type in the JSON string but got " + data['template_version']);
|
|
264
|
-
}
|
|
265
|
-
// ensure the json data is a string
|
|
266
|
-
if (data['pdf_hash'] && !(typeof data['pdf_hash'] === 'string' || data['pdf_hash'] instanceof String)) {
|
|
267
|
-
throw new Error("Expected the field `pdf_hash` to be a primitive type in the JSON string but got " + data['pdf_hash']);
|
|
268
|
-
}
|
|
269
|
-
// ensure the json data is a string
|
|
270
|
-
if (data['download_url'] && !(typeof data['download_url'] === 'string' || data['download_url'] instanceof String)) {
|
|
271
|
-
throw new Error("Expected the field `download_url` to be a primitive type in the JSON string but got " + data['download_url']);
|
|
272
|
-
}
|
|
273
|
-
// ensure the json data is a string
|
|
274
|
-
if (data['permanent_download_url'] && !(typeof data['permanent_download_url'] === 'string' || data['permanent_download_url'] instanceof String)) {
|
|
275
|
-
throw new Error("Expected the field `permanent_download_url` to be a primitive type in the JSON string but got " + data['permanent_download_url']);
|
|
276
|
-
}
|
|
277
|
-
// ensure the json data is a string
|
|
278
|
-
if (data['preview_download_url'] && !(typeof data['preview_download_url'] === 'string' || data['preview_download_url'] instanceof String)) {
|
|
279
|
-
throw new Error("Expected the field `preview_download_url` to be a primitive type in the JSON string but got " + data['preview_download_url']);
|
|
280
|
-
}
|
|
281
|
-
// ensure the json data is a string
|
|
282
|
-
if (data['preview_generated_at'] && !(typeof data['preview_generated_at'] === 'string' || data['preview_generated_at'] instanceof String)) {
|
|
283
|
-
throw new Error("Expected the field `preview_generated_at` to be a primitive type in the JSON string but got " + data['preview_generated_at']);
|
|
284
|
-
}
|
|
285
|
-
// ensure the json data is a string
|
|
286
|
-
if (data['audit_trail_download_url'] && !(typeof data['audit_trail_download_url'] === 'string' || data['audit_trail_download_url'] instanceof String)) {
|
|
287
|
-
throw new Error("Expected the field `audit_trail_download_url` to be a primitive type in the JSON string but got " + data['audit_trail_download_url']);
|
|
288
|
-
}
|
|
289
|
-
// ensure the json data is an array
|
|
290
|
-
if (!Array.isArray(data['actions'])) {
|
|
291
|
-
throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
|
|
292
|
-
}
|
|
293
|
-
return true;
|
|
294
|
-
}
|
|
295
|
-
}]);
|
|
296
|
-
}();
|
|
297
|
-
SubmissionPreview.RequiredProperties = ["batch_id", "data_requests", "editable", "error_message", "expired", "expires_at", "id", "json_schema_errors", "metadata", "password", "processed_at", "state", "template_id", "template_type", "template_version", "test", "truncated_text", "pdf_hash", "download_url", "permanent_download_url", "preview_download_url", "preview_generated_at", "audit_trail_download_url", "actions"];
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* @member {String} batch_id
|
|
301
|
-
*/
|
|
302
|
-
SubmissionPreview.prototype['batch_id'] = undefined;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* @member {Array.<module:model/SubmissionDataRequest>} data_requests
|
|
306
|
-
*/
|
|
307
|
-
SubmissionPreview.prototype['data_requests'] = undefined;
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* @member {Boolean} editable
|
|
311
|
-
*/
|
|
312
|
-
SubmissionPreview.prototype['editable'] = undefined;
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* @member {String} error_message
|
|
316
|
-
*/
|
|
317
|
-
SubmissionPreview.prototype['error_message'] = undefined;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* @member {Boolean} expired
|
|
321
|
-
*/
|
|
322
|
-
SubmissionPreview.prototype['expired'] = undefined;
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* @member {String} expires_at
|
|
326
|
-
*/
|
|
327
|
-
SubmissionPreview.prototype['expires_at'] = undefined;
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* @member {String} id
|
|
331
|
-
*/
|
|
332
|
-
SubmissionPreview.prototype['id'] = undefined;
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* @member {Array.<String>} json_schema_errors
|
|
336
|
-
*/
|
|
337
|
-
SubmissionPreview.prototype['json_schema_errors'] = undefined;
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* @member {Object} metadata
|
|
341
|
-
*/
|
|
342
|
-
SubmissionPreview.prototype['metadata'] = undefined;
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* @member {String} password
|
|
346
|
-
*/
|
|
347
|
-
SubmissionPreview.prototype['password'] = undefined;
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* @member {String} processed_at
|
|
351
|
-
*/
|
|
352
|
-
SubmissionPreview.prototype['processed_at'] = undefined;
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* @member {module:model/SubmissionPreview.StateEnum} state
|
|
356
|
-
*/
|
|
357
|
-
SubmissionPreview.prototype['state'] = undefined;
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @member {String} template_id
|
|
361
|
-
*/
|
|
362
|
-
SubmissionPreview.prototype['template_id'] = undefined;
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* @member {module:model/SubmissionPreview.TemplateTypeEnum} template_type
|
|
366
|
-
*/
|
|
367
|
-
SubmissionPreview.prototype['template_type'] = undefined;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* @member {String} template_version
|
|
371
|
-
*/
|
|
372
|
-
SubmissionPreview.prototype['template_version'] = undefined;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @member {Boolean} test
|
|
376
|
-
*/
|
|
377
|
-
SubmissionPreview.prototype['test'] = undefined;
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* @member {Object} truncated_text
|
|
381
|
-
*/
|
|
382
|
-
SubmissionPreview.prototype['truncated_text'] = undefined;
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* @member {String} pdf_hash
|
|
386
|
-
*/
|
|
387
|
-
SubmissionPreview.prototype['pdf_hash'] = undefined;
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* @member {String} download_url
|
|
391
|
-
*/
|
|
392
|
-
SubmissionPreview.prototype['download_url'] = undefined;
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* @member {String} permanent_download_url
|
|
396
|
-
*/
|
|
397
|
-
SubmissionPreview.prototype['permanent_download_url'] = undefined;
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* @member {String} preview_download_url
|
|
401
|
-
*/
|
|
402
|
-
SubmissionPreview.prototype['preview_download_url'] = undefined;
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* @member {String} preview_generated_at
|
|
406
|
-
*/
|
|
407
|
-
SubmissionPreview.prototype['preview_generated_at'] = undefined;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* @member {String} audit_trail_download_url
|
|
411
|
-
*/
|
|
412
|
-
SubmissionPreview.prototype['audit_trail_download_url'] = undefined;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* @member {Array.<module:model/SubmissionAction>} actions
|
|
416
|
-
*/
|
|
417
|
-
SubmissionPreview.prototype['actions'] = undefined;
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Allowed values for the <code>state</code> property.
|
|
421
|
-
* @enum {String}
|
|
422
|
-
* @readonly
|
|
423
|
-
*/
|
|
424
|
-
SubmissionPreview['StateEnum'] = {
|
|
425
|
-
/**
|
|
426
|
-
* value: "pending"
|
|
427
|
-
* @const
|
|
428
|
-
*/
|
|
429
|
-
"pending": "pending",
|
|
430
|
-
/**
|
|
431
|
-
* value: "processed"
|
|
432
|
-
* @const
|
|
433
|
-
*/
|
|
434
|
-
"processed": "processed",
|
|
435
|
-
/**
|
|
436
|
-
* value: "invalid_data"
|
|
437
|
-
* @const
|
|
438
|
-
*/
|
|
439
|
-
"invalid_data": "invalid_data",
|
|
440
|
-
/**
|
|
441
|
-
* value: "error"
|
|
442
|
-
* @const
|
|
443
|
-
*/
|
|
444
|
-
"error": "error",
|
|
445
|
-
/**
|
|
446
|
-
* value: "image_download_failed"
|
|
447
|
-
* @const
|
|
448
|
-
*/
|
|
449
|
-
"image_download_failed": "image_download_failed",
|
|
450
|
-
/**
|
|
451
|
-
* value: "image_processing_failed"
|
|
452
|
-
* @const
|
|
453
|
-
*/
|
|
454
|
-
"image_processing_failed": "image_processing_failed",
|
|
455
|
-
/**
|
|
456
|
-
* value: "waiting_for_data_requests"
|
|
457
|
-
* @const
|
|
458
|
-
*/
|
|
459
|
-
"waiting_for_data_requests": "waiting_for_data_requests",
|
|
460
|
-
/**
|
|
461
|
-
* value: "syntax_error"
|
|
462
|
-
* @const
|
|
463
|
-
*/
|
|
464
|
-
"syntax_error": "syntax_error",
|
|
465
|
-
/**
|
|
466
|
-
* value: "insufficient_credits"
|
|
467
|
-
* @const
|
|
468
|
-
*/
|
|
469
|
-
"insufficient_credits": "insufficient_credits",
|
|
470
|
-
/**
|
|
471
|
-
* value: "account_suspended"
|
|
472
|
-
* @const
|
|
473
|
-
*/
|
|
474
|
-
"account_suspended": "account_suspended",
|
|
475
|
-
/**
|
|
476
|
-
* value: "license_revoked"
|
|
477
|
-
* @const
|
|
478
|
-
*/
|
|
479
|
-
"license_revoked": "license_revoked",
|
|
480
|
-
/**
|
|
481
|
-
* value: "accidental"
|
|
482
|
-
* @const
|
|
483
|
-
*/
|
|
484
|
-
"accidental": "accidental",
|
|
485
|
-
/**
|
|
486
|
-
* value: "declined"
|
|
487
|
-
* @const
|
|
488
|
-
*/
|
|
489
|
-
"declined": "declined"
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Allowed values for the <code>template_type</code> property.
|
|
494
|
-
* @enum {String}
|
|
495
|
-
* @readonly
|
|
496
|
-
*/
|
|
497
|
-
SubmissionPreview['TemplateTypeEnum'] = {
|
|
498
|
-
/**
|
|
499
|
-
* value: "pdf"
|
|
500
|
-
* @const
|
|
501
|
-
*/
|
|
502
|
-
"pdf": "pdf",
|
|
503
|
-
/**
|
|
504
|
-
* value: "html"
|
|
505
|
-
* @const
|
|
506
|
-
*/
|
|
507
|
-
"html": "html"
|
|
508
|
-
};
|
|
509
|
-
var _default = exports["default"] = SubmissionPreview;
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
18
|
-
* DocSpring API
|
|
19
|
-
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
|
|
20
|
-
*
|
|
21
|
-
* The version of the OpenAPI document: v1
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
|
-
* https://openapi-generator.tech
|
|
26
|
-
* Do not edit the class manually.
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* The TemplateAddFieldsResponse model module.
|
|
31
|
-
* @module model/TemplateAddFieldsResponse
|
|
32
|
-
* @version 3.3.0
|
|
33
|
-
*/
|
|
34
|
-
var TemplateAddFieldsResponse = /*#__PURE__*/function () {
|
|
35
|
-
/**
|
|
36
|
-
* Constructs a new <code>TemplateAddFieldsResponse</code>.
|
|
37
|
-
* @alias module:model/TemplateAddFieldsResponse
|
|
38
|
-
* @extends Object
|
|
39
|
-
* @param status {module:model/TemplateAddFieldsResponse.StatusEnum}
|
|
40
|
-
*/
|
|
41
|
-
function TemplateAddFieldsResponse(status) {
|
|
42
|
-
_classCallCheck(this, TemplateAddFieldsResponse);
|
|
43
|
-
TemplateAddFieldsResponse.initialize(this, status);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Initializes the fields of this object.
|
|
48
|
-
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
49
|
-
* Only for internal use.
|
|
50
|
-
*/
|
|
51
|
-
return _createClass(TemplateAddFieldsResponse, null, [{
|
|
52
|
-
key: "initialize",
|
|
53
|
-
value: function initialize(obj, status) {
|
|
54
|
-
obj['status'] = status;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Constructs a <code>TemplateAddFieldsResponse</code> from a plain JavaScript object, optionally creating a new instance.
|
|
59
|
-
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
60
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
-
* @param {module:model/TemplateAddFieldsResponse} obj Optional instance to populate.
|
|
62
|
-
* @return {module:model/TemplateAddFieldsResponse} The populated <code>TemplateAddFieldsResponse</code> instance.
|
|
63
|
-
*/
|
|
64
|
-
}, {
|
|
65
|
-
key: "constructFromObject",
|
|
66
|
-
value: function constructFromObject(data, obj) {
|
|
67
|
-
if (data) {
|
|
68
|
-
obj = obj || new TemplateAddFieldsResponse();
|
|
69
|
-
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
70
|
-
if (data.hasOwnProperty('status')) {
|
|
71
|
-
obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
|
|
72
|
-
}
|
|
73
|
-
if (data.hasOwnProperty('errors')) {
|
|
74
|
-
obj['errors'] = _ApiClient["default"].convertToType(data['errors'], ['String']);
|
|
75
|
-
}
|
|
76
|
-
if (data.hasOwnProperty('new_field_ids')) {
|
|
77
|
-
obj['new_field_ids'] = _ApiClient["default"].convertToType(data['new_field_ids'], ['Number']);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return obj;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Validates the JSON data with respect to <code>TemplateAddFieldsResponse</code>.
|
|
85
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
86
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateAddFieldsResponse</code>.
|
|
87
|
-
*/
|
|
88
|
-
}, {
|
|
89
|
-
key: "validateJSON",
|
|
90
|
-
value: function validateJSON(data) {
|
|
91
|
-
// check to make sure all required properties are present in the JSON string
|
|
92
|
-
var _iterator = _createForOfIteratorHelper(TemplateAddFieldsResponse.RequiredProperties),
|
|
93
|
-
_step;
|
|
94
|
-
try {
|
|
95
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
96
|
-
var property = _step.value;
|
|
97
|
-
if (!data.hasOwnProperty(property)) {
|
|
98
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// ensure the json data is a string
|
|
102
|
-
} catch (err) {
|
|
103
|
-
_iterator.e(err);
|
|
104
|
-
} finally {
|
|
105
|
-
_iterator.f();
|
|
106
|
-
}
|
|
107
|
-
if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
|
|
108
|
-
throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
|
|
109
|
-
}
|
|
110
|
-
// ensure the json data is an array
|
|
111
|
-
if (!Array.isArray(data['errors'])) {
|
|
112
|
-
throw new Error("Expected the field `errors` to be an array in the JSON data but got " + data['errors']);
|
|
113
|
-
}
|
|
114
|
-
// ensure the json data is an array
|
|
115
|
-
if (!Array.isArray(data['new_field_ids'])) {
|
|
116
|
-
throw new Error("Expected the field `new_field_ids` to be an array in the JSON data but got " + data['new_field_ids']);
|
|
117
|
-
}
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
}]);
|
|
121
|
-
}();
|
|
122
|
-
TemplateAddFieldsResponse.RequiredProperties = ["status"];
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @member {module:model/TemplateAddFieldsResponse.StatusEnum} status
|
|
126
|
-
*/
|
|
127
|
-
TemplateAddFieldsResponse.prototype['status'] = undefined;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @member {Array.<String>} errors
|
|
131
|
-
*/
|
|
132
|
-
TemplateAddFieldsResponse.prototype['errors'] = undefined;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* @member {Array.<Number>} new_field_ids
|
|
136
|
-
*/
|
|
137
|
-
TemplateAddFieldsResponse.prototype['new_field_ids'] = undefined;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Allowed values for the <code>status</code> property.
|
|
141
|
-
* @enum {String}
|
|
142
|
-
* @readonly
|
|
143
|
-
*/
|
|
144
|
-
TemplateAddFieldsResponse['StatusEnum'] = {
|
|
145
|
-
/**
|
|
146
|
-
* value: "success"
|
|
147
|
-
* @const
|
|
148
|
-
*/
|
|
149
|
-
"success": "success",
|
|
150
|
-
/**
|
|
151
|
-
* value: "error"
|
|
152
|
-
* @const
|
|
153
|
-
*/
|
|
154
|
-
"error": "error"
|
|
155
|
-
};
|
|
156
|
-
var _default = exports["default"] = TemplateAddFieldsResponse;
|