react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
46 lines (41 loc) • 1.64 kB
text/typescript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/vin/VINScannerUIResult.yaml
import { TextPatternScannerResult } from '../../text_pattern_scanner/TextPatternScannerTypes';
import { ToJsonConfiguration } from '../../utils/json/JsonSerializationTypes';
import { DeepPartial, PartiallyConstructible } from '../../utils/utils';
import { VinBarcodeResult } from '../../vin/VinScannerTypes';
/**
Configuration of the generic text scanner RTU UI result.
*/
export class VinScannerUiResult extends PartiallyConstructible {
/**
Text result of the VIN scanner.
*/
public readonly textResult: TextPatternScannerResult;
/**
Barcode result of the VIN scanner.
*/
public readonly barcodeResult: VinBarcodeResult;
/** @param source {@displayType `DeepPartial<VinScannerUiResult>`} */
public constructor(source: DeepPartial<VinScannerUiResult> = {}) {
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');
}
}
public serialize(
config: ToJsonConfiguration = new ToJsonConfiguration()
): DeepPartial<VinScannerUiResult> {
return {
textResult: this.textResult.serialize(config),
barcodeResult: this.barcodeResult.serialize(config),
};
}
}