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

namespace Google\Cloud\Ces\V1\EvaluationMetricsThresholds\ToolMatchingSettings;

use UnexpectedValueException;

/**
 * Defines the behavior when an extra tool call is encountered. An extra
 * tool call is a tool call that is present in the execution but does not
 * match any tool call in the golden expectation.
 *
 * Protobuf type <code>google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior</code>
 */
class ExtraToolCallBehavior
{
    /**
     * Unspecified behavior. Defaults to FAIL.
     *
     * Generated from protobuf enum <code>EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0;</code>
     */
    const EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0;
    /**
     * Fail the evaluation if an extra tool call is encountered.
     *
     * Generated from protobuf enum <code>FAIL = 1;</code>
     */
    const FAIL = 1;
    /**
     * Allow the extra tool call.
     *
     * Generated from protobuf enum <code>ALLOW = 2;</code>
     */
    const ALLOW = 2;

    private static $valueToName = [
        self::EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED => 'EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED',
        self::FAIL => 'FAIL',
        self::ALLOW => 'ALLOW',
    ];

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


