<?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 running.
     *
     * 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;
    /**
     * The accelerator topology is unhealthy.
     *
     * Generated from protobuf enum <code>UNHEALTHY = 462118084;</code>
     */
    const UNHEALTHY = 462118084;

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


