# generated by datamodel-codegen:
#   filename:  core/requirements/html_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 Sandbox(Enum):
    none = 'none'
    iframe = 'iframe'
    safeframe = 'safeframe'
    fencedframe = 'fencedframe'


class HtmlAssetRequirements(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    allowed_external_domains: Annotated[
        list[str] | None,
        Field(
            description='List of domains the HTML creative may reference for external resources. Only applicable when external_resources_allowed is true.'
        ),
    ] = None
    external_resources_allowed: Annotated[
        bool | None,
        Field(
            description='Whether the HTML creative can load external resources (scripts, images, fonts, etc.). When false, all resources must be inlined or bundled.'
        ),
    ] = None
    max_file_size_kb: Annotated[
        int | None, Field(description='Maximum file size in kilobytes for the HTML asset', ge=1)
    ] = None
    sandbox: Annotated[
        Sandbox | None,
        Field(
            description="Sandbox environment the HTML must be compatible with. 'none' = direct DOM access, 'iframe' = standard iframe isolation, 'safeframe' = IAB SafeFrame container, 'fencedframe' = Privacy Sandbox fenced frame"
        ),
    ] = Sandbox.none
