<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/automl/v1beta1/data_types.proto

namespace Google\Cloud\AutoMl\V1beta1;

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

/**
 * `StructType` defines the DataType-s of a [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT] type.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.StructType</code>
 */
class StructType extends \Google\Protobuf\Internal\Message
{
    /**
     * Unordered map of struct field names to their data types.
     * Fields cannot be added or removed via Update. Their names and
     * data types are still mutable.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.automl.v1beta1.DataType> fields = 1;</code>
     */
    private $fields;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $fields
     *           Unordered map of struct field names to their data types.
     *           Fields cannot be added or removed via Update. Their names and
     *           data types are still mutable.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\DataTypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Unordered map of struct field names to their data types.
     * Fields cannot be added or removed via Update. Their names and
     * data types are still mutable.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.automl.v1beta1.DataType> fields = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getFields()
    {
        return $this->fields;
    }

    /**
     * Unordered map of struct field names to their data types.
     * Fields cannot be added or removed via Update. Their names and
     * data types are still mutable.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.automl.v1beta1.DataType> fields = 1;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setFields($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1beta1\DataType::class);
        $this->fields = $arr;

        return $this;
    }

}

