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

from __future__ import annotations
from .directionenum import DirectionEnum
from .listworkflowresponse import ListWorkflowResponse, ListWorkflowResponseTypedDict
from .workflowresponsedtosortfield import WorkflowResponseDtoSortField
from .workflowstatusenum import WorkflowStatusEnum
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 WorkflowControllerSearchWorkflowsRequestTypedDict(TypedDict):
    limit: NotRequired[float]
    r"""Number of items to return per page"""
    offset: NotRequired[float]
    r"""Number of items to skip before starting to return results"""
    order_direction: NotRequired[DirectionEnum]
    r"""Direction of sorting"""
    order_by: NotRequired[WorkflowResponseDtoSortField]
    r"""Field to sort the results by"""
    query: NotRequired[str]
    r"""Search query to filter workflows"""
    tags: NotRequired[List[str]]
    r"""Filter workflows by tags"""
    status: NotRequired[List[WorkflowStatusEnum]]
    r"""Filter workflows by status"""
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class WorkflowControllerSearchWorkflowsRequest(BaseModel):
    limit: Annotated[
        Optional[float],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Number of items to return per page"""

    offset: Annotated[
        Optional[float],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Number of items to skip before starting to return results"""

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

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

    query: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Search query to filter workflows"""

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

    status: Annotated[
        Optional[List[WorkflowStatusEnum]],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Filter workflows by status"""

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


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

    result: ListWorkflowResponse
