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

namespace Google\Cloud\AIPlatform\V1;

use UnexpectedValueException;

/**
 * Pairwise prediction autorater preference.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.PairwiseChoice</code>
 */
class PairwiseChoice
{
    /**
     * Unspecified prediction choice.
     *
     * Generated from protobuf enum <code>PAIRWISE_CHOICE_UNSPECIFIED = 0;</code>
     */
    const PAIRWISE_CHOICE_UNSPECIFIED = 0;
    /**
     * Baseline prediction wins
     *
     * Generated from protobuf enum <code>BASELINE = 1;</code>
     */
    const BASELINE = 1;
    /**
     * Candidate prediction wins
     *
     * Generated from protobuf enum <code>CANDIDATE = 2;</code>
     */
    const CANDIDATE = 2;
    /**
     * Winner cannot be determined
     *
     * Generated from protobuf enum <code>TIE = 3;</code>
     */
    const TIE = 3;

    private static $valueToName = [
        self::PAIRWISE_CHOICE_UNSPECIFIED => 'PAIRWISE_CHOICE_UNSPECIFIED',
        self::BASELINE => 'BASELINE',
        self::CANDIDATE => 'CANDIDATE',
        self::TIE => 'TIE',
    ];

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

