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

from typing import TYPE_CHECKING
from importlib import import_module

if TYPE_CHECKING:
    from .apierror import APIError
    from .batchindextextrequest import (
        BatchIndexTextRequest,
        BatchIndexTextRequestTypedDict,
    )
    from .chunk import Chunk, ChunkTypedDict
    from .createindexrequest import CreateIndexRequest, CreateIndexRequestTypedDict
    from .createindexresponse import CreateIndexResponse, CreateIndexResponseTypedDict
    from .deletedocumentop import DeleteDocumentRequest, DeleteDocumentRequestTypedDict
    from .deleteindexop import DeleteIndexRequest, DeleteIndexRequestTypedDict
    from .document import Document, DocumentTypedDict
    from .documentindexedresponse import (
        DocumentIndexedResponse,
        DocumentIndexedResponseTypedDict,
    )
    from .documentretrievedresponse import (
        DocumentRetrievedResponse,
        DocumentRetrievedResponseTypedDict,
    )
    from .errorresponse import ErrorResponse, ErrorResponseData
    from .getdocumentop import GetDocumentRequest, GetDocumentRequestTypedDict
    from .getindexop import GetIndexRequest, GetIndexRequestTypedDict
    from .getindexresponse import GetIndexResponse, GetIndexResponseTypedDict
    from .index import Index, IndexTypedDict
    from .indexfile_request import (
        File,
        FileTypedDict,
        IndexFileRequest,
        IndexFileRequestTypedDict,
        Metadata,
        MetadataTypedDict,
    )
    from .indextextrequest import IndexTextRequest, IndexTextRequestTypedDict
    from .listdocument import ListDocument, ListDocumentTypedDict
    from .listdocumentsop import ListDocumentsRequest, ListDocumentsRequestTypedDict
    from .listindexesresponse import ListIndexesResponse, ListIndexesResponseTypedDict
    from .listpaginateddocumentsresponse import (
        ListPaginatedDocumentsResponse,
        ListPaginatedDocumentsResponseTypedDict,
    )
    from .retrievedocumentsrequest import (
        RetrieveDocumentsRequest,
        RetrieveDocumentsRequestTypedDict,
    )
    from .retrievedocumentsresponse import (
        RetrieveDocumentsResponse,
        RetrieveDocumentsResponseTypedDict,
    )
    from .security import Security, SecurityTypedDict

__all__ = [
    "APIError",
    "BatchIndexTextRequest",
    "BatchIndexTextRequestTypedDict",
    "Chunk",
    "ChunkTypedDict",
    "CreateIndexRequest",
    "CreateIndexRequestTypedDict",
    "CreateIndexResponse",
    "CreateIndexResponseTypedDict",
    "DeleteDocumentRequest",
    "DeleteDocumentRequestTypedDict",
    "DeleteIndexRequest",
    "DeleteIndexRequestTypedDict",
    "Document",
    "DocumentIndexedResponse",
    "DocumentIndexedResponseTypedDict",
    "DocumentRetrievedResponse",
    "DocumentRetrievedResponseTypedDict",
    "DocumentTypedDict",
    "ErrorResponse",
    "ErrorResponseData",
    "File",
    "FileTypedDict",
    "GetDocumentRequest",
    "GetDocumentRequestTypedDict",
    "GetIndexRequest",
    "GetIndexRequestTypedDict",
    "GetIndexResponse",
    "GetIndexResponseTypedDict",
    "Index",
    "IndexFileRequest",
    "IndexFileRequestTypedDict",
    "IndexTextRequest",
    "IndexTextRequestTypedDict",
    "IndexTypedDict",
    "ListDocument",
    "ListDocumentTypedDict",
    "ListDocumentsRequest",
    "ListDocumentsRequestTypedDict",
    "ListIndexesResponse",
    "ListIndexesResponseTypedDict",
    "ListPaginatedDocumentsResponse",
    "ListPaginatedDocumentsResponseTypedDict",
    "Metadata",
    "MetadataTypedDict",
    "RetrieveDocumentsRequest",
    "RetrieveDocumentsRequestTypedDict",
    "RetrieveDocumentsResponse",
    "RetrieveDocumentsResponseTypedDict",
    "Security",
    "SecurityTypedDict",
]

_dynamic_imports: dict[str, str] = {
    "APIError": ".apierror",
    "BatchIndexTextRequest": ".batchindextextrequest",
    "BatchIndexTextRequestTypedDict": ".batchindextextrequest",
    "Chunk": ".chunk",
    "ChunkTypedDict": ".chunk",
    "CreateIndexRequest": ".createindexrequest",
    "CreateIndexRequestTypedDict": ".createindexrequest",
    "CreateIndexResponse": ".createindexresponse",
    "CreateIndexResponseTypedDict": ".createindexresponse",
    "DeleteDocumentRequest": ".deletedocumentop",
    "DeleteDocumentRequestTypedDict": ".deletedocumentop",
    "DeleteIndexRequest": ".deleteindexop",
    "DeleteIndexRequestTypedDict": ".deleteindexop",
    "Document": ".document",
    "DocumentTypedDict": ".document",
    "DocumentIndexedResponse": ".documentindexedresponse",
    "DocumentIndexedResponseTypedDict": ".documentindexedresponse",
    "DocumentRetrievedResponse": ".documentretrievedresponse",
    "DocumentRetrievedResponseTypedDict": ".documentretrievedresponse",
    "ErrorResponse": ".errorresponse",
    "ErrorResponseData": ".errorresponse",
    "GetDocumentRequest": ".getdocumentop",
    "GetDocumentRequestTypedDict": ".getdocumentop",
    "GetIndexRequest": ".getindexop",
    "GetIndexRequestTypedDict": ".getindexop",
    "GetIndexResponse": ".getindexresponse",
    "GetIndexResponseTypedDict": ".getindexresponse",
    "Index": ".index",
    "IndexTypedDict": ".index",
    "File": ".indexfile_request",
    "FileTypedDict": ".indexfile_request",
    "IndexFileRequest": ".indexfile_request",
    "IndexFileRequestTypedDict": ".indexfile_request",
    "Metadata": ".indexfile_request",
    "MetadataTypedDict": ".indexfile_request",
    "IndexTextRequest": ".indextextrequest",
    "IndexTextRequestTypedDict": ".indextextrequest",
    "ListDocument": ".listdocument",
    "ListDocumentTypedDict": ".listdocument",
    "ListDocumentsRequest": ".listdocumentsop",
    "ListDocumentsRequestTypedDict": ".listdocumentsop",
    "ListIndexesResponse": ".listindexesresponse",
    "ListIndexesResponseTypedDict": ".listindexesresponse",
    "ListPaginatedDocumentsResponse": ".listpaginateddocumentsresponse",
    "ListPaginatedDocumentsResponseTypedDict": ".listpaginateddocumentsresponse",
    "RetrieveDocumentsRequest": ".retrievedocumentsrequest",
    "RetrieveDocumentsRequestTypedDict": ".retrievedocumentsrequest",
    "RetrieveDocumentsResponse": ".retrievedocumentsresponse",
    "RetrieveDocumentsResponseTypedDict": ".retrievedocumentsresponse",
    "Security": ".security",
    "SecurityTypedDict": ".security",
}


def __getattr__(attr_name: str) -> object:
    module_name = _dynamic_imports.get(attr_name)
    if module_name is None:
        raise AttributeError(
            f"No {attr_name} found in _dynamic_imports for module name -> {__name__} "
        )

    try:
        module = import_module(module_name, __package__)
        result = getattr(module, attr_name)
        return result
    except ImportError as e:
        raise ImportError(
            f"Failed to import {attr_name} from {module_name}: {e}"
        ) from e
    except AttributeError as e:
        raise AttributeError(
            f"Failed to get {attr_name} from {module_name}: {e}"
        ) from e


def __dir__():
    lazy_attrs = list(_dynamic_imports.keys())
    return sorted(lazy_attrs)
