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

namespace Google\Cloud\DiscoveryEngine\V1\SearchRequest\ContentSearchSpec;

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

/**
 * Specifies the chunk spec to be returned from the search response.
 * Only available if the
 * [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
 * is set to
 * [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec</code>
 */
class ChunkSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * The number of previous chunks to be returned of the current chunk. The
     * maximum allowed value is 3.
     * If not specified, no previous chunks will be returned.
     *
     * Generated from protobuf field <code>int32 num_previous_chunks = 1;</code>
     */
    protected $num_previous_chunks = 0;
    /**
     * The number of next chunks to be returned of the current chunk. The
     * maximum allowed value is 3.
     * If not specified, no next chunks will be returned.
     *
     * Generated from protobuf field <code>int32 num_next_chunks = 2;</code>
     */
    protected $num_next_chunks = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $num_previous_chunks
     *           The number of previous chunks to be returned of the current chunk. The
     *           maximum allowed value is 3.
     *           If not specified, no previous chunks will be returned.
     *     @type int $num_next_chunks
     *           The number of next chunks to be returned of the current chunk. The
     *           maximum allowed value is 3.
     *           If not specified, no next chunks will be returned.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\SearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * The number of previous chunks to be returned of the current chunk. The
     * maximum allowed value is 3.
     * If not specified, no previous chunks will be returned.
     *
     * Generated from protobuf field <code>int32 num_previous_chunks = 1;</code>
     * @return int
     */
    public function getNumPreviousChunks()
    {
        return $this->num_previous_chunks;
    }

    /**
     * The number of previous chunks to be returned of the current chunk. The
     * maximum allowed value is 3.
     * If not specified, no previous chunks will be returned.
     *
     * Generated from protobuf field <code>int32 num_previous_chunks = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setNumPreviousChunks($var)
    {
        GPBUtil::checkInt32($var);
        $this->num_previous_chunks = $var;

        return $this;
    }

    /**
     * The number of next chunks to be returned of the current chunk. The
     * maximum allowed value is 3.
     * If not specified, no next chunks will be returned.
     *
     * Generated from protobuf field <code>int32 num_next_chunks = 2;</code>
     * @return int
     */
    public function getNumNextChunks()
    {
        return $this->num_next_chunks;
    }

    /**
     * The number of next chunks to be returned of the current chunk. The
     * maximum allowed value is 3.
     * If not specified, no next chunks will be returned.
     *
     * Generated from protobuf field <code>int32 num_next_chunks = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setNumNextChunks($var)
    {
        GPBUtil::checkInt32($var);
        $this->num_next_chunks = $var;

        return $this;
    }

}


