# #region AsyncSupersetClientModule [C:3] [TYPE Module] [SEMANTICS superset, transform, dashboard, filter, async-superset-client]
# @defgroup Core Module group.
# @BRIEF Backward-compatible alias for the async-migrated SupersetClient.
# @DEPRECATED 2026-06-04 — class kept as thin compat wrapper. New code should import SupersetClient directly.
# @REPLACED_BY -> [SupersetClient]
# @LAYER Core
# @RELATION INHERITS -> [SupersetClient]
# @RELATION DEPENDS_ON -> [AsyncAPIClient]
# @SIDE_EFFECT Асинхронные HTTP-вызовы к Superset API.

from .config_models import Environment
from .superset_client import SupersetClient
from .utils.async_network import AsyncAPIClient


# #region AsyncSupersetClient [C:3] [TYPE Class]
# @defgroup Core Module group.
# @BRIEF Backward-compatible alias for the async-migrated SupersetClient.
# @RELATION INHERITS -> [SupersetClient]
# @RELATION DEPENDS_ON -> [AsyncAPIClient]
# @SIDE_EFFECT Асинхронные HTTP-вызовы к Superset API.
class AsyncSupersetClient(SupersetClient):
    """Backward-compatible alias. SupersetClient is now fully async.

    All methods from SupersetClient mixins are available as async methods.
    Use SupersetClientRegistry.get_client() for shared connection pooling.
    """

    # #region AsyncSupersetClientInit [TYPE Function] [C:2]
# @ingroup Core
    # @PURPOSE: Initialize async Superset client — delegates to SupersetClient.
    # @PRE  env is valid Environment instance.
    # @POST  Client uses AsyncAPIClient transport.
    # @RELATION DEPENDS_ON -> [AsyncAPIClient]
    def __init__(self, env: Environment):
        # Call parent which creates AsyncAPIClient automatically
        super().__init__(env)
    # #endregion AsyncSupersetClientInit

    # #region AsyncSupersetClientClose [TYPE Function] [C:2]
# @ingroup Core
    # @PURPOSE: Close async transport resources.
    # @POST  Underlying AsyncAPIClient is closed.
    # @SIDE_EFFECT  Closes network sockets.
    # @RELATION CALLS -> [AsyncAPIClient.aclose]
    async def aclose(self) -> None:
        await self.client.aclose()
    # #endregion AsyncSupersetClientClose
# #endregion AsyncSupersetClient
# #endregion AsyncSupersetClientModule
