# clab_connector/services/eda_remover.py

import logging

from eda_integration.clients.eda.client import EDAClient

logger = logging.getLogger(__name__)


class EDARemover:
    """Remove EDA namespace and its resources via transaction."""

    def __init__(self, eda_client: EDAClient):
        self.eda_client = eda_client

    def run(self, namespace: str) -> None:
        """Remove the given namespace from EDA via a delete transaction."""
        self.eda_client.add_delete_to_transaction(
            namespace="",
            kind="Namespace",
            name=namespace,
        )
        self.eda_client.commit_transaction(f"Remove namespace {namespace}")
