"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from typing import TYPE_CHECKING
from importlib import import_module
import builtins
import sys

if TYPE_CHECKING:
    from .accountinfo import AccountInfo, AccountInfoTypedDict
    from .accounttype import AccountType
    from .bankaccountcreateresponse import (
        AccountingBankAccount,
        AccountingBankAccountTypedDict,
        BankAccountCreateResponse,
        BankAccountCreateResponseBankAccountType,
        BankAccountCreateResponseTypedDict,
        Metadata,
        MetadataTypedDict,
        SupplementalData,
        SupplementalDataTypedDict,
    )
    from .bankaccountcredentials import (
        BankAccountCredentials,
        BankAccountCredentialsTypedDict,
    )
    from .bankaccountprototype import (
        BankAccountPrototype,
        BankAccountPrototypeTypedDict,
        BankAccountType,
    )
    from .bankaccounts import (
        BankAccounts,
        BankAccountsAccountingBankAccount,
        BankAccountsAccountingBankAccountTypedDict,
        BankAccountsBankAccountType,
        BankAccountsMetadata,
        BankAccountsMetadataTypedDict,
        BankAccountsSupplementalData,
        BankAccountsSupplementalDataTypedDict,
        BankAccountsTypedDict,
    )
    from .bankaccountstatus import BankAccountStatus
    from .bankfeedaccountmapping import (
        BankFeedAccountMapping,
        BankFeedAccountMappingTypedDict,
    )
    from .bankfeedaccountmappingresponse import (
        BankFeedAccountMappingResponse,
        BankFeedAccountMappingResponseTypedDict,
    )
    from .bankfeedmapping import BankFeedMapping, BankFeedMappingTypedDict
    from .banktransactions import (
        BankTransactionType,
        BankTransactions,
        BankTransactionsTypedDict,
    )
    from .clientratelimitwebhook import (
        ClientRateLimitWebhook,
        ClientRateLimitWebhookTypedDict,
    )
    from .clientratelimitwebhookpayload import (
        ClientRateLimitWebhookPayload,
        ClientRateLimitWebhookPayloadTypedDict,
    )
    from .companies import Companies, CompaniesTypedDict
    from .company import Company, CompanyTypedDict
    from .companyaccesstoken import CompanyAccessToken, CompanyAccessTokenTypedDict
    from .companyinformation import CompanyInformation, CompanyInformationTypedDict
    from .companyreference import (
        CompanyReference,
        CompanyReferenceLinks,
        CompanyReferenceLinksTypedDict,
        CompanyReferenceTypedDict,
    )
    from .companyrequestbody import CompanyRequestBody, CompanyRequestBodyTypedDict
    from .companyupdaterequest import (
        CompanyUpdateRequest,
        CompanyUpdateRequestTypedDict,
    )
    from .connection import Connection, ConnectionTypedDict, SourceType
    from .connections import Connections, ConnectionsTypedDict
    from .createbanktransactions import (
        CreateBankTransactions,
        CreateBankTransactionsTypedDict,
    )
    from .createbanktransactionsresponse import (
        CreateBankTransactionsResponse,
        CreateBankTransactionsResponseTypedDict,
    )
    from .dataconnectionerror import (
        DataConnectionError,
        DataConnectionErrorTypedDict,
        ErrorStatus,
    )
    from .dataconnectionstatus import DataConnectionStatus
    from .datatype import DataType
    from .errorvalidation import ErrorValidation, ErrorValidationTypedDict
    from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict
    from .halref import HalRef, HalRefTypedDict
    from .links import Links, LinksTypedDict
    from .pushchangetype import PushChangeType
    from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict
    from .pushoperation import PushOperation, PushOperationTypedDict
    from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict
    from .pushoperationref import PushOperationRef, PushOperationRefTypedDict
    from .pushoperations import PushOperations, PushOperationsTypedDict
    from .pushoperationstatus import PushOperationStatus
    from .pushoption import PushOption, PushOptionTypedDict
    from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict
    from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict
    from .pushoptiontype import PushOptionType
    from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict
    from .routinginfo import RoutingInfo, RoutingInfoTypedDict, Type
    from .security import Security, SecurityTypedDict
    from .sourceaccount import SourceAccount, SourceAccountTypedDict, Status
    from .sourceaccountbatchcreateresponse import (
        SourceAccountBatchCreateResponse,
        SourceAccountBatchCreateResponseTypedDict,
    )
    from .sourceaccountbatchcreateresult import (
        SourceAccountBatchCreateResult,
        SourceAccountBatchCreateResultTypedDict,
    )
    from .sourceaccountbatcherrorresponse import (
        Result,
        ResultTypedDict,
        SourceAccountBatchErrorResponse,
        SourceAccountBatchErrorResponseTypedDict,
    )
    from .sourceaccountprototype import (
        SourceAccountPrototype,
        SourceAccountPrototypeTypedDict,
    )
    from .sourceaccountv2 import (
        SourceAccountV2,
        SourceAccountV2AccountType,
        SourceAccountV2Status,
        SourceAccountV2TypedDict,
    )
    from .sourceaccountv2batchcreateresponse import (
        SourceAccountV2BatchCreateResponse,
        SourceAccountV2BatchCreateResponseTypedDict,
    )
    from .sourceaccountv2batchcreateresult import (
        SourceAccountV2BatchCreateResult,
        SourceAccountV2BatchCreateResultTypedDict,
    )
    from .sourceaccountv2prototype import (
        SourceAccountV2Prototype,
        SourceAccountV2PrototypeTypedDict,
    )
    from .sourceaccountwebhook import (
        SourceAccountWebhook,
        SourceAccountWebhookTypedDict,
    )
    from .sourceaccountwebhookpayload import (
        SourceAccountWebhookPayload,
        SourceAccountWebhookPayloadSourceAccount,
        SourceAccountWebhookPayloadSourceAccountTypedDict,
        SourceAccountWebhookPayloadTypedDict,
    )
    from .startscheduledsyncresult import (
        StartScheduledSyncResult,
        StartScheduledSyncResultTypedDict,
    )
    from .syncstatusresult import SyncStatusResult, SyncStatusResultTypedDict
    from .targetaccountoption import TargetAccountOption, TargetAccountOptionTypedDict
    from .validation import Validation, ValidationTypedDict
    from .validationitem import ValidationItem, ValidationItemTypedDict

__all__ = [
    "AccountInfo",
    "AccountInfoTypedDict",
    "AccountType",
    "AccountingBankAccount",
    "AccountingBankAccountTypedDict",
    "BankAccountCreateResponse",
    "BankAccountCreateResponseBankAccountType",
    "BankAccountCreateResponseTypedDict",
    "BankAccountCredentials",
    "BankAccountCredentialsTypedDict",
    "BankAccountPrototype",
    "BankAccountPrototypeTypedDict",
    "BankAccountStatus",
    "BankAccountType",
    "BankAccounts",
    "BankAccountsAccountingBankAccount",
    "BankAccountsAccountingBankAccountTypedDict",
    "BankAccountsBankAccountType",
    "BankAccountsMetadata",
    "BankAccountsMetadataTypedDict",
    "BankAccountsSupplementalData",
    "BankAccountsSupplementalDataTypedDict",
    "BankAccountsTypedDict",
    "BankFeedAccountMapping",
    "BankFeedAccountMappingResponse",
    "BankFeedAccountMappingResponseTypedDict",
    "BankFeedAccountMappingTypedDict",
    "BankFeedMapping",
    "BankFeedMappingTypedDict",
    "BankTransactionType",
    "BankTransactions",
    "BankTransactionsTypedDict",
    "ClientRateLimitWebhook",
    "ClientRateLimitWebhookPayload",
    "ClientRateLimitWebhookPayloadTypedDict",
    "ClientRateLimitWebhookTypedDict",
    "Companies",
    "CompaniesTypedDict",
    "Company",
    "CompanyAccessToken",
    "CompanyAccessTokenTypedDict",
    "CompanyInformation",
    "CompanyInformationTypedDict",
    "CompanyReference",
    "CompanyReferenceLinks",
    "CompanyReferenceLinksTypedDict",
    "CompanyReferenceTypedDict",
    "CompanyRequestBody",
    "CompanyRequestBodyTypedDict",
    "CompanyTypedDict",
    "CompanyUpdateRequest",
    "CompanyUpdateRequestTypedDict",
    "Connection",
    "ConnectionTypedDict",
    "Connections",
    "ConnectionsTypedDict",
    "CreateBankTransactions",
    "CreateBankTransactionsResponse",
    "CreateBankTransactionsResponseTypedDict",
    "CreateBankTransactionsTypedDict",
    "DataConnectionError",
    "DataConnectionErrorTypedDict",
    "DataConnectionStatus",
    "DataType",
    "ErrorStatus",
    "ErrorValidation",
    "ErrorValidationItem",
    "ErrorValidationItemTypedDict",
    "ErrorValidationTypedDict",
    "HalRef",
    "HalRefTypedDict",
    "Links",
    "LinksTypedDict",
    "Metadata",
    "MetadataTypedDict",
    "PushChangeType",
    "PushFieldValidation",
    "PushFieldValidationTypedDict",
    "PushOperation",
    "PushOperationChange",
    "PushOperationChangeTypedDict",
    "PushOperationRef",
    "PushOperationRefTypedDict",
    "PushOperationStatus",
    "PushOperationTypedDict",
    "PushOperations",
    "PushOperationsTypedDict",
    "PushOption",
    "PushOptionChoice",
    "PushOptionChoiceTypedDict",
    "PushOptionProperty",
    "PushOptionPropertyTypedDict",
    "PushOptionType",
    "PushOptionTypedDict",
    "PushValidationInfo",
    "PushValidationInfoTypedDict",
    "Result",
    "ResultTypedDict",
    "RoutingInfo",
    "RoutingInfoTypedDict",
    "Security",
    "SecurityTypedDict",
    "SourceAccount",
    "SourceAccountBatchCreateResponse",
    "SourceAccountBatchCreateResponseTypedDict",
    "SourceAccountBatchCreateResult",
    "SourceAccountBatchCreateResultTypedDict",
    "SourceAccountBatchErrorResponse",
    "SourceAccountBatchErrorResponseTypedDict",
    "SourceAccountPrototype",
    "SourceAccountPrototypeTypedDict",
    "SourceAccountTypedDict",
    "SourceAccountV2",
    "SourceAccountV2AccountType",
    "SourceAccountV2BatchCreateResponse",
    "SourceAccountV2BatchCreateResponseTypedDict",
    "SourceAccountV2BatchCreateResult",
    "SourceAccountV2BatchCreateResultTypedDict",
    "SourceAccountV2Prototype",
    "SourceAccountV2PrototypeTypedDict",
    "SourceAccountV2Status",
    "SourceAccountV2TypedDict",
    "SourceAccountWebhook",
    "SourceAccountWebhookPayload",
    "SourceAccountWebhookPayloadSourceAccount",
    "SourceAccountWebhookPayloadSourceAccountTypedDict",
    "SourceAccountWebhookPayloadTypedDict",
    "SourceAccountWebhookTypedDict",
    "SourceType",
    "StartScheduledSyncResult",
    "StartScheduledSyncResultTypedDict",
    "Status",
    "SupplementalData",
    "SupplementalDataTypedDict",
    "SyncStatusResult",
    "SyncStatusResultTypedDict",
    "TargetAccountOption",
    "TargetAccountOptionTypedDict",
    "Type",
    "Validation",
    "ValidationItem",
    "ValidationItemTypedDict",
    "ValidationTypedDict",
]

_dynamic_imports: dict[str, str] = {
    "AccountInfo": ".accountinfo",
    "AccountInfoTypedDict": ".accountinfo",
    "AccountType": ".accounttype",
    "AccountingBankAccount": ".bankaccountcreateresponse",
    "AccountingBankAccountTypedDict": ".bankaccountcreateresponse",
    "BankAccountCreateResponse": ".bankaccountcreateresponse",
    "BankAccountCreateResponseBankAccountType": ".bankaccountcreateresponse",
    "BankAccountCreateResponseTypedDict": ".bankaccountcreateresponse",
    "Metadata": ".bankaccountcreateresponse",
    "MetadataTypedDict": ".bankaccountcreateresponse",
    "SupplementalData": ".bankaccountcreateresponse",
    "SupplementalDataTypedDict": ".bankaccountcreateresponse",
    "BankAccountCredentials": ".bankaccountcredentials",
    "BankAccountCredentialsTypedDict": ".bankaccountcredentials",
    "BankAccountPrototype": ".bankaccountprototype",
    "BankAccountPrototypeTypedDict": ".bankaccountprototype",
    "BankAccountType": ".bankaccountprototype",
    "BankAccounts": ".bankaccounts",
    "BankAccountsAccountingBankAccount": ".bankaccounts",
    "BankAccountsAccountingBankAccountTypedDict": ".bankaccounts",
    "BankAccountsBankAccountType": ".bankaccounts",
    "BankAccountsMetadata": ".bankaccounts",
    "BankAccountsMetadataTypedDict": ".bankaccounts",
    "BankAccountsSupplementalData": ".bankaccounts",
    "BankAccountsSupplementalDataTypedDict": ".bankaccounts",
    "BankAccountsTypedDict": ".bankaccounts",
    "BankAccountStatus": ".bankaccountstatus",
    "BankFeedAccountMapping": ".bankfeedaccountmapping",
    "BankFeedAccountMappingTypedDict": ".bankfeedaccountmapping",
    "BankFeedAccountMappingResponse": ".bankfeedaccountmappingresponse",
    "BankFeedAccountMappingResponseTypedDict": ".bankfeedaccountmappingresponse",
    "BankFeedMapping": ".bankfeedmapping",
    "BankFeedMappingTypedDict": ".bankfeedmapping",
    "BankTransactionType": ".banktransactions",
    "BankTransactions": ".banktransactions",
    "BankTransactionsTypedDict": ".banktransactions",
    "ClientRateLimitWebhook": ".clientratelimitwebhook",
    "ClientRateLimitWebhookTypedDict": ".clientratelimitwebhook",
    "ClientRateLimitWebhookPayload": ".clientratelimitwebhookpayload",
    "ClientRateLimitWebhookPayloadTypedDict": ".clientratelimitwebhookpayload",
    "Companies": ".companies",
    "CompaniesTypedDict": ".companies",
    "Company": ".company",
    "CompanyTypedDict": ".company",
    "CompanyAccessToken": ".companyaccesstoken",
    "CompanyAccessTokenTypedDict": ".companyaccesstoken",
    "CompanyInformation": ".companyinformation",
    "CompanyInformationTypedDict": ".companyinformation",
    "CompanyReference": ".companyreference",
    "CompanyReferenceLinks": ".companyreference",
    "CompanyReferenceLinksTypedDict": ".companyreference",
    "CompanyReferenceTypedDict": ".companyreference",
    "CompanyRequestBody": ".companyrequestbody",
    "CompanyRequestBodyTypedDict": ".companyrequestbody",
    "CompanyUpdateRequest": ".companyupdaterequest",
    "CompanyUpdateRequestTypedDict": ".companyupdaterequest",
    "Connection": ".connection",
    "ConnectionTypedDict": ".connection",
    "SourceType": ".connection",
    "Connections": ".connections",
    "ConnectionsTypedDict": ".connections",
    "CreateBankTransactions": ".createbanktransactions",
    "CreateBankTransactionsTypedDict": ".createbanktransactions",
    "CreateBankTransactionsResponse": ".createbanktransactionsresponse",
    "CreateBankTransactionsResponseTypedDict": ".createbanktransactionsresponse",
    "DataConnectionError": ".dataconnectionerror",
    "DataConnectionErrorTypedDict": ".dataconnectionerror",
    "ErrorStatus": ".dataconnectionerror",
    "DataConnectionStatus": ".dataconnectionstatus",
    "DataType": ".datatype",
    "ErrorValidation": ".errorvalidation",
    "ErrorValidationTypedDict": ".errorvalidation",
    "ErrorValidationItem": ".errorvalidationitem",
    "ErrorValidationItemTypedDict": ".errorvalidationitem",
    "HalRef": ".halref",
    "HalRefTypedDict": ".halref",
    "Links": ".links",
    "LinksTypedDict": ".links",
    "PushChangeType": ".pushchangetype",
    "PushFieldValidation": ".pushfieldvalidation",
    "PushFieldValidationTypedDict": ".pushfieldvalidation",
    "PushOperation": ".pushoperation",
    "PushOperationTypedDict": ".pushoperation",
    "PushOperationChange": ".pushoperationchange",
    "PushOperationChangeTypedDict": ".pushoperationchange",
    "PushOperationRef": ".pushoperationref",
    "PushOperationRefTypedDict": ".pushoperationref",
    "PushOperations": ".pushoperations",
    "PushOperationsTypedDict": ".pushoperations",
    "PushOperationStatus": ".pushoperationstatus",
    "PushOption": ".pushoption",
    "PushOptionTypedDict": ".pushoption",
    "PushOptionChoice": ".pushoptionchoice",
    "PushOptionChoiceTypedDict": ".pushoptionchoice",
    "PushOptionProperty": ".pushoptionproperty",
    "PushOptionPropertyTypedDict": ".pushoptionproperty",
    "PushOptionType": ".pushoptiontype",
    "PushValidationInfo": ".pushvalidationinfo",
    "PushValidationInfoTypedDict": ".pushvalidationinfo",
    "RoutingInfo": ".routinginfo",
    "RoutingInfoTypedDict": ".routinginfo",
    "Type": ".routinginfo",
    "Security": ".security",
    "SecurityTypedDict": ".security",
    "SourceAccount": ".sourceaccount",
    "SourceAccountTypedDict": ".sourceaccount",
    "Status": ".sourceaccount",
    "SourceAccountBatchCreateResponse": ".sourceaccountbatchcreateresponse",
    "SourceAccountBatchCreateResponseTypedDict": ".sourceaccountbatchcreateresponse",
    "SourceAccountBatchCreateResult": ".sourceaccountbatchcreateresult",
    "SourceAccountBatchCreateResultTypedDict": ".sourceaccountbatchcreateresult",
    "Result": ".sourceaccountbatcherrorresponse",
    "ResultTypedDict": ".sourceaccountbatcherrorresponse",
    "SourceAccountBatchErrorResponse": ".sourceaccountbatcherrorresponse",
    "SourceAccountBatchErrorResponseTypedDict": ".sourceaccountbatcherrorresponse",
    "SourceAccountPrototype": ".sourceaccountprototype",
    "SourceAccountPrototypeTypedDict": ".sourceaccountprototype",
    "SourceAccountV2": ".sourceaccountv2",
    "SourceAccountV2AccountType": ".sourceaccountv2",
    "SourceAccountV2Status": ".sourceaccountv2",
    "SourceAccountV2TypedDict": ".sourceaccountv2",
    "SourceAccountV2BatchCreateResponse": ".sourceaccountv2batchcreateresponse",
    "SourceAccountV2BatchCreateResponseTypedDict": ".sourceaccountv2batchcreateresponse",
    "SourceAccountV2BatchCreateResult": ".sourceaccountv2batchcreateresult",
    "SourceAccountV2BatchCreateResultTypedDict": ".sourceaccountv2batchcreateresult",
    "SourceAccountV2Prototype": ".sourceaccountv2prototype",
    "SourceAccountV2PrototypeTypedDict": ".sourceaccountv2prototype",
    "SourceAccountWebhook": ".sourceaccountwebhook",
    "SourceAccountWebhookTypedDict": ".sourceaccountwebhook",
    "SourceAccountWebhookPayload": ".sourceaccountwebhookpayload",
    "SourceAccountWebhookPayloadSourceAccount": ".sourceaccountwebhookpayload",
    "SourceAccountWebhookPayloadSourceAccountTypedDict": ".sourceaccountwebhookpayload",
    "SourceAccountWebhookPayloadTypedDict": ".sourceaccountwebhookpayload",
    "StartScheduledSyncResult": ".startscheduledsyncresult",
    "StartScheduledSyncResultTypedDict": ".startscheduledsyncresult",
    "SyncStatusResult": ".syncstatusresult",
    "SyncStatusResultTypedDict": ".syncstatusresult",
    "TargetAccountOption": ".targetaccountoption",
    "TargetAccountOptionTypedDict": ".targetaccountoption",
    "Validation": ".validation",
    "ValidationTypedDict": ".validation",
    "ValidationItem": ".validationitem",
    "ValidationItemTypedDict": ".validationitem",
}


def dynamic_import(modname, retries=3):
    for attempt in range(retries):
        try:
            return import_module(modname, __package__)
        except KeyError:
            # Clear any half-initialized module and retry
            sys.modules.pop(modname, None)
            if attempt == retries - 1:
                break
    raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")


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 = dynamic_import(module_name)
        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 = builtins.list(_dynamic_imports.keys())
    return builtins.sorted(lazy_attrs)
