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

from .nesterror import NestError
from typing import TYPE_CHECKING
from importlib import import_module
import builtins
import sys

if TYPE_CHECKING:
    from .chaptererrorresponse import ChapterErrorResponse, ChapterErrorResponseData
    from .chapterschema import ChapterSchema, ChapterSchemaTypedDict
    from .committeeschema import CommitteeSchema, CommitteeSchemaTypedDict
    from .eventschema import EventSchema, EventSchemaTypedDict
    from .get_chapterop import GetChapterRequest, GetChapterRequestTypedDict
    from .get_memberop import GetMemberRequest, GetMemberRequestTypedDict
    from .issueschema import IssueSchema, IssueSchemaTypedDict
    from .list_chaptersop import (
        ListChaptersOrdering,
        ListChaptersRequest,
        ListChaptersRequestTypedDict,
    )
    from .list_committeesop import (
        ListCommitteesOrdering,
        ListCommitteesRequest,
        ListCommitteesRequestTypedDict,
    )
    from .list_eventsop import (
        ListEventsOrdering,
        ListEventsRequest,
        ListEventsRequestTypedDict,
    )
    from .list_issuesop import (
        ListIssuesOrdering,
        ListIssuesRequest,
        ListIssuesRequestTypedDict,
    )
    from .list_membersop import (
        ListMembersOrdering,
        ListMembersRequest,
        ListMembersRequestTypedDict,
    )
    from .list_organizationsop import (
        ListOrganizationsOrdering,
        ListOrganizationsRequest,
        ListOrganizationsRequestTypedDict,
    )
    from .list_projectsop import (
        ListProjectsOrdering,
        ListProjectsRequest,
        ListProjectsRequestTypedDict,
    )
    from .list_releasesop import (
        ListReleasesOrdering,
        ListReleasesRequest,
        ListReleasesRequestTypedDict,
    )
    from .list_repositoriesop import (
        ListRepositoriesOrdering,
        ListRepositoriesRequest,
        ListRepositoriesRequestTypedDict,
    )
    from .membererrorresponse import MemberErrorResponse, MemberErrorResponseData
    from .memberschema import MemberSchema, MemberSchemaTypedDict
    from .nestapierror import NestAPIError
    from .no_response_error import NoResponseError
    from .organizationschema import OrganizationSchema, OrganizationSchemaTypedDict
    from .pagedchapterschema import PagedChapterSchema, PagedChapterSchemaTypedDict
    from .pagedcommitteeschema import (
        PagedCommitteeSchema,
        PagedCommitteeSchemaTypedDict,
    )
    from .pagedeventschema import PagedEventSchema, PagedEventSchemaTypedDict
    from .pagedissueschema import PagedIssueSchema, PagedIssueSchemaTypedDict
    from .pagedmemberschema import PagedMemberSchema, PagedMemberSchemaTypedDict
    from .pagedorganizationschema import (
        PagedOrganizationSchema,
        PagedOrganizationSchemaTypedDict,
    )
    from .pagedprojectschema import PagedProjectSchema, PagedProjectSchemaTypedDict
    from .pagedreleaseschema import PagedReleaseSchema, PagedReleaseSchemaTypedDict
    from .pagedrepositoryschema import (
        PagedRepositorySchema,
        PagedRepositorySchemaTypedDict,
    )
    from .projectlevel import ProjectLevel
    from .projectschema import ProjectSchema, ProjectSchemaTypedDict
    from .releaseschema import ReleaseSchema, ReleaseSchemaTypedDict
    from .repositoryschema import RepositorySchema, RepositorySchemaTypedDict
    from .responsevalidationerror import ResponseValidationError
    from .security import Security, SecurityTypedDict
    from .state import State

__all__ = [
    "ChapterErrorResponse",
    "ChapterErrorResponseData",
    "ChapterSchema",
    "ChapterSchemaTypedDict",
    "CommitteeSchema",
    "CommitteeSchemaTypedDict",
    "EventSchema",
    "EventSchemaTypedDict",
    "GetChapterRequest",
    "GetChapterRequestTypedDict",
    "GetMemberRequest",
    "GetMemberRequestTypedDict",
    "IssueSchema",
    "IssueSchemaTypedDict",
    "ListChaptersOrdering",
    "ListChaptersRequest",
    "ListChaptersRequestTypedDict",
    "ListCommitteesOrdering",
    "ListCommitteesRequest",
    "ListCommitteesRequestTypedDict",
    "ListEventsOrdering",
    "ListEventsRequest",
    "ListEventsRequestTypedDict",
    "ListIssuesOrdering",
    "ListIssuesRequest",
    "ListIssuesRequestTypedDict",
    "ListMembersOrdering",
    "ListMembersRequest",
    "ListMembersRequestTypedDict",
    "ListOrganizationsOrdering",
    "ListOrganizationsRequest",
    "ListOrganizationsRequestTypedDict",
    "ListProjectsOrdering",
    "ListProjectsRequest",
    "ListProjectsRequestTypedDict",
    "ListReleasesOrdering",
    "ListReleasesRequest",
    "ListReleasesRequestTypedDict",
    "ListRepositoriesOrdering",
    "ListRepositoriesRequest",
    "ListRepositoriesRequestTypedDict",
    "MemberErrorResponse",
    "MemberErrorResponseData",
    "MemberSchema",
    "MemberSchemaTypedDict",
    "NestAPIError",
    "NestError",
    "NoResponseError",
    "OrganizationSchema",
    "OrganizationSchemaTypedDict",
    "PagedChapterSchema",
    "PagedChapterSchemaTypedDict",
    "PagedCommitteeSchema",
    "PagedCommitteeSchemaTypedDict",
    "PagedEventSchema",
    "PagedEventSchemaTypedDict",
    "PagedIssueSchema",
    "PagedIssueSchemaTypedDict",
    "PagedMemberSchema",
    "PagedMemberSchemaTypedDict",
    "PagedOrganizationSchema",
    "PagedOrganizationSchemaTypedDict",
    "PagedProjectSchema",
    "PagedProjectSchemaTypedDict",
    "PagedReleaseSchema",
    "PagedReleaseSchemaTypedDict",
    "PagedRepositorySchema",
    "PagedRepositorySchemaTypedDict",
    "ProjectLevel",
    "ProjectSchema",
    "ProjectSchemaTypedDict",
    "ReleaseSchema",
    "ReleaseSchemaTypedDict",
    "RepositorySchema",
    "RepositorySchemaTypedDict",
    "ResponseValidationError",
    "Security",
    "SecurityTypedDict",
    "State",
]

_dynamic_imports: dict[str, str] = {
    "ChapterErrorResponse": ".chaptererrorresponse",
    "ChapterErrorResponseData": ".chaptererrorresponse",
    "ChapterSchema": ".chapterschema",
    "ChapterSchemaTypedDict": ".chapterschema",
    "CommitteeSchema": ".committeeschema",
    "CommitteeSchemaTypedDict": ".committeeschema",
    "EventSchema": ".eventschema",
    "EventSchemaTypedDict": ".eventschema",
    "GetChapterRequest": ".get_chapterop",
    "GetChapterRequestTypedDict": ".get_chapterop",
    "GetMemberRequest": ".get_memberop",
    "GetMemberRequestTypedDict": ".get_memberop",
    "IssueSchema": ".issueschema",
    "IssueSchemaTypedDict": ".issueschema",
    "ListChaptersOrdering": ".list_chaptersop",
    "ListChaptersRequest": ".list_chaptersop",
    "ListChaptersRequestTypedDict": ".list_chaptersop",
    "ListCommitteesOrdering": ".list_committeesop",
    "ListCommitteesRequest": ".list_committeesop",
    "ListCommitteesRequestTypedDict": ".list_committeesop",
    "ListEventsOrdering": ".list_eventsop",
    "ListEventsRequest": ".list_eventsop",
    "ListEventsRequestTypedDict": ".list_eventsop",
    "ListIssuesOrdering": ".list_issuesop",
    "ListIssuesRequest": ".list_issuesop",
    "ListIssuesRequestTypedDict": ".list_issuesop",
    "ListMembersOrdering": ".list_membersop",
    "ListMembersRequest": ".list_membersop",
    "ListMembersRequestTypedDict": ".list_membersop",
    "ListOrganizationsOrdering": ".list_organizationsop",
    "ListOrganizationsRequest": ".list_organizationsop",
    "ListOrganizationsRequestTypedDict": ".list_organizationsop",
    "ListProjectsOrdering": ".list_projectsop",
    "ListProjectsRequest": ".list_projectsop",
    "ListProjectsRequestTypedDict": ".list_projectsop",
    "ListReleasesOrdering": ".list_releasesop",
    "ListReleasesRequest": ".list_releasesop",
    "ListReleasesRequestTypedDict": ".list_releasesop",
    "ListRepositoriesOrdering": ".list_repositoriesop",
    "ListRepositoriesRequest": ".list_repositoriesop",
    "ListRepositoriesRequestTypedDict": ".list_repositoriesop",
    "MemberErrorResponse": ".membererrorresponse",
    "MemberErrorResponseData": ".membererrorresponse",
    "MemberSchema": ".memberschema",
    "MemberSchemaTypedDict": ".memberschema",
    "NestAPIError": ".nestapierror",
    "NoResponseError": ".no_response_error",
    "OrganizationSchema": ".organizationschema",
    "OrganizationSchemaTypedDict": ".organizationschema",
    "PagedChapterSchema": ".pagedchapterschema",
    "PagedChapterSchemaTypedDict": ".pagedchapterschema",
    "PagedCommitteeSchema": ".pagedcommitteeschema",
    "PagedCommitteeSchemaTypedDict": ".pagedcommitteeschema",
    "PagedEventSchema": ".pagedeventschema",
    "PagedEventSchemaTypedDict": ".pagedeventschema",
    "PagedIssueSchema": ".pagedissueschema",
    "PagedIssueSchemaTypedDict": ".pagedissueschema",
    "PagedMemberSchema": ".pagedmemberschema",
    "PagedMemberSchemaTypedDict": ".pagedmemberschema",
    "PagedOrganizationSchema": ".pagedorganizationschema",
    "PagedOrganizationSchemaTypedDict": ".pagedorganizationschema",
    "PagedProjectSchema": ".pagedprojectschema",
    "PagedProjectSchemaTypedDict": ".pagedprojectschema",
    "PagedReleaseSchema": ".pagedreleaseschema",
    "PagedReleaseSchemaTypedDict": ".pagedreleaseschema",
    "PagedRepositorySchema": ".pagedrepositoryschema",
    "PagedRepositorySchemaTypedDict": ".pagedrepositoryschema",
    "ProjectLevel": ".projectlevel",
    "ProjectSchema": ".projectschema",
    "ProjectSchemaTypedDict": ".projectschema",
    "ReleaseSchema": ".releaseschema",
    "ReleaseSchemaTypedDict": ".releaseschema",
    "RepositorySchema": ".repositoryschema",
    "RepositorySchemaTypedDict": ".repositoryschema",
    "ResponseValidationError": ".responsevalidationerror",
    "Security": ".security",
    "SecurityTypedDict": ".security",
    "State": ".state",
}


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)
