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

namespace Google\Cloud\Compute\V1\AllocationAggregateReservation;

use UnexpectedValueException;

/**
 * The VM family that all instances scheduled against this reservation must belong to.
 *
 * Protobuf type <code>google.cloud.compute.v1.AllocationAggregateReservation.VmFamily</code>
 */
class VmFamily
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_VM_FAMILY = 0;</code>
     */
    const UNDEFINED_VM_FAMILY = 0;
    /**
     * Generated from protobuf enum <code>VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L = 108020067;</code>
     */
    const VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L = 108020067;
    /**
     * Generated from protobuf enum <code>VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP = 18705267;</code>
     */
    const VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP = 18705267;
    /**
     * Generated from protobuf enum <code>VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407;</code>
     */
    const VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407;

    private static $valueToName = [
        self::UNDEFINED_VM_FAMILY => 'UNDEFINED_VM_FAMILY',
        self::VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L => 'VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L',
        self::VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP => 'VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP',
        self::VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P => 'VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P',
    ];

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


