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

namespace Google\Cloud\Spanner\V1;

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

/**
 * `StructType` defines the fields of a [STRUCT][google.spanner.v1.TypeCode.STRUCT] type.
 *
 * Generated from protobuf message <code>google.spanner.v1.StructType</code>
 */
class StructType extends \Google\Protobuf\Internal\Message
{
    /**
     * The list of fields that make up this struct. Order is
     * significant, because values of this struct type are represented as
     * lists, where the order of field values matches the order of
     * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields
     * matches the order of columns in a read request, or the order of
     * fields in the `SELECT` clause of a query.
     *
     * Generated from protobuf field <code>repeated .google.spanner.v1.StructType.Field fields = 1;</code>
     */
    private $fields;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Spanner\V1\StructType\Field>|\Google\Protobuf\Internal\RepeatedField $fields
     *           The list of fields that make up this struct. Order is
     *           significant, because values of this struct type are represented as
     *           lists, where the order of field values matches the order of
     *           fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields
     *           matches the order of columns in a read request, or the order of
     *           fields in the `SELECT` clause of a query.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\V1\Type::initOnce();
        parent::__construct($data);
    }

    /**
     * The list of fields that make up this struct. Order is
     * significant, because values of this struct type are represented as
     * lists, where the order of field values matches the order of
     * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields
     * matches the order of columns in a read request, or the order of
     * fields in the `SELECT` clause of a query.
     *
     * Generated from protobuf field <code>repeated .google.spanner.v1.StructType.Field fields = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFields()
    {
        return $this->fields;
    }

    /**
     * The list of fields that make up this struct. Order is
     * significant, because values of this struct type are represented as
     * lists, where the order of field values matches the order of
     * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields
     * matches the order of columns in a read request, or the order of
     * fields in the `SELECT` clause of a query.
     *
     * Generated from protobuf field <code>repeated .google.spanner.v1.StructType.Field fields = 1;</code>
     * @param array<\Google\Cloud\Spanner\V1\StructType\Field>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFields($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\V1\StructType\Field::class);
        $this->fields = $arr;

        return $this;
    }

}

