<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/run/v2/k8s.min.proto

namespace Google\Cloud\Run\V2\EmptyDirVolumeSource;

use UnexpectedValueException;

/**
 * The different types of medium supported for EmptyDir.
 *
 * Protobuf type <code>google.cloud.run.v2.EmptyDirVolumeSource.Medium</code>
 */
class Medium
{
    /**
     * When not specified, falls back to the default implementation which
     * is currently in memory (this may change over time).
     *
     * Generated from protobuf enum <code>MEDIUM_UNSPECIFIED = 0;</code>
     */
    const MEDIUM_UNSPECIFIED = 0;
    /**
     * Explicitly set the EmptyDir to be in memory. Uses tmpfs.
     *
     * Generated from protobuf enum <code>MEMORY = 1;</code>
     */
    const MEMORY = 1;

    private static $valueToName = [
        self::MEDIUM_UNSPECIFIED => 'MEDIUM_UNSPECIFIED',
        self::MEMORY => 'MEMORY',
    ];

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


