# coding: utf-8

# flake8: noqa

"""
    Rapidata Asset API

    The API for the Rapidata Asset service

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


__version__ = "1.0.0"

# These are imported eagerly as they're commonly needed
from rapidata.api_client.api_response import ApiResponse
from rapidata.api_client.api_client import ApiClient
from rapidata.api_client.configuration import Configuration
from rapidata.api_client.exceptions import OpenApiException
from rapidata.api_client.exceptions import ApiTypeError
from rapidata.api_client.exceptions import ApiValueError
from rapidata.api_client.exceptions import ApiKeyError
from rapidata.api_client.exceptions import ApiAttributeError
from rapidata.api_client.exceptions import ApiException

# Lazy loading for APIs
_API_IMPORTS = {
    "AssetApi": "rapidata.api_client.api.asset_api",
    "AudienceApi": "rapidata.api_client.api.audience_api",
    "BatchUploadApi": "rapidata.api_client.api.batch_upload_api",
    "BenchmarkApi": "rapidata.api_client.api.benchmark_api",
    "CampaignApi": "rapidata.api_client.api.campaign_api",
    "ClientApi": "rapidata.api_client.api.client_api",
    "CompareWorkflowApi": "rapidata.api_client.api.compare_workflow_api",
    "CustomerApi": "rapidata.api_client.api.customer_api",
    "CustomerRapidApi": "rapidata.api_client.api.customer_rapid_api",
    "DatapointApi": "rapidata.api_client.api.datapoint_api",
    "DatasetApi": "rapidata.api_client.api.dataset_api",
    "EvaluationWorkflowApi": "rapidata.api_client.api.evaluation_workflow_api",
    "FeedbackApi": "rapidata.api_client.api.feedback_api",
    "FlowApi": "rapidata.api_client.api.flow_api",
    "FlowItemApi": "rapidata.api_client.api.flow_item_api",
    "GroupedRankingWorkflowApi": "rapidata.api_client.api.grouped_ranking_workflow_api",
    "IdentityApi": "rapidata.api_client.api.identity_api",
    "JobApi": "rapidata.api_client.api.job_api",
    "LeaderboardApi": "rapidata.api_client.api.leaderboard_api",
    "NewsletterApi": "rapidata.api_client.api.newsletter_api",
    "OrderApi": "rapidata.api_client.api.order_api",
    "ParticipantApi": "rapidata.api_client.api.participant_api",
    "PipelineApi": "rapidata.api_client.api.pipeline_api",
    "PromptApi": "rapidata.api_client.api.prompt_api",
    "RankingFlowApi": "rapidata.api_client.api.ranking_flow_api",
    "RankingFlowItemApi": "rapidata.api_client.api.ranking_flow_item_api",
    "RapidApi": "rapidata.api_client.api.rapid_api",
    "RapidataIdentityAPIApi": "rapidata.api_client.api.rapidata_identity_api_api",
    "RapidsApi": "rapidata.api_client.api.rapids_api",
    "SampleApi": "rapidata.api_client.api.sample_api",
    "SimpleWorkflowApi": "rapidata.api_client.api.simple_workflow_api",
    "SurveyApi": "rapidata.api_client.api.survey_api",
    "UserRapidApi": "rapidata.api_client.api.user_rapid_api",
    "ValidationSetApi": "rapidata.api_client.api.validation_set_api",
    "WorkflowApi": "rapidata.api_client.api.workflow_api",
}

# Import model mappings from the models subpackage (dynamically discovered)
from rapidata.api_client.models import _MODEL_IMPORTS

# Combine all lazy imports
_LAZY_IMPORTS = {**_API_IMPORTS, **_MODEL_IMPORTS}

# Cache for imported modules
_IMPORTED: dict[str, type] = {}


def __getattr__(name: str):
    """Lazy import handler for APIs and models."""
    if name in _IMPORTED:
        return _IMPORTED[name]

    if name in _LAZY_IMPORTS:
        module_path = _LAZY_IMPORTS[name]
        import importlib

        module = importlib.import_module(module_path)
        attr = getattr(module, name)
        _IMPORTED[name] = attr
        return attr

    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


def __dir__():
    """Return list of available attributes for autocompletion."""
    return list(globals().keys()) + list(_LAZY_IMPORTS.keys())


# For type checkers and IDE support
__all__ = (
    [
        # Core
        "__version__",
        "ApiResponse",
        "ApiClient",
        "Configuration",
        "OpenApiException",
        "ApiTypeError",
        "ApiValueError",
        "ApiKeyError",
        "ApiAttributeError",
        "ApiException",
    ]
    + list(_API_IMPORTS.keys())
    + list(_MODEL_IMPORTS.keys())
)
