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

namespace Google\Cloud\AIPlatform\V1\RagRetrievalConfig;

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

/**
 * Config for ranking and reranking.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking</code>
 */
class Ranking extends \Google\Protobuf\Internal\Message
{
    protected $ranking_config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\RankService $rank_service
     *           Optional. Config for Rank Service.
     *     @type \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\LlmRanker $llm_ranker
     *           Optional. Config for LlmRanker.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Config for Rank Service.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking.RankService rank_service = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\RankService|null
     */
    public function getRankService()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Optional. Config for Rank Service.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking.RankService rank_service = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\RankService $var
     * @return $this
     */
    public function setRankService($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\RankService::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. Config for LlmRanker.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking.LlmRanker llm_ranker = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\LlmRanker|null
     */
    public function getLlmRanker()
    {
        return $this->readOneof(3);
    }

    public function hasLlmRanker()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. Config for LlmRanker.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking.LlmRanker llm_ranker = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\LlmRanker $var
     * @return $this
     */
    public function setLlmRanker($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking\LlmRanker::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

