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

import typing

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


class CrossEnvSecretResponse(UniversalBaseModel):
    """
    A secret key across all environments.
    """

    environments: typing.List[EnvSecretInfo] = pydantic.Field()
    """
    List of environments containing this key
    """

    is_secret: bool = pydantic.Field()
    """
    Whether this is a secret
    """

    key: str = pydantic.Field()
    """
    Secret key name
    """

    value: typing.Optional[str] = pydantic.Field(default=None)
    """
    Value for non-secrets (is_secret=False) only. Always None for secrets.
    """

    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
