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

namespace Google\Cloud\Asset\V1\ConditionEvaluation;

use UnexpectedValueException;

/**
 * Value of this expression.
 *
 * Protobuf type <code>google.cloud.asset.v1.ConditionEvaluation.EvaluationValue</code>
 */
class EvaluationValue
{
    /**
     * Reserved for future use.
     *
     * Generated from protobuf enum <code>EVALUATION_VALUE_UNSPECIFIED = 0;</code>
     */
    const EVALUATION_VALUE_UNSPECIFIED = 0;
    /**
     * The evaluation result is `true`.
     *
     * Generated from protobuf enum <code>TRUE = 1;</code>
     */
    const TRUE = 1;
    /**
     * The evaluation result is `false`.
     *
     * Generated from protobuf enum <code>FALSE = 2;</code>
     */
    const FALSE = 2;
    /**
     * The evaluation result is `conditional` when the condition expression
     * contains variables that are either missing input values or have not been
     * supported by Analyzer yet.
     *
     * Generated from protobuf enum <code>CONDITIONAL = 3;</code>
     */
    const CONDITIONAL = 3;

    private static $valueToName = [
        self::EVALUATION_VALUE_UNSPECIFIED => 'EVALUATION_VALUE_UNSPECIFIED',
        self::TRUE => 'TRUE',
        self::FALSE => 'FALSE',
        self::CONDITIONAL => 'CONDITIONAL',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(EvaluationValue::class, \Google\Cloud\Asset\V1\ConditionEvaluation_EvaluationValue::class);

