@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
41 lines • 1.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PortfolioExtract = void 0;
const index_1 = require("./../index");
class PortfolioExtract {
constructor(data) {
this.selection = (data.selection || []).map(index_1.PortfolioSelection.fromJson);
let singleFileAsZipDefault = true;
this.singleFileAsZip = typeof (data === null || data === void 0 ? void 0 : data.singleFileAsZip) !== "undefined" ? data === null || data === void 0 ? void 0 : data.singleFileAsZip : singleFileAsZipDefault;
}
static getSelectionDefault() {
return [];
}
static getSelectionDescription() {
return "";
}
static getSingleFileAsZipDefault() {
return true;
}
static getSingleFileAsZipDescription() {
return "The returned attachments will be generated as a ZIP file even if selection is used to select only one single file. You can change this behaviour by setting this option to \"false\". In this case, the file will not be zipped, and will instead be returned directly as is. However, this will only work if selection has been used to select one file and one file only.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new PortfolioExtract(data);
}
toJson() {
var _a;
return {
'selection': (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()),
'singleFileAsZip': this.singleFileAsZip,
};
}
clone() {
return PortfolioExtract.fromJson(this.toJson());
}
}
exports.PortfolioExtract = PortfolioExtract;
//# sourceMappingURL=PortfolioExtract.js.map