# 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


class V1VisionStepResultsItemDistance(UniversalBaseModel):
    distance_found: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="distanceFound"),
        pydantic.Field(alias="distanceFound", description="The distance found between the start and end references"),
    ] = None
    end_step_name: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="endStepName"),
        pydantic.Field(
            alias="endStepName",
            description="The name of the second reference step that we're checking the distances between",
        ),
    ] = None
    enforce_offset_angle_range: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="enforceOffsetAngleRange"),
        pydantic.Field(alias="enforceOffsetAngleRange", description="Whether an offset angle range is enforced"),
    ] = None
    max_distance: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="maxDistance"),
        pydantic.Field(alias="maxDistance", description="The maximum allowed distance threshold"),
    ] = None
    max_offset_angle: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="maxOffsetAngle"),
        pydantic.Field(
            alias="maxOffsetAngle",
            description="The maximum angle allowance (in degrees) if enforceOffsetAngleRange is true",
        ),
    ] = None
    min_distance: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="minDistance"),
        pydantic.Field(alias="minDistance", description="The minumum allowed distance threshold"),
    ] = None
    min_offset_angle: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="minOffsetAngle"),
        pydantic.Field(
            alias="minOffsetAngle",
            description="The minimum angle allowance (in degrees) if enforceOffsetAngleRange is true",
        ),
    ] = None
    offset_angle_found: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="offsetAngleFound"),
        pydantic.Field(
            alias="offsetAngleFound",
            description="The counter-clockwise angle (in degrees) found between the horizontal axis of the start reference step and the last",
        ),
    ] = None
    start_step_name: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="startStepName"),
        pydantic.Field(
            alias="startStepName",
            description="The name of the first reference step that we're checking the distances between",
        ),
    ] = None
    unit: typing.Optional[str] = pydantic.Field(default=None)
    """
    The measurement unit of the distance found and the min and max distance threshold
    """

    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
