from typing import (
    Dict,
    List,
    Optional,
    Union,
)

from nreports.repository import (
    I18NRepository,
    L10NRepository,
)
from nreports_api.shared import JSON
from ._Line import Line


class CommandLine(Line):

    def __init__(
        self,
        line: JSON,
    ) -> None:
        super().__init__(line)

        self.command = line.get("command")

    def inner_format(
        self,
        data: Dict[str, Union[JSON, Dict[str, List[Dict[str, JSON]]]]],
        i18n_repository: I18NRepository,
        l10n_repository: L10NRepository,
    ) -> List[Dict[str, str]]:

        return [{"command": self.command}]

    def get_inner_data_to_build(
        self,
    ) -> Dict[str, Optional[Dict[str, None]]]:

        return {}
