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

from __future__ import annotations
from .authdto import AuthDto, AuthDtoTypedDict
from .workspacedto import WorkspaceDto, WorkspaceDtoTypedDict
from novu_py.types import BaseModel
import pydantic
from typing import Any, Dict, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


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

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


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

    id: str

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


ContextTypedDict = TypeAliasType("ContextTypedDict", Union[TwoTypedDict, str])


Context = TypeAliasType("Context", Union[Two, str])


class CreateChannelConnectionRequestDtoTypedDict(TypedDict):
    integration_identifier: str
    r"""The identifier of the integration to use for this channel connection."""
    workspace: WorkspaceDtoTypedDict
    auth: AuthDtoTypedDict
    identifier: NotRequired[str]
    r"""The unique identifier for the channel connection. If not provided, one will be generated automatically."""
    subscriber_id: NotRequired[str]
    r"""The subscriber ID to link the channel connection to"""
    context: NotRequired[Dict[str, ContextTypedDict]]


class CreateChannelConnectionRequestDto(BaseModel):
    integration_identifier: Annotated[
        str, pydantic.Field(alias="integrationIdentifier")
    ]
    r"""The identifier of the integration to use for this channel connection."""

    workspace: WorkspaceDto

    auth: AuthDto

    identifier: Optional[str] = None
    r"""The unique identifier for the channel connection. If not provided, one will be generated automatically."""

    subscriber_id: Annotated[Optional[str], pydantic.Field(alias="subscriberId")] = None
    r"""The subscriber ID to link the channel connection to"""

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