"""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 .canonicaltoolattributes import (
        CanonicalToolAttributes,
        CanonicalToolAttributesTypedDict,
    )
    from .environment import Environment, EnvironmentTypedDict
    from .environmententry import EnvironmentEntry, EnvironmentEntryTypedDict
    from .getinstanceop import (
        GetInstanceRequest,
        GetInstanceRequestTypedDict,
        GetInstanceSecurity,
        GetInstanceSecurityOption1,
        GetInstanceSecurityOption1TypedDict,
        GetInstanceSecurityOption2,
        GetInstanceSecurityOption2TypedDict,
        GetInstanceSecurityTypedDict,
    )
    from .getinstanceresult import GetInstanceResult, GetInstanceResultTypedDict
    from .getprompttemplateresult import (
        GetPromptTemplateResult,
        GetPromptTemplateResultTypedDict,
    )
    from .gettemplateop import (
        GetTemplateRequest,
        GetTemplateRequestTypedDict,
        GetTemplateSecurity,
        GetTemplateSecurityOption1,
        GetTemplateSecurityOption1TypedDict,
        GetTemplateSecurityOption2,
        GetTemplateSecurityOption2TypedDict,
        GetTemplateSecurityTypedDict,
    )
    from .httptooldefinition import HTTPToolDefinition, HTTPToolDefinitionTypedDict
    from .prompttemplate import Engine, Kind, PromptTemplate, PromptTemplateTypedDict
    from .rendertemplateop import (
        RenderTemplateRequest,
        RenderTemplateRequestTypedDict,
        RenderTemplateSecurity,
        RenderTemplateSecurityOption1,
        RenderTemplateSecurityOption1TypedDict,
        RenderTemplateSecurityOption2,
        RenderTemplateSecurityOption2TypedDict,
        RenderTemplateSecurityTypedDict,
    )
    from .rendertemplaterequestbody import (
        RenderTemplateRequestBody,
        RenderTemplateRequestBodyTypedDict,
    )
    from .rendertemplateresult import (
        RenderTemplateResult,
        RenderTemplateResultTypedDict,
    )
    from .serviceerror import ServiceError, ServiceErrorData
    from .toolvariation import ToolVariation, ToolVariationTypedDict

__all__ = [
    "APIError",
    "CanonicalToolAttributes",
    "CanonicalToolAttributesTypedDict",
    "Engine",
    "Environment",
    "EnvironmentEntry",
    "EnvironmentEntryTypedDict",
    "EnvironmentTypedDict",
    "GetInstanceRequest",
    "GetInstanceRequestTypedDict",
    "GetInstanceResult",
    "GetInstanceResultTypedDict",
    "GetInstanceSecurity",
    "GetInstanceSecurityOption1",
    "GetInstanceSecurityOption1TypedDict",
    "GetInstanceSecurityOption2",
    "GetInstanceSecurityOption2TypedDict",
    "GetInstanceSecurityTypedDict",
    "GetPromptTemplateResult",
    "GetPromptTemplateResultTypedDict",
    "GetTemplateRequest",
    "GetTemplateRequestTypedDict",
    "GetTemplateSecurity",
    "GetTemplateSecurityOption1",
    "GetTemplateSecurityOption1TypedDict",
    "GetTemplateSecurityOption2",
    "GetTemplateSecurityOption2TypedDict",
    "GetTemplateSecurityTypedDict",
    "HTTPToolDefinition",
    "HTTPToolDefinitionTypedDict",
    "Kind",
    "PromptTemplate",
    "PromptTemplateTypedDict",
    "RenderTemplateRequest",
    "RenderTemplateRequestBody",
    "RenderTemplateRequestBodyTypedDict",
    "RenderTemplateRequestTypedDict",
    "RenderTemplateResult",
    "RenderTemplateResultTypedDict",
    "RenderTemplateSecurity",
    "RenderTemplateSecurityOption1",
    "RenderTemplateSecurityOption1TypedDict",
    "RenderTemplateSecurityOption2",
    "RenderTemplateSecurityOption2TypedDict",
    "RenderTemplateSecurityTypedDict",
    "ServiceError",
    "ServiceErrorData",
    "ToolVariation",
    "ToolVariationTypedDict",
]

_dynamic_imports: dict[str, str] = {
    "APIError": ".apierror",
    "CanonicalToolAttributes": ".canonicaltoolattributes",
    "CanonicalToolAttributesTypedDict": ".canonicaltoolattributes",
    "Environment": ".environment",
    "EnvironmentTypedDict": ".environment",
    "EnvironmentEntry": ".environmententry",
    "EnvironmentEntryTypedDict": ".environmententry",
    "GetInstanceRequest": ".getinstanceop",
    "GetInstanceRequestTypedDict": ".getinstanceop",
    "GetInstanceSecurity": ".getinstanceop",
    "GetInstanceSecurityOption1": ".getinstanceop",
    "GetInstanceSecurityOption1TypedDict": ".getinstanceop",
    "GetInstanceSecurityOption2": ".getinstanceop",
    "GetInstanceSecurityOption2TypedDict": ".getinstanceop",
    "GetInstanceSecurityTypedDict": ".getinstanceop",
    "GetInstanceResult": ".getinstanceresult",
    "GetInstanceResultTypedDict": ".getinstanceresult",
    "GetPromptTemplateResult": ".getprompttemplateresult",
    "GetPromptTemplateResultTypedDict": ".getprompttemplateresult",
    "GetTemplateRequest": ".gettemplateop",
    "GetTemplateRequestTypedDict": ".gettemplateop",
    "GetTemplateSecurity": ".gettemplateop",
    "GetTemplateSecurityOption1": ".gettemplateop",
    "GetTemplateSecurityOption1TypedDict": ".gettemplateop",
    "GetTemplateSecurityOption2": ".gettemplateop",
    "GetTemplateSecurityOption2TypedDict": ".gettemplateop",
    "GetTemplateSecurityTypedDict": ".gettemplateop",
    "HTTPToolDefinition": ".httptooldefinition",
    "HTTPToolDefinitionTypedDict": ".httptooldefinition",
    "Engine": ".prompttemplate",
    "Kind": ".prompttemplate",
    "PromptTemplate": ".prompttemplate",
    "PromptTemplateTypedDict": ".prompttemplate",
    "RenderTemplateRequest": ".rendertemplateop",
    "RenderTemplateRequestTypedDict": ".rendertemplateop",
    "RenderTemplateSecurity": ".rendertemplateop",
    "RenderTemplateSecurityOption1": ".rendertemplateop",
    "RenderTemplateSecurityOption1TypedDict": ".rendertemplateop",
    "RenderTemplateSecurityOption2": ".rendertemplateop",
    "RenderTemplateSecurityOption2TypedDict": ".rendertemplateop",
    "RenderTemplateSecurityTypedDict": ".rendertemplateop",
    "RenderTemplateRequestBody": ".rendertemplaterequestbody",
    "RenderTemplateRequestBodyTypedDict": ".rendertemplaterequestbody",
    "RenderTemplateResult": ".rendertemplateresult",
    "RenderTemplateResultTypedDict": ".rendertemplateresult",
    "ServiceError": ".serviceerror",
    "ServiceErrorData": ".serviceerror",
    "ToolVariation": ".toolvariation",
    "ToolVariationTypedDict": ".toolvariation",
}


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)
