# generated by datamodel-codegen:
#   filename:  get-products-request.json
#   timestamp: 2025-11-18T04:34:42+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any

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

from . import brand_manifest as brand_manifest_1
from . import delivery_type as delivery_type_1
from . import format_id


class FormatType(Enum):
    video = 'video'
    display = 'display'
    audio = 'audio'


class Filters(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    delivery_type: delivery_type_1.DeliveryType | None = None
    format_ids: Annotated[
        list[format_id.FormatId] | None, Field(description='Filter by specific format IDs')
    ] = None
    format_types: Annotated[
        list[FormatType] | None, Field(description='Filter by format types')
    ] = None
    is_fixed_price: Annotated[
        bool | None, Field(description='Filter for fixed price vs auction products')
    ] = None
    min_exposures: Annotated[
        int | None,
        Field(description='Minimum exposures/impressions needed for measurement validity', ge=1),
    ] = None
    standard_formats_only: Annotated[
        bool | None, Field(description='Only return products accepting IAB standard formats')
    ] = None


class GetProductsRequest(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    brand_manifest: Annotated[
        brand_manifest_1.BrandManifest | AnyUrl | None,
        Field(
            description='Brand information manifest providing brand context, assets, and product catalog. Can be provided inline or as a URL reference to a hosted manifest.',
            examples=[
                {
                    'data': {
                        'colors': {'primary': '#FF6B35'},
                        'name': 'ACME Corporation',
                        'url': 'https://acmecorp.com',
                    },
                    'description': 'Inline brand manifest',
                },
                {
                    'data': 'https://cdn.acmecorp.com/brand-manifest.json',
                    'description': 'URL string reference to hosted manifest',
                },
            ],
            title='Brand Manifest Reference',
        ),
    ] = None
    brief: Annotated[
        str | None, Field(description='Natural language description of campaign requirements')
    ] = None
    context: Annotated[
        dict[str, Any] | None,
        Field(
            description='Initiator-provided context included in the request payload. Agentsmust echo this value back unchanged in responses and webhooks. Use for UI/session hints, correlation tokens, or tracking metadata.'
        ),
    ] = None
    filters: Annotated[
        Filters | None, Field(description='Structured filters for product discovery')
    ] = None
