from __future__ import annotations

import logging
from pathlib import Path

from clarabot_nano_common.common.config.extract.data_dir import DataDirExtractedConfig

logger = logging.getLogger(__name__)


class ControlApiConfig(DataDirExtractedConfig):
    def __init__(self, config):
        DataDirExtractedConfig.__init__(self, config)
        # NOTE: these are for convenience as they cannot change runtime (local).
        self.control_api_path = Path(config["local"]["control_api_path"])
        self.control_api_mode = config["local"]["control_api_mode"]
        self.control_api_group = config["local"]["control_api_group"]

    def _matches(self, other: ControlApiConfig) -> bool:
        return DataDirExtractedConfig._matches(self, other)
