<?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 generation failure.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason</code>
 */
class QueryGenerationFailureReason
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0;</code>
     */
    const QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0;
    /**
     * Query generation is blocked due to out of quota.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_OUT_OF_QUOTA = 1;</code>
     */
    const QUERY_GENERATION_OUT_OF_QUOTA = 1;
    /**
     * Call to Knowedge Assist query generation model fails.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_FAILED = 2;</code>
     */
    const QUERY_GENERATION_FAILED = 2;
    /**
     * Query generation model decides that there is no new topic change or
     * there has been similar queries generated in the previous turns.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_NO_QUERY_GENERATED = 3;</code>
     */
    const QUERY_GENERATION_NO_QUERY_GENERATED = 3;
    /**
     * Knowedge Assist generated query is blocked by RAI (Responsible AI).
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_RAI_FAILED = 4;</code>
     */
    const QUERY_GENERATION_RAI_FAILED = 4;
    /**
     * Query generation is blocked by Knowledge Assist conversation profile
     * level / agent id level filtering.
     *
     * Generated from protobuf enum <code>NOT_IN_ALLOWLIST = 5;</code>
     */
    const NOT_IN_ALLOWLIST = 5;
    /**
     * The generated query is blocked due to redaction.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_QUERY_REDACTED = 6;</code>
     */
    const QUERY_GENERATION_QUERY_REDACTED = 6;
    /**
     * Query generation failed due to LLM response parse failure.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10;</code>
     */
    const QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10;
    /**
     * The conversation has no messages.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_EMPTY_CONVERSATION = 11;</code>
     */
    const QUERY_GENERATION_EMPTY_CONVERSATION = 11;
    /**
     * The last message in the conversation is empty.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12;</code>
     */
    const QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12;
    /**
     * The trigger event condition is not met.
     * This occurs in the following scenarios:
     * 1. The trigger_event is CUSTOMER_MESSAGE or UNSPECIFIED, but the last
     *    message is not from the customer.
     * 2. The trigger_event is AGENT_MESSAGE, but the last message is not from
     *    the agent.
     *
     * Generated from protobuf enum <code>QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13;</code>
     */
    const QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13;

    private static $valueToName = [
        self::QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED => 'QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED',
        self::QUERY_GENERATION_OUT_OF_QUOTA => 'QUERY_GENERATION_OUT_OF_QUOTA',
        self::QUERY_GENERATION_FAILED => 'QUERY_GENERATION_FAILED',
        self::QUERY_GENERATION_NO_QUERY_GENERATED => 'QUERY_GENERATION_NO_QUERY_GENERATED',
        self::QUERY_GENERATION_RAI_FAILED => 'QUERY_GENERATION_RAI_FAILED',
        self::NOT_IN_ALLOWLIST => 'NOT_IN_ALLOWLIST',
        self::QUERY_GENERATION_QUERY_REDACTED => 'QUERY_GENERATION_QUERY_REDACTED',
        self::QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED => 'QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED',
        self::QUERY_GENERATION_EMPTY_CONVERSATION => 'QUERY_GENERATION_EMPTY_CONVERSATION',
        self::QUERY_GENERATION_EMPTY_LAST_MESSAGE => 'QUERY_GENERATION_EMPTY_LAST_MESSAGE',
        self::QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET => 'QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET',
    ];

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

