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

namespace Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics;

use UnexpectedValueException;

/**
 * A type that determines how metrics should be interpreted.
 *
 * Protobuf type <code>google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType</code>
 */
class MetricsType
{
    /**
     * The metrics type is unspecified. By default, metrics without a
     * particular specification are for leaf entity types (i.e., top-level
     * entity types without child types, or child types which are not
     * parent types themselves).
     *
     * Generated from protobuf enum <code>METRICS_TYPE_UNSPECIFIED = 0;</code>
     */
    const METRICS_TYPE_UNSPECIFIED = 0;
    /**
     * Indicates whether metrics for this particular label type represent an
     * aggregate of metrics for other types instead of being based on actual
     * TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf)
     * entity types are an aggregate of metrics for their children.
     *
     * Generated from protobuf enum <code>AGGREGATE = 1;</code>
     */
    const AGGREGATE = 1;

    private static $valueToName = [
        self::METRICS_TYPE_UNSPECIFIED => 'METRICS_TYPE_UNSPECIFIED',
        self::AGGREGATE => 'AGGREGATE',
    ];

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


