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

namespace Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest;

use UnexpectedValueException;

/**
 * The source of the query. We use QuerySource to distinguish queries directly
 * entered by agents and suggested queries from
 * [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist].
 * If SUGGESTED_QUERY source is specified, we will treat it as a continuation
 * of a SuggestKnowledgeAssist call.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource</code>
 */
class QuerySource
{
    /**
     * Unknown query source.
     *
     * Generated from protobuf enum <code>QUERY_SOURCE_UNSPECIFIED = 0;</code>
     */
    const QUERY_SOURCE_UNSPECIFIED = 0;
    /**
     * The query is from agents.
     *
     * Generated from protobuf enum <code>AGENT_QUERY = 1;</code>
     */
    const AGENT_QUERY = 1;
    /**
     * The query is a suggested query from
     * [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist].
     *
     * Generated from protobuf enum <code>SUGGESTED_QUERY = 2;</code>
     */
    const SUGGESTED_QUERY = 2;

    private static $valueToName = [
        self::QUERY_SOURCE_UNSPECIFIED => 'QUERY_SOURCE_UNSPECIFIED',
        self::AGENT_QUERY => 'AGENT_QUERY',
        self::SUGGESTED_QUERY => 'SUGGESTED_QUERY',
    ];

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

