# 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 EnvResponse(UniversalBaseModel):
    """
    Full environment details.
    """

    agent_id: str = pydantic.Field()
    """
    Parent agent ID
    """

    branch_rules: typing.List[str] = pydantic.Field()
    """
    Branch patterns for matching (e.g., ['main'], ['feature/*'])
    """

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

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

    is_prod: bool = pydantic.Field()
    """
    Whether this is the production environment (protected)
    """

    name: str = pydantic.Field()
    """
    Environment name (e.g., 'production', 'staging')
    """

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

    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
