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

namespace Google\Cloud\Compute\V1\BfdStatus;

use UnexpectedValueException;

/**
 * The diagnostic code specifies the local system's reason for the last change
 * in session state. This allows remote systems to determine the reason that
 * the previous session failed, for example. These diagnostic codes are
 * specified in section 4.1 ofRFC5880
 *
 * Protobuf type <code>google.cloud.compute.v1.BfdStatus.LocalDiagnostic</code>
 */
class LocalDiagnostic
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_LOCAL_DIAGNOSTIC = 0;</code>
     */
    const UNDEFINED_LOCAL_DIAGNOSTIC = 0;
    /**
     * Generated from protobuf enum <code>ADMINISTRATIVELY_DOWN = 121685798;</code>
     */
    const ADMINISTRATIVELY_DOWN = 121685798;
    /**
     * Generated from protobuf enum <code>CONCATENATED_PATH_DOWN = 26186892;</code>
     */
    const CONCATENATED_PATH_DOWN = 26186892;
    /**
     * Generated from protobuf enum <code>CONTROL_DETECTION_TIME_EXPIRED = 135478383;</code>
     */
    const CONTROL_DETECTION_TIME_EXPIRED = 135478383;
    /**
     * Generated from protobuf enum <code>DIAGNOSTIC_UNSPECIFIED = 58720895;</code>
     */
    const DIAGNOSTIC_UNSPECIFIED = 58720895;
    /**
     * Generated from protobuf enum <code>ECHO_FUNCTION_FAILED = 220687466;</code>
     */
    const ECHO_FUNCTION_FAILED = 220687466;
    /**
     * Generated from protobuf enum <code>FORWARDING_PLANE_RESET = 19715882;</code>
     */
    const FORWARDING_PLANE_RESET = 19715882;
    /**
     * Generated from protobuf enum <code>NEIGHBOR_SIGNALED_SESSION_DOWN = 374226742;</code>
     */
    const NEIGHBOR_SIGNALED_SESSION_DOWN = 374226742;
    /**
     * Generated from protobuf enum <code>NO_DIAGNOSTIC = 222503141;</code>
     */
    const NO_DIAGNOSTIC = 222503141;
    /**
     * Generated from protobuf enum <code>PATH_DOWN = 290605180;</code>
     */
    const PATH_DOWN = 290605180;
    /**
     * Generated from protobuf enum <code>REVERSE_CONCATENATED_PATH_DOWN = 479337129;</code>
     */
    const REVERSE_CONCATENATED_PATH_DOWN = 479337129;

    private static $valueToName = [
        self::UNDEFINED_LOCAL_DIAGNOSTIC => 'UNDEFINED_LOCAL_DIAGNOSTIC',
        self::ADMINISTRATIVELY_DOWN => 'ADMINISTRATIVELY_DOWN',
        self::CONCATENATED_PATH_DOWN => 'CONCATENATED_PATH_DOWN',
        self::CONTROL_DETECTION_TIME_EXPIRED => 'CONTROL_DETECTION_TIME_EXPIRED',
        self::DIAGNOSTIC_UNSPECIFIED => 'DIAGNOSTIC_UNSPECIFIED',
        self::ECHO_FUNCTION_FAILED => 'ECHO_FUNCTION_FAILED',
        self::FORWARDING_PLANE_RESET => 'FORWARDING_PLANE_RESET',
        self::NEIGHBOR_SIGNALED_SESSION_DOWN => 'NEIGHBOR_SIGNALED_SESSION_DOWN',
        self::NO_DIAGNOSTIC => 'NO_DIAGNOSTIC',
        self::PATH_DOWN => 'PATH_DOWN',
        self::REVERSE_CONCATENATED_PATH_DOWN => 'REVERSE_CONCATENATED_PATH_DOWN',
    ];

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

