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

from __future__ import annotations
from lambdadb.types import BaseModel
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
import pydantic
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class FetchDocsRequestBodyTypedDict(TypedDict):
    ids: List[str]
    r"""A list of document IDs to fetch. Note that the maximum number of document IDs is 100."""
    consistent_read: NotRequired[bool]
    r"""If your application requires a strongly consistent read, set consistentRead to true. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value."""
    include_vectors: NotRequired[bool]
    r"""If your application need to include vector values in the response, set includeVectors to true."""


class FetchDocsRequestBody(BaseModel):
    ids: List[str]
    r"""A list of document IDs to fetch. Note that the maximum number of document IDs is 100."""

    consistent_read: Annotated[
        Optional[bool], pydantic.Field(alias="consistentRead")
    ] = False
    r"""If your application requires a strongly consistent read, set consistentRead to true. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value."""

    include_vectors: Annotated[
        Optional[bool], pydantic.Field(alias="includeVectors")
    ] = False
    r"""If your application need to include vector values in the response, set includeVectors to true."""


class FetchDocsRequestTypedDict(TypedDict):
    collection_name: str
    r"""Collection name."""
    request_body: FetchDocsRequestBodyTypedDict


class FetchDocsRequest(BaseModel):
    collection_name: Annotated[
        str,
        pydantic.Field(alias="collectionName"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]
    r"""Collection name."""

    request_body: Annotated[
        FetchDocsRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]


class FetchDocsDocTypedDict(TypedDict):
    collection: str
    doc: Dict[str, Any]


class FetchDocsDoc(BaseModel):
    collection: str

    doc: Dict[str, Any]


class FetchDocsResponseTypedDict(TypedDict):
    r"""Fetched documents."""

    total: int
    r"""Total number of documents returned."""
    took: int
    r"""Elapsed time in milliseconds."""
    docs: List[FetchDocsDocTypedDict]


class FetchDocsResponse(BaseModel):
    r"""Fetched documents."""

    total: int
    r"""Total number of documents returned."""

    took: int
    r"""Elapsed time in milliseconds."""

    docs: List[FetchDocsDoc]
