from ...tl.mtproto_request import MTProtoRequest


class InputNotifyPeer(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer"""

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

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

        Constructor for InputNotifyPeer: Instance of either InputNotifyPeer, InputNotifyUsers, InputNotifyChats, InputNotifyAll.
        """
        super().__init__()

        self.peer = peer

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

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

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

    def __repr__(self):
        return 'inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer'

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