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

namespace Google\Cloud\Compute\V1\AcceleratorTopologiesInfoAcceleratorTopologyInfoInfoPerTopologyState;

use UnexpectedValueException;

/**
 * The state of the accelerator topology.
 *
 * Protobuf type <code>google.cloud.compute.v1.AcceleratorTopologiesInfoAcceleratorTopologyInfoInfoPerTopologyState.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;
    /**
     * The accelerator topology is available.
     *
     * Generated from protobuf enum <code>AVAILABLE = 442079913;</code>
     */
    const AVAILABLE = 442079913;
    /**
     * The accelerator topology is degraded. The underlying capacity is not in a
     * healthy state and is not available.
     *
     * Generated from protobuf enum <code>DEGRADED = 396890926;</code>
     */
    const DEGRADED = 396890926;
    /**
     * The accelerator topology is running. If there are both running and
     * degraded hosts within a topology, DEGRADED state will be returned.
     *
     * Generated from protobuf enum <code>RUNNING = 121282975;</code>
     */
    const RUNNING = 121282975;
    /**
     * The state of the topology is unspecified.
     *
     * Generated from protobuf enum <code>TOPOLOGY_STATE_UNSPECIFIED = 188327545;</code>
     */
    const TOPOLOGY_STATE_UNSPECIFIED = 188327545;
    /**
     * This value has been deprecated and is no longer used.
     *
     * Generated from protobuf enum <code>UNHEALTHY = 462118084;</code>
     */
    const UNHEALTHY = 462118084;

    private static $valueToName = [
        self::UNDEFINED_STATE => 'UNDEFINED_STATE',
        self::AVAILABLE => 'AVAILABLE',
        self::DEGRADED => 'DEGRADED',
        self::RUNNING => 'RUNNING',
        self::TOPOLOGY_STATE_UNSPECIFIED => 'TOPOLOGY_STATE_UNSPECIFIED',
        self::UNHEALTHY => 'UNHEALTHY',
    ];

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


