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

namespace Google\Cloud\AIPlatform\V1\ComputationBasedMetricSpec;

use UnexpectedValueException;

/**
 * Types of computation based metrics.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.ComputationBasedMetricSpec.ComputationBasedMetricType</code>
 */
class ComputationBasedMetricType
{
    /**
     * Unspecified computation based metric type.
     *
     * Generated from protobuf enum <code>COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED = 0;</code>
     */
    const COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED = 0;
    /**
     * Exact match metric.
     *
     * Generated from protobuf enum <code>EXACT_MATCH = 1;</code>
     */
    const EXACT_MATCH = 1;
    /**
     * BLEU metric.
     *
     * Generated from protobuf enum <code>BLEU = 2;</code>
     */
    const BLEU = 2;
    /**
     * ROUGE metric.
     *
     * Generated from protobuf enum <code>ROUGE = 3;</code>
     */
    const ROUGE = 3;

    private static $valueToName = [
        self::COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED => 'COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED',
        self::EXACT_MATCH => 'EXACT_MATCH',
        self::BLEU => 'BLEU',
        self::ROUGE => 'ROUGE',
    ];

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

