# 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 .app_platform import AppPlatform
from .feature_category import FeatureCategory
from .feature_status import FeatureStatus


class FeatureItemResponse(UniversalBaseModel):
    """
    A single feature entry returned to the client, combining catalog metadata and the user's toggle.
    """

    key: str = pydantic.Field()
    """
    Unique feature identifier
    """

    name: str = pydantic.Field()
    """
    Human-readable feature name
    """

    description: str = pydantic.Field()
    """
    What this feature does
    """

    category: FeatureCategory = pydantic.Field()
    """
    Feature grouping category
    """

    status: FeatureStatus = pydantic.Field()
    """
    Rollout status: 'alpha', 'beta', or 'public'
    """

    apps: typing.List[AppPlatform] = pydantic.Field()
    """
    Platforms this feature is available on: 'web', 'desktop', or both
    """

    enabled: bool = pydantic.Field()
    """
    Whether this feature is enabled for the user
    """

    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
