# generated by datamodel-codegen:
#   filename:  core/requirements/image_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


class Format(Enum):
    jpg = 'jpg'
    jpeg = 'jpeg'
    png = 'png'
    gif = 'gif'
    webp = 'webp'
    svg = 'svg'
    avif = 'avif'


class ImageAssetRequirements(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    animation_allowed: Annotated[
        bool | None, Field(description='Whether animated images (GIF, animated WebP) are accepted')
    ] = None
    aspect_ratio: Annotated[
        str | None,
        Field(
            description="Required aspect ratio (e.g., '16:9', '1:1', '1.91:1')",
            pattern='^\\d+(\\.\\d+)?:\\d+(\\.\\d+)?$',
        ),
    ] = None
    formats: Annotated[list[Format] | None, Field(description='Accepted image file formats')] = None
    max_animation_duration_ms: Annotated[
        int | None,
        Field(
            description='Maximum animation duration in milliseconds (if animation_allowed is true)',
            ge=0,
        ),
    ] = 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. For exact dimensions, set min_height = max_height.',
            ge=1,
        ),
    ] = None
    max_width: Annotated[
        int | None,
        Field(
            description='Maximum width in pixels. For exact dimensions, set min_width = max_width.',
            ge=1,
        ),
    ] = None
    min_height: Annotated[
        int | None,
        Field(
            description='Minimum height in pixels. For exact dimensions, set min_height = max_height.',
            ge=1,
        ),
    ] = None
    min_width: Annotated[
        int | None,
        Field(
            description='Minimum width in pixels. For exact dimensions, set min_width = max_width.',
            ge=1,
        ),
    ] = None
    transparency_required: Annotated[
        bool | None,
        Field(
            description='Whether the image must support transparency (requires PNG, WebP, or GIF)'
        ),
    ] = None
