<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto\Message;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.Message.PeerDataOperationRequestType</code>
 */
class PeerDataOperationRequestType
{
    /**
     * Generated from protobuf enum <code>UPLOAD_STICKER = 0;</code>
     */
    const UPLOAD_STICKER = 0;
    /**
     * Generated from protobuf enum <code>SEND_RECENT_STICKER_BOOTSTRAP = 1;</code>
     */
    const SEND_RECENT_STICKER_BOOTSTRAP = 1;
    /**
     * Generated from protobuf enum <code>GENERATE_LINK_PREVIEW = 2;</code>
     */
    const GENERATE_LINK_PREVIEW = 2;
    /**
     * Generated from protobuf enum <code>HISTORY_SYNC_ON_DEMAND = 3;</code>
     */
    const HISTORY_SYNC_ON_DEMAND = 3;
    /**
     * Generated from protobuf enum <code>PLACEHOLDER_MESSAGE_RESEND = 4;</code>
     */
    const PLACEHOLDER_MESSAGE_RESEND = 4;
    /**
     * Generated from protobuf enum <code>WAFFLE_LINKING_NONCE_FETCH = 5;</code>
     */
    const WAFFLE_LINKING_NONCE_FETCH = 5;
    /**
     * Generated from protobuf enum <code>FULL_HISTORY_SYNC_ON_DEMAND = 6;</code>
     */
    const FULL_HISTORY_SYNC_ON_DEMAND = 6;
    /**
     * Generated from protobuf enum <code>COMPANION_META_NONCE_FETCH = 7;</code>
     */
    const COMPANION_META_NONCE_FETCH = 7;
    /**
     * Generated from protobuf enum <code>COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY = 8;</code>
     */
    const COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY = 8;
    /**
     * Generated from protobuf enum <code>COMPANION_CANONICAL_USER_NONCE_FETCH = 9;</code>
     */
    const COMPANION_CANONICAL_USER_NONCE_FETCH = 9;
    /**
     * Generated from protobuf enum <code>HISTORY_SYNC_CHUNK_RETRY = 10;</code>
     */
    const HISTORY_SYNC_CHUNK_RETRY = 10;
    /**
     * Generated from protobuf enum <code>GALAXY_FLOW_ACTION = 11;</code>
     */
    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);
    }
}

