# generated by datamodel-codegen:
#   filename:  vast-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 TrackingEvent(Enum):
    start = 'start'
    firstQuartile = 'firstQuartile'
    midpoint = 'midpoint'
    thirdQuartile = 'thirdQuartile'
    complete = 'complete'
    impression = 'impression'
    click = 'click'
    pause = 'pause'
    resume = 'resume'
    skip = 'skip'
    mute = 'mute'
    unmute = 'unmute'
    fullscreen = 'fullscreen'
    exitFullscreen = 'exitFullscreen'
    playerExpand = 'playerExpand'
    playerCollapse = 'playerCollapse'


class VastVersion(Enum):
    field_2_0 = '2.0'
    field_3_0 = '3.0'
    field_4_0 = '4.0'
    field_4_1 = '4.1'
    field_4_2 = '4.2'


class VastAsset1(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    delivery_type: Annotated[
        Literal['url'],
        Field(description='Discriminator indicating VAST is delivered via URL endpoint'),
    ]
    duration_ms: Annotated[
        int | None, Field(description='Expected video duration in milliseconds (if known)', ge=0)
    ] = None
    tracking_events: Annotated[
        list[TrackingEvent] | None, Field(description='Tracking events supported by this VAST tag')
    ] = None
    url: Annotated[AnyUrl, Field(description='URL endpoint that returns VAST XML')]
    vast_version: Annotated[VastVersion | None, Field(description='VAST specification version')] = (
        None
    )
    vpaid_enabled: Annotated[
        bool | None,
        Field(description='Whether VPAID (Video Player-Ad Interface Definition) is supported'),
    ] = None


class VastAsset2(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    content: Annotated[str, Field(description='Inline VAST XML content')]
    delivery_type: Annotated[
        Literal['inline'],
        Field(description='Discriminator indicating VAST is delivered as inline XML content'),
    ]
    duration_ms: Annotated[
        int | None, Field(description='Expected video duration in milliseconds (if known)', ge=0)
    ] = None
    tracking_events: Annotated[
        list[TrackingEvent] | None, Field(description='Tracking events supported by this VAST tag')
    ] = None
    vast_version: Annotated[VastVersion | None, Field(description='VAST specification version')] = (
        None
    )
    vpaid_enabled: Annotated[
        bool | None,
        Field(description='Whether VPAID (Video Player-Ad Interface Definition) is supported'),
    ] = None
