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

namespace PhpWA\Protocol\Proto\Message\PeerDataOperationRequestResponseMessage\PeerDataOperationResult;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode</code>
 */
class FullHistorySyncOnDemandResponseCode
{
    /**
     * Generated from protobuf enum <code>REQUEST_SUCCESS = 0;</code>
     */
    const REQUEST_SUCCESS = 0;
    /**
     * Generated from protobuf enum <code>REQUEST_TIME_EXPIRED = 1;</code>
     */
    const REQUEST_TIME_EXPIRED = 1;
    /**
     * Generated from protobuf enum <code>DECLINED_SHARING_HISTORY = 2;</code>
     */
    const DECLINED_SHARING_HISTORY = 2;
    /**
     * Generated from protobuf enum <code>GENERIC_ERROR = 3;</code>
     */
    const GENERIC_ERROR = 3;
    /**
     * Generated from protobuf enum <code>ERROR_REQUEST_ON_NON_SMB_PRIMARY = 4;</code>
     */
    const ERROR_REQUEST_ON_NON_SMB_PRIMARY = 4;
    /**
     * Generated from protobuf enum <code>ERROR_HOSTED_DEVICE_NOT_CONNECTED = 5;</code>
     */
    const ERROR_HOSTED_DEVICE_NOT_CONNECTED = 5;
    /**
     * Generated from protobuf enum <code>ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET = 6;</code>
     */
    const ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET = 6;

    private static $valueToName = [
        self::REQUEST_SUCCESS => 'REQUEST_SUCCESS',
        self::REQUEST_TIME_EXPIRED => 'REQUEST_TIME_EXPIRED',
        self::DECLINED_SHARING_HISTORY => 'DECLINED_SHARING_HISTORY',
        self::GENERIC_ERROR => 'GENERIC_ERROR',
        self::ERROR_REQUEST_ON_NON_SMB_PRIMARY => 'ERROR_REQUEST_ON_NON_SMB_PRIMARY',
        self::ERROR_HOSTED_DEVICE_NOT_CONNECTED => 'ERROR_HOSTED_DEVICE_NOT_CONNECTED',
        self::ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET => 'ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET',
    ];

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

