# 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 .listen_v1close_stream import ListenV1CloseStreamParams
    from .listen_v1finalize import ListenV1FinalizeParams
    from .listen_v1keep_alive import ListenV1KeepAliveParams
    from .listen_v1metadata import ListenV1MetadataParams
    from .listen_v1results import ListenV1ResultsParams
    from .listen_v1results_channel import ListenV1ResultsChannelParams
    from .listen_v1results_channel_alternatives_item import ListenV1ResultsChannelAlternativesItemParams
    from .listen_v1results_channel_alternatives_item_words_item import (
        ListenV1ResultsChannelAlternativesItemWordsItemParams,
    )
    from .listen_v1results_entities_item import ListenV1ResultsEntitiesItemParams
    from .listen_v1results_metadata import ListenV1ResultsMetadataParams
    from .listen_v1results_metadata_model_info import ListenV1ResultsMetadataModelInfoParams
    from .listen_v1speech_started import ListenV1SpeechStartedParams
    from .listen_v1utterance_end import ListenV1UtteranceEndParams
_dynamic_imports: typing.Dict[str, str] = {
    "ListenV1CloseStreamParams": ".listen_v1close_stream",
    "ListenV1FinalizeParams": ".listen_v1finalize",
    "ListenV1KeepAliveParams": ".listen_v1keep_alive",
    "ListenV1MetadataParams": ".listen_v1metadata",
    "ListenV1ResultsChannelAlternativesItemParams": ".listen_v1results_channel_alternatives_item",
    "ListenV1ResultsChannelAlternativesItemWordsItemParams": ".listen_v1results_channel_alternatives_item_words_item",
    "ListenV1ResultsChannelParams": ".listen_v1results_channel",
    "ListenV1ResultsEntitiesItemParams": ".listen_v1results_entities_item",
    "ListenV1ResultsMetadataModelInfoParams": ".listen_v1results_metadata_model_info",
    "ListenV1ResultsMetadataParams": ".listen_v1results_metadata",
    "ListenV1ResultsParams": ".listen_v1results",
    "ListenV1SpeechStartedParams": ".listen_v1speech_started",
    "ListenV1UtteranceEndParams": ".listen_v1utterance_end",
}


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__ = [
    "ListenV1CloseStreamParams",
    "ListenV1FinalizeParams",
    "ListenV1KeepAliveParams",
    "ListenV1MetadataParams",
    "ListenV1ResultsChannelAlternativesItemParams",
    "ListenV1ResultsChannelAlternativesItemWordsItemParams",
    "ListenV1ResultsChannelParams",
    "ListenV1ResultsEntitiesItemParams",
    "ListenV1ResultsMetadataModelInfoParams",
    "ListenV1ResultsMetadataParams",
    "ListenV1ResultsParams",
    "ListenV1SpeechStartedParams",
    "ListenV1UtteranceEndParams",
]
