"""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 .assetrefdto import AssetRefDto, AssetRefDtoTypedDict
    from .cawgidentitydto import (
        CawgIdentityDto,
        CawgIdentityDtoTypedDict,
        Signer,
        SignerSeparate,
        SignerSeparateTypedDict,
        SignerTypedDict,
        SignerUseMainSigner,
        SignerUseMainSignerTypedDict,
        SigningAlg,
        TypeSeparate,
        TypeUseMainSigner,
    )
    from .cawgverifydto import CawgVerifyDto, CawgVerifyDtoTypedDict
    from .getpresignedurlop import (
        GetPresignedURLResponse,
        GetPresignedURLResponseTypedDict,
    )
    from .gettrustlistop import GetTrustListResponse, GetTrustListResponseTypedDict
    from .healthzresponse import HealthzResponse, HealthzResponseTypedDict
    from .limitsdto import LimitsDto, LimitsDtoTypedDict
    from .presignedurl import PresignedURL, PresignedURLTypedDict
    from .presignresponse import PresignResponse, PresignResponseTypedDict
    from .problemresponse_error import Details, DetailsTypedDict
    from .s3 import S3, S3TypedDict
    from .security import Security, SecurityTypedDict
    from .signassetop import SignAssetResponse, SignAssetResponseTypedDict
    from .signerrefdto import (
        SignerRefDto,
        SignerRefDtoEnv,
        SignerRefDtoEnvTypedDict,
        SignerRefDtoLocal,
        SignerRefDtoLocalTypedDict,
        SignerRefDtoTypedDict,
        TypeEnv,
        TypeLocal,
    )
    from .signrequest import Mode, SignRequest, SignRequestTypedDict
    from .signresponse import (
        Alg,
        Assurance,
        Evidence,
        EvidenceTypedDict,
        SignResponse,
        SignResponseTypedDict,
    )
    from .trustlistresponse import (
        Data,
        DataTypedDict,
        Default,
        Policy,
        PolicyTypedDict,
        TrustListResponse,
        TrustListResponseTypedDict,
    )
    from .verifyassetop import VerifyAssetResponse, VerifyAssetResponseTypedDict
    from .verifyrequest import VerifyRequest, VerifyRequestTypedDict
    from .verifyresponse import VerifyResponse, VerifyResponseTypedDict

__all__ = [
    "Alg",
    "AssetRefDto",
    "AssetRefDtoTypedDict",
    "Assurance",
    "CawgIdentityDto",
    "CawgIdentityDtoTypedDict",
    "CawgVerifyDto",
    "CawgVerifyDtoTypedDict",
    "Data",
    "DataTypedDict",
    "Default",
    "Details",
    "DetailsTypedDict",
    "Evidence",
    "EvidenceTypedDict",
    "GetPresignedURLResponse",
    "GetPresignedURLResponseTypedDict",
    "GetTrustListResponse",
    "GetTrustListResponseTypedDict",
    "HealthzResponse",
    "HealthzResponseTypedDict",
    "LimitsDto",
    "LimitsDtoTypedDict",
    "Mode",
    "Policy",
    "PolicyTypedDict",
    "PresignResponse",
    "PresignResponseTypedDict",
    "PresignedURL",
    "PresignedURLTypedDict",
    "S3",
    "S3TypedDict",
    "Security",
    "SecurityTypedDict",
    "SignAssetResponse",
    "SignAssetResponseTypedDict",
    "SignRequest",
    "SignRequestTypedDict",
    "SignResponse",
    "SignResponseTypedDict",
    "Signer",
    "SignerRefDto",
    "SignerRefDtoEnv",
    "SignerRefDtoEnvTypedDict",
    "SignerRefDtoLocal",
    "SignerRefDtoLocalTypedDict",
    "SignerRefDtoTypedDict",
    "SignerSeparate",
    "SignerSeparateTypedDict",
    "SignerTypedDict",
    "SignerUseMainSigner",
    "SignerUseMainSignerTypedDict",
    "SigningAlg",
    "TrustListResponse",
    "TrustListResponseTypedDict",
    "TypeEnv",
    "TypeLocal",
    "TypeSeparate",
    "TypeUseMainSigner",
    "VerifyAssetResponse",
    "VerifyAssetResponseTypedDict",
    "VerifyRequest",
    "VerifyRequestTypedDict",
    "VerifyResponse",
    "VerifyResponseTypedDict",
]

_dynamic_imports: dict[str, str] = {
    "AssetRefDto": ".assetrefdto",
    "AssetRefDtoTypedDict": ".assetrefdto",
    "CawgIdentityDto": ".cawgidentitydto",
    "CawgIdentityDtoTypedDict": ".cawgidentitydto",
    "Signer": ".cawgidentitydto",
    "SignerSeparate": ".cawgidentitydto",
    "SignerSeparateTypedDict": ".cawgidentitydto",
    "SignerTypedDict": ".cawgidentitydto",
    "SignerUseMainSigner": ".cawgidentitydto",
    "SignerUseMainSignerTypedDict": ".cawgidentitydto",
    "SigningAlg": ".cawgidentitydto",
    "TypeSeparate": ".cawgidentitydto",
    "TypeUseMainSigner": ".cawgidentitydto",
    "CawgVerifyDto": ".cawgverifydto",
    "CawgVerifyDtoTypedDict": ".cawgverifydto",
    "GetPresignedURLResponse": ".getpresignedurlop",
    "GetPresignedURLResponseTypedDict": ".getpresignedurlop",
    "GetTrustListResponse": ".gettrustlistop",
    "GetTrustListResponseTypedDict": ".gettrustlistop",
    "HealthzResponse": ".healthzresponse",
    "HealthzResponseTypedDict": ".healthzresponse",
    "LimitsDto": ".limitsdto",
    "LimitsDtoTypedDict": ".limitsdto",
    "PresignedURL": ".presignedurl",
    "PresignedURLTypedDict": ".presignedurl",
    "PresignResponse": ".presignresponse",
    "PresignResponseTypedDict": ".presignresponse",
    "Details": ".problemresponse_error",
    "DetailsTypedDict": ".problemresponse_error",
    "S3": ".s3",
    "S3TypedDict": ".s3",
    "Security": ".security",
    "SecurityTypedDict": ".security",
    "SignAssetResponse": ".signassetop",
    "SignAssetResponseTypedDict": ".signassetop",
    "SignerRefDto": ".signerrefdto",
    "SignerRefDtoEnv": ".signerrefdto",
    "SignerRefDtoEnvTypedDict": ".signerrefdto",
    "SignerRefDtoLocal": ".signerrefdto",
    "SignerRefDtoLocalTypedDict": ".signerrefdto",
    "SignerRefDtoTypedDict": ".signerrefdto",
    "TypeEnv": ".signerrefdto",
    "TypeLocal": ".signerrefdto",
    "Mode": ".signrequest",
    "SignRequest": ".signrequest",
    "SignRequestTypedDict": ".signrequest",
    "Alg": ".signresponse",
    "Assurance": ".signresponse",
    "Evidence": ".signresponse",
    "EvidenceTypedDict": ".signresponse",
    "SignResponse": ".signresponse",
    "SignResponseTypedDict": ".signresponse",
    "Data": ".trustlistresponse",
    "DataTypedDict": ".trustlistresponse",
    "Default": ".trustlistresponse",
    "Policy": ".trustlistresponse",
    "PolicyTypedDict": ".trustlistresponse",
    "TrustListResponse": ".trustlistresponse",
    "TrustListResponseTypedDict": ".trustlistresponse",
    "VerifyAssetResponse": ".verifyassetop",
    "VerifyAssetResponseTypedDict": ".verifyassetop",
    "VerifyRequest": ".verifyrequest",
    "VerifyRequestTypedDict": ".verifyrequest",
    "VerifyResponse": ".verifyresponse",
    "VerifyResponseTypedDict": ".verifyresponse",
}


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)
