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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Grounding support.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.GroundingSupport</code>
 */
class GroundingSupport extends \Google\Protobuf\Internal\Message
{
    /**
     * Segment of the content this support belongs to.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.Segment segment = 1;</code>
     */
    protected $segment = null;
    /**
     * A list of indices (into 'grounding_chunk') specifying the
     * citations associated with the claim. For instance [1,3,4] means
     * that grounding_chunk[1], grounding_chunk[3],
     * grounding_chunk[4] are the retrieved content attributed to the claim.
     *
     * Generated from protobuf field <code>repeated int32 grounding_chunk_indices = 2;</code>
     */
    private $grounding_chunk_indices;
    /**
     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
     * most confident. This list must have the same size as the
     * grounding_chunk_indices.
     *
     * Generated from protobuf field <code>repeated float confidence_scores = 3;</code>
     */
    private $confidence_scores;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\Segment $segment
     *           Segment of the content this support belongs to.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $grounding_chunk_indices
     *           A list of indices (into 'grounding_chunk') specifying the
     *           citations associated with the claim. For instance [1,3,4] means
     *           that grounding_chunk[1], grounding_chunk[3],
     *           grounding_chunk[4] are the retrieved content attributed to the claim.
     *     @type array<float>|\Google\Protobuf\Internal\RepeatedField $confidence_scores
     *           Confidence score of the support references. Ranges from 0 to 1. 1 is the
     *           most confident. This list must have the same size as the
     *           grounding_chunk_indices.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce();
        parent::__construct($data);
    }

    /**
     * Segment of the content this support belongs to.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.Segment segment = 1;</code>
     * @return \Google\Cloud\AIPlatform\V1\Segment|null
     */
    public function getSegment()
    {
        return $this->segment;
    }

    public function hasSegment()
    {
        return isset($this->segment);
    }

    public function clearSegment()
    {
        unset($this->segment);
    }

    /**
     * Segment of the content this support belongs to.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.Segment segment = 1;</code>
     * @param \Google\Cloud\AIPlatform\V1\Segment $var
     * @return $this
     */
    public function setSegment($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Segment::class);
        $this->segment = $var;

        return $this;
    }

    /**
     * A list of indices (into 'grounding_chunk') specifying the
     * citations associated with the claim. For instance [1,3,4] means
     * that grounding_chunk[1], grounding_chunk[3],
     * grounding_chunk[4] are the retrieved content attributed to the claim.
     *
     * Generated from protobuf field <code>repeated int32 grounding_chunk_indices = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getGroundingChunkIndices()
    {
        return $this->grounding_chunk_indices;
    }

    /**
     * A list of indices (into 'grounding_chunk') specifying the
     * citations associated with the claim. For instance [1,3,4] means
     * that grounding_chunk[1], grounding_chunk[3],
     * grounding_chunk[4] are the retrieved content attributed to the claim.
     *
     * Generated from protobuf field <code>repeated int32 grounding_chunk_indices = 2;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setGroundingChunkIndices($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->grounding_chunk_indices = $arr;

        return $this;
    }

    /**
     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
     * most confident. This list must have the same size as the
     * grounding_chunk_indices.
     *
     * Generated from protobuf field <code>repeated float confidence_scores = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConfidenceScores()
    {
        return $this->confidence_scores;
    }

    /**
     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
     * most confident. This list must have the same size as the
     * grounding_chunk_indices.
     *
     * Generated from protobuf field <code>repeated float confidence_scores = 3;</code>
     * @param array<float>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConfidenceScores($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FLOAT);
        $this->confidence_scores = $arr;

        return $this;
    }

}

