# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel


class ParseConfigBlockOptionsBarcodes(UncheckedBaseModel):
    """
    Options for barcode blocks.
    """

    image_clipping_enabled: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="imageClippingEnabled")
    ] = pydantic.Field(alias="imageClippingEnabled", default=None)
    """
    Whether to clip and extract images of barcodes. When enabled, barcode images will be available in the `imageUrl` field of BarcodeDetails.
    """

    reading_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="readingEnabled")] = (
        pydantic.Field(alias="readingEnabled", default=None)
    )
    """
    Whether to decode and read barcode values. When enabled, decoded values will be available in the `decodedValue` field of BarcodeDetails.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
