from ....tl.mtproto_request import MTProtoRequest


class GetMessageEditDataRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData"""

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

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

        :returns messages.MessageEditData: Instance of MessageEditData.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.peer = peer
        self.id = id

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

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

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

    def __repr__(self):
        return 'messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData'

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