<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_chat_preview( self, invite_link: str ):
 """Use this method to get the preview of a chat using the invite link. This method only returns a chat preview, if you want to join a chat use :meth:`join_chat` Args: invite_link (``str``):
 Unique identifier for the target chat in form of *t.me/joinchat/* links. Returns: Either :obj:`Chat` or :obj:`ChatPreview`, depending on whether you already joined the chat or not. Raises: :class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error. ``ValueError`` in case of an invalid invite_link. """

        match = self.INVITE_LINK_RE.match(invite_link)

        if match:
            r = self.send(
                functions.messages.CheckChatInvite(
                    hash=match.group(1)
                )
            )

            if isinstance(r, types.ChatInvite):
                return pyrogram.ChatPreview._parse(self, r)

            if isinstance(r, types.ChatInviteAlready):
                chat = r.chat

                if isinstance(chat, types.Chat):
                    return pyrogram.Chat._parse_chat_chat(self, chat)

                if isinstance(chat, types.Channel):
                    return pyrogram.Chat._parse_channel_chat(self, chat)
        else:
            raise ValueError("The invite_link is invalid")