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

namespace Google\Cloud\Compute\V1\ResourcePolicyWorkloadPolicy;

use UnexpectedValueException;

/**
 * Specifies the connection mode for the accelerator topology. If not
 * specified, the default is AUTO_CONNECT.
 *
 * Protobuf type <code>google.cloud.compute.v1.ResourcePolicyWorkloadPolicy.AcceleratorTopologyMode</code>
 */
class AcceleratorTopologyMode
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ACCELERATOR_TOPOLOGY_MODE = 0;</code>
     */
    const UNDEFINED_ACCELERATOR_TOPOLOGY_MODE = 0;
    /**
     * The interconnected chips are pre-configured at the time of VM creation.
     *
     * Generated from protobuf enum <code>AUTO_CONNECT = 491872826;</code>
     */
    const AUTO_CONNECT = 491872826;
    /**
     * The interconnected chips are connected on demand. At the time of VM
     * creation, the chips are not connected.
     *
     * Generated from protobuf enum <code>PROVISION_ONLY = 399134966;</code>
     */
    const PROVISION_ONLY = 399134966;

    private static $valueToName = [
        self::UNDEFINED_ACCELERATOR_TOPOLOGY_MODE => 'UNDEFINED_ACCELERATOR_TOPOLOGY_MODE',
        self::AUTO_CONNECT => 'AUTO_CONNECT',
        self::PROVISION_ONLY => 'PROVISION_ONLY',
    ];

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

