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

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


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


class DigestRegularMetadataType(str, Enum):
    REGULAR = "regular"
    BACKOFF = "backoff"


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


class DigestRegularMetadataTypedDict(TypedDict):
    type: DigestRegularMetadataType
    amount: NotRequired[float]
    unit: NotRequired[DigestRegularMetadataUnit]
    digest_key: NotRequired[str]
    backoff: NotRequired[bool]
    backoff_amount: NotRequired[float]
    backoff_unit: NotRequired[BackoffUnit]
    update_mode: NotRequired[bool]


class DigestRegularMetadata(BaseModel):
    type: DigestRegularMetadataType

    amount: Optional[float] = None

    unit: Optional[DigestRegularMetadataUnit] = None

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

    backoff: Optional[bool] = None

    backoff_amount: Annotated[
        Optional[float], pydantic.Field(alias="backoffAmount")
    ] = None

    backoff_unit: Annotated[
        Optional[BackoffUnit], pydantic.Field(alias="backoffUnit")
    ] = None

    update_mode: Annotated[Optional[bool], pydantic.Field(alias="updateMode")] = None
