# generated by datamodel-codegen:
#   filename:  core/attribution_window.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 ..enums import attribution_model
from . import duration


class AttributionWindow(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    model: Annotated[
        attribution_model.AttributionModel,
        Field(
            description='Attribution model used to assign credit when multiple touchpoints exist'
        ),
    ]
    post_click: Annotated[
        duration.Duration | None,
        Field(
            description='Post-click attribution window. Conversions occurring within this duration after a click are attributed to the ad.'
        ),
    ] = None
    post_view: Annotated[
        duration.Duration | None,
        Field(
            description='Post-view attribution window. Conversions occurring within this duration after an ad impression (without click) are attributed to the ad.'
        ),
    ] = None
