def METHOD_NAME(cls, data: str) -> Optional[UnsubscribeData]:
    if data.find(UNSUB_PREFIX) == -1:
        try:
            # subject has the format {alias.id}=
            if data.endswith("="):
                alias_id = int(data[:-1])
                return UnsubscribeData(UnsubscribeAction.DisableAlias, alias_id)
            # {contact.id}_
            elif data.endswith("_"):
                contact_id = int(data[:-1])
                return UnsubscribeData(UnsubscribeAction.DisableContact, contact_id)
            # {user.id}*
            elif data.endswith("*"):
                user_id = int(data[:-1])
                return UnsubscribeData(
                    UnsubscribeAction.UnsubscribeNewsletter, user_id
                )
            else:
                # some email providers might strip off the = suffix
                alias_id = int(data)
                return UnsubscribeData(UnsubscribeAction.DisableAlias, alias_id)
        except ValueError:
            return None
    signer = cls._get_signer()
    try:
        verified_data = signer.unsign(data[len(UNSUB_PREFIX) + 1 :])
    except itsdangerous.BadSignature:
        return None
    try:
        padded_data = verified_data + (b"=" * (-len(verified_data) % 4))
        payload = json.loads(base64.urlsafe_b64decode(padded_data))
    except ValueError:
        return None
    action = UnsubscribeAction(payload[0])
    action_data = payload[1]
    if action == UnsubscribeAction.OriginalUnsubscribeMailto:
        # Skip version number in action_data[0] for now it's always 0
        action_data = UnsubscribeOriginalData(
            action_data[1], action_data[2], action_data[3]
        )
    return UnsubscribeData(action, action_data)