# generated by datamodel-codegen:
#   filename:  list-creative-formats-response.json
#   timestamp: 2025-11-15T22:03:55+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any

from adcp.types.base import AdCPBaseModel
from pydantic import AnyUrl, ConfigDict, Field

from . import error, format


class Capability(Enum):
    validation = "validation"
    assembly = "assembly"
    generation = "generation"
    preview = "preview"


class CreativeAgent(AdCPBaseModel):
    agent_name: Annotated[
        str | None, Field(description="Human-readable name for the creative agent")
    ] = None
    agent_url: Annotated[
        AnyUrl,
        Field(
            description="Base URL for the creative agent (e.g., 'https://reference.adcp.org', 'https://dco.example.com'). Call list_creative_formats on this URL to get its formats."
        ),
    ]
    capabilities: Annotated[
        list[Capability] | None, Field(description="Capabilities this creative agent provides")
    ] = None


class ListCreativeFormatsResponse(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    context: Annotated[
        dict[str, Any] | None,
        Field(
            description="Initiator-provided context echoed inside the task payload. Opaque metadata such as UI/session hints, correlation tokens, or tracking identifiers."
        ),
    ] = None
    creative_agents: Annotated[
        list[CreativeAgent] | None,
        Field(
            description="Optional: Creative agents that provide additional formats. Buyers can recursively query these agents to discover more formats. No authentication required for list_creative_formats."
        ),
    ] = None
    errors: Annotated[
        list[error.Error] | None,
        Field(description="Task-specific errors and warnings (e.g., format availability issues)"),
    ] = None
    formats: Annotated[
        list[format.Format],
        Field(
            description="Full format definitions for all formats this agent supports. Each format's authoritative source is indicated by its agent_url field."
        ),
    ]
