# 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 .fleet_device_object_response_body import FleetDeviceObjectResponseBody
from .industrial_asset_object_response_body import IndustrialAssetObjectResponseBody
from .job_location_response_object_response_body import JobLocationResponseObjectResponseBody
from .job_response_object_response_body_status import JobResponseObjectResponseBodyStatus


class JobResponseObjectResponseBody(UniversalBaseModel):
    """
    Job object to be passed back
    """

    address: JobLocationResponseObjectResponseBody
    created_at: typing_extensions.Annotated[
        str, FieldMetadata(alias="createdAt"), pydantic.Field(alias="createdAt", description="When the job was created")
    ]
    customer_name: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="customerName"),
        pydantic.Field(alias="customerName", description="Customer name for job"),
    ]
    end_date: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="endDate"),
        pydantic.Field(alias="endDate", description="End date of job in RFC 3339 format"),
    ]
    fleet_devices: typing_extensions.Annotated[
        typing.Optional[typing.List[FleetDeviceObjectResponseBody]],
        FieldMetadata(alias="fleetDevices"),
        pydantic.Field(
            alias="fleetDevices",
            description="fleet devices in this job (cannot have both industrial assets and fleet devices in the same job)",
        ),
    ] = None
    id: str = pydantic.Field()
    """
    Job id
    """

    industrial_assets: typing_extensions.Annotated[
        typing.Optional[typing.List[IndustrialAssetObjectResponseBody]],
        FieldMetadata(alias="industrialAssets"),
        pydantic.Field(
            alias="industrialAssets",
            description="Industrial Assets in this job (cannot have both industrial assets and fleet devices in the same job)",
        ),
    ] = None
    modified_at: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="modifiedAt"),
        pydantic.Field(alias="modifiedAt", description="When the job was last modified"),
    ]
    name: str = pydantic.Field()
    """
    Job name
    """

    notes: str = pydantic.Field()
    """
    Notes for the upcoming job
    """

    ontime_window_after_arrival_ms: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="ontimeWindowAfterArrivalMs"),
        pydantic.Field(
            alias="ontimeWindowAfterArrivalMs",
            description="Specifies the time window (in milliseconds) after a stop's scheduled arrival time during which the stop is considered 'on-time'.",
        ),
    ] = None
    ontime_window_before_arrival_ms: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="ontimeWindowBeforeArrivalMs"),
        pydantic.Field(
            alias="ontimeWindowBeforeArrivalMs",
            description="Specifies the time window (in milliseconds) before a stop's scheduled arrival time during which the stop is considered 'on-time'.",
        ),
    ] = None
    start_date: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="startDate"),
        pydantic.Field(alias="startDate", description="Start date of job in RFC 3339 format"),
    ]
    status: JobResponseObjectResponseBodyStatus = pydantic.Field()
    """
    The current job status  Valid values: `active`, `scheduled`, `completed`
    """

    uuid_: typing_extensions.Annotated[
        str, FieldMetadata(alias="uuid"), pydantic.Field(alias="uuid", description="Samsara uuid")
    ]

    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
