UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

52 lines (47 loc) 1.66 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/document/CroppingResult.yaml import { ToJsonConfiguration } from '../../utils/json/JsonSerializationTypes'; import { DeepPartial, PartiallyConstructible } from '../../utils/utils'; /** Configuration of the cropping result. */ export class CroppingResult extends PartiallyConstructible { /** The UUID of the document that was cropped. */ public readonly documentUuid: string; /** The UUID of the page of the document that was cropped. */ public readonly pageUuid: string; /** The error message if a problem occurred. */ public readonly errorMessage: string | null = null; /** @param source {@displayType `DeepPartial<CroppingResult>`} */ public constructor(source: DeepPartial<CroppingResult> = {}) { super(); if (source.documentUuid !== undefined) { this.documentUuid = source.documentUuid; } else { throw new Error('documentUuid must be present in constructor argument'); } if (source.pageUuid !== undefined) { this.pageUuid = source.pageUuid; } else { throw new Error('pageUuid must be present in constructor argument'); } if (source.errorMessage !== undefined) { this.errorMessage = source.errorMessage != null ? source.errorMessage : null; } } public serialize( config: ToJsonConfiguration = new ToJsonConfiguration() ): DeepPartial<CroppingResult> { return { documentUuid: this.documentUuid, pageUuid: this.pageUuid, errorMessage: this.errorMessage != null ? this.errorMessage : null, }; } }