from typing import List


class UserAlertsTable(object):

    def __init__(
        self,
        user_id,    # type: str
        user_name,  # type: str
    ):
        # type: (...) -> None

        self.user_id = user_id
        self.user_name = user_name
        self.records = []  # type: List[AlertCondition]

    def add(
        self,
        alert_type,  # type: str
        value,       # type: str
    ):
        # type: (...) -> None

        self.records.append(AlertCondition(
            alert_type,
            value,
        ))

    def build_table_rows(self):
        # type: (...) -> List[List[str, str, str]]

        return [[self.user_name, cond.alert_type, cond.value] for cond in self.records]


class AlertCondition(object):
    def __init__(
        self,
        alert_type,  # type: str
        value,       # type: str
    ):
        # type: (...) -> None

        self.alert_type = alert_type
        self.value = value
