from ...tl.tlobject import TLObject


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

    # Telegram's constructor (U)ID for this class
    constructor_id = 0xb8bc5b0c
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0x58981615

    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 to_dict(self):
        return {
            'peer': None if self.peer is None else self.peer.to_dict(),
        }

    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 (attributes=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 TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)
