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

from __future__ import annotations

from enum import Enum
from typing import Annotated

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


class Codec(Enum):
    h264 = 'h264'
    h265 = 'h265'
    vp8 = 'vp8'
    vp9 = 'vp9'
    av1 = 'av1'


class Container(Enum):
    mp4 = 'mp4'
    webm = 'webm'
    mov = 'mov'
    avi = 'avi'
    mkv = 'mkv'


class FrameRate(RootModel[float]):
    root: Annotated[float, Field(ge=1.0)]


class VideoAssetRequirements(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    aspect_ratio: Annotated[
        str | None,
        Field(description="Required aspect ratio (e.g., '16:9', '9:16')", pattern='^\\d+:\\d+$'),
    ] = None
    audio_required: Annotated[
        bool | None, Field(description='Whether the video must include an audio track')
    ] = None
    codecs: Annotated[list[Codec] | None, Field(description='Accepted video codecs')] = None
    containers: Annotated[
        list[Container] | None, Field(description='Accepted video container formats')
    ] = None
    frame_rates: Annotated[
        list[FrameRate] | None,
        Field(description='Accepted frame rates in frames per second (e.g., [24, 30, 60])'),
    ] = None
    max_bitrate_kbps: Annotated[
        int | None, Field(description='Maximum video bitrate in kilobits per second', ge=1)
    ] = None
    max_duration_ms: Annotated[
        int | None, Field(description='Maximum duration in milliseconds', ge=1)
    ] = None
    max_file_size_kb: Annotated[
        int | None, Field(description='Maximum file size in kilobytes', ge=1)
    ] = None
    max_height: Annotated[int | None, Field(description='Maximum height in pixels', ge=1)] = None
    max_width: Annotated[int | None, Field(description='Maximum width in pixels', ge=1)] = None
    min_bitrate_kbps: Annotated[
        int | None, Field(description='Minimum video bitrate in kilobits per second', ge=1)
    ] = None
    min_duration_ms: Annotated[
        int | None, Field(description='Minimum duration in milliseconds', ge=1)
    ] = None
    min_height: Annotated[int | None, Field(description='Minimum height in pixels', ge=1)] = None
    min_width: Annotated[int | None, Field(description='Minimum width in pixels', ge=1)] = None
