from ....tl.mtproto_request import MTProtoRequest


class ForwardMessageRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates"""

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

    def __init__(self, peer, id, random_id):
        """
        :param peer: Telegram type: «InputPeer».
        :param id: Telegram type: «int».
        :param random_id: Telegram type: «long».

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, UpdatesTg, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.peer = peer
        self.id = id
        self.random_id = random_id

    def on_send(self, writer):
        writer.write_int(ForwardMessageRequest.constructor_id, signed=False)
        self.peer.on_send(writer)
        writer.write_int(self.id)
        writer.write_long(self.random_id)

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

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

    def __repr__(self):
        return 'messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates'

    def __str__(self):
        return '(messages.forwardMessage (ID: 0x33963bf9) = (peer={}, id={}, random_id={}))'.format(str(self.peer), str(self.id), str(self.random_id))
