# generated by datamodel-codegen:
#   filename:  core/forecast_point.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

from . import forecast_range


class Metrics(AdCPBaseModel):
    audience_size: forecast_range.ForecastRange | None = None
    clicks: forecast_range.ForecastRange | None = None
    completed_views: forecast_range.ForecastRange | None = None
    engagements: forecast_range.ForecastRange | None = None
    follows: forecast_range.ForecastRange | None = None
    frequency: forecast_range.ForecastRange | None = None
    grps: forecast_range.ForecastRange | None = None
    impressions: forecast_range.ForecastRange | None = None
    profile_visits: forecast_range.ForecastRange | None = None
    reach: forecast_range.ForecastRange | None = None
    saves: forecast_range.ForecastRange | None = None
    spend: forecast_range.ForecastRange | None = None
    views: forecast_range.ForecastRange | None = None


class ForecastPoint(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    budget: Annotated[
        float,
        Field(
            description='Budget amount for this forecast point. For allocation-level forecasts, this is the absolute budget for that allocation (not the percentage). For proposal-level forecasts, this is the total proposal budget.',
            ge=0.0,
        ),
    ]
    metrics: Annotated[
        Metrics,
        Field(
            description='Forecasted metric values at this budget level. Keys are forecastable-metric enum values for delivery/engagement or event-type enum values for outcomes. Values are ForecastRange objects (low/mid/high). Use { "mid": value } for point estimates. Include spend when the platform predicts it will differ from budget. Additional keys beyond the documented properties are allowed for event-type values (purchase, lead, app_install, etc.).'
        ),
    ]
