<?php
 
 
 

namespace PhpWA\Protocol\Proto\Message;

use UnexpectedValueException;




class PeerDataOperationRequestType
{
    


    const UPLOAD_STICKER = 0;
    


    const SEND_RECENT_STICKER_BOOTSTRAP = 1;
    


    const GENERATE_LINK_PREVIEW = 2;
    


    const HISTORY_SYNC_ON_DEMAND = 3;
    


    const PLACEHOLDER_MESSAGE_RESEND = 4;
    


    const WAFFLE_LINKING_NONCE_FETCH = 5;
    


    const FULL_HISTORY_SYNC_ON_DEMAND = 6;
    


    const COMPANION_META_NONCE_FETCH = 7;
    


    const COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY = 8;
    


    const COMPANION_CANONICAL_USER_NONCE_FETCH = 9;
    


    const HISTORY_SYNC_CHUNK_RETRY = 10;
    


    const GALAXY_FLOW_ACTION = 11;

    private static $valueToName = [
        self::UPLOAD_STICKER => 'UPLOAD_STICKER',
        self::SEND_RECENT_STICKER_BOOTSTRAP => 'SEND_RECENT_STICKER_BOOTSTRAP',
        self::GENERATE_LINK_PREVIEW => 'GENERATE_LINK_PREVIEW',
        self::HISTORY_SYNC_ON_DEMAND => 'HISTORY_SYNC_ON_DEMAND',
        self::PLACEHOLDER_MESSAGE_RESEND => 'PLACEHOLDER_MESSAGE_RESEND',
        self::WAFFLE_LINKING_NONCE_FETCH => 'WAFFLE_LINKING_NONCE_FETCH',
        self::FULL_HISTORY_SYNC_ON_DEMAND => 'FULL_HISTORY_SYNC_ON_DEMAND',
        self::COMPANION_META_NONCE_FETCH => 'COMPANION_META_NONCE_FETCH',
        self::COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY => 'COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY',
        self::COMPANION_CANONICAL_USER_NONCE_FETCH => 'COMPANION_CANONICAL_USER_NONCE_FETCH',
        self::HISTORY_SYNC_CHUNK_RETRY => 'HISTORY_SYNC_CHUNK_RETRY',
        self::GALAXY_FLOW_ACTION => 'GALAXY_FLOW_ACTION',
    ];

    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);
    }
}

