"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .timedconfig import TimedConfig, TimedConfigTypedDict
from enum import Enum
from novu_py.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class DigestTimedMetadataUnit(str, Enum):
    SECONDS = "seconds"
    MINUTES = "minutes"
    HOURS = "hours"
    DAYS = "days"
    WEEKS = "weeks"
    MONTHS = "months"


class DigestTimedMetadataType(str, Enum):
    TIMED = "timed"


class DigestTimedMetadataTypedDict(TypedDict):
    type: DigestTimedMetadataType
    amount: NotRequired[float]
    unit: NotRequired[DigestTimedMetadataUnit]
    digest_key: NotRequired[str]
    timed: NotRequired[TimedConfigTypedDict]


class DigestTimedMetadata(BaseModel):
    type: DigestTimedMetadataType

    amount: Optional[float] = None

    unit: Optional[DigestTimedMetadataUnit] = None

    digest_key: Annotated[Optional[str], pydantic.Field(alias="digestKey")] = None

    timed: Optional[TimedConfig] = None
