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

namespace Google\Cloud\Compute\V1\ReservationSubBlockHealthInfo;

use UnexpectedValueException;

/**
 * The health status of the reservation subBlock.
 *
 * Protobuf type <code>google.cloud.compute.v1.ReservationSubBlockHealthInfo.HealthStatus</code>
 */
class HealthStatus
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_HEALTH_STATUS = 0;</code>
     */
    const UNDEFINED_HEALTH_STATUS = 0;
    /**
     * The reservation subBlock is degraded.
     *
     * Generated from protobuf enum <code>DEGRADED = 396890926;</code>
     */
    const DEGRADED = 396890926;
    /**
     * The reservation subBlock is healthy.
     *
     * Generated from protobuf enum <code>HEALTHY = 439801213;</code>
     */
    const HEALTHY = 439801213;
    /**
     * The health status of the reservation subBlock is unspecified.
     *
     * Generated from protobuf enum <code>HEALTH_STATUS_UNSPECIFIED = 482246925;</code>
     */
    const HEALTH_STATUS_UNSPECIFIED = 482246925;

    private static $valueToName = [
        self::UNDEFINED_HEALTH_STATUS => 'UNDEFINED_HEALTH_STATUS',
        self::DEGRADED => 'DEGRADED',
        self::HEALTHY => 'HEALTHY',
        self::HEALTH_STATUS_UNSPECIFIED => 'HEALTH_STATUS_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);
    }
}


