<?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.HistorySyncType</code>
 */
class HistorySyncType
{
    /**
     * Generated from protobuf enum <code>INITIAL_BOOTSTRAP = 0;</code>
     */
    const INITIAL_BOOTSTRAP = 0;
    /**
     * Generated from protobuf enum <code>INITIAL_STATUS_V3 = 1;</code>
     */
    const INITIAL_STATUS_V3 = 1;
    /**
     * Generated from protobuf enum <code>FULL = 2;</code>
     */
    const FULL = 2;
    /**
     * Generated from protobuf enum <code>RECENT = 3;</code>
     */
    const RECENT = 3;
    /**
     * Generated from protobuf enum <code>PUSH_NAME = 4;</code>
     */
    const PUSH_NAME = 4;
    /**
     * Generated from protobuf enum <code>NON_BLOCKING_DATA = 5;</code>
     */
    const NON_BLOCKING_DATA = 5;
    /**
     * Generated from protobuf enum <code>ON_DEMAND = 6;</code>
     */
    const ON_DEMAND = 6;
    /**
     * Generated from protobuf enum <code>NO_HISTORY = 7;</code>
     */
    const NO_HISTORY = 7;
    /**
     * Generated from protobuf enum <code>MESSAGE_ACCESS_STATUS = 8;</code>
     */
    const MESSAGE_ACCESS_STATUS = 8;

    private static $valueToName = [
        self::INITIAL_BOOTSTRAP => 'INITIAL_BOOTSTRAP',
        self::INITIAL_STATUS_V3 => 'INITIAL_STATUS_V3',
        self::FULL => 'FULL',
        self::RECENT => 'RECENT',
        self::PUSH_NAME => 'PUSH_NAME',
        self::NON_BLOCKING_DATA => 'NON_BLOCKING_DATA',
        self::ON_DEMAND => 'ON_DEMAND',
        self::NO_HISTORY => 'NO_HISTORY',
        self::MESSAGE_ACCESS_STATUS => 'MESSAGE_ACCESS_STATUS',
    ];

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

