# generated by datamodel-codegen:
#   filename:  property/property_list_filters.json
#   timestamp: 2026-02-28T17:39:50+00:00

from __future__ import annotations

from typing import Annotated

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

from ..core import identifier
from ..enums import channels, property_type
from . import feature_requirement


class CountriesAllItem(RootModel[str]):
    root: Annotated[str, Field(pattern='^[A-Z]{2}$')]


class PropertyListFilters(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    channels_any: Annotated[
        list[channels.MediaChannel] | None,
        Field(
            description='Property must support ANY of the listed channels. When omitted, no channel restriction is applied.',
            min_length=1,
        ),
    ] = None
    countries_all: Annotated[
        list[CountriesAllItem] | None,
        Field(
            description='Property must have feature data for ALL listed countries (ISO codes). When omitted, no country restriction is applied.',
            min_length=1,
        ),
    ] = None
    exclude_identifiers: Annotated[
        list[identifier.Identifier] | None,
        Field(description='Identifiers to always exclude from results', min_length=1),
    ] = None
    feature_requirements: Annotated[
        list[feature_requirement.FeatureRequirement] | None,
        Field(
            description='Feature-based requirements. Property must pass ALL requirements (AND logic).',
            min_length=1,
        ),
    ] = None
    property_types: Annotated[
        list[property_type.PropertyType] | None,
        Field(description='Filter to these property types', min_length=1),
    ] = None
