<?php
 
 
 

namespace PhpWA\Protocol\Proto\Message\ProtocolMessage;

use UnexpectedValueException;




class Type
{
    


    const REVOKE = 0;
    


    const EPHEMERAL_SETTING = 3;
    


    const EPHEMERAL_SYNC_RESPONSE = 4;
    


    const HISTORY_SYNC_NOTIFICATION = 5;
    


    const APP_STATE_SYNC_KEY_SHARE = 6;
    


    const APP_STATE_SYNC_KEY_REQUEST = 7;
    


    const MSG_FANOUT_BACKFILL_REQUEST = 8;
    


    const INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9;
    


    const APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10;
    


    const SHARE_PHONE_NUMBER = 11;
    


    const MESSAGE_EDIT = 14;
    


    const PEER_DATA_OPERATION_REQUEST_MESSAGE = 16;
    


    const PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE = 17;
    


    const REQUEST_WELCOME_MESSAGE = 18;
    


    const BOT_FEEDBACK_MESSAGE = 19;
    


    const MEDIA_NOTIFY_MESSAGE = 20;
    


    const CLOUD_API_THREAD_CONTROL_NOTIFICATION = 21;
    


    const LID_MIGRATION_MAPPING_SYNC = 22;
    


    const REMINDER_MESSAGE = 23;
    


    const BOT_MEMU_ONBOARDING_MESSAGE = 24;
    


    const STATUS_MENTION_MESSAGE = 25;
    


    const STOP_GENERATION_MESSAGE = 26;
    


    const LIMIT_SHARING = 27;
    


    const AI_PSI_METADATA = 28;
    


    const AI_QUERY_FANOUT = 29;
    


    const GROUP_MEMBER_LABEL_CHANGE = 30;

    private static $valueToName = [
        self::REVOKE => 'REVOKE',
        self::EPHEMERAL_SETTING => 'EPHEMERAL_SETTING',
        self::EPHEMERAL_SYNC_RESPONSE => 'EPHEMERAL_SYNC_RESPONSE',
        self::HISTORY_SYNC_NOTIFICATION => 'HISTORY_SYNC_NOTIFICATION',
        self::APP_STATE_SYNC_KEY_SHARE => 'APP_STATE_SYNC_KEY_SHARE',
        self::APP_STATE_SYNC_KEY_REQUEST => 'APP_STATE_SYNC_KEY_REQUEST',
        self::MSG_FANOUT_BACKFILL_REQUEST => 'MSG_FANOUT_BACKFILL_REQUEST',
        self::INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC => 'INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC',
        self::APP_STATE_FATAL_EXCEPTION_NOTIFICATION => 'APP_STATE_FATAL_EXCEPTION_NOTIFICATION',
        self::SHARE_PHONE_NUMBER => 'SHARE_PHONE_NUMBER',
        self::MESSAGE_EDIT => 'MESSAGE_EDIT',
        self::PEER_DATA_OPERATION_REQUEST_MESSAGE => 'PEER_DATA_OPERATION_REQUEST_MESSAGE',
        self::PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE => 'PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE',
        self::REQUEST_WELCOME_MESSAGE => 'REQUEST_WELCOME_MESSAGE',
        self::BOT_FEEDBACK_MESSAGE => 'BOT_FEEDBACK_MESSAGE',
        self::MEDIA_NOTIFY_MESSAGE => 'MEDIA_NOTIFY_MESSAGE',
        self::CLOUD_API_THREAD_CONTROL_NOTIFICATION => 'CLOUD_API_THREAD_CONTROL_NOTIFICATION',
        self::LID_MIGRATION_MAPPING_SYNC => 'LID_MIGRATION_MAPPING_SYNC',
        self::REMINDER_MESSAGE => 'REMINDER_MESSAGE',
        self::BOT_MEMU_ONBOARDING_MESSAGE => 'BOT_MEMU_ONBOARDING_MESSAGE',
        self::STATUS_MENTION_MESSAGE => 'STATUS_MENTION_MESSAGE',
        self::STOP_GENERATION_MESSAGE => 'STOP_GENERATION_MESSAGE',
        self::LIMIT_SHARING => 'LIMIT_SHARING',
        self::AI_PSI_METADATA => 'AI_PSI_METADATA',
        self::AI_QUERY_FANOUT => 'AI_QUERY_FANOUT',
        self::GROUP_MEMBER_LABEL_CHANGE => 'GROUP_MEMBER_LABEL_CHANGE',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

