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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Defines a retrieval tool that model can call to access external knowledge.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.Retrieval</code>
 */
class Retrieval extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Deprecated. This option is no longer supported.
     *
     * Generated from protobuf field <code>bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @deprecated
     */
    protected $disable_attribution = false;
    protected $source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\VertexAISearch $vertex_ai_search
     *           Set to use data source powered by Vertex AI Search.
     *     @type \Google\Cloud\AIPlatform\V1\VertexRagStore $vertex_rag_store
     *           Set to use data source powered by Vertex RAG store.
     *           User data is uploaded via the VertexRagDataService.
     *     @type bool $disable_attribution
     *           Optional. Deprecated. This option is no longer supported.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Set to use data source powered by Vertex AI Search.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.VertexAISearch vertex_ai_search = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\VertexAISearch|null
     */
    public function getVertexAiSearch()
    {
        return $this->readOneof(2);
    }

    public function hasVertexAiSearch()
    {
        return $this->hasOneof(2);
    }

    /**
     * Set to use data source powered by Vertex AI Search.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.VertexAISearch vertex_ai_search = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\VertexAISearch $var
     * @return $this
     */
    public function setVertexAiSearch($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\VertexAISearch::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Set to use data source powered by Vertex RAG store.
     * User data is uploaded via the VertexRagDataService.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.VertexRagStore vertex_rag_store = 4;</code>
     * @return \Google\Cloud\AIPlatform\V1\VertexRagStore|null
     */
    public function getVertexRagStore()
    {
        return $this->readOneof(4);
    }

    public function hasVertexRagStore()
    {
        return $this->hasOneof(4);
    }

    /**
     * Set to use data source powered by Vertex RAG store.
     * User data is uploaded via the VertexRagDataService.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.VertexRagStore vertex_rag_store = 4;</code>
     * @param \Google\Cloud\AIPlatform\V1\VertexRagStore $var
     * @return $this
     */
    public function setVertexRagStore($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\VertexRagStore::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Optional. Deprecated. This option is no longer supported.
     *
     * Generated from protobuf field <code>bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     * @deprecated
     */
    public function getDisableAttribution()
    {
        if ($this->disable_attribution !== false) {
            @trigger_error('disable_attribution is deprecated.', E_USER_DEPRECATED);
        }
        return $this->disable_attribution;
    }

    /**
     * Optional. Deprecated. This option is no longer supported.
     *
     * Generated from protobuf field <code>bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setDisableAttribution($var)
    {
        @trigger_error('disable_attribution is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->disable_attribution = $var;

        return $this;
    }

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

}

