from ...tl.tlobject import TLObject


class WallPaperSolid(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper"""

    # Telegram's constructor (U)ID for this class
    constructor_id = 0x63117f24
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0x96a2c98b

    def __init__(self, id, title, bg_color, color):
        """
        :param id: Telegram type: "int".
        :param title: Telegram type: "string".
        :param bg_color: Telegram type: "int".
        :param color: Telegram type: "int".

        Constructor for WallPaper: Instance of either WallPaper, WallPaperSolid.
        """
        super().__init__()

        self.id = id
        self.title = title
        self.bg_color = bg_color
        self.color = color

    def to_dict(self):
        return {
            'id': self.id,
            'title': self.title,
            'bg_color': self.bg_color,
            'color': self.color,
        }

    def on_send(self, writer):
        writer.write_int(WallPaperSolid.constructor_id, signed=False)
        writer.write_int(self.id)
        writer.tgwrite_string(self.title)
        writer.write_int(self.bg_color)
        writer.write_int(self.color)

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return WallPaperSolid(None, None, None, None)

    def on_response(self, reader):
        self.id = reader.read_int()
        self.title = reader.tgread_string()
        self.bg_color = reader.read_int()
        self.color = reader.read_int()

    def __repr__(self):
        return 'wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)
