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

from __future__ import annotations
from .document import Document, DocumentTypedDict
from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict
from abbyy_document_ai.types import BaseModel
from abbyy_document_ai.utils import FieldMetadata, QueryParamMetadata
import pydantic
from typing import Callable, Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ListDocumentsRequestTypedDict(TypedDict):
    cursor: NotRequired[str]
    r"""The cursor to start the list from. If not provided, the list will start from the most recent documents."""
    limit: NotRequired[int]
    r"""The number of documents to return. The maximum allowed value is 25. If not provided, the list will return up to 10 documents."""


class ListDocumentsRequest(BaseModel):
    cursor: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""The cursor to start the list from. If not provided, the list will start from the most recent documents."""

    limit: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 10
    r"""The number of documents to return. The maximum allowed value is 25. If not provided, the list will return up to 10 documents."""


class ListDocumentsResponseTypedDict(TypedDict):
    http_meta: HTTPMetadataTypedDict
    headers: Dict[str, List[str]]
    documents: NotRequired[List[DocumentTypedDict]]
    r"""Default Response"""


class ListDocumentsResponse(BaseModel):
    next: Callable[[], Optional[ListDocumentsResponse]]

    http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None

    headers: Dict[str, List[str]]

    documents: Optional[List[Document]] = None
    r"""Default Response"""
