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

namespace Google\Cloud\Dataplex\V1;

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

/**
 * Schema information describing the structure and layout of the data.
 *
 * Generated from protobuf message <code>google.cloud.dataplex.v1.Schema</code>
 */
class Schema extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Set to `true` if user-managed or `false` if managed by Dataplex.
     * The default is `false` (managed by Dataplex).
     * - Set to `false`to enable Dataplex discovery to update the schema.
     *   including new data discovery, schema inference, and schema evolution.
     *   Users retain the ability to input and edit the schema. Dataplex
     *   treats schema input by the user as though produced
     *   by a previous Dataplex discovery operation, and it will
     *   evolve the schema and take action based on that treatment.
     * - Set to `true` to fully manage the entity
     *   schema. This setting guarantees that Dataplex will not
     *   change schema fields.
     *
     * Generated from protobuf field <code>bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $user_managed = false;
    /**
     * Optional. The sequence of fields describing data in table entities.
     * **Note:** BigQuery SchemaFields are immutable.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.Schema.SchemaField fields = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $fields;
    /**
     * Optional. The sequence of fields describing the partition structure in
     * entities. If this field is empty, there are no partitions within the data.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.Schema.PartitionField partition_fields = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $partition_fields;
    /**
     * Optional. The structure of paths containing partition data within the
     * entity.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.Schema.PartitionStyle partition_style = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $partition_style = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $user_managed
     *           Required. Set to `true` if user-managed or `false` if managed by Dataplex.
     *           The default is `false` (managed by Dataplex).
     *           - Set to `false`to enable Dataplex discovery to update the schema.
     *             including new data discovery, schema inference, and schema evolution.
     *             Users retain the ability to input and edit the schema. Dataplex
     *             treats schema input by the user as though produced
     *             by a previous Dataplex discovery operation, and it will
     *             evolve the schema and take action based on that treatment.
     *           - Set to `true` to fully manage the entity
     *             schema. This setting guarantees that Dataplex will not
     *             change schema fields.
     *     @type array<\Google\Cloud\Dataplex\V1\Schema\SchemaField>|\Google\Protobuf\Internal\RepeatedField $fields
     *           Optional. The sequence of fields describing data in table entities.
     *           **Note:** BigQuery SchemaFields are immutable.
     *     @type array<\Google\Cloud\Dataplex\V1\Schema\PartitionField>|\Google\Protobuf\Internal\RepeatedField $partition_fields
     *           Optional. The sequence of fields describing the partition structure in
     *           entities. If this field is empty, there are no partitions within the data.
     *     @type int $partition_style
     *           Optional. The structure of paths containing partition data within the
     *           entity.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataplex\V1\Metadata::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Set to `true` if user-managed or `false` if managed by Dataplex.
     * The default is `false` (managed by Dataplex).
     * - Set to `false`to enable Dataplex discovery to update the schema.
     *   including new data discovery, schema inference, and schema evolution.
     *   Users retain the ability to input and edit the schema. Dataplex
     *   treats schema input by the user as though produced
     *   by a previous Dataplex discovery operation, and it will
     *   evolve the schema and take action based on that treatment.
     * - Set to `true` to fully manage the entity
     *   schema. This setting guarantees that Dataplex will not
     *   change schema fields.
     *
     * Generated from protobuf field <code>bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return bool
     */
    public function getUserManaged()
    {
        return $this->user_managed;
    }

    /**
     * Required. Set to `true` if user-managed or `false` if managed by Dataplex.
     * The default is `false` (managed by Dataplex).
     * - Set to `false`to enable Dataplex discovery to update the schema.
     *   including new data discovery, schema inference, and schema evolution.
     *   Users retain the ability to input and edit the schema. Dataplex
     *   treats schema input by the user as though produced
     *   by a previous Dataplex discovery operation, and it will
     *   evolve the schema and take action based on that treatment.
     * - Set to `true` to fully manage the entity
     *   schema. This setting guarantees that Dataplex will not
     *   change schema fields.
     *
     * Generated from protobuf field <code>bool user_managed = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param bool $var
     * @return $this
     */
    public function setUserManaged($var)
    {
        GPBUtil::checkBool($var);
        $this->user_managed = $var;

        return $this;
    }

    /**
     * Optional. The sequence of fields describing data in table entities.
     * **Note:** BigQuery SchemaFields are immutable.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.Schema.SchemaField fields = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFields()
    {
        return $this->fields;
    }

    /**
     * Optional. The sequence of fields describing data in table entities.
     * **Note:** BigQuery SchemaFields are immutable.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.Schema.SchemaField fields = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\Dataplex\V1\Schema\SchemaField>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFields($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataplex\V1\Schema\SchemaField::class);
        $this->fields = $arr;

        return $this;
    }

    /**
     * Optional. The sequence of fields describing the partition structure in
     * entities. If this field is empty, there are no partitions within the data.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.Schema.PartitionField partition_fields = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPartitionFields()
    {
        return $this->partition_fields;
    }

    /**
     * Optional. The sequence of fields describing the partition structure in
     * entities. If this field is empty, there are no partitions within the data.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.Schema.PartitionField partition_fields = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\Dataplex\V1\Schema\PartitionField>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPartitionFields($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataplex\V1\Schema\PartitionField::class);
        $this->partition_fields = $arr;

        return $this;
    }

    /**
     * Optional. The structure of paths containing partition data within the
     * entity.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.Schema.PartitionStyle partition_style = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getPartitionStyle()
    {
        return $this->partition_style;
    }

    /**
     * Optional. The structure of paths containing partition data within the
     * entity.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.Schema.PartitionStyle partition_style = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setPartitionStyle($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataplex\V1\Schema\PartitionStyle::class);
        $this->partition_style = $var;

        return $this;
    }

}

