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

namespace Google\Cloud\AIPlatform\V1\Metric;

use UnexpectedValueException;

/**
 * The per-metric statistics on evaluation results supported by
 * `EvaluationService.EvaluateDataset`.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.Metric.AggregationMetric</code>
 */
class AggregationMetric
{
    /**
     * Unspecified aggregation metric.
     *
     * Generated from protobuf enum <code>AGGREGATION_METRIC_UNSPECIFIED = 0;</code>
     */
    const AGGREGATION_METRIC_UNSPECIFIED = 0;
    /**
     * Average aggregation metric. Not supported for Pairwise metric.
     *
     * Generated from protobuf enum <code>AVERAGE = 1;</code>
     */
    const AVERAGE = 1;
    /**
     * Mode aggregation metric.
     *
     * Generated from protobuf enum <code>MODE = 2;</code>
     */
    const MODE = 2;
    /**
     * Standard deviation aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>STANDARD_DEVIATION = 3;</code>
     */
    const STANDARD_DEVIATION = 3;
    /**
     * Variance aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>VARIANCE = 4;</code>
     */
    const VARIANCE = 4;
    /**
     * Minimum aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>MINIMUM = 5;</code>
     */
    const MINIMUM = 5;
    /**
     * Maximum aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>MAXIMUM = 6;</code>
     */
    const MAXIMUM = 6;
    /**
     * Median aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>MEDIAN = 7;</code>
     */
    const MEDIAN = 7;
    /**
     * 90th percentile aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>PERCENTILE_P90 = 8;</code>
     */
    const PERCENTILE_P90 = 8;
    /**
     * 95th percentile aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>PERCENTILE_P95 = 9;</code>
     */
    const PERCENTILE_P95 = 9;
    /**
     * 99th percentile aggregation metric. Not supported for pairwise metric.
     *
     * Generated from protobuf enum <code>PERCENTILE_P99 = 10;</code>
     */
    const PERCENTILE_P99 = 10;

    private static $valueToName = [
        self::AGGREGATION_METRIC_UNSPECIFIED => 'AGGREGATION_METRIC_UNSPECIFIED',
        self::AVERAGE => 'AVERAGE',
        self::MODE => 'MODE',
        self::STANDARD_DEVIATION => 'STANDARD_DEVIATION',
        self::VARIANCE => 'VARIANCE',
        self::MINIMUM => 'MINIMUM',
        self::MAXIMUM => 'MAXIMUM',
        self::MEDIAN => 'MEDIAN',
        self::PERCENTILE_P90 => 'PERCENTILE_P90',
        self::PERCENTILE_P95 => 'PERCENTILE_P95',
        self::PERCENTILE_P99 => 'PERCENTILE_P99',
    ];

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

