# generated by datamodel-codegen:
#   filename:  core/duration.json
#   timestamp: 2026-02-28T17:39:50+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 Unit(Enum):
    minutes = 'minutes'
    hours = 'hours'
    days = 'days'
    campaign = 'campaign'


class Duration(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    interval: Annotated[
        int, Field(description="Number of time units. Must be 1 when unit is 'campaign'.", ge=1)
    ]
    unit: Annotated[
        Unit, Field(description="Time unit. 'campaign' spans the full campaign flight.")
    ]
