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

namespace Google\Cloud\BareMetalSolution\V2;

use UnexpectedValueException;

/**
 * Performance tier of the Volume.
 *
 * Protobuf type <code>google.cloud.baremetalsolution.v2.VolumePerformanceTier</code>
 */
class VolumePerformanceTier
{
    /**
     * Value is not specified.
     *
     * Generated from protobuf enum <code>VOLUME_PERFORMANCE_TIER_UNSPECIFIED = 0;</code>
     */
    const VOLUME_PERFORMANCE_TIER_UNSPECIFIED = 0;
    /**
     * Regular volumes, shared aggregates.
     *
     * Generated from protobuf enum <code>VOLUME_PERFORMANCE_TIER_SHARED = 1;</code>
     */
    const VOLUME_PERFORMANCE_TIER_SHARED = 1;
    /**
     * Assigned aggregates.
     *
     * Generated from protobuf enum <code>VOLUME_PERFORMANCE_TIER_ASSIGNED = 2;</code>
     */
    const VOLUME_PERFORMANCE_TIER_ASSIGNED = 2;
    /**
     * High throughput aggregates.
     *
     * Generated from protobuf enum <code>VOLUME_PERFORMANCE_TIER_HT = 3;</code>
     */
    const VOLUME_PERFORMANCE_TIER_HT = 3;

    private static $valueToName = [
        self::VOLUME_PERFORMANCE_TIER_UNSPECIFIED => 'VOLUME_PERFORMANCE_TIER_UNSPECIFIED',
        self::VOLUME_PERFORMANCE_TIER_SHARED => 'VOLUME_PERFORMANCE_TIER_SHARED',
        self::VOLUME_PERFORMANCE_TIER_ASSIGNED => 'VOLUME_PERFORMANCE_TIER_ASSIGNED',
        self::VOLUME_PERFORMANCE_TIER_HT => 'VOLUME_PERFORMANCE_TIER_HT',
    ];

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

