# generated by datamodel-codegen:
#   filename:  reporting-capabilities.json
#   timestamp: 2025-11-15T22:03:55+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated

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


class AvailableMetric(Enum):
    impressions = "impressions"
    spend = "spend"
    clicks = "clicks"
    ctr = "ctr"
    video_completions = "video_completions"
    completion_rate = "completion_rate"
    conversions = "conversions"
    viewability = "viewability"
    engagement_rate = "engagement_rate"


class AvailableReportingFrequency(Enum):
    hourly = "hourly"
    daily = "daily"
    monthly = "monthly"


class ReportingCapabilities(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    available_metrics: Annotated[
        list[AvailableMetric],
        Field(
            description="Metrics available in reporting. Impressions and spend are always implicitly included.",
            examples=[
                ["impressions", "spend", "clicks", "video_completions"],
                ["impressions", "spend", "conversions"],
            ],
        ),
    ]
    available_reporting_frequencies: Annotated[
        list[AvailableReportingFrequency],
        Field(description="Supported reporting frequency options", min_length=1),
    ]
    expected_delay_minutes: Annotated[
        int,
        Field(
            description="Expected delay in minutes before reporting data becomes available (e.g., 240 for 4-hour delay)",
            examples=[240, 300, 1440],
            ge=0,
        ),
    ]
    supports_webhooks: Annotated[
        bool,
        Field(description="Whether this product supports webhook-based reporting notifications"),
    ]
    timezone: Annotated[
        str,
        Field(
            description="Timezone for reporting periods. Use 'UTC' or IANA timezone (e.g., 'America/New_York'). Critical for daily/monthly frequency alignment.",
            examples=["UTC", "America/New_York", "Europe/London", "America/Los_Angeles"],
        ),
    ]
