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

namespace Google\Cloud\DiscoveryEngine\V1beta\Answer\Reference;

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

/**
 * Chunk information.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.Answer.Reference.ChunkInfo</code>
 */
class ChunkInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Chunk resource name.
     *
     * Generated from protobuf field <code>string chunk = 1 [(.google.api.resource_reference) = {</code>
     */
    protected $chunk = '';
    /**
     * Chunk textual content.
     *
     * Generated from protobuf field <code>string content = 2;</code>
     */
    protected $content = '';
    /**
     * Relevance score.
     *
     * Generated from protobuf field <code>optional float relevance_score = 3;</code>
     */
    protected $relevance_score = null;
    /**
     * Document metadata.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Answer.Reference.ChunkInfo.DocumentMetadata document_metadata = 4;</code>
     */
    protected $document_metadata = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $chunk
     *           Chunk resource name.
     *     @type string $content
     *           Chunk textual content.
     *     @type float $relevance_score
     *           Relevance score.
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\Answer\Reference\ChunkInfo\DocumentMetadata $document_metadata
     *           Document metadata.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Answer::initOnce();
        parent::__construct($data);
    }

    /**
     * Chunk resource name.
     *
     * Generated from protobuf field <code>string chunk = 1 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getChunk()
    {
        return $this->chunk;
    }

    /**
     * Chunk resource name.
     *
     * Generated from protobuf field <code>string chunk = 1 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setChunk($var)
    {
        GPBUtil::checkString($var, True);
        $this->chunk = $var;

        return $this;
    }

    /**
     * Chunk textual content.
     *
     * Generated from protobuf field <code>string content = 2;</code>
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Chunk textual content.
     *
     * Generated from protobuf field <code>string content = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, True);
        $this->content = $var;

        return $this;
    }

    /**
     * Relevance score.
     *
     * Generated from protobuf field <code>optional float relevance_score = 3;</code>
     * @return float
     */
    public function getRelevanceScore()
    {
        return isset($this->relevance_score) ? $this->relevance_score : 0.0;
    }

    public function hasRelevanceScore()
    {
        return isset($this->relevance_score);
    }

    public function clearRelevanceScore()
    {
        unset($this->relevance_score);
    }

    /**
     * Relevance score.
     *
     * Generated from protobuf field <code>optional float relevance_score = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setRelevanceScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->relevance_score = $var;

        return $this;
    }

    /**
     * Document metadata.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Answer.Reference.ChunkInfo.DocumentMetadata document_metadata = 4;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\Answer\Reference\ChunkInfo\DocumentMetadata|null
     */
    public function getDocumentMetadata()
    {
        return $this->document_metadata;
    }

    public function hasDocumentMetadata()
    {
        return isset($this->document_metadata);
    }

    public function clearDocumentMetadata()
    {
        unset($this->document_metadata);
    }

    /**
     * Document metadata.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Answer.Reference.ChunkInfo.DocumentMetadata document_metadata = 4;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\Answer\Reference\ChunkInfo\DocumentMetadata $var
     * @return $this
     */
    public function setDocumentMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Answer\Reference\ChunkInfo\DocumentMetadata::class);
        $this->document_metadata = $var;

        return $this;
    }

}


