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

namespace Google\Cloud\GkeMultiCloud\V1\AzureCluster;

use UnexpectedValueException;

/**
 * The lifecycle state of the cluster.
 *
 * Protobuf type <code>google.cloud.gkemulticloud.v1.AzureCluster.State</code>
 */
class State
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The PROVISIONING state indicates the cluster is being created.
     *
     * Generated from protobuf enum <code>PROVISIONING = 1;</code>
     */
    const PROVISIONING = 1;
    /**
     * The RUNNING state indicates the cluster has been created and is fully
     * usable.
     *
     * Generated from protobuf enum <code>RUNNING = 2;</code>
     */
    const RUNNING = 2;
    /**
     * The RECONCILING state indicates that some work is actively being done on
     * the cluster, such as upgrading the control plane replicas.
     *
     * Generated from protobuf enum <code>RECONCILING = 3;</code>
     */
    const RECONCILING = 3;
    /**
     * The STOPPING state indicates the cluster is being deleted.
     *
     * Generated from protobuf enum <code>STOPPING = 4;</code>
     */
    const STOPPING = 4;
    /**
     * The ERROR state indicates the cluster is in a broken unrecoverable
     * state.
     *
     * Generated from protobuf enum <code>ERROR = 5;</code>
     */
    const ERROR = 5;
    /**
     * The DEGRADED state indicates the cluster 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);
    }
}


