# generated by datamodel-codegen:
#   filename:  core/targeting.json
#   timestamp: 2026-01-08T19:25:24+00:00

from __future__ import annotations

from typing import Annotated

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

from . import frequency_cap as frequency_cap_1


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


class TargetingOverlay(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    axe_exclude_segment: Annotated[
        str | None, Field(description='AXE segment ID to exclude from targeting')
    ] = None
    axe_include_segment: Annotated[
        str | None, Field(description='AXE segment ID to include for targeting')
    ] = None
    frequency_cap: frequency_cap_1.FrequencyCap | None = None
    geo_country_any_of: Annotated[
        list[GeoCountryAnyOfItem] | None,
        Field(
            description='Restrict delivery to specific countries (ISO codes). Use for regulatory compliance or RCT testing.'
        ),
    ] = None
    geo_metro_any_of: Annotated[
        list[str] | None,
        Field(
            description='Restrict delivery to specific metro areas (DMA codes). Use for regulatory compliance or RCT testing.'
        ),
    ] = None
    geo_postal_code_any_of: Annotated[
        list[str] | None,
        Field(
            description='Restrict delivery to specific postal/ZIP codes. Use for regulatory compliance or RCT testing.'
        ),
    ] = None
    geo_region_any_of: Annotated[
        list[str] | None,
        Field(
            description='Restrict delivery to specific regions/states. Use for regulatory compliance or RCT testing.'
        ),
    ] = None
