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

from __future__ import annotations

from typing import Annotated

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

from . import media_buy_status, package


class MediaBuy(AdCPBaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    buyer_ref: Annotated[
        str | None, Field(description="Buyer's reference identifier for this media buy")
    ] = None
    created_at: Annotated[AwareDatetime | None, Field(description="Creation timestamp")] = None
    creative_deadline: Annotated[
        AwareDatetime | None, Field(description="ISO 8601 timestamp for creative upload deadline")
    ] = None
    media_buy_id: Annotated[
        str, Field(description="Publisher's unique identifier for the media buy")
    ]
    packages: Annotated[
        list[package.Package], Field(description="Array of packages within this media buy")
    ]
    promoted_offering: Annotated[
        str, Field(description="Description of advertiser and what is being promoted")
    ]
    status: media_buy_status.MediaBuyStatus
    total_budget: Annotated[float, Field(description="Total budget amount", ge=0.0)]
    updated_at: Annotated[AwareDatetime | None, Field(description="Last update timestamp")] = None
