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

namespace Google\Cloud\NetworkManagement\V1\LoadBalancerBackend;

use UnexpectedValueException;

/**
 * State of a health check firewall configuration:
 *
 * Protobuf type <code>google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState</code>
 */
class HealthCheckFirewallState
{
    /**
     * State is unspecified. Default state if not populated.
     *
     * Generated from protobuf enum <code>HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED = 0;</code>
     */
    const HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED = 0;
    /**
     * There are configured firewall rules to allow health check probes to the
     * backend.
     *
     * Generated from protobuf enum <code>CONFIGURED = 1;</code>
     */
    const CONFIGURED = 1;
    /**
     * There are firewall rules configured to allow partial health check ranges
     * or block all health check ranges.
     * If a health check probe is sent from denied IP ranges,
     * the health check to the backend will fail. Then, the backend will be
     * marked unhealthy and will not receive traffic sent to the load balancer.
     *
     * Generated from protobuf enum <code>MISCONFIGURED = 2;</code>
     */
    const MISCONFIGURED = 2;

    private static $valueToName = [
        self::HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED => 'HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED',
        self::CONFIGURED => 'CONFIGURED',
        self::MISCONFIGURED => 'MISCONFIGURED',
    ];

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


