# 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 .patch_job_objectjob_location_request_object_request_body import PatchJobObjectjobLocationRequestObjectRequestBody


class PatchJobObjectRequestBody(UniversalBaseModel):
    """
    Job object with fields to update. If a field is not provided, it will not be updated
    """

    address: typing.Optional[PatchJobObjectjobLocationRequestObjectRequestBody] = None
    customer_name: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="customerName"),
        pydantic.Field(alias="customerName", description="Customer name for job"),
    ] = None
    end_date: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="endDate"),
        pydantic.Field(
            alias="endDate",
            description="End date of job in RFC 3339 format. Must be greater than or equal to the start date",
        ),
    ] = None
    fleet_device_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[int]],
        FieldMetadata(alias="fleetDeviceIds"),
        pydantic.Field(
            alias="fleetDeviceIds",
            description="Fleet devices to be added to this job (cannot have both industrial assets and fleet devices in the same job)",
        ),
    ] = None
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Job Id
    """

    industrial_asset_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="industrialAssetIds"),
        pydantic.Field(
            alias="industrialAssetIds",
            description="IndustrialAssets to be added to this job (cannot have both industrial assets and fleet devices in the same job)",
        ),
    ] = None
    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Job name
    """

    notes: typing.Optional[str] = pydantic.Field(default=None)
    """
    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[
        typing.Optional[str],
        FieldMetadata(alias="startDate"),
        pydantic.Field(alias="startDate", description="Start date of job in RFC 3339 format."),
    ] = 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
