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

namespace Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties;

use UnexpectedValueException;

/**
 * Specifies whether this VM may be a stable fleet VM. Setting this to "Periodic" designates this VM as a Stable Fleet VM.
 * See go/stable-fleet-ug for more details.
 *
 * Protobuf type <code>google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.MaintenanceInterval</code>
 */
class MaintenanceInterval
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_MAINTENANCE_INTERVAL = 0;</code>
     */
    const UNDEFINED_MAINTENANCE_INTERVAL = 0;
    /**
     * Generated from protobuf enum <code>AS_NEEDED = 232289378;</code>
     */
    const AS_NEEDED = 232289378;
    /**
     * Generated from protobuf enum <code>PERIODIC = 142804635;</code>
     */
    const PERIODIC = 142804635;

    private static $valueToName = [
        self::UNDEFINED_MAINTENANCE_INTERVAL => 'UNDEFINED_MAINTENANCE_INTERVAL',
        self::AS_NEEDED => 'AS_NEEDED',
        self::PERIODIC => 'PERIODIC',
    ];

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




