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

from __future__ import annotations
from .listtopicsubscriptionsresponsedto import (
    ListTopicSubscriptionsResponseDto,
    ListTopicSubscriptionsResponseDtoTypedDict,
)
from enum import Enum
from novu_py.types import BaseModel
from novu_py.utils import (
    FieldMetadata,
    HeaderMetadata,
    PathParamMetadata,
    QueryParamMetadata,
)
import pydantic
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


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

    ASC = "ASC"
    DESC = "DESC"


class SubscribersControllerListSubscriberTopicsRequestTypedDict(TypedDict):
    subscriber_id: str
    r"""The identifier of the subscriber"""
    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[
        SubscribersControllerListSubscriberTopicsQueryParamOrderDirection
    ]
    r"""Direction of sorting"""
    order_by: NotRequired[str]
    r"""Field to order by"""
    include_cursor: NotRequired[bool]
    r"""Include cursor item in response"""
    key: NotRequired[str]
    r"""Filter by topic key"""
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class SubscribersControllerListSubscriberTopicsRequest(BaseModel):
    subscriber_id: Annotated[
        str,
        pydantic.Field(alias="subscriberId"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]
    r"""The identifier of the subscriber"""

    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[SubscribersControllerListSubscriberTopicsQueryParamOrderDirection],
        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"""

    key: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Filter by topic key"""

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


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

    result: ListTopicSubscriptionsResponseDto
