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

namespace Google\Cloud\DiscoveryEngine\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Response message for
 * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.CompleteQueryResponse</code>
 */
class CompleteQueryResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Results of the matched query suggestions. The result list is ordered and
     * the first result is a top suggestion.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion query_suggestions = 1;</code>
     */
    private $query_suggestions;
    /**
     * True if the returned suggestions are all tail suggestions.
     * For tail matching to be triggered, include_tail_suggestions in the request
     * must be true and there must be no suggestions that match the full query.
     *
     * Generated from protobuf field <code>bool tail_match_triggered = 2;</code>
     */
    protected $tail_match_triggered = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DiscoveryEngine\V1\CompleteQueryResponse\QuerySuggestion[] $query_suggestions
     *           Results of the matched query suggestions. The result list is ordered and
     *           the first result is a top suggestion.
     *     @type bool $tail_match_triggered
     *           True if the returned suggestions are all tail suggestions.
     *           For tail matching to be triggered, include_tail_suggestions in the request
     *           must be true and there must be no suggestions that match the full query.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\CompletionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Results of the matched query suggestions. The result list is ordered and
     * the first result is a top suggestion.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion query_suggestions = 1;</code>
     * @return RepeatedField<\Google\Cloud\DiscoveryEngine\V1\CompleteQueryResponse\QuerySuggestion>
     */
    public function getQuerySuggestions()
    {
        return $this->query_suggestions;
    }

    /**
     * Results of the matched query suggestions. The result list is ordered and
     * the first result is a top suggestion.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion query_suggestions = 1;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\CompleteQueryResponse\QuerySuggestion[] $var
     * @return $this
     */
    public function setQuerySuggestions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\CompleteQueryResponse\QuerySuggestion::class);
        $this->query_suggestions = $arr;

        return $this;
    }

    /**
     * True if the returned suggestions are all tail suggestions.
     * For tail matching to be triggered, include_tail_suggestions in the request
     * must be true and there must be no suggestions that match the full query.
     *
     * Generated from protobuf field <code>bool tail_match_triggered = 2;</code>
     * @return bool
     */
    public function getTailMatchTriggered()
    {
        return $this->tail_match_triggered;
    }

    /**
     * True if the returned suggestions are all tail suggestions.
     * For tail matching to be triggered, include_tail_suggestions in the request
     * must be true and there must be no suggestions that match the full query.
     *
     * Generated from protobuf field <code>bool tail_match_triggered = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setTailMatchTriggered($var)
    {
        GPBUtil::checkBool($var);
        $this->tail_match_triggered = $var;

        return $this;
    }

}

