<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/answer_record.proto

namespace Google\Cloud\Dialogflow\V2\AgentAssistantFeedback;

use UnexpectedValueException;

/**
 * Relevance of an answer.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance</code>
 */
class AnswerRelevance
{
    /**
     * Answer relevance unspecified.
     *
     * Generated from protobuf enum <code>ANSWER_RELEVANCE_UNSPECIFIED = 0;</code>
     */
    const ANSWER_RELEVANCE_UNSPECIFIED = 0;
    /**
     * Answer is irrelevant to query.
     *
     * Generated from protobuf enum <code>IRRELEVANT = 1;</code>
     */
    const IRRELEVANT = 1;
    /**
     * Answer is relevant to query.
     *
     * Generated from protobuf enum <code>RELEVANT = 2;</code>
     */
    const RELEVANT = 2;

    private static $valueToName = [
        self::ANSWER_RELEVANCE_UNSPECIFIED => 'ANSWER_RELEVANCE_UNSPECIFIED',
        self::IRRELEVANT => 'IRRELEVANT',
        self::RELEVANT => 'RELEVANT',
    ];

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


