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

namespace Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata;

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

/**
 * Grounding info for a claim in the candidate and its support.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport</code>
 */
class GroundingSupport extends \Google\Protobuf\Internal\Message
{
    /**
     * Text for the claim in the candidate. Always provided when a
     * support is found.
     *
     * Generated from protobuf field <code>string claim_text = 1;</code>
     */
    protected $claim_text = '';
    /**
     * A list of indices (into 'support_chunks') specifying the
     * citations associated with the claim. For instance [1,3,4] means
     * that support_chunks[1], support_chunks[3],
     * support_chunks[4] are the chunks attributed to the claim.
     *
     * Generated from protobuf field <code>repeated int32 support_chunk_indices = 3;</code>
     */
    private $support_chunk_indices;
    /**
     * A score in the range of [0, 1] describing how grounded is a specific
     * claim in the support chunks indicated.
     * Higher value means that the claim is better supported by the chunks.
     *
     * Generated from protobuf field <code>optional float support_score = 2;</code>
     */
    protected $support_score = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $claim_text
     *           Text for the claim in the candidate. Always provided when a
     *           support is found.
     *     @type int[] $support_chunk_indices
     *           A list of indices (into 'support_chunks') specifying the
     *           citations associated with the claim. For instance [1,3,4] means
     *           that support_chunks[1], support_chunks[3],
     *           support_chunks[4] are the chunks attributed to the claim.
     *     @type float $support_score
     *           A score in the range of [0, 1] describing how grounded is a specific
     *           claim in the support chunks indicated.
     *           Higher value means that the claim is better supported by the chunks.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Text for the claim in the candidate. Always provided when a
     * support is found.
     *
     * Generated from protobuf field <code>string claim_text = 1;</code>
     * @return string
     */
    public function getClaimText()
    {
        return $this->claim_text;
    }

    /**
     * Text for the claim in the candidate. Always provided when a
     * support is found.
     *
     * Generated from protobuf field <code>string claim_text = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setClaimText($var)
    {
        GPBUtil::checkString($var, True);
        $this->claim_text = $var;

        return $this;
    }

    /**
     * A list of indices (into 'support_chunks') specifying the
     * citations associated with the claim. For instance [1,3,4] means
     * that support_chunks[1], support_chunks[3],
     * support_chunks[4] are the chunks attributed to the claim.
     *
     * Generated from protobuf field <code>repeated int32 support_chunk_indices = 3;</code>
     * @return RepeatedField<int>
     */
    public function getSupportChunkIndices()
    {
        return $this->support_chunk_indices;
    }

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

        return $this;
    }

    /**
     * A score in the range of [0, 1] describing how grounded is a specific
     * claim in the support chunks indicated.
     * Higher value means that the claim is better supported by the chunks.
     *
     * Generated from protobuf field <code>optional float support_score = 2;</code>
     * @return float
     */
    public function getSupportScore()
    {
        return isset($this->support_score) ? $this->support_score : 0.0;
    }

    public function hasSupportScore()
    {
        return isset($this->support_score);
    }

    public function clearSupportScore()
    {
        unset($this->support_score);
    }

    /**
     * A score in the range of [0, 1] describing how grounded is a specific
     * claim in the support chunks indicated.
     * Higher value means that the claim is better supported by the chunks.
     *
     * Generated from protobuf field <code>optional float support_score = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setSupportScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->support_score = $var;

        return $this;
    }

}

