from telethon.tl.mtproto_request import MTProtoRequest


class UpdateStatusRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    account.updateStatus#6628562c offline:Bool = Bool"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0x6628562c

    def __init__(self, offline):
        """
        :param offline: Telegram type: «Bool».
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.offline = offline

    def on_send(self, writer):
        writer.write_int(UpdateStatusRequest.constructor_id, signed=False)
        writer.tgwrite_bool(self.offline)

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return UpdateStatusRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'account.updateStatus#6628562c offline:Bool = Bool'

    def __str__(self):
        return '(account.updateStatus (ID: 0x6628562c) = (offline={}))'.format(str(self.offline))
