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

namespace Google\Cloud\GkeMultiCloud\V1\AwsNodePool;

use UnexpectedValueException;

/**
 * The lifecycle state of the node pool.
 *
 * Protobuf type <code>google.cloud.gkemulticloud.v1.AwsNodePool.State</code>
 */
class State
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The PROVISIONING state indicates the node pool is being created.
     *
     * Generated from protobuf enum <code>PROVISIONING = 1;</code>
     */
    const PROVISIONING = 1;
    /**
     * The RUNNING state indicates the node pool has been created
     * and is fully usable.
     *
     * Generated from protobuf enum <code>RUNNING = 2;</code>
     */
    const RUNNING = 2;
    /**
     * The RECONCILING state indicates that the node pool is being reconciled.
     *
     * Generated from protobuf enum <code>RECONCILING = 3;</code>
     */
    const RECONCILING = 3;
    /**
     * The STOPPING state indicates the node pool is being deleted.
     *
     * Generated from protobuf enum <code>STOPPING = 4;</code>
     */
    const STOPPING = 4;
    /**
     * The ERROR state indicates the node pool is in a broken unrecoverable
     * state.
     *
     * Generated from protobuf enum <code>ERROR = 5;</code>
     */
    const ERROR = 5;
    /**
     * The DEGRADED state indicates the node pool requires user action to
     * restore full functionality.
     *
     * Generated from protobuf enum <code>DEGRADED = 6;</code>
     */
    const DEGRADED = 6;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::PROVISIONING => 'PROVISIONING',
        self::RUNNING => 'RUNNING',
        self::RECONCILING => 'RECONCILING',
        self::STOPPING => 'STOPPING',
        self::ERROR => 'ERROR',
        self::DEGRADED => 'DEGRADED',
    ];

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

