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

namespace Google\Cloud\Spanner\V1\ExecuteBatchDmlRequest;

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

/**
 * A single DML statement.
 *
 * Generated from protobuf message <code>google.spanner.v1.ExecuteBatchDmlRequest.Statement</code>
 */
class Statement extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The DML string.
     *
     * Generated from protobuf field <code>string sql = 1;</code>
     */
    private $sql = '';
    /**
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id > &#64;msg_id AND id < &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct params = 2;</code>
     */
    private $params = null;
    /**
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     *
     * Generated from protobuf field <code>map<string, .google.spanner.v1.Type> param_types = 3;</code>
     */
    private $param_types;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $sql
     *           Required. The DML string.
     *     @type \Google\Protobuf\Struct $params
     *           The DML string can contain parameter placeholders. A parameter
     *           placeholder consists of `'&#64;'` followed by the parameter
     *           name. Parameter names consist of any combination of letters,
     *           numbers, and underscores.
     *           Parameters can appear anywhere that a literal value is expected.  The
     *           same parameter name can be used more than once, for example:
     *             `"WHERE id > &#64;msg_id AND id < &#64;msg_id + 100"`
     *           It is an error to execute an SQL statement with unbound parameters.
     *           Parameter values are specified using `params`, which is a JSON
     *           object whose keys are parameter names, and whose values are the
     *           corresponding parameter values.
     *     @type array|\Google\Protobuf\Internal\MapField $param_types
     *           It is not always possible for Cloud Spanner to infer the right SQL type
     *           from a JSON value.  For example, values of type `BYTES` and values
     *           of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     *           In these cases, `param_types` can be used to specify the exact
     *           SQL type for some or all of the SQL statement parameters. See the
     *           definition of [Type][google.spanner.v1.Type] for more information
     *           about SQL types.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\V1\Spanner::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The DML string.
     *
     * Generated from protobuf field <code>string sql = 1;</code>
     * @return string
     */
    public function getSql()
    {
        return $this->sql;
    }

    /**
     * Required. The DML string.
     *
     * Generated from protobuf field <code>string sql = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setSql($var)
    {
        GPBUtil::checkString($var, True);
        $this->sql = $var;

        return $this;
    }

    /**
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id > &#64;msg_id AND id < &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct params = 2;</code>
     * @return \Google\Protobuf\Struct
     */
    public function getParams()
    {
        return $this->params;
    }

    /**
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id > &#64;msg_id AND id < &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct params = 2;</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setParams($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->params = $var;

        return $this;
    }

    /**
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     *
     * Generated from protobuf field <code>map<string, .google.spanner.v1.Type> param_types = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getParamTypes()
    {
        return $this->param_types;
    }

    /**
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     *
     * Generated from protobuf field <code>map<string, .google.spanner.v1.Type> param_types = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setParamTypes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\V1\Type::class);
        $this->param_types = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Statement::class, \Google\Cloud\Spanner\V1\ExecuteBatchDmlRequest_Statement::class);

