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

namespace Google\Cloud\Compute\V1\ReservationAdvancedDeploymentControl;

use UnexpectedValueException;

/**
 * Indicates chosen reservation operational mode for the reservation.
 *
 * Protobuf type <code>google.cloud.compute.v1.ReservationAdvancedDeploymentControl.ReservationOperationalMode</code>
 */
class ReservationOperationalMode
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_RESERVATION_OPERATIONAL_MODE = 0;</code>
     */
    const UNDEFINED_RESERVATION_OPERATIONAL_MODE = 0;
    /**
     * Google Cloud does not manage the failure of machines, but provides
     * additional capacity, which is not guaranteed to be available.
     *
     * Generated from protobuf enum <code>ALL_CAPACITY = 500029880;</code>
     */
    const ALL_CAPACITY = 500029880;
    /**
     * Google Cloud manages the failure of machines to provide high
     * availability.
     *
     * Generated from protobuf enum <code>HIGHLY_AVAILABLE_CAPACITY = 110861600;</code>
     */
    const HIGHLY_AVAILABLE_CAPACITY = 110861600;
    /**
     * Generated from protobuf enum <code>RESERVATION_OPERATIONAL_MODE_UNSPECIFIED = 194296603;</code>
     */
    const RESERVATION_OPERATIONAL_MODE_UNSPECIFIED = 194296603;

    private static $valueToName = [
        self::UNDEFINED_RESERVATION_OPERATIONAL_MODE => 'UNDEFINED_RESERVATION_OPERATIONAL_MODE',
        self::ALL_CAPACITY => 'ALL_CAPACITY',
        self::HIGHLY_AVAILABLE_CAPACITY => 'HIGHLY_AVAILABLE_CAPACITY',
        self::RESERVATION_OPERATIONAL_MODE_UNSPECIFIED => 'RESERVATION_OPERATIONAL_MODE_UNSPECIFIED',
    ];

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

