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

namespace Google\Cloud\Container\V1\GPUDriverInstallationConfig;

use UnexpectedValueException;

/**
 * The GPU driver version to install.
 *
 * Protobuf type <code>google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion</code>
 */
class GPUDriverVersion
{
    /**
     * Default value is to not install any GPU driver.
     *
     * Generated from protobuf enum <code>GPU_DRIVER_VERSION_UNSPECIFIED = 0;</code>
     */
    const GPU_DRIVER_VERSION_UNSPECIFIED = 0;
    /**
     * Disable GPU driver auto installation and needs manual installation
     *
     * Generated from protobuf enum <code>INSTALLATION_DISABLED = 1;</code>
     */
    const INSTALLATION_DISABLED = 1;
    /**
     * "Default" GPU driver in COS and Ubuntu.
     *
     * Generated from protobuf enum <code>DEFAULT = 2;</code>
     */
    const PBDEFAULT = 2;
    /**
     * "Latest" GPU driver in COS.
     *
     * Generated from protobuf enum <code>LATEST = 3;</code>
     */
    const LATEST = 3;

    private static $valueToName = [
        self::GPU_DRIVER_VERSION_UNSPECIFIED => 'GPU_DRIVER_VERSION_UNSPECIFIED',
        self::INSTALLATION_DISABLED => 'INSTALLATION_DISABLED',
        self::PBDEFAULT => 'DEFAULT',
        self::LATEST => 'LATEST',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}

