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

namespace Google\Cloud\Compute\V1\DeprecationStatus;

use UnexpectedValueException;

/**
 * The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.
 *
 * Protobuf type <code>google.cloud.compute.v1.DeprecationStatus.State</code>
 */
class State
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATE = 0;</code>
     */
    const UNDEFINED_STATE = 0;
    /**
     * Generated from protobuf enum <code>ACTIVE = 46297862;</code>
     */
    const ACTIVE = 46297862;
    /**
     * Generated from protobuf enum <code>DELETED = 120962041;</code>
     */
    const DELETED = 120962041;
    /**
     * Generated from protobuf enum <code>DEPRECATED = 194924979;</code>
     */
    const DEPRECATED = 194924979;
    /**
     * Generated from protobuf enum <code>OBSOLETE = 66532761;</code>
     */
    const OBSOLETE = 66532761;

    private static $valueToName = [
        self::UNDEFINED_STATE => 'UNDEFINED_STATE',
        self::ACTIVE => 'ACTIVE',
        self::DELETED => 'DELETED',
        self::DEPRECATED => 'DEPRECATED',
        self::OBSOLETE => 'OBSOLETE',
    ];

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


