# generated by datamodel-codegen:
#   filename:  core/creative_filters.json
#   timestamp: 2026-02-27T02:10:10+00:00

from __future__ import annotations

from typing import Annotated

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

from ..enums import creative_status
from . import account_ref


class CreativeFilters(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    accounts: Annotated[
        list[account_ref.AccountReference] | None,
        Field(
            description='Filter creatives by owning accounts. Useful for agencies managing multiple client accounts.',
            min_length=1,
        ),
    ] = None
    assigned_to_packages: Annotated[
        list[str] | None,
        Field(description='Filter creatives assigned to any of these packages', min_length=1),
    ] = None
    buyer_refs: Annotated[
        list[str] | None,
        Field(
            description='Filter creatives assigned to media buys with any of these buyer references',
            min_length=1,
        ),
    ] = None
    created_after: Annotated[
        AwareDatetime | None,
        Field(description='Filter creatives created after this date (ISO 8601)'),
    ] = None
    created_before: Annotated[
        AwareDatetime | None,
        Field(description='Filter creatives created before this date (ISO 8601)'),
    ] = None
    creative_ids: Annotated[
        list[str] | None,
        Field(description='Filter by specific creative IDs', max_length=100, min_length=1),
    ] = None
    formats: Annotated[
        list[str] | None,
        Field(
            description='Filter by creative format types (e.g., video, audio, display)',
            min_length=1,
        ),
    ] = None
    has_performance_data: Annotated[
        bool | None, Field(description='Filter creatives that have performance data when true')
    ] = None
    media_buy_ids: Annotated[
        list[str] | None,
        Field(description='Filter creatives assigned to any of these media buys', min_length=1),
    ] = None
    name_contains: Annotated[
        str | None,
        Field(description='Filter by creative names containing this text (case-insensitive)'),
    ] = None
    statuses: Annotated[
        list[creative_status.CreativeStatus] | None,
        Field(description='Filter by creative approval statuses', min_length=1),
    ] = None
    tags: Annotated[
        list[str] | None,
        Field(description='Filter by creative tags (all tags must match)', min_length=1),
    ] = None
    tags_any: Annotated[
        list[str] | None,
        Field(description='Filter by creative tags (any tag must match)', min_length=1),
    ] = None
    unassigned: Annotated[
        bool | None,
        Field(
            description='Filter for unassigned creatives when true, assigned creatives when false'
        ),
    ] = None
    updated_after: Annotated[
        AwareDatetime | None,
        Field(description='Filter creatives last updated after this date (ISO 8601)'),
    ] = None
    updated_before: Annotated[
        AwareDatetime | None,
        Field(description='Filter creatives last updated before this date (ISO 8601)'),
    ] = None
