from telethon.tl.mtproto_request import MTProtoRequest


class NotifyPeer(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    notifyPeer#9fd40bd8 peer:Peer = NotifyPeer"""

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

    def __init__(self, peer):
        """
        :param peer: Telegram type: «Peer».
        """
        super().__init__()

        self.peer = peer

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

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

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

    def __repr__(self):
        return 'notifyPeer#9fd40bd8 peer:Peer = NotifyPeer'

    def __str__(self):
        return '(notifyPeer (ID: 0x9fd40bd8) = (peer={}))'.format(str(self.peer))
