# This file was auto-generated by Fern from our API Definition.

# isort: skip_file

import typing
from importlib import import_module

if typing.TYPE_CHECKING:
    from .types import (
        SpeakV2Close,
        SpeakV2Configure,
        SpeakV2ConfigureFailure,
        SpeakV2ConfigureFailureCode,
        SpeakV2ConfigureSuccess,
        SpeakV2ConfigureSuccessApplied,
        SpeakV2Connected,
        SpeakV2Error,
        SpeakV2ErrorCode,
        SpeakV2Flush,
        SpeakV2Flushed,
        SpeakV2Interrupt,
        SpeakV2InterruptPlaybackOffset,
        SpeakV2SessionMetadata,
        SpeakV2Speak,
        SpeakV2SpeechInterrupted,
        SpeakV2SpeechInterruptedMetadata,
        SpeakV2SpeechInterruptedMetadataControlsApplied,
        SpeakV2SpeechMetadata,
        SpeakV2SpeechMetadataControlsApplied,
        SpeakV2SpeechStarted,
        SpeakV2Warning,
    )
    from . import audio
    from .audio import AudioGenerateRequestCallbackMethod, AudioGenerateRequestContainer, AudioGenerateRequestEncoding
    from .requests import (
        SpeakV2CloseParams,
        SpeakV2ConfigureFailureParams,
        SpeakV2ConfigureParams,
        SpeakV2ConfigureSuccessAppliedParams,
        SpeakV2ConfigureSuccessParams,
        SpeakV2ConnectedParams,
        SpeakV2ErrorParams,
        SpeakV2FlushParams,
        SpeakV2FlushedParams,
        SpeakV2InterruptParams,
        SpeakV2InterruptPlaybackOffsetParams,
        SpeakV2SessionMetadataParams,
        SpeakV2SpeakParams,
        SpeakV2SpeechInterruptedMetadataControlsAppliedParams,
        SpeakV2SpeechInterruptedMetadataParams,
        SpeakV2SpeechInterruptedParams,
        SpeakV2SpeechMetadataControlsAppliedParams,
        SpeakV2SpeechMetadataParams,
        SpeakV2SpeechStartedParams,
        SpeakV2WarningParams,
    )
_dynamic_imports: typing.Dict[str, str] = {
    "AudioGenerateRequestCallbackMethod": ".audio",
    "AudioGenerateRequestContainer": ".audio",
    "AudioGenerateRequestEncoding": ".audio",
    "SpeakV2Close": ".types",
    "SpeakV2CloseParams": ".requests",
    "SpeakV2Configure": ".types",
    "SpeakV2ConfigureFailure": ".types",
    "SpeakV2ConfigureFailureCode": ".types",
    "SpeakV2ConfigureFailureParams": ".requests",
    "SpeakV2ConfigureParams": ".requests",
    "SpeakV2ConfigureSuccess": ".types",
    "SpeakV2ConfigureSuccessApplied": ".types",
    "SpeakV2ConfigureSuccessAppliedParams": ".requests",
    "SpeakV2ConfigureSuccessParams": ".requests",
    "SpeakV2Connected": ".types",
    "SpeakV2ConnectedParams": ".requests",
    "SpeakV2Error": ".types",
    "SpeakV2ErrorCode": ".types",
    "SpeakV2ErrorParams": ".requests",
    "SpeakV2Flush": ".types",
    "SpeakV2FlushParams": ".requests",
    "SpeakV2Flushed": ".types",
    "SpeakV2FlushedParams": ".requests",
    "SpeakV2Interrupt": ".types",
    "SpeakV2InterruptParams": ".requests",
    "SpeakV2InterruptPlaybackOffset": ".types",
    "SpeakV2InterruptPlaybackOffsetParams": ".requests",
    "SpeakV2SessionMetadata": ".types",
    "SpeakV2SessionMetadataParams": ".requests",
    "SpeakV2Speak": ".types",
    "SpeakV2SpeakParams": ".requests",
    "SpeakV2SpeechInterrupted": ".types",
    "SpeakV2SpeechInterruptedMetadata": ".types",
    "SpeakV2SpeechInterruptedMetadataControlsApplied": ".types",
    "SpeakV2SpeechInterruptedMetadataControlsAppliedParams": ".requests",
    "SpeakV2SpeechInterruptedMetadataParams": ".requests",
    "SpeakV2SpeechInterruptedParams": ".requests",
    "SpeakV2SpeechMetadata": ".types",
    "SpeakV2SpeechMetadataControlsApplied": ".types",
    "SpeakV2SpeechMetadataControlsAppliedParams": ".requests",
    "SpeakV2SpeechMetadataParams": ".requests",
    "SpeakV2SpeechStarted": ".types",
    "SpeakV2SpeechStartedParams": ".requests",
    "SpeakV2Warning": ".types",
    "SpeakV2WarningParams": ".requests",
    "audio": ".audio",
}


def __getattr__(attr_name: str) -> typing.Any:
    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__)
        if module_name == f".{attr_name}":
            return module
        else:
            return getattr(module, attr_name)
    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)


__all__ = [
    "AudioGenerateRequestCallbackMethod",
    "AudioGenerateRequestContainer",
    "AudioGenerateRequestEncoding",
    "SpeakV2Close",
    "SpeakV2CloseParams",
    "SpeakV2Configure",
    "SpeakV2ConfigureFailure",
    "SpeakV2ConfigureFailureCode",
    "SpeakV2ConfigureFailureParams",
    "SpeakV2ConfigureParams",
    "SpeakV2ConfigureSuccess",
    "SpeakV2ConfigureSuccessApplied",
    "SpeakV2ConfigureSuccessAppliedParams",
    "SpeakV2ConfigureSuccessParams",
    "SpeakV2Connected",
    "SpeakV2ConnectedParams",
    "SpeakV2Error",
    "SpeakV2ErrorCode",
    "SpeakV2ErrorParams",
    "SpeakV2Flush",
    "SpeakV2FlushParams",
    "SpeakV2Flushed",
    "SpeakV2FlushedParams",
    "SpeakV2Interrupt",
    "SpeakV2InterruptParams",
    "SpeakV2InterruptPlaybackOffset",
    "SpeakV2InterruptPlaybackOffsetParams",
    "SpeakV2SessionMetadata",
    "SpeakV2SessionMetadataParams",
    "SpeakV2Speak",
    "SpeakV2SpeakParams",
    "SpeakV2SpeechInterrupted",
    "SpeakV2SpeechInterruptedMetadata",
    "SpeakV2SpeechInterruptedMetadataControlsApplied",
    "SpeakV2SpeechInterruptedMetadataControlsAppliedParams",
    "SpeakV2SpeechInterruptedMetadataParams",
    "SpeakV2SpeechInterruptedParams",
    "SpeakV2SpeechMetadata",
    "SpeakV2SpeechMetadataControlsApplied",
    "SpeakV2SpeechMetadataControlsAppliedParams",
    "SpeakV2SpeechMetadataParams",
    "SpeakV2SpeechStarted",
    "SpeakV2SpeechStartedParams",
    "SpeakV2Warning",
    "SpeakV2WarningParams",
    "audio",
]
