# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .cell_connectivity_response_response_body import CellConnectivityResponseResponseBody
from .gateway_details_response_response_body_gateway_battery_state import (
    GatewayDetailsResponseResponseBodyGatewayBatteryState,
)


class GatewayDetailsResponseResponseBody(UniversalBaseModel):
    """
    Gateway-specific health metadata.
    """

    cell_connectivity: typing_extensions.Annotated[
        typing.Optional[CellConnectivityResponseResponseBody],
        FieldMetadata(alias="cellConnectivity"),
        pydantic.Field(alias="cellConnectivity"),
    ] = None
    gateway_battery_state: typing_extensions.Annotated[
        typing.Optional[GatewayDetailsResponseResponseBodyGatewayBatteryState],
        FieldMetadata(alias="gatewayBatteryState"),
        pydantic.Field(
            alias="gatewayBatteryState",
            description="The gateway's battery state.  Valid values: `critical`, `low`, `ok`, `unknown`",
        ),
    ] = None
    gateway_battery_temp: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="gatewayBatteryTemp"),
        pydantic.Field(
            alias="gatewayBatteryTemp", description="The battery temperature of the gateway, in degrees Celsius."
        ),
    ] = None
    gateway_battery_volts: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="gatewayBatteryVolts"),
        pydantic.Field(alias="gatewayBatteryVolts", description="The battery voltage of the gateway, in volts."),
    ] = None
    last_check_in_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="lastCheckInTime"),
        pydantic.Field(
            alias="lastCheckInTime", description="The timestamp of the gateway's last check-in, in RFC 3339 format."
        ),
    ] = None
    vehicle_battery_volts: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="vehicleBatteryVolts"),
        pydantic.Field(
            alias="vehicleBatteryVolts",
            description="The battery voltage of the vehicle that gateway is connected to, in volts.",
        ),
    ] = 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
