react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
91 lines (83 loc) • 2.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DocumentData = void 0;
var _PageData = require("../document_scanner/PageData");
var _JsonSerializationTypes = require("../utils/json/JsonSerializationTypes");
var _utils = require("../utils/utils");
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from native/schemas/document/DocumentData.yaml
/**
Document Data.
*/
class DocumentData extends _utils.PartiallyConstructible {
/**
The unique identifier of the document.
*/
/**
The creation timestamp of the document.
*/
/**
The list of pages.
*/
/**
The maximum size of the document image.
Default is 0
*/
documentImageSizeLimit = 0;
/**
The URI of the default destination location for PDF rendering.
*/
/**
The URI of the default destination location for TIFF rendering.
*/
/** @param source {@displayType `DeepPartial<DocumentData>`} */
constructor(source = {}) {
super();
if (source.uuid !== undefined) {
this.uuid = source.uuid;
} else {
throw new Error('uuid must be present in constructor argument');
}
if (source.creationTimestamp !== undefined) {
this.creationTimestamp = source.creationTimestamp;
} else {
throw new Error('creationTimestamp must be present in constructor argument');
}
if (source.pages !== undefined) {
this.pages = source.pages.map(it => {
return new _PageData.PageData(it);
});
} else {
throw new Error('pages must be present in constructor argument');
}
if (source.documentImageSizeLimit !== undefined) {
this.documentImageSizeLimit = source.documentImageSizeLimit;
}
if (source.pdfURI !== undefined) {
this.pdfURI = source.pdfURI;
} else {
throw new Error('pdfURI must be present in constructor argument');
}
if (source.tiffURI !== undefined) {
this.tiffURI = source.tiffURI;
} else {
throw new Error('tiffURI must be present in constructor argument');
}
}
serialize(config = new _JsonSerializationTypes.ToJsonConfiguration()) {
return {
uuid: this.uuid,
creationTimestamp: this.creationTimestamp,
pages: this.pages.map(it => {
return it.serialize(config);
}),
documentImageSizeLimit: this.documentImageSizeLimit,
pdfURI: this.pdfURI,
tiffURI: this.tiffURI
};
}
}
exports.DocumentData = DocumentData;
//# sourceMappingURL=DocumentData.js.map