# 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 .get_purchase_orders_root_request_status import GetPurchaseOrdersRootRequestStatus
    from .get_purchase_orders_root_response import GetPurchaseOrdersRootResponse
    from .patch_purchase_orders_id_request_items_item import PatchPurchaseOrdersIdRequestItemsItem
    from .purchase_order_bulk_upsert_request_purchase_orders_item import (
        PurchaseOrderBulkUpsertRequestPurchaseOrdersItem,
    )
    from .purchase_order_bulk_upsert_request_purchase_orders_item_items_item import (
        PurchaseOrderBulkUpsertRequestPurchaseOrdersItemItemsItem,
    )
    from .purchase_order_create_request_items_item import PurchaseOrderCreateRequestItemsItem
_dynamic_imports: typing.Dict[str, str] = {
    "GetPurchaseOrdersRootRequestStatus": ".get_purchase_orders_root_request_status",
    "GetPurchaseOrdersRootResponse": ".get_purchase_orders_root_response",
    "PatchPurchaseOrdersIdRequestItemsItem": ".patch_purchase_orders_id_request_items_item",
    "PurchaseOrderBulkUpsertRequestPurchaseOrdersItem": ".purchase_order_bulk_upsert_request_purchase_orders_item",
    "PurchaseOrderBulkUpsertRequestPurchaseOrdersItemItemsItem": ".purchase_order_bulk_upsert_request_purchase_orders_item_items_item",
    "PurchaseOrderCreateRequestItemsItem": ".purchase_order_create_request_items_item",
}


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__ = [
    "GetPurchaseOrdersRootRequestStatus",
    "GetPurchaseOrdersRootResponse",
    "PatchPurchaseOrdersIdRequestItemsItem",
    "PurchaseOrderBulkUpsertRequestPurchaseOrdersItem",
    "PurchaseOrderBulkUpsertRequestPurchaseOrdersItemItemsItem",
    "PurchaseOrderCreateRequestItemsItem",
]
