capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
77 lines • 2.67 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from core/schemas/VINScannerTypes.yaml
import { TextPatternScannerResult } from '../text_pattern_scanner/TextPatternScannerTypes';
import { ToJsonConfiguration } from '../utils/json/JsonSerializationTypes';
import { PartiallyConstructible } from '../utils/utils';
export const VinBarcodeExtractionStatusValues = [
'SUCCESS',
'BARCODE_WITHOUT_VIN',
'NO_BARCODE_FOUND',
'BARCODE_EXTRACTION_DISABLED',
];
/**
Result of the barcode scanner.
*/
export class VinBarcodeResult extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<VinBarcodeResult>`} */
constructor(source = {}) {
super();
if (source.extractedVIN !== undefined) {
this.extractedVIN = source.extractedVIN;
}
else {
throw new Error('extractedVIN must be present in constructor argument');
}
if (source.rectangle !== undefined) {
this.rectangle = source.rectangle.map((it) => {
return { x: it.x, y: it.y };
});
}
else {
throw new Error('rectangle must be present in constructor argument');
}
if (source.status !== undefined) {
this.status = source.status;
}
else {
throw new Error('status must be present in constructor argument');
}
}
serialize(config = new ToJsonConfiguration()) {
return {
extractedVIN: this.extractedVIN,
rectangle: this.rectangle.map((it) => {
return it;
}),
status: this.status,
};
}
}
/**
Result of the VIN scanner.
*/
export class VinScannerResult extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<VinScannerResult>`} */
constructor(source = {}) {
super();
if (source.textResult !== undefined) {
this.textResult = new TextPatternScannerResult(source.textResult);
}
else {
throw new Error('textResult must be present in constructor argument');
}
if (source.barcodeResult !== undefined) {
this.barcodeResult = new VinBarcodeResult(source.barcodeResult);
}
else {
throw new Error('barcodeResult must be present in constructor argument');
}
}
serialize(config = new ToJsonConfiguration()) {
return {
textResult: this.textResult.serialize(config),
barcodeResult: this.barcodeResult.serialize(config),
};
}
}
//# sourceMappingURL=VinScannerTypes.js.map