# 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_find_edge_angle_range import V1VisionStepResultsItemFindEdgeAngleRange
from .v_1_vision_step_results_item_find_edge_contrast_range import V1VisionStepResultsItemFindEdgeContrastRange
from .v_1_vision_step_results_item_find_edge_sharpness_range import V1VisionStepResultsItemFindEdgeSharpnessRange
from .v_1_vision_step_results_item_find_edge_straightness_range import V1VisionStepResultsItemFindEdgeStraightnessRange


class V1VisionStepResultsItemFindEdge(UniversalBaseModel):
    angle_found: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="angleFound"),
        pydantic.Field(alias="angleFound", description="The detected angle in degrees"),
    ] = None
    angle_range: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindEdgeAngleRange],
        FieldMetadata(alias="angleRange"),
        pydantic.Field(alias="angleRange", description="The configured angle allowance range"),
    ] = None
    contrast_percent: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="contrastPercent"),
        pydantic.Field(alias="contrastPercent", description="The detected contrast percentage"),
    ] = None
    contrast_range: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindEdgeContrastRange],
        FieldMetadata(alias="contrastRange"),
        pydantic.Field(alias="contrastRange", description="The configured contrast allowance range"),
    ] = None
    filter_polarity: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="filterPolarity"),
        pydantic.Field(
            alias="filterPolarity",
            description="The configured polarity for finding edges. Valid values: `LIGHT TO DARK`, `DARK TO LIGHT`.",
        ),
    ] = None
    sharpness_percent: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="sharpnessPercent"),
        pydantic.Field(alias="sharpnessPercent", description="The detected sharpness percentage"),
    ] = None
    sharpness_range: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindEdgeSharpnessRange],
        FieldMetadata(alias="sharpnessRange"),
        pydantic.Field(alias="sharpnessRange", description="The configured sharpness allowance range"),
    ] = None
    straightness_found: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="straightnessFound"),
        pydantic.Field(alias="straightnessFound", description="The detected straightness percentage"),
    ] = None
    straightness_range: typing_extensions.Annotated[
        typing.Optional[V1VisionStepResultsItemFindEdgeStraightnessRange],
        FieldMetadata(alias="straightnessRange"),
        pydantic.Field(alias="straightnessRange", description="The configured straightness allowance range"),
    ] = 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
