from telethon.tl.mtproto_request import MTProtoRequest


class ChannelParticipantEditor(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    channelParticipantEditor#98192d61 user_id:int inviter_id:int date:date = ChannelParticipant"""

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

    def __init__(self, user_id, inviter_id, date):
        """
        :param user_id: Telegram type: «int».
        :param inviter_id: Telegram type: «int».
        :param date: Telegram type: «date».
        """
        super().__init__()

        self.user_id = user_id
        self.inviter_id = inviter_id
        self.date = date

    def on_send(self, writer):
        writer.write_int(ChannelParticipantEditor.constructor_id, signed=False)
        writer.write_int(self.user_id)
        writer.write_int(self.inviter_id)
        writer.tgwrite_date(self.date)

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

    def on_response(self, reader):
        self.user_id = reader.read_int()
        self.inviter_id = reader.read_int()
        self.date = reader.tgread_date()

    def __repr__(self):
        return 'channelParticipantEditor#98192d61 user_id:int inviter_id:int date:date = ChannelParticipant'

    def __str__(self):
        return '(channelParticipantEditor (ID: 0x98192d61) = (user_id={}, inviter_id={}, date={}))'.format(str(self.user_id), str(self.inviter_id), str(self.date))
