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

namespace Google\Cloud\Memorystore\V1beta\Instance;

use UnexpectedValueException;

/**
 * Possible node types of the instance. See
 * https://cloud.google.com/memorystore/docs/valkey/instance-node-specification
 * for more information.
 *
 * Protobuf type <code>google.cloud.memorystore.v1beta.Instance.NodeType</code>
 */
class NodeType
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>NODE_TYPE_UNSPECIFIED = 0;</code>
     */
    const NODE_TYPE_UNSPECIFIED = 0;
    /**
     * Shared core nano.
     *
     * Generated from protobuf enum <code>SHARED_CORE_NANO = 1;</code>
     */
    const SHARED_CORE_NANO = 1;
    /**
     * High memory medium.
     *
     * Generated from protobuf enum <code>HIGHMEM_MEDIUM = 2;</code>
     */
    const HIGHMEM_MEDIUM = 2;
    /**
     * High memory extra large.
     *
     * Generated from protobuf enum <code>HIGHMEM_XLARGE = 3;</code>
     */
    const HIGHMEM_XLARGE = 3;
    /**
     * Standard small.
     *
     * Generated from protobuf enum <code>STANDARD_SMALL = 4;</code>
     */
    const STANDARD_SMALL = 4;

    private static $valueToName = [
        self::NODE_TYPE_UNSPECIFIED => 'NODE_TYPE_UNSPECIFIED',
        self::SHARED_CORE_NANO => 'SHARED_CORE_NANO',
        self::HIGHMEM_MEDIUM => 'HIGHMEM_MEDIUM',
        self::HIGHMEM_XLARGE => 'HIGHMEM_XLARGE',
        self::STANDARD_SMALL => 'STANDARD_SMALL',
    ];

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


