# 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, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .v_1_vision_step_results_item_angle_check import V1VisionStepResultsItemAngleCheck
from .v_1_vision_step_results_item_barcode_item import V1VisionStepResultsItemBarcodeItem
from .v_1_vision_step_results_item_boolean_logic import V1VisionStepResultsItemBooleanLogic
from .v_1_vision_step_results_item_caliper import V1VisionStepResultsItemCaliper
from .v_1_vision_step_results_item_contour import V1VisionStepResultsItemContour
from .v_1_vision_step_results_item_distance import V1VisionStepResultsItemDistance
from .v_1_vision_step_results_item_expiration_date import V1VisionStepResultsItemExpirationDate
from .v_1_vision_step_results_item_find_copies import V1VisionStepResultsItemFindCopies
from .v_1_vision_step_results_item_find_edge import V1VisionStepResultsItemFindEdge
from .v_1_vision_step_results_item_find_shapes import V1VisionStepResultsItemFindShapes
from .v_1_vision_step_results_item_fixture import V1VisionStepResultsItemFixture
from .v_1_vision_step_results_item_label_match import V1VisionStepResultsItemLabelMatch
from .v_1_vision_step_results_item_presence_absence import V1VisionStepResultsItemPresenceAbsence
from .v_1_vision_step_results_item_text_match import V1VisionStepResultsItemTextMatch


class V1VisionStepResultsItem(UniversalBaseModel):
    angle_check: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemAngleCheck],
        FieldMetadata(alias="angleCheck"),
        pydantic.Field(alias="angleCheck"),
    ] = None
    barcode: typing.Optional[typing.List[V1VisionStepResultsItemBarcodeItem]] = None
    boolean_logic: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemBooleanLogic],
        FieldMetadata(alias="booleanLogic"),
        pydantic.Field(alias="booleanLogic"),
    ] = None
    caliper: typing.Optional[V1VisionStepResultsItemCaliper] = None
    contour: typing.Optional[V1VisionStepResultsItemContour] = None
    distance: typing.Optional[V1VisionStepResultsItemDistance] = None
    expiration_date: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemExpirationDate],
        FieldMetadata(alias="expirationDate"),
        pydantic.Field(alias="expirationDate"),
    ] = None
    find_copies: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindCopies],
        FieldMetadata(alias="findCopies"),
        pydantic.Field(alias="findCopies"),
    ] = None
    find_edge: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindEdge],
        FieldMetadata(alias="findEdge"),
        pydantic.Field(alias="findEdge"),
    ] = None
    find_shapes: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindShapes],
        FieldMetadata(alias="findShapes"),
        pydantic.Field(alias="findShapes"),
    ] = None
    fixture: typing.Optional[V1VisionStepResultsItemFixture] = None
    label_match: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemLabelMatch],
        FieldMetadata(alias="labelMatch"),
        pydantic.Field(alias="labelMatch"),
    ] = None
    name: typing.Optional[str] = None
    presence_absence: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemPresenceAbsence],
        FieldMetadata(alias="presenceAbsence"),
        pydantic.Field(alias="presenceAbsence"),
    ] = None
    result: typing.Optional[str] = None
    text_match: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemTextMatch],
        FieldMetadata(alias="textMatch"),
        pydantic.Field(alias="textMatch"),
    ] = None

    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
