# 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 (
        agent_templates,
        agents,
        audience,
        calls,
        campaigns,
        knowledge_base,
        logs,
        organization,
        phone_numbers,
        user,
        webhooks,
        workflows,
    )
    from .helpers import AtomsClient, Audience, Call, Campaign, KB
    # OpenAPI backward-compat: API classes
    from .api.agent_templates_api import AgentTemplatesApi
    from .api.agents_api import AgentsApi
    from .api.calls_api import CallsApi
    from .api.campaigns_api import CampaignsApi
    from .api.knowledge_base_api import KnowledgeBaseApi
    from .api.logs_api import LogsApi
    from .api.organization_api import OrganizationApi
    from .api.user_api import UserApi
    # OpenAPI backward-compat: infrastructure
    from .api_response import ApiResponse
    from .api_client import ApiClient
    from .configuration import Configuration
    from .exceptions import (
        OpenApiException,
        ApiTypeError,
        ApiValueError,
        ApiKeyError,
        ApiAttributeError,
        ApiException,
    )
    # OpenAPI backward-compat: models
    from .models import (
        AgentDTO,
        AgentDTOLanguage,
        AgentDTOSynthesizer,
        AgentDTOSynthesizerVoiceConfig,
        AgentFromTemplatePost200Response,
        AgentGet200Response,
        AgentGet200ResponseData,
        AgentIdDelete200Response,
        AgentIdGet200Response,
        AgentIdPatch200Response,
        AgentIdPatchRequest,
        AgentIdPatchRequestLanguage,
        AgentIdPatchRequestLanguageSwitching,
        AgentIdPatchRequestSynthesizer,
        AgentIdPatchRequestSynthesizerVoiceConfig,
        AgentIdPatchRequestSynthesizerVoiceConfigOneOf,
        AgentIdPatchRequestSynthesizerVoiceConfigOneOf1,
        AgentTemplateGet200Response,
        AgentTemplateGet200ResponseDataInner,
        BadRequestErrorResponse,
        CreateAgentFromTemplateRequest,
        CreateAgentRequest,
        CreateAgentRequestLanguage,
        CreateAgentRequestLanguageSynthesizer,
        CreateAgentRequestLanguageSynthesizerVoiceConfig,
        CampaignPost201Response,
        CampaignPostRequest,
        CampaignGetRequest,
        CampaignGet200Response,
        CampaignGet200ResponseData,
        CampaignIdGet200Response,
        ConversationIdGet200Response,
        ConversationIdGet200ResponseData,
        ConversationOutboundPost200Response,
        ConversationOutboundPost200ResponseData,
        ConversationOutboundPostRequest,
        InternalServerErrorResponse,
        KnowledgeBase,
        KnowledgeBaseItem,
        KnowledgebaseGet200Response,
        KnowledgebaseIdGet200Response,
        KnowledgebaseIdItemsGet200Response,
        KnowledgebaseIdItemsUploadTextPostRequest,
        KnowledgebasePost201Response,
        KnowledgebasePostRequest,
        OrganizationGet200Response,
        OrganizationGet200ResponseData,
        OrganizationGet200ResponseDataMembersInner,
        OrganizationGet200ResponseDataSubscription,
        ProductPhoneNumbersGet200Response,
        ProductPhoneNumbersGet200ResponseDataInner,
        ProductPhoneNumbersGet200ResponseDataInnerAttributes,
        UnauthorizedErrorReponse,
        UserGet200Response,
        UserGet200ResponseData,
    )
_dynamic_imports: typing.Dict[str, str] = {
    "agent_templates": ".agent_templates",
    "agents": ".agents",
    "audience": ".audience",
    "calls": ".calls",
    "campaigns": ".campaigns",
    "knowledge_base": ".knowledge_base",
    "logs": ".logs",
    "organization": ".organization",
    "phone_numbers": ".phone_numbers",
    "user": ".user",
    "webhooks": ".webhooks",
    "workflows": ".workflows",
    # Helper classes re-exported for convenience
    "AtomsClient": ".helpers.atoms_client",
    "Audience": ".helpers.audience",
    "Call": ".helpers.call",
    "Campaign": ".helpers.campaign",
    "KB": ".helpers.kb",
    # OpenAPI backward-compat: API classes
    "AgentTemplatesApi": ".api.agent_templates_api",
    "AgentsApi": ".api.agents_api",
    "CallsApi": ".api.calls_api",
    "CampaignsApi": ".api.campaigns_api",
    "KnowledgeBaseApi": ".api.knowledge_base_api",
    "LogsApi": ".api.logs_api",
    "OrganizationApi": ".api.organization_api",
    "UserApi": ".api.user_api",
    # OpenAPI backward-compat: infrastructure
    "ApiResponse": ".api_response",
    "ApiClient": ".api_client",
    "Configuration": ".configuration",
    "OpenApiException": ".exceptions",
    "ApiTypeError": ".exceptions",
    "ApiValueError": ".exceptions",
    "ApiKeyError": ".exceptions",
    "ApiAttributeError": ".exceptions",
    "ApiException": ".exceptions",
    # OpenAPI backward-compat: models
    "AgentDTO": ".models",
    "AgentDTOLanguage": ".models",
    "AgentDTOSynthesizer": ".models",
    "AgentDTOSynthesizerVoiceConfig": ".models",
    "AgentFromTemplatePost200Response": ".models",
    "AgentGet200Response": ".models",
    "AgentGet200ResponseData": ".models",
    "AgentIdDelete200Response": ".models",
    "AgentIdGet200Response": ".models",
    "AgentIdPatch200Response": ".models",
    "AgentIdPatchRequest": ".models",
    "AgentIdPatchRequestLanguage": ".models",
    "AgentIdPatchRequestLanguageSwitching": ".models",
    "AgentIdPatchRequestSynthesizer": ".models",
    "AgentIdPatchRequestSynthesizerVoiceConfig": ".models",
    "AgentIdPatchRequestSynthesizerVoiceConfigOneOf": ".models",
    "AgentIdPatchRequestSynthesizerVoiceConfigOneOf1": ".models",
    "AgentTemplateGet200Response": ".models",
    "AgentTemplateGet200ResponseDataInner": ".models",
    "BadRequestErrorResponse": ".models",
    "CreateAgentFromTemplateRequest": ".models",
    "CreateAgentRequest": ".models",
    "CreateAgentRequestLanguage": ".models",
    "CreateAgentRequestLanguageSynthesizer": ".models",
    "CreateAgentRequestLanguageSynthesizerVoiceConfig": ".models",
    "CampaignPost201Response": ".models",
    "CampaignPostRequest": ".models",
    "CampaignGetRequest": ".models",
    "CampaignGet200Response": ".models",
    "CampaignGet200ResponseData": ".models",
    "CampaignIdGet200Response": ".models",
    "ConversationIdGet200Response": ".models",
    "ConversationIdGet200ResponseData": ".models",
    "ConversationOutboundPost200Response": ".models",
    "ConversationOutboundPost200ResponseData": ".models",
    "ConversationOutboundPostRequest": ".models",
    "InternalServerErrorResponse": ".models",
    "KnowledgeBase": ".models",
    "KnowledgeBaseItem": ".models",
    "KnowledgebaseGet200Response": ".models",
    "KnowledgebaseIdGet200Response": ".models",
    "KnowledgebaseIdItemsGet200Response": ".models",
    "KnowledgebaseIdItemsUploadTextPostRequest": ".models",
    "KnowledgebasePost201Response": ".models",
    "KnowledgebasePostRequest": ".models",
    "OrganizationGet200Response": ".models",
    "OrganizationGet200ResponseData": ".models",
    "OrganizationGet200ResponseDataMembersInner": ".models",
    "OrganizationGet200ResponseDataSubscription": ".models",
    "ProductPhoneNumbersGet200Response": ".models",
    "ProductPhoneNumbersGet200ResponseDataInner": ".models",
    "ProductPhoneNumbersGet200ResponseDataInnerAttributes": ".models",
    "UnauthorizedErrorReponse": ".models",
    "UserGet200Response": ".models",
    "UserGet200ResponseData": ".models",
}


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__ = [
    # Fern submodules
    "agent_templates",
    "agents",
    "audience",
    "calls",
    "campaigns",
    "knowledge_base",
    "logs",
    "organization",
    "phone_numbers",
    "user",
    "webhooks",
    "workflows",
    # Helper classes
    "AtomsClient",
    "Audience",
    "Call",
    "Campaign",
    "KB",
    # OpenAPI backward-compat: API classes
    "AgentTemplatesApi",
    "AgentsApi",
    "CallsApi",
    "CampaignsApi",
    "KnowledgeBaseApi",
    "LogsApi",
    "OrganizationApi",
    "UserApi",
    # OpenAPI backward-compat: infrastructure
    "ApiResponse",
    "ApiClient",
    "Configuration",
    "OpenApiException",
    "ApiTypeError",
    "ApiValueError",
    "ApiKeyError",
    "ApiAttributeError",
    "ApiException",
    # OpenAPI backward-compat: models
    "AgentDTO",
    "AgentDTOLanguage",
    "AgentDTOSynthesizer",
    "AgentDTOSynthesizerVoiceConfig",
    "AgentFromTemplatePost200Response",
    "AgentGet200Response",
    "AgentGet200ResponseData",
    "AgentIdDelete200Response",
    "AgentIdGet200Response",
    "AgentIdPatch200Response",
    "AgentIdPatchRequest",
    "AgentIdPatchRequestLanguage",
    "AgentIdPatchRequestLanguageSwitching",
    "AgentIdPatchRequestSynthesizer",
    "AgentIdPatchRequestSynthesizerVoiceConfig",
    "AgentIdPatchRequestSynthesizerVoiceConfigOneOf",
    "AgentIdPatchRequestSynthesizerVoiceConfigOneOf1",
    "AgentTemplateGet200Response",
    "AgentTemplateGet200ResponseDataInner",
    "BadRequestErrorResponse",
    "CreateAgentFromTemplateRequest",
    "CreateAgentRequest",
    "CreateAgentRequestLanguage",
    "CreateAgentRequestLanguageSynthesizer",
    "CreateAgentRequestLanguageSynthesizerVoiceConfig",
    "CampaignPost201Response",
    "CampaignPostRequest",
    "CampaignGetRequest",
    "CampaignGet200Response",
    "CampaignGet200ResponseData",
    "CampaignIdGet200Response",
    "ConversationIdGet200Response",
    "ConversationIdGet200ResponseData",
    "ConversationOutboundPost200Response",
    "ConversationOutboundPost200ResponseData",
    "ConversationOutboundPostRequest",
    "InternalServerErrorResponse",
    "KnowledgeBase",
    "KnowledgeBaseItem",
    "KnowledgebaseGet200Response",
    "KnowledgebaseIdGet200Response",
    "KnowledgebaseIdItemsGet200Response",
    "KnowledgebaseIdItemsUploadTextPostRequest",
    "KnowledgebasePost201Response",
    "KnowledgebasePostRequest",
    "OrganizationGet200Response",
    "OrganizationGet200ResponseData",
    "OrganizationGet200ResponseDataMembersInner",
    "OrganizationGet200ResponseDataSubscription",
    "ProductPhoneNumbersGet200Response",
    "ProductPhoneNumbersGet200ResponseDataInner",
    "ProductPhoneNumbersGet200ResponseDataInnerAttributes",
    "UnauthorizedErrorReponse",
    "UserGet200Response",
    "UserGet200ResponseData",
]
