<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/appengine/v1/instance.proto

namespace Google\Cloud\AppEngine\V1\Instance;

use UnexpectedValueException;

/**
 * Availability of the instance.
 *
 * Protobuf type <code>google.appengine.v1.Instance.Availability</code>
 */
class Availability
{
    /**
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * Generated from protobuf enum <code>RESIDENT = 1;</code>
     */
    const RESIDENT = 1;
    /**
     * Generated from protobuf enum <code>DYNAMIC = 2;</code>
     */
    const DYNAMIC = 2;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::RESIDENT => 'RESIDENT',
        self::DYNAMIC => 'DYNAMIC',
    ];

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


