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

namespace Google\Cloud\Dialogflow\V2\KnowledgeAssistDebugInfo;

use UnexpectedValueException;

/**
 * Reason for query categorization failure.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason</code>
 */
class QueryCategorizationFailureReason
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0;</code>
     */
    const QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0;
    /**
     * Vertex AI Search config supplied for query categorization is invalid.
     *
     * Generated from protobuf enum <code>QUERY_CATEGORIZATION_INVALID_CONFIG = 1;</code>
     */
    const QUERY_CATEGORIZATION_INVALID_CONFIG = 1;
    /**
     * Vertex AI Search result does not contain a query categorization result.
     *
     * Generated from protobuf enum <code>QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2;</code>
     */
    const QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2;
    /**
     * Vertex AI Search call fails.
     *
     * Generated from protobuf enum <code>QUERY_CATEGORIZATION_FAILED = 3;</code>
     */
    const QUERY_CATEGORIZATION_FAILED = 3;

    private static $valueToName = [
        self::QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED => 'QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED',
        self::QUERY_CATEGORIZATION_INVALID_CONFIG => 'QUERY_CATEGORIZATION_INVALID_CONFIG',
        self::QUERY_CATEGORIZATION_RESULT_NOT_FOUND => 'QUERY_CATEGORIZATION_RESULT_NOT_FOUND',
        self::QUERY_CATEGORIZATION_FAILED => 'QUERY_CATEGORIZATION_FAILED',
    ];

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

