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

from __future__ import annotations

from typing import Annotated

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

from ...enums import asset_content_type
from .. import ext as ext_1
from . import asset_requirements as asset_requirements_1


class OfferingAssetConstraint(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    asset_group_id: Annotated[
        str,
        Field(
            description="The asset group this constraint applies to. Values are format-defined vocabulary — each format chooses its own group IDs (e.g., 'headlines', 'images', 'videos'). Buyers discover them via list_creative_formats."
        ),
    ]
    asset_requirements: Annotated[
        asset_requirements_1.AssetRequirements | None,
        Field(
            description='Technical requirements for each item in this group (e.g., max_length for text, min_width/aspect_ratio for images). Applies uniformly to all items in the group.'
        ),
    ] = None
    asset_type: Annotated[
        asset_content_type.AssetContentType,
        Field(description='The expected content type for this group.'),
    ]
    ext: ext_1.ExtensionObject | None = None
    max_count: Annotated[
        int | None, Field(description='Maximum number of items allowed in this group.', ge=1)
    ] = None
    min_count: Annotated[
        int | None, Field(description='Minimum number of items required in this group.', ge=1)
    ] = None
    required: Annotated[
        bool | None,
        Field(
            description='Whether this asset group must be present in each offering. Defaults to true.'
        ),
    ] = True
