"""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 .errorbadgateway import ErrorBADGATEWAY, ErrorBADGATEWAYData
    from .errorbadrequest import ErrorBADREQUEST, ErrorBADREQUESTData
    from .errorconflict import ErrorCONFLICT, ErrorCONFLICTData
    from .errorforbidden import ErrorFORBIDDEN, ErrorFORBIDDENData
    from .errorinternalservererror import (
        ErrorINTERNALSERVERERROR,
        ErrorINTERNALSERVERERRORData,
    )
    from .errornotfound import ErrorNOTFOUND, ErrorNOTFOUNDData
    from .errorpreconditionfailed import (
        ErrorPRECONDITIONFAILED,
        ErrorPRECONDITIONFAILEDData,
    )
    from .errorunauthorized import ErrorUNAUTHORIZED, ErrorUNAUTHORIZEDData
    from .errorunprocessablecontent import (
        ErrorUNPROCESSABLECONTENT,
        ErrorUNPROCESSABLECONTENTData,
    )
    from .no_response_error import NoResponseError
    from .responsevalidationerror import ResponseValidationError
    from .tofupiloterror import TofuPilotError

__all__ = [
    "APIError",
    "ErrorBADGATEWAY",
    "ErrorBADGATEWAYData",
    "ErrorBADREQUEST",
    "ErrorBADREQUESTData",
    "ErrorCONFLICT",
    "ErrorCONFLICTData",
    "ErrorFORBIDDEN",
    "ErrorFORBIDDENData",
    "ErrorINTERNALSERVERERROR",
    "ErrorINTERNALSERVERERRORData",
    "ErrorNOTFOUND",
    "ErrorNOTFOUNDData",
    "ErrorPRECONDITIONFAILED",
    "ErrorPRECONDITIONFAILEDData",
    "ErrorUNAUTHORIZED",
    "ErrorUNAUTHORIZEDData",
    "ErrorUNPROCESSABLECONTENT",
    "ErrorUNPROCESSABLECONTENTData",
    "NoResponseError",
    "ResponseValidationError",
    "TofuPilotError",
]

_dynamic_imports: dict[str, str] = {
    "APIError": ".apierror",
    "ErrorBADGATEWAY": ".errorbadgateway",
    "ErrorBADGATEWAYData": ".errorbadgateway",
    "ErrorBADREQUEST": ".errorbadrequest",
    "ErrorBADREQUESTData": ".errorbadrequest",
    "ErrorCONFLICT": ".errorconflict",
    "ErrorCONFLICTData": ".errorconflict",
    "ErrorFORBIDDEN": ".errorforbidden",
    "ErrorFORBIDDENData": ".errorforbidden",
    "ErrorINTERNALSERVERERROR": ".errorinternalservererror",
    "ErrorINTERNALSERVERERRORData": ".errorinternalservererror",
    "ErrorNOTFOUND": ".errornotfound",
    "ErrorNOTFOUNDData": ".errornotfound",
    "ErrorPRECONDITIONFAILED": ".errorpreconditionfailed",
    "ErrorPRECONDITIONFAILEDData": ".errorpreconditionfailed",
    "ErrorUNAUTHORIZED": ".errorunauthorized",
    "ErrorUNAUTHORIZEDData": ".errorunauthorized",
    "ErrorUNPROCESSABLECONTENT": ".errorunprocessablecontent",
    "ErrorUNPROCESSABLECONTENTData": ".errorunprocessablecontent",
    "NoResponseError": ".no_response_error",
    "ResponseValidationError": ".responsevalidationerror",
    "TofuPilotError": ".tofupiloterror",
}


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)
