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

namespace Google\Cloud\ResourceManager\V3\Project;

use UnexpectedValueException;

/**
 * Project lifecycle states.
 *
 * Protobuf type <code>google.cloud.resourcemanager.v3.Project.State</code>
 */
class State
{
    /**
     * Unspecified state.  This is only used/useful for distinguishing
     * unset values.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The normal and active state.
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * The project has been marked for deletion by the user
     * (by invoking
     * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject])
     * or by the system (Google Cloud Platform).
     * This can generally be reversed by invoking [UndeleteProject]
     * [google.cloud.resourcemanager.v3.Projects.UndeleteProject].
     *
     * Generated from protobuf enum <code>DELETE_REQUESTED = 2;</code>
     */
    const DELETE_REQUESTED = 2;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::ACTIVE => 'ACTIVE',
        self::DELETE_REQUESTED => 'DELETE_REQUESTED',
    ];

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


