<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/cx/v3/environment.proto

namespace Google\Cloud\Dialogflow\Cx\V3\ContinuousTestResult;

use UnexpectedValueException;

/**
 * The overall result for a continuous test run in an agent environment.
 *
 * Protobuf type <code>google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult</code>
 */
class AggregatedTestResult
{
    /**
     * Not specified. Should never be used.
     *
     * Generated from protobuf enum <code>AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;</code>
     */
    const AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;
    /**
     * All the tests passed.
     *
     * Generated from protobuf enum <code>PASSED = 1;</code>
     */
    const PASSED = 1;
    /**
     * At least one test did not pass.
     *
     * Generated from protobuf enum <code>FAILED = 2;</code>
     */
    const FAILED = 2;

    private static $valueToName = [
        self::AGGREGATED_TEST_RESULT_UNSPECIFIED => 'AGGREGATED_TEST_RESULT_UNSPECIFIED',
        self::PASSED => 'PASSED',
        self::FAILED => 'FAILED',
    ];

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


