# 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 . import v1, v2
    from .v1 import (
        ListenV1CloseStream,
        ListenV1CloseStreamParams,
        ListenV1CloseStreamType,
        ListenV1Finalize,
        ListenV1FinalizeParams,
        ListenV1FinalizeType,
        ListenV1KeepAlive,
        ListenV1KeepAliveParams,
        ListenV1KeepAliveType,
        ListenV1Metadata,
        ListenV1MetadataParams,
        ListenV1Results,
        ListenV1ResultsChannel,
        ListenV1ResultsChannelAlternativesItem,
        ListenV1ResultsChannelAlternativesItemParams,
        ListenV1ResultsChannelAlternativesItemWordsItem,
        ListenV1ResultsChannelAlternativesItemWordsItemParams,
        ListenV1ResultsChannelParams,
        ListenV1ResultsEntitiesItem,
        ListenV1ResultsEntitiesItemParams,
        ListenV1ResultsMetadata,
        ListenV1ResultsMetadataModelInfo,
        ListenV1ResultsMetadataModelInfoParams,
        ListenV1ResultsMetadataParams,
        ListenV1ResultsParams,
        ListenV1SpeechStarted,
        ListenV1SpeechStartedParams,
        ListenV1UtteranceEnd,
        ListenV1UtteranceEndParams,
    )
    from .v2 import (
        ListenV2CloseStream,
        ListenV2CloseStreamParams,
        ListenV2CloseStreamType,
        ListenV2Connected,
        ListenV2ConnectedParams,
        ListenV2FatalError,
        ListenV2FatalErrorParams,
        ListenV2TurnInfo,
        ListenV2TurnInfoEvent,
        ListenV2TurnInfoParams,
        ListenV2TurnInfoWordsItem,
        ListenV2TurnInfoWordsItemParams,
    )
_dynamic_imports: typing.Dict[str, str] = {
    "ListenV1CloseStream": ".v1",
    "ListenV1CloseStreamParams": ".v1",
    "ListenV1CloseStreamType": ".v1",
    "ListenV1Finalize": ".v1",
    "ListenV1FinalizeParams": ".v1",
    "ListenV1FinalizeType": ".v1",
    "ListenV1KeepAlive": ".v1",
    "ListenV1KeepAliveParams": ".v1",
    "ListenV1KeepAliveType": ".v1",
    "ListenV1Metadata": ".v1",
    "ListenV1MetadataParams": ".v1",
    "ListenV1Results": ".v1",
    "ListenV1ResultsChannel": ".v1",
    "ListenV1ResultsChannelAlternativesItem": ".v1",
    "ListenV1ResultsChannelAlternativesItemParams": ".v1",
    "ListenV1ResultsChannelAlternativesItemWordsItem": ".v1",
    "ListenV1ResultsChannelAlternativesItemWordsItemParams": ".v1",
    "ListenV1ResultsChannelParams": ".v1",
    "ListenV1ResultsEntitiesItem": ".v1",
    "ListenV1ResultsEntitiesItemParams": ".v1",
    "ListenV1ResultsMetadata": ".v1",
    "ListenV1ResultsMetadataModelInfo": ".v1",
    "ListenV1ResultsMetadataModelInfoParams": ".v1",
    "ListenV1ResultsMetadataParams": ".v1",
    "ListenV1ResultsParams": ".v1",
    "ListenV1SpeechStarted": ".v1",
    "ListenV1SpeechStartedParams": ".v1",
    "ListenV1UtteranceEnd": ".v1",
    "ListenV1UtteranceEndParams": ".v1",
    "ListenV2CloseStream": ".v2",
    "ListenV2CloseStreamParams": ".v2",
    "ListenV2CloseStreamType": ".v2",
    "ListenV2Connected": ".v2",
    "ListenV2ConnectedParams": ".v2",
    "ListenV2FatalError": ".v2",
    "ListenV2FatalErrorParams": ".v2",
    "ListenV2TurnInfo": ".v2",
    "ListenV2TurnInfoEvent": ".v2",
    "ListenV2TurnInfoParams": ".v2",
    "ListenV2TurnInfoWordsItem": ".v2",
    "ListenV2TurnInfoWordsItemParams": ".v2",
    "v1": ".v1",
    "v2": ".v2",
}


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__ = [
    "ListenV1CloseStream",
    "ListenV1CloseStreamParams",
    "ListenV1CloseStreamType",
    "ListenV1Finalize",
    "ListenV1FinalizeParams",
    "ListenV1FinalizeType",
    "ListenV1KeepAlive",
    "ListenV1KeepAliveParams",
    "ListenV1KeepAliveType",
    "ListenV1Metadata",
    "ListenV1MetadataParams",
    "ListenV1Results",
    "ListenV1ResultsChannel",
    "ListenV1ResultsChannelAlternativesItem",
    "ListenV1ResultsChannelAlternativesItemParams",
    "ListenV1ResultsChannelAlternativesItemWordsItem",
    "ListenV1ResultsChannelAlternativesItemWordsItemParams",
    "ListenV1ResultsChannelParams",
    "ListenV1ResultsEntitiesItem",
    "ListenV1ResultsEntitiesItemParams",
    "ListenV1ResultsMetadata",
    "ListenV1ResultsMetadataModelInfo",
    "ListenV1ResultsMetadataModelInfoParams",
    "ListenV1ResultsMetadataParams",
    "ListenV1ResultsParams",
    "ListenV1SpeechStarted",
    "ListenV1SpeechStartedParams",
    "ListenV1UtteranceEnd",
    "ListenV1UtteranceEndParams",
    "ListenV2CloseStream",
    "ListenV2CloseStreamParams",
    "ListenV2CloseStreamType",
    "ListenV2Connected",
    "ListenV2ConnectedParams",
    "ListenV2FatalError",
    "ListenV2FatalErrorParams",
    "ListenV2TurnInfo",
    "ListenV2TurnInfoEvent",
    "ListenV2TurnInfoParams",
    "ListenV2TurnInfoWordsItem",
    "ListenV2TurnInfoWordsItemParams",
    "v1",
    "v2",
]
