from telethon.tl.mtproto_request import MTProtoRequest


class SendMessageUploadAudioAction(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction"""

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

    def __init__(self, progress):
        """
        :param progress: Telegram type: «int».
        """
        super().__init__()

        self.progress = progress

    def on_send(self, writer):
        writer.write_int(SendMessageUploadAudioAction.constructor_id, signed=False)
        writer.write_int(self.progress)

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

    def on_response(self, reader):
        self.progress = reader.read_int()

    def __repr__(self):
        return 'sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction'

    def __str__(self):
        return '(sendMessageUploadAudioAction (ID: 0xf351d7ab) = (progress={}))'.format(str(self.progress))
