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

from __future__ import annotations
from .listsubscribersresponsedto import (
    ListSubscribersResponseDto,
    ListSubscribersResponseDtoTypedDict,
)
from enum import Enum
from novu_py.types import BaseModel
from novu_py.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
import pydantic
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class OrderDirection(str, Enum):
    ASC = "ASC"
    DESC = "DESC"


class SubscribersControllerSearchSubscribersRequestTypedDict(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."""
    email: NotRequired[str]
    r"""Email address of the subscriber to filter results."""
    name: NotRequired[str]
    r"""Name of the subscriber to filter results."""
    phone: NotRequired[str]
    r"""Phone number of the subscriber to filter results."""
    subscriber_id: NotRequired[str]
    r"""Unique identifier of the subscriber to filter results."""
    limit: NotRequired[float]
    order_direction: NotRequired[OrderDirection]
    order_by: NotRequired[Any]
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class SubscribersControllerSearchSubscribersRequest(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."""

    email: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Email address of the subscriber to filter results."""

    name: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Name of the subscriber to filter results."""

    phone: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Phone number of the subscriber to filter results."""

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

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

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

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

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


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

    result: ListSubscribersResponseDto
