import warnings
import sys
from types import ModuleType

# Import everything from enums
from .enums import *

# Import other modules
from . import schema, server, utils, graphapp_manager, playground_login


# Create a deprecation wrapper module
class DeprecatedTypesModule(ModuleType):
    def __getattr__(self, name):
        warnings.warn(
            f"Accessing '{name}' from 'adxp_sdk.serves.types' is deprecated. "
            "Please use 'adxp_sdk.serves.enums' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        # Get the attribute from enums module
        return getattr(sys.modules["adxp_sdk.serves.enums"], name)


# Register the deprecated types module
deprecated_types = DeprecatedTypesModule("adxp_sdk.serves.types")
sys.modules["adxp_sdk.serves.types"] = deprecated_types
