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

namespace Google\Cloud\Spanner\V1;

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

/**
 * The request for
 * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
 *
 * Generated from protobuf message <code>google.spanner.v1.BatchCreateSessionsRequest</code>
 */
class BatchCreateSessionsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The database in which the new sessions are created.
     *
     * Generated from protobuf field <code>string database = 1;</code>
     */
    private $database = '';
    /**
     * Parameters to be applied to each created session.
     *
     * Generated from protobuf field <code>.google.spanner.v1.Session session_template = 2;</code>
     */
    private $session_template = null;
    /**
     * Required. The number of sessions to be created in this batch call.
     * The API may return fewer than the requested number of sessions. If a
     * specific number of sessions are desired, the client can make additional
     * calls to BatchCreateSessions (adjusting
     * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
     * as necessary).
     *
     * Generated from protobuf field <code>int32 session_count = 3;</code>
     */
    private $session_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $database
     *           Required. The database in which the new sessions are created.
     *     @type \Google\Cloud\Spanner\V1\Session $session_template
     *           Parameters to be applied to each created session.
     *     @type int $session_count
     *           Required. The number of sessions to be created in this batch call.
     *           The API may return fewer than the requested number of sessions. If a
     *           specific number of sessions are desired, the client can make additional
     *           calls to BatchCreateSessions (adjusting
     *           [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
     *           as necessary).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\V1\Spanner::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The database in which the new sessions are created.
     *
     * Generated from protobuf field <code>string database = 1;</code>
     * @return string
     */
    public function getDatabase()
    {
        return $this->database;
    }

    /**
     * Required. The database in which the new sessions are created.
     *
     * Generated from protobuf field <code>string database = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDatabase($var)
    {
        GPBUtil::checkString($var, True);
        $this->database = $var;

        return $this;
    }

    /**
     * Parameters to be applied to each created session.
     *
     * Generated from protobuf field <code>.google.spanner.v1.Session session_template = 2;</code>
     * @return \Google\Cloud\Spanner\V1\Session
     */
    public function getSessionTemplate()
    {
        return $this->session_template;
    }

    /**
     * Parameters to be applied to each created session.
     *
     * Generated from protobuf field <code>.google.spanner.v1.Session session_template = 2;</code>
     * @param \Google\Cloud\Spanner\V1\Session $var
     * @return $this
     */
    public function setSessionTemplate($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\Session::class);
        $this->session_template = $var;

        return $this;
    }

    /**
     * Required. The number of sessions to be created in this batch call.
     * The API may return fewer than the requested number of sessions. If a
     * specific number of sessions are desired, the client can make additional
     * calls to BatchCreateSessions (adjusting
     * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
     * as necessary).
     *
     * Generated from protobuf field <code>int32 session_count = 3;</code>
     * @return int
     */
    public function getSessionCount()
    {
        return $this->session_count;
    }

    /**
     * Required. The number of sessions to be created in this batch call.
     * The API may return fewer than the requested number of sessions. If a
     * specific number of sessions are desired, the client can make additional
     * calls to BatchCreateSessions (adjusting
     * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
     * as necessary).
     *
     * Generated from protobuf field <code>int32 session_count = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setSessionCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->session_count = $var;

        return $this;
    }

}

