@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
65 lines • 2.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebserviceResult = void 0;
const index_1 = require("./index");
class WebserviceResult {
constructor(data) {
let codeDefault = 0;
this.code = typeof (data === null || data === void 0 ? void 0 : data.code) !== "undefined" ? data === null || data === void 0 ? void 0 : data.code : codeDefault;
let descriptionDefault = "";
this.description = typeof (data === null || data === void 0 ? void 0 : data.description) !== "undefined" ? data === null || data === void 0 ? void 0 : data.description : descriptionDefault;
let exitCodeDefault = 0;
this.exitCode = typeof (data === null || data === void 0 ? void 0 : data.exitCode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.exitCode : exitCodeDefault;
let hideExceptionDefault = false;
this.hideException = typeof (data === null || data === void 0 ? void 0 : data.hideException) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hideException : hideExceptionDefault;
this.stackTrace = index_1.WebserviceResultStackTrace.fromJson(data === null || data === void 0 ? void 0 : data.stackTrace);
}
static getCodeDefault() {
return 0;
}
static getCodeDescription() {
return "The error code of the operation. For a successful operation, this value must be zero. If you get any other negative value, the execution has failed.";
}
static getDescriptionDefault() {
return "";
}
static getDescriptionDescription() {
return "A description of the operation\u00B4s result.";
}
static getExitCodeDefault() {
return 0;
}
static getExitCodeDescription() {
return "The exit code of an external application, if such an application was used for the operation.";
}
static getHideExceptionDefault() {
return false;
}
static getHideExceptionDescription() {
return "";
}
static getStackTraceDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new WebserviceResult(data);
}
toJson() {
var _a;
return {
'code': this.code,
'description': this.description,
'exitCode': this.exitCode,
'hideException': this.hideException,
'stackTrace': (_a = this.stackTrace) === null || _a === void 0 ? void 0 : _a.toJson(),
};
}
clone() {
return WebserviceResult.fromJson(this.toJson());
}
}
exports.WebserviceResult = WebserviceResult;
//# sourceMappingURL=WebserviceResult.js.map