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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * A query to retrieve relevant contexts.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.RagQuery</code>
 */
class RagQuery extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The retrieval config for the query.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig rag_retrieval_config = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $rag_retrieval_config = null;
    protected $query;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           Optional. The query in text format to get relevant contexts.
     *     @type \Google\Cloud\AIPlatform\V1\RagRetrievalConfig $rag_retrieval_config
     *           Optional. The retrieval config for the query.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\VertexRagService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The query in text format to get relevant contexts.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getText()
    {
        return $this->readOneof(1);
    }

    public function hasText()
    {
        return $this->hasOneof(1);
    }

    /**
     * Optional. The query in text format to get relevant contexts.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. The retrieval config for the query.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig rag_retrieval_config = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\RagRetrievalConfig|null
     */
    public function getRagRetrievalConfig()
    {
        return $this->rag_retrieval_config;
    }

    public function hasRagRetrievalConfig()
    {
        return isset($this->rag_retrieval_config);
    }

    public function clearRagRetrievalConfig()
    {
        unset($this->rag_retrieval_config);
    }

    /**
     * Optional. The retrieval config for the query.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig rag_retrieval_config = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\RagRetrievalConfig $var
     * @return $this
     */
    public function setRagRetrievalConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagRetrievalConfig::class);
        $this->rag_retrieval_config = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getQuery()
    {
        return $this->whichOneof("query");
    }

}

