# generated by datamodel-codegen:
#   filename:  core/creative_manifest.json
#   timestamp: 2025-11-22T19:54:03+00:00

from __future__ import annotations

from typing import Annotated

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

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


class CreativeManifest(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    assets: Annotated[
        dict[
            str,
            image_asset.ImageAsset
            | video_asset.VideoAsset
            | audio_asset.AudioAsset
            | text_asset.TextAsset
            | url_asset.UrlAsset
            | html_asset.HtmlAsset
            | javascript_asset.JavascriptAsset
            | webhook_asset.WebhookAsset
            | css_asset.CssAsset
            | promoted_offerings.PromotedOfferings
            | vast_asset.VastAsset1
            | vast_asset.VastAsset2
            | daast_asset.DaastAsset1
            | daast_asset.DaastAsset2,
        ],
        Field(
            description="Map of asset IDs to actual asset content. Each key MUST match an asset_id from the format's assets_required array (e.g., 'banner_image', 'clickthrough_url', 'video_file', 'vast_tag'). The asset_id is the technical identifier used to match assets to format requirements.\n\nIMPORTANT: Creative manifest validation MUST be performed in the context of the format specification. The format defines what type each asset_id should be, which eliminates any validation ambiguity."
        ),
    ]
    ext: ext_1.ExtensionObject | None = None
    format_id: Annotated[
        format_id_1.FormatId,
        Field(
            description="Format identifier this manifest is for. Can be a template format (id only) or a deterministic format (id + dimensions/duration). For dimension-specific creatives, include width/height/unit in the format_id to create a unique identifier (e.g., {id: 'display_static', width: 300, height: 250, unit: 'px'})."
        ),
    ]
    promoted_offering: Annotated[
        str | None,
        Field(
            description='Product name or offering being advertised. Maps to promoted_offerings in create_media_buy request to associate creative with the product being promoted.'
        ),
    ] = None
