UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

147 lines 6.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentFile = void 0; const index_1 = require("./../index"); class DocumentFile { constructor(data) { let documentIdDefault = ""; this.documentId = typeof data.documentId !== "undefined" ? data.documentId : documentIdDefault; this.error = index_1.WebserviceException.fromJson(data === null || data === void 0 ? void 0 : data.error); let fileExtensionDefault = ""; this.fileExtension = typeof (data === null || data === void 0 ? void 0 : data.fileExtension) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileExtension : fileExtensionDefault; let fileLastModifiedDefault = ""; this.fileLastModified = typeof (data === null || data === void 0 ? void 0 : data.fileLastModified) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileLastModified : fileLastModifiedDefault; let fileNameDefault = ""; this.fileName = typeof (data === null || data === void 0 ? void 0 : data.fileName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileName : fileNameDefault; let filePathDefault = ""; this.filePath = typeof (data === null || data === void 0 ? void 0 : data.filePath) !== "undefined" ? data === null || data === void 0 ? void 0 : data.filePath : filePathDefault; let fileSizeDefault = 0; this.fileSize = typeof (data === null || data === void 0 ? void 0 : data.fileSize) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileSize : fileSizeDefault; let fileTypeGroupsDefault = ""; this.fileTypeGroups = typeof (data === null || data === void 0 ? void 0 : data.fileTypeGroups) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileTypeGroups : fileTypeGroupsDefault; let fileTypeIdDefault = 0; this.fileTypeId = typeof (data === null || data === void 0 ? void 0 : data.fileTypeId) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileTypeId : fileTypeIdDefault; let historyIdDefault = 0; this.historyId = typeof (data === null || data === void 0 ? void 0 : data.historyId) !== "undefined" ? data === null || data === void 0 ? void 0 : data.historyId : historyIdDefault; let isFileLockedDefault = false; this.isFileLocked = typeof (data === null || data === void 0 ? void 0 : data.isFileLocked) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isFileLocked : isFileLockedDefault; this.metadata = index_1.Metadata.fromJson(data === null || data === void 0 ? void 0 : data.metadata); let mimeTypeDefault = ""; this.mimeType = typeof (data === null || data === void 0 ? void 0 : data.mimeType) !== "undefined" ? data === null || data === void 0 ? void 0 : data.mimeType : mimeTypeDefault; let parentDocumentIdDefault = ""; this.parentDocumentId = typeof (data === null || data === void 0 ? void 0 : data.parentDocumentId) !== "undefined" ? data === null || data === void 0 ? void 0 : data.parentDocumentId : parentDocumentIdDefault; this.password = index_1.DocumentPassword.fromJson(data === null || data === void 0 ? void 0 : data.password); } static getDocumentIdDefault() { return ""; } static getDocumentIdDescription() { return "Unique document id, which is required to access this document"; } static getErrorDescription() { return ""; } static getFileExtensionDefault() { return ""; } static getFileExtensionDescription() { return "File extension (without dot)"; } static getFileLastModifiedDefault() { return ""; } static getFileLastModifiedDescription() { return "Date of the last file modification"; } static getFileNameDefault() { return ""; } static getFileNameDescription() { return "File name for the document (without extension)"; } static getFilePathDefault() { return ""; } static getFilePathDescription() { return "File path for the document"; } static getFileSizeDefault() { return 0; } static getFileSizeDescription() { return "File size of the document (in bytes)"; } static getFileTypeGroupsDefault() { return ""; } static getFileTypeGroupsDescription() { return "An internal unique text that describes the group to which the file belongs"; } static getFileTypeIdDefault() { return 0; } static getFileTypeIdDescription() { return "An internal unique id for the file type"; } static getHistoryIdDefault() { return 0; } static getHistoryIdDescription() { return "History id of the file entry"; } static getIsFileLockedDefault() { return false; } static getIsFileLockedDescription() { return "If set the document is currently locked"; } static getMetadataDescription() { return ""; } static getMimeTypeDefault() { return ""; } static getMimeTypeDescription() { return "Mime type of the document"; } static getParentDocumentIdDefault() { return ""; } static getParentDocumentIdDescription() { return "If available, the id of the parent document"; } static getPasswordDescription() { return ""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new DocumentFile(data); } toJson() { var _a, _b, _c; return { 'documentId': this.documentId, 'error': (_a = this.error) === null || _a === void 0 ? void 0 : _a.toJson(), 'fileExtension': this.fileExtension, 'fileLastModified': this.fileLastModified, 'fileName': this.fileName, 'filePath': this.filePath, 'fileSize': this.fileSize, 'fileTypeGroups': this.fileTypeGroups, 'fileTypeId': this.fileTypeId, 'historyId': this.historyId, 'isFileLocked': this.isFileLocked, 'metadata': (_b = this.metadata) === null || _b === void 0 ? void 0 : _b.toJson(), 'mimeType': this.mimeType, 'parentDocumentId': this.parentDocumentId, 'password': (_c = this.password) === null || _c === void 0 ? void 0 : _c.toJson(), }; } clone() { return DocumentFile.fromJson(this.toJson()); } } exports.DocumentFile = DocumentFile; //# sourceMappingURL=DocumentFile.js.map