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

from __future__ import annotations
from .listcontextsresponsedto import (
    ListContextsResponseDto,
    ListContextsResponseDtoTypedDict,
)
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 OrderDirection(str, Enum):
    r"""Direction of sorting"""

    ASC = "ASC"
    DESC = "DESC"


class ContextsControllerListContextsRequestTypedDict(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"""
    order_direction: NotRequired[OrderDirection]
    r"""Direction of sorting"""
    order_by: NotRequired[str]
    r"""Field to order by"""
    include_cursor: NotRequired[bool]
    r"""Include cursor item in response"""
    id: NotRequired[str]
    r"""Filter contexts by id"""
    search: NotRequired[str]
    r"""Search contexts by type or id (supports partial matching across both fields)"""
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class ContextsControllerListContextsRequest(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"""

    order_direction: Annotated[
        Optional[OrderDirection],
        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"""

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

    search: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Search contexts by type or id (supports partial matching across both fields)"""

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


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

    result: ListContextsResponseDto
