import json

from update_api.dto import PosUpdaterDto


class ChromeUpdaterDto(PosUpdaterDto):

    def __init__(
        self,               # type: ChromeUpdaterDto
        pos_id,             # type: int
        user_id,            # type: str
        validate_version,   # type: bool
    ):
        # type: (...) -> None

        super(ChromeUpdaterDto, self).__init__(
            pos_id=pos_id,
            user_id=user_id,
        )

        self.validate_version = validate_version

    def __str__(
        self,  # type: ChromeUpdaterDto
    ):
        # type: (...) -> str

        return json.dumps({
            "pos_id": self.pos_id,
            "user_id": self.user_id,
            "validate_version": self.validate_version,
        })
