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

namespace Google\Cloud\Compute\V1\InstanceGroupManagerStatusAcceleratorTopology;

use UnexpectedValueException;

/**
 * Output only. [Output Only] The state of the accelerator topology.
 *
 * Protobuf type <code>google.cloud.compute.v1.InstanceGroupManagerStatusAcceleratorTopology.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 being activated.
     *
     * Generated from protobuf enum <code>ACTIVATING = 378825968;</code>
     */
    const ACTIVATING = 378825968;
    /**
     * The accelerator topology is active.
     *
     * Generated from protobuf enum <code>ACTIVE = 314733318;</code>
     */
    const ACTIVE = 314733318;
    /**
     * The accelerator topology is being deactivated.
     *
     * Generated from protobuf enum <code>DEACTIVATING = 57182257;</code>
     */
    const DEACTIVATING = 57182257;
    /**
     * The accelerator topology failed.
     *
     * Generated from protobuf enum <code>FAILED = 455706685;</code>
     */
    const FAILED = 455706685;
    /**
     * The configuration is incomplete and the accelerator topology cannot
     * be activated due to insufficient number of running VMs.
     *
     * Generated from protobuf enum <code>INCOMPLETE = 11941214;</code>
     */
    const INCOMPLETE = 11941214;
    /**
     * The accelerator topology is being reactivated.
     *
     * Generated from protobuf enum <code>REACTIVATING = 253727587;</code>
     */
    const REACTIVATING = 253727587;

    private static $valueToName = [
        self::UNDEFINED_STATE => 'UNDEFINED_STATE',
        self::ACTIVATING => 'ACTIVATING',
        self::ACTIVE => 'ACTIVE',
        self::DEACTIVATING => 'DEACTIVATING',
        self::FAILED => 'FAILED',
        self::INCOMPLETE => 'INCOMPLETE',
        self::REACTIVATING => 'REACTIVATING',
    ];

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

