<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/alert.proto

namespace Google\Cloud\Monitoring\V3\AlertPolicy\Condition;

use UnexpectedValueException;

/**
 * A condition control that determines how metric-threshold conditions
 * are evaluated when data stops arriving.
 * This control doesn't affect metric-absence policies.
 *
 * Protobuf type <code>google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData</code>
 */
class EvaluationMissingData
{
    /**
     * An unspecified evaluation missing data option.  Equivalent to
     * EVALUATION_MISSING_DATA_NO_OP.
     *
     * Generated from protobuf enum <code>EVALUATION_MISSING_DATA_UNSPECIFIED = 0;</code>
     */
    const EVALUATION_MISSING_DATA_UNSPECIFIED = 0;
    /**
     * If there is no data to evaluate the condition, then evaluate the
     * condition as false.
     *
     * Generated from protobuf enum <code>EVALUATION_MISSING_DATA_INACTIVE = 1;</code>
     */
    const EVALUATION_MISSING_DATA_INACTIVE = 1;
    /**
     * If there is no data to evaluate the condition, then evaluate the
     * condition as true.
     *
     * Generated from protobuf enum <code>EVALUATION_MISSING_DATA_ACTIVE = 2;</code>
     */
    const EVALUATION_MISSING_DATA_ACTIVE = 2;
    /**
     * Do not evaluate the condition to any value if there is no data.
     *
     * Generated from protobuf enum <code>EVALUATION_MISSING_DATA_NO_OP = 3;</code>
     */
    const EVALUATION_MISSING_DATA_NO_OP = 3;

    private static $valueToName = [
        self::EVALUATION_MISSING_DATA_UNSPECIFIED => 'EVALUATION_MISSING_DATA_UNSPECIFIED',
        self::EVALUATION_MISSING_DATA_INACTIVE => 'EVALUATION_MISSING_DATA_INACTIVE',
        self::EVALUATION_MISSING_DATA_ACTIVE => 'EVALUATION_MISSING_DATA_ACTIVE',
        self::EVALUATION_MISSING_DATA_NO_OP => 'EVALUATION_MISSING_DATA_NO_OP',
    ];

    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(EvaluationMissingData::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_EvaluationMissingData::class);

