<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/memcache/v1beta2/cloud_memcache.proto

namespace Google\Cloud\Memcache\V1beta2;

use UnexpectedValueException;

/**
 * Memcached versions supported by our service.
 *
 * Protobuf type <code>google.cloud.memcache.v1beta2.MemcacheVersion</code>
 */
class MemcacheVersion
{
    /**
     * Generated from protobuf enum <code>MEMCACHE_VERSION_UNSPECIFIED = 0;</code>
     */
    const MEMCACHE_VERSION_UNSPECIFIED = 0;
    /**
     * Memcached 1.5 version.
     *
     * Generated from protobuf enum <code>MEMCACHE_1_5 = 1;</code>
     */
    const MEMCACHE_1_5 = 1;

    private static $valueToName = [
        self::MEMCACHE_VERSION_UNSPECIFIED => 'MEMCACHE_VERSION_UNSPECIFIED',
        self::MEMCACHE_1_5 => 'MEMCACHE_1_5',
    ];

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

