# generated by datamodel-codegen:
#   filename:  core/offering_asset_group.json
#   timestamp: 2026-02-23T01:56:40+00:00

from __future__ import annotations

from typing import Annotated

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

from ..enums import asset_content_type
from . import ext as ext_1
from .assets import (
    audio_asset,
    css_asset,
    daast_asset,
    html_asset,
    image_asset,
    javascript_asset,
    markdown_asset,
    text_asset,
    url_asset,
    vast_asset,
    video_asset,
    webhook_asset,
)


class OfferingAssetGroup(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    asset_group_id: Annotated[
        str,
        Field(
            description="Identifies the creative role this group fills. Values are defined by each format's offering_asset_constraints — not protocol constants. Discover them via list_creative_formats (e.g., a format might declare 'headlines', 'images', or 'videos')."
        ),
    ]
    asset_type: Annotated[
        asset_content_type.AssetContentType,
        Field(description='The content type of all items in this group.'),
    ]
    ext: ext_1.ExtensionObject | None = None
    items: Annotated[
        list[
            text_asset.TextAsset
            | image_asset.ImageAsset
            | video_asset.VideoAsset
            | audio_asset.AudioAsset
            | url_asset.UrlAsset
            | html_asset.HtmlAsset
            | markdown_asset.MarkdownAsset
            | vast_asset.VastAsset
            | daast_asset.DaastAsset
            | css_asset.CssAsset
            | javascript_asset.JavascriptAsset
            | webhook_asset.WebhookAsset
        ],
        Field(
            description='The assets in this group. Each item should match the structure for the declared asset_type. Note: JSON Schema validation accepts any valid asset structure here; enforcement that items match asset_type is the responsibility of the consuming agent.',
            min_length=1,
        ),
    ]
