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

from __future__ import annotations
from .channeltypeenum import ChannelTypeEnum
from .messagesresponsedto import MessagesResponseDto, MessagesResponseDtoTypedDict
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 MessagesControllerGetMessagesRequestTypedDict(TypedDict):
    channel: NotRequired[ChannelTypeEnum]
    r"""Channel type through which the message is sent"""
    subscriber_id: NotRequired[str]
    transaction_id: NotRequired[List[str]]
    context_keys: NotRequired[List[str]]
    r"""Filter by exact context keys, order insensitive (format: \"type:id\")"""
    page: NotRequired[float]
    limit: NotRequired[float]
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class MessagesControllerGetMessagesRequest(BaseModel):
    channel: Annotated[
        Optional[ChannelTypeEnum],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Channel type through which the message is sent"""

    subscriber_id: Annotated[
        Optional[str],
        pydantic.Field(alias="subscriberId"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None

    transaction_id: Annotated[
        Optional[List[str]],
        pydantic.Field(alias="transactionId"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None

    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\")"""

    page: Annotated[
        Optional[float],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 0

    limit: Annotated[
        Optional[float],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 10

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


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

    result: MessagesResponseDto
