from typing import Literal, NotRequired, TypedDict

ERROR = "error"
INFO = "info"
OPTIONAL = "optional"
RECOMMENDED = "recommended"
REQUIRED = "required"
WARNING = "warning"


AttributeRequirement = Literal[OPTIONAL, RECOMMENDED, REQUIRED]
AttributeSeverity = Literal[ERROR, INFO, WARNING]
AttributeType = Literal["string", "int", "double", "boolean", "string[]", "any"]


class AttributeMetadata(TypedDict):
    environment: str | None
    model_provider: str | None
    model: str | None
    project_id: str | None
    session_id: str | None
    start_time: str | None
    end_time: str | None
    span_id: str | None
    span_parent_id: str | None
    trace_id: str | None
    user_id: str | None


class AttributeSpec(TypedDict):
    name: str
    requirement: AttributeRequirement
    type: NotRequired[AttributeType]
    deprecated: NotRequired[bool]
    deprecated_message: NotRequired[str]
    valid_values: NotRequired[list[str]]


class AttributeValidationDetail(TypedDict):
    name: str
    requirement: AttributeRequirement
    severity: AttributeSeverity
    type: NotRequired[AttributeType]
    deprecated: NotRequired[bool]
    deprecated_message: NotRequired[str]
    valid_values: NotRequired[list[str]]


AttributeValidationDetails = dict[str, AttributeValidationDetail]
