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

from __future__ import annotations
from .createmsteamschannelendpointdto import (
    CreateMsTeamsChannelEndpointDto,
    CreateMsTeamsChannelEndpointDtoTypedDict,
)
from .createmsteamsuserendpointdto import (
    CreateMsTeamsUserEndpointDto,
    CreateMsTeamsUserEndpointDtoTypedDict,
)
from .createphoneendpointdto import (
    CreatePhoneEndpointDto,
    CreatePhoneEndpointDtoTypedDict,
)
from .createslackchannelendpointdto import (
    CreateSlackChannelEndpointDto,
    CreateSlackChannelEndpointDtoTypedDict,
)
from .createslackuserendpointdto import (
    CreateSlackUserEndpointDto,
    CreateSlackUserEndpointDtoTypedDict,
)
from .createwebhookendpointdto import (
    CreateWebhookEndpointDto,
    CreateWebhookEndpointDtoTypedDict,
)
from .getchannelendpointresponsedto import (
    GetChannelEndpointResponseDto,
    GetChannelEndpointResponseDtoTypedDict,
)
from novu_py.types import BaseModel
from novu_py.utils import (
    FieldMetadata,
    HeaderMetadata,
    RequestMetadata,
    get_discriminator,
)
import pydantic
from pydantic import Discriminator, Tag
from typing import Dict, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


ChannelEndpointsControllerCreateChannelEndpointRequestBodyTypedDict = TypeAliasType(
    "ChannelEndpointsControllerCreateChannelEndpointRequestBodyTypedDict",
    Union[
        CreateSlackChannelEndpointDtoTypedDict,
        CreateSlackUserEndpointDtoTypedDict,
        CreateWebhookEndpointDtoTypedDict,
        CreatePhoneEndpointDtoTypedDict,
        CreateMsTeamsChannelEndpointDtoTypedDict,
        CreateMsTeamsUserEndpointDtoTypedDict,
    ],
)
r"""Channel endpoint creation request. The structure varies based on the type field."""


ChannelEndpointsControllerCreateChannelEndpointRequestBody = Annotated[
    Union[
        Annotated[CreateSlackChannelEndpointDto, Tag("slack_channel")],
        Annotated[CreateSlackUserEndpointDto, Tag("slack_user")],
        Annotated[CreateWebhookEndpointDto, Tag("webhook")],
        Annotated[CreatePhoneEndpointDto, Tag("phone")],
        Annotated[CreateMsTeamsChannelEndpointDto, Tag("ms_teams_channel")],
        Annotated[CreateMsTeamsUserEndpointDto, Tag("ms_teams_user")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""Channel endpoint creation request. The structure varies based on the type field."""


class ChannelEndpointsControllerCreateChannelEndpointRequestTypedDict(TypedDict):
    request_body: ChannelEndpointsControllerCreateChannelEndpointRequestBodyTypedDict
    r"""Channel endpoint creation request. The structure varies based on the type field."""
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class ChannelEndpointsControllerCreateChannelEndpointRequest(BaseModel):
    request_body: Annotated[
        ChannelEndpointsControllerCreateChannelEndpointRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]
    r"""Channel endpoint creation request. The structure varies based on the type field."""

    idempotency_key: Annotated[
        Optional[str],
        pydantic.Field(alias="idempotency-key"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""A header for idempotency purposes"""


class ChannelEndpointsControllerCreateChannelEndpointResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: GetChannelEndpointResponseDtoTypedDict


class ChannelEndpointsControllerCreateChannelEndpointResponse(BaseModel):
    headers: Dict[str, List[str]]

    result: GetChannelEndpointResponseDto
