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

namespace Google\Cloud\Asset\V1;

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

/**
 * A field in TableSchema.
 *
 * Generated from protobuf message <code>google.cloud.asset.v1.TableFieldSchema</code>
 */
class TableFieldSchema extends \Google\Protobuf\Internal\Message
{
    /**
     * The field name. The name must contain only letters (a-z, A-Z),
     * numbers (0-9), or underscores (_), and must start with a letter or
     * underscore. The maximum length is 128 characters.
     *
     * Generated from protobuf field <code>string field = 1;</code>
     */
    private $field = '';
    /**
     * The field data type. Possible values include
     * * STRING
     * * BYTES
     * * INTEGER
     * * FLOAT
     * * BOOLEAN
     * * TIMESTAMP
     * * DATE
     * * TIME
     * * DATETIME
     * * GEOGRAPHY,
     * * NUMERIC,
     * * BIGNUMERIC,
     * * RECORD
     * (where RECORD indicates that the field contains a nested schema).
     *
     * Generated from protobuf field <code>string type = 2;</code>
     */
    private $type = '';
    /**
     * The field mode. Possible values include NULLABLE, REQUIRED and
     * REPEATED. The default value is NULLABLE.
     *
     * Generated from protobuf field <code>string mode = 3;</code>
     */
    private $mode = '';
    /**
     * Describes the nested schema fields if the type property is set
     * to RECORD.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.TableFieldSchema fields = 4;</code>
     */
    private $fields;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $field
     *           The field name. The name must contain only letters (a-z, A-Z),
     *           numbers (0-9), or underscores (_), and must start with a letter or
     *           underscore. The maximum length is 128 characters.
     *     @type string $type
     *           The field data type. Possible values include
     *           * STRING
     *           * BYTES
     *           * INTEGER
     *           * FLOAT
     *           * BOOLEAN
     *           * TIMESTAMP
     *           * DATE
     *           * TIME
     *           * DATETIME
     *           * GEOGRAPHY,
     *           * NUMERIC,
     *           * BIGNUMERIC,
     *           * RECORD
     *           (where RECORD indicates that the field contains a nested schema).
     *     @type string $mode
     *           The field mode. Possible values include NULLABLE, REQUIRED and
     *           REPEATED. The default value is NULLABLE.
     *     @type array<\Google\Cloud\Asset\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $fields
     *           Describes the nested schema fields if the type property is set
     *           to RECORD.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce();
        parent::__construct($data);
    }

    /**
     * The field name. The name must contain only letters (a-z, A-Z),
     * numbers (0-9), or underscores (_), and must start with a letter or
     * underscore. The maximum length is 128 characters.
     *
     * Generated from protobuf field <code>string field = 1;</code>
     * @return string
     */
    public function getField()
    {
        return $this->field;
    }

    /**
     * The field name. The name must contain only letters (a-z, A-Z),
     * numbers (0-9), or underscores (_), and must start with a letter or
     * underscore. The maximum length is 128 characters.
     *
     * Generated from protobuf field <code>string field = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setField($var)
    {
        GPBUtil::checkString($var, True);
        $this->field = $var;

        return $this;
    }

    /**
     * The field data type. Possible values include
     * * STRING
     * * BYTES
     * * INTEGER
     * * FLOAT
     * * BOOLEAN
     * * TIMESTAMP
     * * DATE
     * * TIME
     * * DATETIME
     * * GEOGRAPHY,
     * * NUMERIC,
     * * BIGNUMERIC,
     * * RECORD
     * (where RECORD indicates that the field contains a nested schema).
     *
     * Generated from protobuf field <code>string type = 2;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The field data type. Possible values include
     * * STRING
     * * BYTES
     * * INTEGER
     * * FLOAT
     * * BOOLEAN
     * * TIMESTAMP
     * * DATE
     * * TIME
     * * DATETIME
     * * GEOGRAPHY,
     * * NUMERIC,
     * * BIGNUMERIC,
     * * RECORD
     * (where RECORD indicates that the field contains a nested schema).
     *
     * Generated from protobuf field <code>string type = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

    /**
     * The field mode. Possible values include NULLABLE, REQUIRED and
     * REPEATED. The default value is NULLABLE.
     *
     * Generated from protobuf field <code>string mode = 3;</code>
     * @return string
     */
    public function getMode()
    {
        return $this->mode;
    }

    /**
     * The field mode. Possible values include NULLABLE, REQUIRED and
     * REPEATED. The default value is NULLABLE.
     *
     * Generated from protobuf field <code>string mode = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMode($var)
    {
        GPBUtil::checkString($var, True);
        $this->mode = $var;

        return $this;
    }

    /**
     * Describes the nested schema fields if the type property is set
     * to RECORD.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.TableFieldSchema fields = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFields()
    {
        return $this->fields;
    }

    /**
     * Describes the nested schema fields if the type property is set
     * to RECORD.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.TableFieldSchema fields = 4;</code>
     * @param array<\Google\Cloud\Asset\V1\TableFieldSchema>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFields($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\TableFieldSchema::class);
        $this->fields = $arr;

        return $this;
    }

}

