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

from __future__ import annotations

from typing import Annotated

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

from . import audio_asset, css_asset, daast_asset
from . import format_id as format_id_1
from . import (
    html_asset,
    image_asset,
    javascript_asset,
    promoted_offerings,
    text_asset,
    url_asset,
    vast_asset,
    video_asset,
)


class Input(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    context_description: Annotated[
        str | None,
        Field(description="Natural language description of the context for AI-generated content"),
    ] = None
    macros: Annotated[
        dict[str, str] | None, Field(description="Macro values to apply for this preview")
    ] = None
    name: Annotated[str, Field(description="Human-readable name for this preview variant")]


class CreativeAsset(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    approved: Annotated[
        bool | None,
        Field(
            description="For generative creatives: set to true to approve and finalize, false to request regeneration with updated assets/message. Omit for non-generative creatives."
        ),
    ] = None
    assets: Annotated[
        dict[
            str,
            image_asset.ImageAsset
            | video_asset.VideoAsset
            | audio_asset.AudioAsset
            | text_asset.TextAsset
            | html_asset.HtmlAsset
            | css_asset.CssAsset
            | javascript_asset.JavascriptAsset
            | promoted_offerings.PromotedOfferings
            | url_asset.UrlAsset
            | vast_asset.VastAsset1
            | vast_asset.VastAsset2
            | daast_asset.DaastAsset1
            | daast_asset.DaastAsset2,
        ],
        Field(description="Assets required by the format, keyed by asset_role"),
    ]
    creative_id: Annotated[str, Field(description="Unique identifier for the creative")]
    format_id: Annotated[
        format_id_1.FormatId,
        Field(description="Format identifier specifying which format this creative conforms to"),
    ]
    inputs: Annotated[
        list[Input] | None,
        Field(
            description="Preview contexts for generative formats - defines what scenarios to generate previews for"
        ),
    ] = None
    name: Annotated[str, Field(description="Human-readable creative name")]
    tags: Annotated[
        list[str] | None, Field(description="User-defined tags for organization and searchability")
    ] = None
