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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class EnvVarResponse(UniversalBaseModel):
    """
    Response model for a single environment variable.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Creation timestamp
    """

    env_id: str = pydantic.Field()
    """
    Environment ID
    """

    id: str = pydantic.Field()
    """
    Unique identifier
    """

    is_secret: bool = pydantic.Field()
    """
    Whether value is write-only
    """

    key: str = pydantic.Field()
    """
    Variable key
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last update timestamp
    """

    value: typing.Optional[str] = pydantic.Field(default=None)
    """
    Decrypted value (only for non-secrets when requested)
    """

    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
