# generated by datamodel-codegen:
#   filename:  property/property_list.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 AnyUrl, AwareDatetime, ConfigDict, Field

from ..core import brand_ref
from . import base_property_source, property_list_filters


class PropertyList(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    base_properties: Annotated[
        list[base_property_source.BasePropertySource] | None,
        Field(
            description="Array of property sources to evaluate. Each entry is a discriminated union: publisher_tags (publisher_domain + tags), publisher_ids (publisher_domain + property_ids), or identifiers (direct identifiers). If omitted, queries the agent's entire property database."
        ),
    ] = None
    brand: Annotated[
        brand_ref.BrandReference | None,
        Field(
            description='Brand reference used to automatically apply appropriate rules. Resolved to full brand identity at execution time.'
        ),
    ] = None
    cache_duration_hours: Annotated[
        int | None,
        Field(
            description='Recommended cache duration for resolved list. Consumers should re-fetch after this period.',
            ge=1,
        ),
    ] = 24
    created_at: Annotated[AwareDatetime | None, Field(description='When the list was created')] = (
        None
    )
    description: Annotated[str | None, Field(description="Description of the list's purpose")] = (
        None
    )
    filters: Annotated[
        property_list_filters.PropertyListFilters | None,
        Field(description='Dynamic filters applied when resolving the list'),
    ] = None
    list_id: Annotated[str, Field(description='Unique identifier for this property list')]
    name: Annotated[str, Field(description='Human-readable name for the list')]
    principal: Annotated[
        str | None, Field(description='Principal identity that owns this list')
    ] = None
    property_count: Annotated[
        int | None,
        Field(description='Number of properties in the resolved list (at time of last resolution)'),
    ] = None
    updated_at: Annotated[
        AwareDatetime | None, Field(description='When the list was last modified')
    ] = None
    webhook_url: Annotated[
        AnyUrl | None,
        Field(description='URL to receive notifications when the resolved list changes'),
    ] = None
