from ....tl.mtproto_request import MTProtoRequest


class ExportChatInviteRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite"""

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

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

        :returns ExportedChatInvite: Instance of either ChatInviteEmpty, ChatInviteExported.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.chat_id = chat_id

    def on_send(self, writer):
        writer.write_int(ExportChatInviteRequest.constructor_id, signed=False)
        writer.write_int(self.chat_id)

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

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

    def __repr__(self):
        return 'messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite'

    def __str__(self):
        return '(messages.exportChatInvite (ID: 0x7d885289) = (chat_id={}))'.format(str(self.chat_id))
