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

namespace Google\Cloud\BigQuery\Storage\V1;

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

/**
 * Request message for `CreateReadSession`.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.storage.v1.CreateReadSessionRequest</code>
 */
class CreateReadSessionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The request project that owns the session, in the form of
     * `projects/{project_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. Session to be created.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $read_session = null;
    /**
     * Max initial number of streams. If unset or zero, the server will
     * provide a value of streams so as to produce reasonable throughput. Must be
     * non-negative. The number of streams may be lower than the requested number,
     * depending on the amount parallelism that is reasonable for the table. Error
     * will be returned if the max count is greater than the current system
     * max limit of 1,000.
     * Streams must be read starting from offset 0.
     *
     * Generated from protobuf field <code>int32 max_stream_count = 3;</code>
     */
    private $max_stream_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The request project that owns the session, in the form of
     *           `projects/{project_id}`.
     *     @type \Google\Cloud\BigQuery\Storage\V1\ReadSession $read_session
     *           Required. Session to be created.
     *     @type int $max_stream_count
     *           Max initial number of streams. If unset or zero, the server will
     *           provide a value of streams so as to produce reasonable throughput. Must be
     *           non-negative. The number of streams may be lower than the requested number,
     *           depending on the amount parallelism that is reasonable for the table. Error
     *           will be returned if the max count is greater than the current system
     *           max limit of 1,000.
     *           Streams must be read starting from offset 0.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The request project that owns the session, in the form of
     * `projects/{project_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The request project that owns the session, in the form of
     * `projects/{project_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. Session to be created.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\BigQuery\Storage\V1\ReadSession
     */
    public function getReadSession()
    {
        return isset($this->read_session) ? $this->read_session : null;
    }

    public function hasReadSession()
    {
        return isset($this->read_session);
    }

    public function clearReadSession()
    {
        unset($this->read_session);
    }

    /**
     * Required. Session to be created.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.storage.v1.ReadSession read_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\BigQuery\Storage\V1\ReadSession $var
     * @return $this
     */
    public function setReadSession($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ReadSession::class);
        $this->read_session = $var;

        return $this;
    }

    /**
     * Max initial number of streams. If unset or zero, the server will
     * provide a value of streams so as to produce reasonable throughput. Must be
     * non-negative. The number of streams may be lower than the requested number,
     * depending on the amount parallelism that is reasonable for the table. Error
     * will be returned if the max count is greater than the current system
     * max limit of 1,000.
     * Streams must be read starting from offset 0.
     *
     * Generated from protobuf field <code>int32 max_stream_count = 3;</code>
     * @return int
     */
    public function getMaxStreamCount()
    {
        return $this->max_stream_count;
    }

    /**
     * Max initial number of streams. If unset or zero, the server will
     * provide a value of streams so as to produce reasonable throughput. Must be
     * non-negative. The number of streams may be lower than the requested number,
     * depending on the amount parallelism that is reasonable for the table. Error
     * will be returned if the max count is greater than the current system
     * max limit of 1,000.
     * Streams must be read starting from offset 0.
     *
     * Generated from protobuf field <code>int32 max_stream_count = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxStreamCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_stream_count = $var;

        return $this;
    }

}

