from ...tl.tlobject import TLObject


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

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

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

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

        self.link = link

    def to_dict(self):
        return {
            'link': self.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 (attributes=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 TLObject.pretty_format(self)

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