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

from __future__ import annotations
from .emailchanneloverrides import EmailChannelOverrides, EmailChannelOverridesTypedDict
from .severitylevelenum import SeverityLevelEnum
from .stepsoverrides import StepsOverrides, StepsOverridesTypedDict
from .subscriberpayloaddto import SubscriberPayloadDto, SubscriberPayloadDtoTypedDict
from .tenantpayloaddto import TenantPayloadDto, TenantPayloadDtoTypedDict
from novu_py.types import BaseModel
import pydantic
from pydantic import ConfigDict
from typing import Any, Dict, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class TriggerEventToAllRequestDtoChannelsTypedDict(TypedDict):
    r"""Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides."""

    email: NotRequired[EmailChannelOverridesTypedDict]
    r"""Email channel specific overrides"""


class TriggerEventToAllRequestDtoChannels(BaseModel):
    r"""Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides."""

    email: Optional[EmailChannelOverrides] = None
    r"""Email channel specific overrides"""


class TriggerEventToAllRequestDtoOverridesTypedDict(TypedDict):
    r"""This could be used to override provider specific configurations"""

    steps: NotRequired[Dict[str, StepsOverridesTypedDict]]
    r"""This could be used to override provider specific configurations or layout at the step level"""
    channels: NotRequired[TriggerEventToAllRequestDtoChannelsTypedDict]
    r"""Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides."""
    providers: NotRequired[Dict[str, Dict[str, Any]]]
    r"""Overrides the provider configuration for the entire workflow and all steps"""
    email: NotRequired[Dict[str, Any]]
    r"""Override the email provider specific configurations for the entire workflow"""
    push: NotRequired[Dict[str, Any]]
    r"""Override the push provider specific configurations for the entire workflow"""
    sms: NotRequired[Dict[str, Any]]
    r"""Override the sms provider specific configurations for the entire workflow"""
    chat: NotRequired[Dict[str, Any]]
    r"""Override the chat provider specific configurations for the entire workflow"""
    layout_identifier: NotRequired[str]
    r"""Override the layout identifier for the entire workflow"""
    severity: NotRequired[SeverityLevelEnum]
    r"""Severity of the workflow"""


class TriggerEventToAllRequestDtoOverrides(BaseModel):
    r"""This could be used to override provider specific configurations"""

    model_config = ConfigDict(
        populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
    )
    __pydantic_extra__: Dict[str, Dict[str, Any]] = pydantic.Field(init=False)

    steps: Optional[Dict[str, StepsOverrides]] = None
    r"""This could be used to override provider specific configurations or layout at the step level"""

    channels: Optional[TriggerEventToAllRequestDtoChannels] = None
    r"""Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides."""

    providers: Optional[Dict[str, Dict[str, Any]]] = None
    r"""Overrides the provider configuration for the entire workflow and all steps"""

    email: Annotated[
        Optional[Dict[str, Any]],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
        ),
    ] = None
    r"""Override the email provider specific configurations for the entire workflow"""

    push: Annotated[
        Optional[Dict[str, Any]],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
        ),
    ] = None
    r"""Override the push provider specific configurations for the entire workflow"""

    sms: Annotated[
        Optional[Dict[str, Any]],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
        ),
    ] = None
    r"""Override the sms provider specific configurations for the entire workflow"""

    chat: Annotated[
        Optional[Dict[str, Any]],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
        ),
    ] = None
    r"""Override the chat provider specific configurations for the entire workflow"""

    layout_identifier: Annotated[
        Optional[str],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
            alias="layoutIdentifier",
        ),
    ] = None
    r"""Override the layout identifier for the entire workflow"""

    severity: Optional[SeverityLevelEnum] = None
    r"""Severity of the workflow"""

    @property
    def additional_properties(self):
        return self.__pydantic_extra__

    @additional_properties.setter
    def additional_properties(self, value):
        self.__pydantic_extra__ = value  # pyright: ignore[reportIncompatibleVariableOverride]


TriggerEventToAllRequestDtoActorTypedDict = TypeAliasType(
    "TriggerEventToAllRequestDtoActorTypedDict",
    Union[SubscriberPayloadDtoTypedDict, str],
)
r"""It is used to display the Avatar of the provided actor's subscriber id or actor object.
If a new actor object is provided, we will create a new subscriber in our system

"""


TriggerEventToAllRequestDtoActor = TypeAliasType(
    "TriggerEventToAllRequestDtoActor", Union[SubscriberPayloadDto, str]
)
r"""It is used to display the Avatar of the provided actor's subscriber id or actor object.
If a new actor object is provided, we will create a new subscriber in our system

"""


TriggerEventToAllRequestDtoTenantTypedDict = TypeAliasType(
    "TriggerEventToAllRequestDtoTenantTypedDict", Union[TenantPayloadDtoTypedDict, str]
)
r"""It is used to specify a tenant context during trigger event.
If a new tenant object is provided, we will create a new tenant.

"""


TriggerEventToAllRequestDtoTenant = TypeAliasType(
    "TriggerEventToAllRequestDtoTenant", Union[TenantPayloadDto, str]
)
r"""It is used to specify a tenant context during trigger event.
If a new tenant object is provided, we will create a new tenant.

"""


class TriggerEventToAllRequestDtoContext2TypedDict(TypedDict):
    r"""Rich context object with id and optional data"""

    id: str
    data: NotRequired[Dict[str, Any]]
    r"""Optional additional context data"""


class TriggerEventToAllRequestDtoContext2(BaseModel):
    r"""Rich context object with id and optional data"""

    id: str

    data: Optional[Dict[str, Any]] = None
    r"""Optional additional context data"""


TriggerEventToAllRequestDtoContextTypedDict = TypeAliasType(
    "TriggerEventToAllRequestDtoContextTypedDict",
    Union[TriggerEventToAllRequestDtoContext2TypedDict, str],
)


TriggerEventToAllRequestDtoContext = TypeAliasType(
    "TriggerEventToAllRequestDtoContext",
    Union[TriggerEventToAllRequestDtoContext2, str],
)


class TriggerEventToAllRequestDtoTypedDict(TypedDict):
    name: str
    r"""The trigger identifier associated for the template you wish to send. This identifier can be found on the template page."""
    payload: Dict[str, Any]
    r"""The payload object is used to pass additional information that
    could be used to render the template, or perform routing rules based on it.
    For In-App channel, payload data are also available in <Inbox />
    """
    overrides: NotRequired[TriggerEventToAllRequestDtoOverridesTypedDict]
    r"""This could be used to override provider specific configurations"""
    transaction_id: NotRequired[str]
    r"""A unique identifier for this transaction, we will generated a UUID if not provided."""
    actor: NotRequired[TriggerEventToAllRequestDtoActorTypedDict]
    r"""It is used to display the Avatar of the provided actor's subscriber id or actor object.
    If a new actor object is provided, we will create a new subscriber in our system

    """
    tenant: NotRequired[TriggerEventToAllRequestDtoTenantTypedDict]
    r"""It is used to specify a tenant context during trigger event.
    If a new tenant object is provided, we will create a new tenant.

    """
    context: NotRequired[Dict[str, TriggerEventToAllRequestDtoContextTypedDict]]


class TriggerEventToAllRequestDto(BaseModel):
    name: str
    r"""The trigger identifier associated for the template you wish to send. This identifier can be found on the template page."""

    payload: Dict[str, Any]
    r"""The payload object is used to pass additional information that
    could be used to render the template, or perform routing rules based on it.
    For In-App channel, payload data are also available in <Inbox />
    """

    overrides: Optional[TriggerEventToAllRequestDtoOverrides] = None
    r"""This could be used to override provider specific configurations"""

    transaction_id: Annotated[Optional[str], pydantic.Field(alias="transactionId")] = (
        None
    )
    r"""A unique identifier for this transaction, we will generated a UUID if not provided."""

    actor: Optional[TriggerEventToAllRequestDtoActor] = None
    r"""It is used to display the Avatar of the provided actor's subscriber id or actor object.
    If a new actor object is provided, we will create a new subscriber in our system

    """

    tenant: Optional[TriggerEventToAllRequestDtoTenant] = None
    r"""It is used to specify a tenant context during trigger event.
    If a new tenant object is provided, we will create a new tenant.

    """

    context: Optional[Dict[str, TriggerEventToAllRequestDtoContext]] = None
