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

namespace Google\Cloud\BeyondCorp\AppConnectors\V1;

use UnexpectedValueException;

/**
 * HealthStatus represents the health status.
 *
 * Protobuf type <code>google.cloud.beyondcorp.appconnectors.v1.HealthStatus</code>
 */
class HealthStatus
{
    /**
     * Health status is unknown: not initialized or failed to retrieve.
     *
     * Generated from protobuf enum <code>HEALTH_STATUS_UNSPECIFIED = 0;</code>
     */
    const HEALTH_STATUS_UNSPECIFIED = 0;
    /**
     * The resource is healthy.
     *
     * Generated from protobuf enum <code>HEALTHY = 1;</code>
     */
    const HEALTHY = 1;
    /**
     * The resource is unhealthy.
     *
     * Generated from protobuf enum <code>UNHEALTHY = 2;</code>
     */
    const UNHEALTHY = 2;
    /**
     * The resource is unresponsive.
     *
     * Generated from protobuf enum <code>UNRESPONSIVE = 3;</code>
     */
    const UNRESPONSIVE = 3;
    /**
     * Some sub-resources are UNHEALTHY.
     *
     * Generated from protobuf enum <code>DEGRADED = 4;</code>
     */
    const DEGRADED = 4;

    private static $valueToName = [
        self::HEALTH_STATUS_UNSPECIFIED => 'HEALTH_STATUS_UNSPECIFIED',
        self::HEALTHY => 'HEALTHY',
        self::UNHEALTHY => 'UNHEALTHY',
        self::UNRESPONSIVE => 'UNRESPONSIVE',
        self::DEGRADED => 'DEGRADED',
    ];

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

