<?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;

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

/**
 * Citation for the generated content.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata</code>
 */
class GroundingMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Retrieval metadata to provide an understanding in the
     * retrieval steps performed by the model. There can be multiple such
     * messages which can correspond to different parts of the retrieval. This
     * is a mechanism used to ensure transparency to our users.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata retrieval_metadata = 5;</code>
     */
    private $retrieval_metadata;
    /**
     * List of chunks to be attributed across all claims in the candidate.
     * These are derived from the grounding sources supplied in the request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.FactChunk support_chunks = 1;</code>
     */
    private $support_chunks;
    /**
     * Web search queries for the following-up web search.
     *
     * Generated from protobuf field <code>repeated string web_search_queries = 3;</code>
     */
    private $web_search_queries;
    /**
     * Google search entry for the following-up web searches.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint search_entry_point = 4;</code>
     */
    protected $search_entry_point = null;
    /**
     * GroundingSupport across all claims in the answer candidate.
     * An support to a fact indicates that the claim is supported by
     * the fact.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport grounding_support = 2;</code>
     */
    private $grounding_support;
    /**
     * Images from the web search.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata images = 9;</code>
     */
    private $images;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata[] $retrieval_metadata
     *           Retrieval metadata to provide an understanding in the
     *           retrieval steps performed by the model. There can be multiple such
     *           messages which can correspond to different parts of the retrieval. This
     *           is a mechanism used to ensure transparency to our users.
     *     @type \Google\Cloud\DiscoveryEngine\V1\FactChunk[] $support_chunks
     *           List of chunks to be attributed across all claims in the candidate.
     *           These are derived from the grounding sources supplied in the request.
     *     @type string[] $web_search_queries
     *           Web search queries for the following-up web search.
     *     @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint $search_entry_point
     *           Google search entry for the following-up web searches.
     *     @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport[] $grounding_support
     *           GroundingSupport across all claims in the answer candidate.
     *           An support to a fact indicates that the claim is supported by
     *           the fact.
     *     @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\ImageMetadata[] $images
     *           Images from the web search.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Retrieval metadata to provide an understanding in the
     * retrieval steps performed by the model. There can be multiple such
     * messages which can correspond to different parts of the retrieval. This
     * is a mechanism used to ensure transparency to our users.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata retrieval_metadata = 5;</code>
     * @return RepeatedField<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata>
     */
    public function getRetrievalMetadata()
    {
        return $this->retrieval_metadata;
    }

    /**
     * Retrieval metadata to provide an understanding in the
     * retrieval steps performed by the model. There can be multiple such
     * messages which can correspond to different parts of the retrieval. This
     * is a mechanism used to ensure transparency to our users.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata retrieval_metadata = 5;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata[] $var
     * @return $this
     */
    public function setRetrievalMetadata($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata::class);
        $this->retrieval_metadata = $arr;

        return $this;
    }

    /**
     * List of chunks to be attributed across all claims in the candidate.
     * These are derived from the grounding sources supplied in the request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.FactChunk support_chunks = 1;</code>
     * @return RepeatedField<\Google\Cloud\DiscoveryEngine\V1\FactChunk>
     */
    public function getSupportChunks()
    {
        return $this->support_chunks;
    }

    /**
     * List of chunks to be attributed across all claims in the candidate.
     * These are derived from the grounding sources supplied in the request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.FactChunk support_chunks = 1;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\FactChunk[] $var
     * @return $this
     */
    public function setSupportChunks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\FactChunk::class);
        $this->support_chunks = $arr;

        return $this;
    }

    /**
     * Web search queries for the following-up web search.
     *
     * Generated from protobuf field <code>repeated string web_search_queries = 3;</code>
     * @return RepeatedField<string>
     */
    public function getWebSearchQueries()
    {
        return $this->web_search_queries;
    }

    /**
     * Web search queries for the following-up web search.
     *
     * Generated from protobuf field <code>repeated string web_search_queries = 3;</code>
     * @param string[] $var
     * @return $this
     */
    public function setWebSearchQueries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->web_search_queries = $arr;

        return $this;
    }

    /**
     * Google search entry for the following-up web searches.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint search_entry_point = 4;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint|null
     */
    public function getSearchEntryPoint()
    {
        return $this->search_entry_point;
    }

    public function hasSearchEntryPoint()
    {
        return isset($this->search_entry_point);
    }

    public function clearSearchEntryPoint()
    {
        unset($this->search_entry_point);
    }

    /**
     * Google search entry for the following-up web searches.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint search_entry_point = 4;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint $var
     * @return $this
     */
    public function setSearchEntryPoint($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint::class);
        $this->search_entry_point = $var;

        return $this;
    }

    /**
     * GroundingSupport across all claims in the answer candidate.
     * An support to a fact indicates that the claim is supported by
     * the fact.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport grounding_support = 2;</code>
     * @return RepeatedField<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport>
     */
    public function getGroundingSupport()
    {
        return $this->grounding_support;
    }

    /**
     * GroundingSupport across all claims in the answer candidate.
     * An support to a fact indicates that the claim is supported by
     * the fact.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport grounding_support = 2;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport[] $var
     * @return $this
     */
    public function setGroundingSupport($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport::class);
        $this->grounding_support = $arr;

        return $this;
    }

    /**
     * Images from the web search.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata images = 9;</code>
     * @return RepeatedField<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\ImageMetadata>
     */
    public function getImages()
    {
        return $this->images;
    }

    /**
     * Images from the web search.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata images = 9;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\ImageMetadata[] $var
     * @return $this
     */
    public function setImages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\ImageMetadata::class);
        $this->images = $arr;

        return $this;
    }

}

