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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .device_component_details_external_power import DeviceComponentDetailsExternalPower
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class DeviceComponentDetailsBatteryDetails(UncheckedBaseModel):
    visible_percent: typing.Optional[int] = pydantic.Field(default=None)
    """
    The battery charge percentage as displayed on the device.
    """

    external_power: typing.Optional[DeviceComponentDetailsExternalPower] = pydantic.Field(default=None)
    """
    The status of external_power.
    See [ExternalPower](#type-externalpower) for possible values
    """

    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
