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

from ..core.unchecked_base_model import UncheckedBaseModel
from .component_component_type import ComponentComponentType
import pydantic
import typing
from .device_component_details_application_details import DeviceComponentDetailsApplicationDetails
from .device_component_details_card_reader_details import DeviceComponentDetailsCardReaderDetails
from .device_component_details_battery_details import DeviceComponentDetailsBatteryDetails
from .device_component_details_wi_fi_details import DeviceComponentDetailsWiFiDetails
from .device_component_details_ethernet_details import DeviceComponentDetailsEthernetDetails
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Component(UncheckedBaseModel):
    """
    The wrapper object for the component entries of a given component type.
    """

    type: ComponentComponentType = pydantic.Field()
    """
    The type of this component. Each component type has expected properties expressed
    in a structured format within its corresponding `*_details` field.
    See [ComponentType](#type-componenttype) for possible values
    """

    application_details: typing.Optional[DeviceComponentDetailsApplicationDetails] = pydantic.Field(default=None)
    """
    Structured data for an `Application`, set for Components of type `APPLICATION`.
    """

    card_reader_details: typing.Optional[DeviceComponentDetailsCardReaderDetails] = pydantic.Field(default=None)
    """
    Structured data for a `CardReader`, set for Components of type `CARD_READER`.
    """

    battery_details: typing.Optional[DeviceComponentDetailsBatteryDetails] = pydantic.Field(default=None)
    """
    Structured data for a `Battery`, set for Components of type `BATTERY`.
    """

    wifi_details: typing.Optional[DeviceComponentDetailsWiFiDetails] = pydantic.Field(default=None)
    """
    Structured data for a `WiFi` interface, set for Components of type `WIFI`.
    """

    ethernet_details: typing.Optional[DeviceComponentDetailsEthernetDetails] = pydantic.Field(default=None)
    """
    Structured data for an `Ethernet` interface, set for Components of type `ETHERNET`.
    """

    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
