from telethon.tl.mtproto_request import MTProtoRequest


class ChatParticipantCreator(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    chatParticipantCreator#da13538a user_id:int = ChatParticipant"""

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

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

        self.user_id = user_id

    def on_send(self, writer):
        writer.write_int(ChatParticipantCreator.constructor_id, signed=False)
        writer.write_int(self.user_id)

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

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

    def __repr__(self):
        return 'chatParticipantCreator#da13538a user_id:int = ChatParticipant'

    def __str__(self):
        return '(chatParticipantCreator (ID: 0xda13538a) = (user_id={}))'.format(str(self.user_id))
