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

namespace Google\Cloud\Bigtable\Admin\V2;

use UnexpectedValueException;

/**
 * Storage media types for persisting Bigtable data.
 *
 * Protobuf type <code>google.bigtable.admin.v2.StorageType</code>
 */
class StorageType
{
    /**
     * The user did not specify a storage type.
     *
     * Generated from protobuf enum <code>STORAGE_TYPE_UNSPECIFIED = 0;</code>
     */
    const STORAGE_TYPE_UNSPECIFIED = 0;
    /**
     * Flash (SSD) storage should be used.
     *
     * Generated from protobuf enum <code>SSD = 1;</code>
     */
    const SSD = 1;
    /**
     * Magnetic drive (HDD) storage should be used.
     *
     * Generated from protobuf enum <code>HDD = 2;</code>
     */
    const HDD = 2;

    private static $valueToName = [
        self::STORAGE_TYPE_UNSPECIFIED => 'STORAGE_TYPE_UNSPECIFIED',
        self::SSD => 'SSD',
        self::HDD => 'HDD',
    ];

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

