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

from typing import TYPE_CHECKING
from importlib import import_module
import builtins
import sys

if TYPE_CHECKING:
    from .bulkupsertdocsop import (
        BulkUpsertDocsRequest,
        BulkUpsertDocsRequestBody,
        BulkUpsertDocsRequestBodyTypedDict,
        BulkUpsertDocsRequestTypedDict,
    )
    from .collectionresponse import CollectionResponse, CollectionResponseTypedDict
    from .createcollectionop import (
        CreateCollectionRequest,
        CreateCollectionRequestTypedDict,
        CreateCollectionResponse,
        CreateCollectionResponseTypedDict,
    )
    from .deletecollectionop import (
        DeleteCollectionRequest,
        DeleteCollectionRequestTypedDict,
    )
    from .deletedocsop import (
        DeleteDocsRequest,
        DeleteDocsRequestBody,
        DeleteDocsRequestBodyTypedDict,
        DeleteDocsRequestTypedDict,
    )
    from .fetchdocsop import (
        FetchDocsDoc,
        FetchDocsDocTypedDict,
        FetchDocsRequest,
        FetchDocsRequestBody,
        FetchDocsRequestBodyTypedDict,
        FetchDocsRequestTypedDict,
        FetchDocsResponse,
        FetchDocsResponseTypedDict,
    )
    from .fieldsselector_union import (
        FieldsSelector1,
        FieldsSelector1TypedDict,
        FieldsSelector2,
        FieldsSelector2TypedDict,
        FieldsSelectorUnion,
        FieldsSelectorUnionTypedDict,
    )
    from .getbulkupsertdocsop import (
        GetBulkUpsertDocsRequest,
        GetBulkUpsertDocsRequestTypedDict,
        GetBulkUpsertDocsResponse,
        GetBulkUpsertDocsResponseTypedDict,
        GetBulkUpsertDocsType,
        HTTPMethod,
    )
    from .getcollectionop import (
        GetCollectionRequest,
        GetCollectionRequestTypedDict,
        GetCollectionResponse,
        GetCollectionResponseTypedDict,
    )
    from .indexconfigs_union import (
        Analyzer,
        IndexConfigs,
        IndexConfigsObject,
        IndexConfigsObjectTypedDict,
        IndexConfigsText,
        IndexConfigsTextTypedDict,
        IndexConfigsTypedDict,
        IndexConfigsUnion,
        IndexConfigsUnionTypedDict,
        IndexConfigsVector,
        IndexConfigsVectorTypedDict,
        Similarity,
        Type,
        TypeObject,
        TypeText,
        TypeVector,
    )
    from .listcollectionsop import (
        ListCollectionsResponse,
        ListCollectionsResponseTypedDict,
    )
    from .listdocsop import (
        ListDocsRequest,
        ListDocsRequestTypedDict,
        ListDocsResponse,
        ListDocsResponseTypedDict,
    )
    from .messageresponse import MessageResponse, MessageResponseTypedDict
    from .partitionconfig import DataType, PartitionConfig, PartitionConfigTypedDict
    from .partitionfilter import PartitionFilter, PartitionFilterTypedDict
    from .querycollectionop import (
        QueryCollectionDoc,
        QueryCollectionDocTypedDict,
        QueryCollectionRequest,
        QueryCollectionRequestBody,
        QueryCollectionRequestBodyTypedDict,
        QueryCollectionRequestTypedDict,
        QueryCollectionResponse,
        QueryCollectionResponseTypedDict,
    )
    from .security import Security, SecurityTypedDict
    from .status import Status
    from .updatecollectionop import (
        UpdateCollectionRequest,
        UpdateCollectionRequestBody,
        UpdateCollectionRequestBodyTypedDict,
        UpdateCollectionRequestTypedDict,
        UpdateCollectionResponse,
        UpdateCollectionResponseTypedDict,
    )
    from .updatedocsop import (
        UpdateDocsRequest,
        UpdateDocsRequestBody,
        UpdateDocsRequestBodyTypedDict,
        UpdateDocsRequestTypedDict,
    )
    from .upsertdocsop import (
        UpsertDocsRequest,
        UpsertDocsRequestBody,
        UpsertDocsRequestBodyTypedDict,
        UpsertDocsRequestTypedDict,
    )

__all__ = [
    "Analyzer",
    "BulkUpsertDocsRequest",
    "BulkUpsertDocsRequestBody",
    "BulkUpsertDocsRequestBodyTypedDict",
    "BulkUpsertDocsRequestTypedDict",
    "CollectionResponse",
    "CollectionResponseTypedDict",
    "CreateCollectionRequest",
    "CreateCollectionRequestTypedDict",
    "CreateCollectionResponse",
    "CreateCollectionResponseTypedDict",
    "DataType",
    "DeleteCollectionRequest",
    "DeleteCollectionRequestTypedDict",
    "DeleteDocsRequest",
    "DeleteDocsRequestBody",
    "DeleteDocsRequestBodyTypedDict",
    "DeleteDocsRequestTypedDict",
    "FetchDocsDoc",
    "FetchDocsDocTypedDict",
    "FetchDocsRequest",
    "FetchDocsRequestBody",
    "FetchDocsRequestBodyTypedDict",
    "FetchDocsRequestTypedDict",
    "FetchDocsResponse",
    "FetchDocsResponseTypedDict",
    "FieldsSelector1",
    "FieldsSelector1TypedDict",
    "FieldsSelector2",
    "FieldsSelector2TypedDict",
    "FieldsSelectorUnion",
    "FieldsSelectorUnionTypedDict",
    "GetBulkUpsertDocsRequest",
    "GetBulkUpsertDocsRequestTypedDict",
    "GetBulkUpsertDocsResponse",
    "GetBulkUpsertDocsResponseTypedDict",
    "GetBulkUpsertDocsType",
    "GetCollectionRequest",
    "GetCollectionRequestTypedDict",
    "GetCollectionResponse",
    "GetCollectionResponseTypedDict",
    "HTTPMethod",
    "IndexConfigs",
    "IndexConfigsObject",
    "IndexConfigsObjectTypedDict",
    "IndexConfigsText",
    "IndexConfigsTextTypedDict",
    "IndexConfigsTypedDict",
    "IndexConfigsUnion",
    "IndexConfigsUnionTypedDict",
    "IndexConfigsVector",
    "IndexConfigsVectorTypedDict",
    "ListCollectionsResponse",
    "ListCollectionsResponseTypedDict",
    "ListDocsRequest",
    "ListDocsRequestTypedDict",
    "ListDocsResponse",
    "ListDocsResponseTypedDict",
    "MessageResponse",
    "MessageResponseTypedDict",
    "PartitionConfig",
    "PartitionConfigTypedDict",
    "PartitionFilter",
    "PartitionFilterTypedDict",
    "QueryCollectionDoc",
    "QueryCollectionDocTypedDict",
    "QueryCollectionRequest",
    "QueryCollectionRequestBody",
    "QueryCollectionRequestBodyTypedDict",
    "QueryCollectionRequestTypedDict",
    "QueryCollectionResponse",
    "QueryCollectionResponseTypedDict",
    "Security",
    "SecurityTypedDict",
    "Similarity",
    "Status",
    "Type",
    "TypeObject",
    "TypeText",
    "TypeVector",
    "UpdateCollectionRequest",
    "UpdateCollectionRequestBody",
    "UpdateCollectionRequestBodyTypedDict",
    "UpdateCollectionRequestTypedDict",
    "UpdateCollectionResponse",
    "UpdateCollectionResponseTypedDict",
    "UpdateDocsRequest",
    "UpdateDocsRequestBody",
    "UpdateDocsRequestBodyTypedDict",
    "UpdateDocsRequestTypedDict",
    "UpsertDocsRequest",
    "UpsertDocsRequestBody",
    "UpsertDocsRequestBodyTypedDict",
    "UpsertDocsRequestTypedDict",
]

_dynamic_imports: dict[str, str] = {
    "BulkUpsertDocsRequest": ".bulkupsertdocsop",
    "BulkUpsertDocsRequestBody": ".bulkupsertdocsop",
    "BulkUpsertDocsRequestBodyTypedDict": ".bulkupsertdocsop",
    "BulkUpsertDocsRequestTypedDict": ".bulkupsertdocsop",
    "CollectionResponse": ".collectionresponse",
    "CollectionResponseTypedDict": ".collectionresponse",
    "CreateCollectionRequest": ".createcollectionop",
    "CreateCollectionRequestTypedDict": ".createcollectionop",
    "CreateCollectionResponse": ".createcollectionop",
    "CreateCollectionResponseTypedDict": ".createcollectionop",
    "DeleteCollectionRequest": ".deletecollectionop",
    "DeleteCollectionRequestTypedDict": ".deletecollectionop",
    "DeleteDocsRequest": ".deletedocsop",
    "DeleteDocsRequestBody": ".deletedocsop",
    "DeleteDocsRequestBodyTypedDict": ".deletedocsop",
    "DeleteDocsRequestTypedDict": ".deletedocsop",
    "FetchDocsDoc": ".fetchdocsop",
    "FetchDocsDocTypedDict": ".fetchdocsop",
    "FetchDocsRequest": ".fetchdocsop",
    "FetchDocsRequestBody": ".fetchdocsop",
    "FetchDocsRequestBodyTypedDict": ".fetchdocsop",
    "FetchDocsRequestTypedDict": ".fetchdocsop",
    "FetchDocsResponse": ".fetchdocsop",
    "FetchDocsResponseTypedDict": ".fetchdocsop",
    "FieldsSelector1": ".fieldsselector_union",
    "FieldsSelector1TypedDict": ".fieldsselector_union",
    "FieldsSelector2": ".fieldsselector_union",
    "FieldsSelector2TypedDict": ".fieldsselector_union",
    "FieldsSelectorUnion": ".fieldsselector_union",
    "FieldsSelectorUnionTypedDict": ".fieldsselector_union",
    "GetBulkUpsertDocsRequest": ".getbulkupsertdocsop",
    "GetBulkUpsertDocsRequestTypedDict": ".getbulkupsertdocsop",
    "GetBulkUpsertDocsResponse": ".getbulkupsertdocsop",
    "GetBulkUpsertDocsResponseTypedDict": ".getbulkupsertdocsop",
    "GetBulkUpsertDocsType": ".getbulkupsertdocsop",
    "HTTPMethod": ".getbulkupsertdocsop",
    "GetCollectionRequest": ".getcollectionop",
    "GetCollectionRequestTypedDict": ".getcollectionop",
    "GetCollectionResponse": ".getcollectionop",
    "GetCollectionResponseTypedDict": ".getcollectionop",
    "Analyzer": ".indexconfigs_union",
    "IndexConfigs": ".indexconfigs_union",
    "IndexConfigsObject": ".indexconfigs_union",
    "IndexConfigsObjectTypedDict": ".indexconfigs_union",
    "IndexConfigsText": ".indexconfigs_union",
    "IndexConfigsTextTypedDict": ".indexconfigs_union",
    "IndexConfigsTypedDict": ".indexconfigs_union",
    "IndexConfigsUnion": ".indexconfigs_union",
    "IndexConfigsUnionTypedDict": ".indexconfigs_union",
    "IndexConfigsVector": ".indexconfigs_union",
    "IndexConfigsVectorTypedDict": ".indexconfigs_union",
    "Similarity": ".indexconfigs_union",
    "Type": ".indexconfigs_union",
    "TypeObject": ".indexconfigs_union",
    "TypeText": ".indexconfigs_union",
    "TypeVector": ".indexconfigs_union",
    "ListCollectionsResponse": ".listcollectionsop",
    "ListCollectionsResponseTypedDict": ".listcollectionsop",
    "ListDocsRequest": ".listdocsop",
    "ListDocsRequestTypedDict": ".listdocsop",
    "ListDocsResponse": ".listdocsop",
    "ListDocsResponseTypedDict": ".listdocsop",
    "MessageResponse": ".messageresponse",
    "MessageResponseTypedDict": ".messageresponse",
    "DataType": ".partitionconfig",
    "PartitionConfig": ".partitionconfig",
    "PartitionConfigTypedDict": ".partitionconfig",
    "PartitionFilter": ".partitionfilter",
    "PartitionFilterTypedDict": ".partitionfilter",
    "QueryCollectionDoc": ".querycollectionop",
    "QueryCollectionDocTypedDict": ".querycollectionop",
    "QueryCollectionRequest": ".querycollectionop",
    "QueryCollectionRequestBody": ".querycollectionop",
    "QueryCollectionRequestBodyTypedDict": ".querycollectionop",
    "QueryCollectionRequestTypedDict": ".querycollectionop",
    "QueryCollectionResponse": ".querycollectionop",
    "QueryCollectionResponseTypedDict": ".querycollectionop",
    "Security": ".security",
    "SecurityTypedDict": ".security",
    "Status": ".status",
    "UpdateCollectionRequest": ".updatecollectionop",
    "UpdateCollectionRequestBody": ".updatecollectionop",
    "UpdateCollectionRequestBodyTypedDict": ".updatecollectionop",
    "UpdateCollectionRequestTypedDict": ".updatecollectionop",
    "UpdateCollectionResponse": ".updatecollectionop",
    "UpdateCollectionResponseTypedDict": ".updatecollectionop",
    "UpdateDocsRequest": ".updatedocsop",
    "UpdateDocsRequestBody": ".updatedocsop",
    "UpdateDocsRequestBodyTypedDict": ".updatedocsop",
    "UpdateDocsRequestTypedDict": ".updatedocsop",
    "UpsertDocsRequest": ".upsertdocsop",
    "UpsertDocsRequestBody": ".upsertdocsop",
    "UpsertDocsRequestBodyTypedDict": ".upsertdocsop",
    "UpsertDocsRequestTypedDict": ".upsertdocsop",
}


def dynamic_import(modname, retries=3):
    for attempt in range(retries):
        try:
            return import_module(modname, __package__)
        except KeyError:
            # Clear any half-initialized module and retry
            sys.modules.pop(modname, None)
            if attempt == retries - 1:
                break
    raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")


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 = dynamic_import(module_name)
        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 = builtins.list(_dynamic_imports.keys())
    return builtins.sorted(lazy_attrs)
