# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Iterable
from typing_extensions import Required, TypedDict

__all__ = ["NotiflowRunParams", "Actor", "Recipient"]


class NotiflowRunParams(TypedDict, total=False):
    actor: Actor
    """Actor (triggering user) specification. Accessible in templates as `actor.*`."""

    data: object
    """Template variables. Accessible in notification templates as `data.*`."""

    recipients: Iterable[Recipient]
    """List of recipients.

    Each recipient must have an `external_id`. Users are auto-created if they don't
    exist.
    """

    topic: str
    """Topic name for pub/sub targeting. Cannot be used with `recipients`."""


class Actor(TypedDict, total=False):
    """Actor (triggering user) specification. Accessible in templates as `actor.*`."""

    external_id: Required[str]
    """Your system's identifier for the actor (required)"""

    avatar: str

    custom_fields: object

    email: str

    first_name: str

    last_name: str

    locale: str

    phone: str

    timezone: str


class Recipient(TypedDict, total=False):
    """Recipient specification for running a notiflow.

    Users are auto-created if they don't exist.
    """

    external_id: Required[str]
    """Your system's unique identifier for this user (required)"""

    avatar: str
    """Avatar URL"""

    custom_fields: object
    """Custom attributes"""

    email: str
    """Email address (used if user is auto-created)"""

    first_name: str
    """First name"""

    last_name: str
    """Last name"""

    locale: str
    """BCP 47 locale"""

    phone: str
    """Phone number in E.164 format"""

    timezone: str
    """IANA timezone"""
