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

namespace Google\Cloud\Container\V1\Cluster;

use UnexpectedValueException;

/**
 * The current status of the cluster.
 *
 * Protobuf type <code>google.container.v1.Cluster.Status</code>
 */
class Status
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>STATUS_UNSPECIFIED = 0;</code>
     */
    const STATUS_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 master or node software. Details can
     * be found in the `statusMessage` field.
     *
     * 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 unusable. It will be
     * automatically deleted. Details can be found in the `statusMessage` field.
     *
     * Generated from protobuf enum <code>ERROR = 5;</code>
     */
    const ERROR = 5;
    /**
     * The DEGRADED state indicates the cluster requires user action to restore
     * full functionality. Details can be found in the `statusMessage` field.
     *
     * Generated from protobuf enum <code>DEGRADED = 6;</code>
     */
    const DEGRADED = 6;

    private static $valueToName = [
        self::STATUS_UNSPECIFIED => 'STATUS_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);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Status::class, \Google\Cloud\Container\V1\Cluster_Status::class);

