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

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


class Type(str, Enum):
    r"""Type of the delay. Currently only 'regular' is supported by the schema."""

    REGULAR = "regular"
    TIMED = "timed"


class Unit(str, Enum):
    r"""Unit of time for the delay amount."""

    SECONDS = "seconds"
    MINUTES = "minutes"
    HOURS = "hours"
    DAYS = "days"
    WEEKS = "weeks"
    MONTHS = "months"


class DelayControlDtoTypedDict(TypedDict):
    skip: NotRequired[Dict[str, Any]]
    r"""JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference."""
    type: NotRequired[Type]
    r"""Type of the delay. Currently only 'regular' is supported by the schema."""
    amount: NotRequired[float]
    r"""Amount of time to delay."""
    unit: NotRequired[Unit]
    r"""Unit of time for the delay amount."""
    cron: NotRequired[str]
    r"""Cron expression for the delay. Min length 1."""


class DelayControlDto(BaseModel):
    skip: Optional[Dict[str, Any]] = None
    r"""JSONLogic filter conditions for conditionally skipping the step execution. Supports complex logical operations with AND, OR, and comparison operators. See https://jsonlogic.com/ for full typing reference."""

    type: Optional[Type] = Type.REGULAR
    r"""Type of the delay. Currently only 'regular' is supported by the schema."""

    amount: Optional[float] = None
    r"""Amount of time to delay."""

    unit: Optional[Unit] = None
    r"""Unit of time for the delay amount."""

    cron: Optional[str] = None
    r"""Cron expression for the delay. Min length 1."""
