from clarabot_nano.core.config.update.base import AbstractRemoteConfigUpdateHandler


class UpdateIndexedLanguages(AbstractRemoteConfigUpdateHandler):
    HANDLER_KEY = "indexed_languages"

    def _execute(self, data: dict):
        self._c["indexed_languages"] = data["indexed_languages"]

    def _describe_change(self, old_config: dict, new_config: dict, data: dict) -> str:
        return f"Indexed languages set to {new_config.get('indexed_languages')!r}"
