<?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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</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 [(.google.api.field_behavior) = REQUIRED];</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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</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|null
     */
    public function getSessionTemplate()
    {
        return $this->session_template;
    }

    public function hasSessionTemplate()
    {
        return isset($this->session_template);
    }

    public function clearSessionTemplate()
    {
        unset($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 [(.google.api.field_behavior) = REQUIRED];</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 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setSessionCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->session_count = $var;

        return $this;
    }

}

