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

namespace Google\Cloud\AlloyDb\V1;

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

/**
 * SqlResult represents the result for the execution of a sql statement.
 *
 * Generated from protobuf message <code>google.cloud.alloydb.v1.SqlResult</code>
 */
class SqlResult extends \Google\Protobuf\Internal\Message
{
    /**
     * List of columns included in the result. This also includes the data type
     * of the column.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1.SqlResultColumn columns = 1;</code>
     */
    private $columns;
    /**
     * Rows returned by the SQL statement.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1.SqlResultRow rows = 2;</code>
     */
    private $rows;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\AlloyDb\V1\SqlResultColumn>|\Google\Protobuf\Internal\RepeatedField $columns
     *           List of columns included in the result. This also includes the data type
     *           of the column.
     *     @type array<\Google\Cloud\AlloyDb\V1\SqlResultRow>|\Google\Protobuf\Internal\RepeatedField $rows
     *           Rows returned by the SQL statement.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Alloydb\V1\DataModel::initOnce();
        parent::__construct($data);
    }

    /**
     * List of columns included in the result. This also includes the data type
     * of the column.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1.SqlResultColumn columns = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getColumns()
    {
        return $this->columns;
    }

    /**
     * List of columns included in the result. This also includes the data type
     * of the column.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1.SqlResultColumn columns = 1;</code>
     * @param array<\Google\Cloud\AlloyDb\V1\SqlResultColumn>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setColumns($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SqlResultColumn::class);
        $this->columns = $arr;

        return $this;
    }

    /**
     * Rows returned by the SQL statement.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1.SqlResultRow rows = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRows()
    {
        return $this->rows;
    }

    /**
     * Rows returned by the SQL statement.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1.SqlResultRow rows = 2;</code>
     * @param array<\Google\Cloud\AlloyDb\V1\SqlResultRow>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRows($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SqlResultRow::class);
        $this->rows = $arr;

        return $this;
    }

}

