# 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 .enum_value_response_body import EnumValueResponseBody


class ReadingDefinitionResponseBody(UniversalBaseModel):
    """
    Definition of a reading.
    """

    category: str = pydantic.Field()
    """
    The category enumeration that this reading belongs to.
    """

    description: str = pydantic.Field()
    """
    The human readable description for this reading. Translated to English.
    """

    entity_type: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="entityType"),
        pydantic.Field(alias="entityType", description="Entity type of this reading."),
    ]
    enum_values: typing_extensions.Annotated[
        typing.Optional[typing.List[EnumValueResponseBody]],
        FieldMetadata(alias="enumValues"),
        pydantic.Field(alias="enumValues", description="Array of enumeration values"),
    ] = None
    ingestion_enabled: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="ingestionEnabled"),
        pydantic.Field(
            alias="ingestionEnabled", description="Indicates whether this reading can be ingested using the API."
        ),
    ]
    label: str = pydantic.Field()
    """
    The label for this reading that is suitable to show to a user. Translated to English.
    """

    reading_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="readingId"),
        pydantic.Field(
            alias="readingId", description="The ID of the reading used to fetch time series data in other endpoints."
        ),
    ]
    type: typing.Dict[str, typing.Any] = pydantic.Field()
    """
    The type information for the reading. Contains the complete type structure including dataType, unit, enumValues, fields, etc.
    """

    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
