from ...tl.mtproto_request import MTProtoRequest


class ChatInviteExported(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    chatInviteExported#fc2e05bc link:string = ExportedChatInvite"""

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

    def __init__(self, link):
        """
        :param link: Telegram type: «string».

        Constructor for ExportedChatInvite: Instance of either ChatInviteEmpty, ChatInviteExported.
        """
        super().__init__()

        self.link = link

    def on_send(self, writer):
        writer.write_int(ChatInviteExported.constructor_id, signed=False)
        writer.tgwrite_string(self.link)

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

    def on_response(self, reader):
        self.link = reader.tgread_string()

    def __repr__(self):
        return 'chatInviteExported#fc2e05bc link:string = ExportedChatInvite'

    def __str__(self):
        return '(chatInviteExported (ID: 0xfc2e05bc) = (link={}))'.format(str(self.link))
