# generated by datamodel-codegen:
#   filename:  daast-asset.json
#   timestamp: 2025-11-18T03:35:10+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated, Literal

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


class DaastVersion(Enum):
    field_1_0 = '1.0'
    field_1_1 = '1.1'


class TrackingEvent(Enum):
    start = 'start'
    firstQuartile = 'firstQuartile'
    midpoint = 'midpoint'
    thirdQuartile = 'thirdQuartile'
    complete = 'complete'
    impression = 'impression'
    pause = 'pause'
    resume = 'resume'
    skip = 'skip'
    mute = 'mute'
    unmute = 'unmute'


class DaastAsset1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    companion_ads: Annotated[
        bool | None, Field(description='Whether companion display ads are included')
    ] = None
    daast_version: Annotated[
        DaastVersion | None, Field(description='DAAST specification version')
    ] = None
    delivery_type: Annotated[
        Literal['url'],
        Field(description='Discriminator indicating DAAST is delivered via URL endpoint'),
    ]
    duration_ms: Annotated[
        int | None, Field(description='Expected audio duration in milliseconds (if known)', ge=0)
    ] = None
    tracking_events: Annotated[
        list[TrackingEvent] | None, Field(description='Tracking events supported by this DAAST tag')
    ] = None
    url: Annotated[AnyUrl, Field(description='URL endpoint that returns DAAST XML')]


class DaastAsset2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    companion_ads: Annotated[
        bool | None, Field(description='Whether companion display ads are included')
    ] = None
    content: Annotated[str, Field(description='Inline DAAST XML content')]
    daast_version: Annotated[
        DaastVersion | None, Field(description='DAAST specification version')
    ] = None
    delivery_type: Annotated[
        Literal['inline'],
        Field(description='Discriminator indicating DAAST is delivered as inline XML content'),
    ]
    duration_ms: Annotated[
        int | None, Field(description='Expected audio duration in milliseconds (if known)', ge=0)
    ] = None
    tracking_events: Annotated[
        list[TrackingEvent] | None, Field(description='Tracking events supported by this DAAST tag')
    ] = None
