# 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 .part_instance_input_object_request_body import PartInstanceInputObjectRequestBody
from .service_task_instance_input_object_request_body_status import ServiceTaskInstanceInputObjectRequestBodyStatus
from .work_order_money_object_request_body import WorkOrderMoneyObjectRequestBody


class ServiceTaskInstanceInputObjectRequestBody(UniversalBaseModel):
    """
    Work Order Service Task object.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the service task instance. Only set if updating an existing service task instance.
    """

    labor_hourly_cost: typing_extensions.Annotated[
        typing.Optional[WorkOrderMoneyObjectRequestBody],
        FieldMetadata(alias="laborHourlyCost"),
        pydantic.Field(alias="laborHourlyCost"),
    ] = None
    labor_time_minutes: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="laborTimeMinutes"),
        pydantic.Field(alias="laborTimeMinutes", description="The time of labor needed"),
    ] = None
    parts: typing.Optional[typing.List[PartInstanceInputObjectRequestBody]] = pydantic.Field(default=None)
    """
    Parts for the service task.
    """

    parts_cost: typing_extensions.Annotated[
        typing.Optional[WorkOrderMoneyObjectRequestBody],
        FieldMetadata(alias="partsCost"),
        pydantic.Field(alias="partsCost"),
    ] = None
    service_task_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="serviceTaskId"),
        pydantic.Field(alias="serviceTaskId", description="ID of the service task."),
    ]
    status: ServiceTaskInstanceInputObjectRequestBodyStatus = pydantic.Field()
    """
    The status of the service task.  Valid values: `Unknown`, `Open`, `In Progress`, `On Hold`, `Completed`
    """

    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
