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

from __future__ import annotations
from .activitynotificationexecutiondetailresponsedto import (
    ActivityNotificationExecutionDetailResponseDto,
    ActivityNotificationExecutionDetailResponseDtoTypedDict,
)
from .activitynotificationstepresponsedto import (
    ActivityNotificationStepResponseDto,
    ActivityNotificationStepResponseDtoTypedDict,
)
from .digestmetadatadto import DigestMetadataDto, DigestMetadataDtoTypedDict
from .providersidenum import ProvidersIDEnum
from enum import Enum
from novu_py.types import BaseModel
import pydantic
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ActivityNotificationJobResponseDtoType(str, Enum):
    r"""Type of the job"""

    IN_APP = "in_app"
    EMAIL = "email"
    SMS = "sms"
    CHAT = "chat"
    PUSH = "push"
    DIGEST = "digest"
    TRIGGER = "trigger"
    DELAY = "delay"
    THROTTLE = "throttle"
    CUSTOM = "custom"


class ActivityNotificationJobResponseDtoPayloadTypedDict(TypedDict):
    r"""Optional payload for the job"""


class ActivityNotificationJobResponseDtoPayload(BaseModel):
    r"""Optional payload for the job"""


class ActivityNotificationJobResponseDtoTypedDict(TypedDict):
    id: str
    r"""Unique identifier of the job"""
    type: ActivityNotificationJobResponseDtoType
    r"""Type of the job"""
    execution_details: List[ActivityNotificationExecutionDetailResponseDtoTypedDict]
    r"""Execution details of the job"""
    step: ActivityNotificationStepResponseDtoTypedDict
    r"""Step details of the job"""
    provider_id: ProvidersIDEnum
    r"""Provider ID of the job"""
    status: str
    r"""Status of the job"""
    digest: NotRequired[DigestMetadataDtoTypedDict]
    r"""Optional digest for the job, including metadata and events"""
    overrides: NotRequired[Dict[str, Any]]
    r"""Optional context object for additional error details."""
    payload: NotRequired[ActivityNotificationJobResponseDtoPayloadTypedDict]
    r"""Optional payload for the job"""
    updated_at: NotRequired[str]
    r"""Updated time of the notification"""
    schedule_extensions_count: NotRequired[float]
    r"""The number of times the digest/delay job has been extended to align with the subscribers schedule"""


class ActivityNotificationJobResponseDto(BaseModel):
    id: Annotated[str, pydantic.Field(alias="_id")]
    r"""Unique identifier of the job"""

    type: ActivityNotificationJobResponseDtoType
    r"""Type of the job"""

    execution_details: Annotated[
        List[ActivityNotificationExecutionDetailResponseDto],
        pydantic.Field(alias="executionDetails"),
    ]
    r"""Execution details of the job"""

    step: ActivityNotificationStepResponseDto
    r"""Step details of the job"""

    provider_id: Annotated[ProvidersIDEnum, pydantic.Field(alias="providerId")]
    r"""Provider ID of the job"""

    status: str
    r"""Status of the job"""

    digest: Optional[DigestMetadataDto] = None
    r"""Optional digest for the job, including metadata and events"""

    overrides: Optional[Dict[str, Any]] = None
    r"""Optional context object for additional error details."""

    payload: Optional[ActivityNotificationJobResponseDtoPayload] = None
    r"""Optional payload for the job"""

    updated_at: Annotated[Optional[str], pydantic.Field(alias="updatedAt")] = None
    r"""Updated time of the notification"""

    schedule_extensions_count: Annotated[
        Optional[float], pydantic.Field(alias="scheduleExtensionsCount")
    ] = None
    r"""The number of times the digest/delay job has been extended to align with the subscribers schedule"""
