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

from __future__ import annotations
from .listchannelendpointsresponsedto import (
    ListChannelEndpointsResponseDto,
    ListChannelEndpointsResponseDtoTypedDict,
)
from .providersidenum import ProvidersIDEnum
from enum import Enum
from novu_py.types import BaseModel
from novu_py.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
import pydantic
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ChannelEndpointsControllerListChannelEndpointsQueryParamOrderDirection(str, Enum):
    r"""Direction of sorting"""

    ASC = "ASC"
    DESC = "DESC"


class ChannelEndpointsControllerListChannelEndpointsQueryParamChannel(str, Enum):
    r"""Channel type to filter results."""

    IN_APP = "in_app"
    EMAIL = "email"
    SMS = "sms"
    CHAT = "chat"
    PUSH = "push"


class ChannelEndpointsControllerListChannelEndpointsRequestTypedDict(TypedDict):
    after: NotRequired[str]
    r"""Cursor for pagination indicating the starting point after which to fetch results."""
    before: NotRequired[str]
    r"""Cursor for pagination indicating the ending point before which to fetch results."""
    limit: NotRequired[float]
    r"""Limit the number of items to return (max 100)"""
    order_direction: NotRequired[
        ChannelEndpointsControllerListChannelEndpointsQueryParamOrderDirection
    ]
    r"""Direction of sorting"""
    order_by: NotRequired[str]
    r"""Field to order by"""
    include_cursor: NotRequired[bool]
    r"""Include cursor item in response"""
    subscriber_id: NotRequired[str]
    r"""The subscriber ID to filter results by"""
    context_keys: NotRequired[List[str]]
    r"""Filter by exact context keys, order insensitive (format: \"type:id\")"""
    channel: NotRequired[
        ChannelEndpointsControllerListChannelEndpointsQueryParamChannel
    ]
    r"""Channel type to filter results."""
    provider_id: NotRequired[ProvidersIDEnum]
    r"""Filter by provider identifier (e.g., sendgrid, twilio, slack, etc.)."""
    integration_identifier: NotRequired[str]
    r"""Integration identifier to filter results."""
    connection_identifier: NotRequired[str]
    r"""Connection identifier to filter results."""
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class ChannelEndpointsControllerListChannelEndpointsRequest(BaseModel):
    after: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Cursor for pagination indicating the starting point after which to fetch results."""

    before: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Cursor for pagination indicating the ending point before which to fetch results."""

    limit: Annotated[
        Optional[float],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Limit the number of items to return (max 100)"""

    order_direction: Annotated[
        Optional[
            ChannelEndpointsControllerListChannelEndpointsQueryParamOrderDirection
        ],
        pydantic.Field(alias="orderDirection"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Direction of sorting"""

    order_by: Annotated[
        Optional[str],
        pydantic.Field(alias="orderBy"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Field to order by"""

    include_cursor: Annotated[
        Optional[bool],
        pydantic.Field(alias="includeCursor"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Include cursor item in response"""

    subscriber_id: Annotated[
        Optional[str],
        pydantic.Field(alias="subscriberId"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""The subscriber ID to filter results by"""

    context_keys: Annotated[
        Optional[List[str]],
        pydantic.Field(alias="contextKeys"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Filter by exact context keys, order insensitive (format: \"type:id\")"""

    channel: Annotated[
        Optional[ChannelEndpointsControllerListChannelEndpointsQueryParamChannel],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Channel type to filter results."""

    provider_id: Annotated[
        Optional[ProvidersIDEnum],
        pydantic.Field(alias="providerId"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Filter by provider identifier (e.g., sendgrid, twilio, slack, etc.)."""

    integration_identifier: Annotated[
        Optional[str],
        pydantic.Field(alias="integrationIdentifier"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Integration identifier to filter results."""

    connection_identifier: Annotated[
        Optional[str],
        pydantic.Field(alias="connectionIdentifier"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Connection identifier to filter results."""

    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 ChannelEndpointsControllerListChannelEndpointsResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: ListChannelEndpointsResponseDtoTypedDict


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

    result: ListChannelEndpointsResponseDto
