# 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 .alert_object_driver_response_body import AlertObjectDriverResponseBody
from .alert_object_vehicle_response_body import AlertObjectVehicleResponseBody
from .event_location_response_body import EventLocationResponseBody
from .worker_safety_sos_data_response_body_source_type import WorkerSafetySosDataResponseBodySourceType


class WorkerSafetySosDataResponseBody(UniversalBaseModel):
    """
    Details specific to Worker Safety SOS.
    """

    driver: typing.Optional[AlertObjectDriverResponseBody] = None
    location: typing.Optional[EventLocationResponseBody] = None
    source_type: typing_extensions.Annotated[
        WorkerSafetySosDataResponseBodySourceType,
        FieldMetadata(alias="sourceType"),
        pydantic.Field(
            alias="sourceType",
            description="The source of the SOS signal.  Valid values: `appSos`, `noResponseCheckIn`, `wearableSos`, `fallDetected`",
        ),
    ]
    vehicle: typing.Optional[AlertObjectVehicleResponseBody] = None
    worker_safety_incident_url: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="workerSafetyIncidentUrl"),
        pydantic.Field(
            alias="workerSafetyIncidentUrl", description="URL of the Worker Safety incident in the cloud dashboard."
        ),
    ]

    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
