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

namespace Google\Cloud\Container\V1\GPUSharingConfig;

use UnexpectedValueException;

/**
 * The type of GPU sharing strategy currently provided.
 *
 * Protobuf type <code>google.container.v1.GPUSharingConfig.GPUSharingStrategy</code>
 */
class GPUSharingStrategy
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>GPU_SHARING_STRATEGY_UNSPECIFIED = 0;</code>
     */
    const GPU_SHARING_STRATEGY_UNSPECIFIED = 0;
    /**
     * GPUs are time-shared between containers.
     *
     * Generated from protobuf enum <code>TIME_SHARING = 1;</code>
     */
    const TIME_SHARING = 1;

    private static $valueToName = [
        self::GPU_SHARING_STRATEGY_UNSPECIFIED => 'GPU_SHARING_STRATEGY_UNSPECIFIED',
        self::TIME_SHARING => 'TIME_SHARING',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GPUSharingStrategy::class, \Google\Cloud\Container\V1\GPUSharingConfig_GPUSharingStrategy::class);

