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

namespace Google\Cloud\Dataform\V1beta1\CompilationResultAction;

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

/**
 * Represents a database relation.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1beta1.CompilationResultAction.Relation</code>
 */
class Relation extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of actions that this action depends on.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataform.v1beta1.Target dependency_targets = 1;</code>
     */
    private $dependency_targets;
    /**
     * Whether this action is disabled (i.e. should not be run).
     *
     * Generated from protobuf field <code>bool disabled = 2;</code>
     */
    private $disabled = false;
    /**
     * Arbitrary, user-defined tags on this action.
     *
     * Generated from protobuf field <code>repeated string tags = 3;</code>
     */
    private $tags;
    /**
     * Descriptor for the relation and its columns.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 4;</code>
     */
    private $relation_descriptor = null;
    /**
     * The type of this relation.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation.RelationType relation_type = 5;</code>
     */
    private $relation_type = 0;
    /**
     * The SELECT query which returns rows which this relation should contain.
     *
     * Generated from protobuf field <code>string select_query = 6;</code>
     */
    private $select_query = '';
    /**
     * SQL statements to be executed before creating the relation.
     *
     * Generated from protobuf field <code>repeated string pre_operations = 7;</code>
     */
    private $pre_operations;
    /**
     * SQL statements to be executed after creating the relation.
     *
     * Generated from protobuf field <code>repeated string post_operations = 8;</code>
     */
    private $post_operations;
    /**
     * Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
     * `relation_type` is `INCREMENTAL_TABLE`.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation.IncrementalTableConfig incremental_table_config = 9;</code>
     */
    private $incremental_table_config = null;
    /**
     * The SQL expression used to partition the relation.
     *
     * Generated from protobuf field <code>string partition_expression = 10;</code>
     */
    private $partition_expression = '';
    /**
     * A list of columns or SQL expressions used to cluster the table.
     *
     * Generated from protobuf field <code>repeated string cluster_expressions = 11;</code>
     */
    private $cluster_expressions;
    /**
     * Sets the partition expiration in days.
     *
     * Generated from protobuf field <code>int32 partition_expiration_days = 12;</code>
     */
    private $partition_expiration_days = 0;
    /**
     * Specifies whether queries on this table must include a predicate filter
     * that filters on the partitioning column.
     *
     * Generated from protobuf field <code>bool require_partition_filter = 13;</code>
     */
    private $require_partition_filter = false;
    /**
     * Additional options that will be provided as key/value pairs into the
     * options clause of a create table/view statement. See
     * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
     * for more information on which options are supported.
     *
     * Generated from protobuf field <code>map<string, string> additional_options = 14;</code>
     */
    private $additional_options;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Dataform\V1beta1\Target>|\Google\Protobuf\Internal\RepeatedField $dependency_targets
     *           A list of actions that this action depends on.
     *     @type bool $disabled
     *           Whether this action is disabled (i.e. should not be run).
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $tags
     *           Arbitrary, user-defined tags on this action.
     *     @type \Google\Cloud\Dataform\V1beta1\RelationDescriptor $relation_descriptor
     *           Descriptor for the relation and its columns.
     *     @type int $relation_type
     *           The type of this relation.
     *     @type string $select_query
     *           The SELECT query which returns rows which this relation should contain.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $pre_operations
     *           SQL statements to be executed before creating the relation.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $post_operations
     *           SQL statements to be executed after creating the relation.
     *     @type \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation\IncrementalTableConfig $incremental_table_config
     *           Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
     *           `relation_type` is `INCREMENTAL_TABLE`.
     *     @type string $partition_expression
     *           The SQL expression used to partition the relation.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $cluster_expressions
     *           A list of columns or SQL expressions used to cluster the table.
     *     @type int $partition_expiration_days
     *           Sets the partition expiration in days.
     *     @type bool $require_partition_filter
     *           Specifies whether queries on this table must include a predicate filter
     *           that filters on the partitioning column.
     *     @type array|\Google\Protobuf\Internal\MapField $additional_options
     *           Additional options that will be provided as key/value pairs into the
     *           options clause of a create table/view statement. See
     *           https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
     *           for more information on which options are supported.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of actions that this action depends on.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataform.v1beta1.Target dependency_targets = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDependencyTargets()
    {
        return $this->dependency_targets;
    }

    /**
     * A list of actions that this action depends on.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataform.v1beta1.Target dependency_targets = 1;</code>
     * @param array<\Google\Cloud\Dataform\V1beta1\Target>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDependencyTargets($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataform\V1beta1\Target::class);
        $this->dependency_targets = $arr;

        return $this;
    }

    /**
     * Whether this action is disabled (i.e. should not be run).
     *
     * Generated from protobuf field <code>bool disabled = 2;</code>
     * @return bool
     */
    public function getDisabled()
    {
        return $this->disabled;
    }

    /**
     * Whether this action is disabled (i.e. should not be run).
     *
     * Generated from protobuf field <code>bool disabled = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setDisabled($var)
    {
        GPBUtil::checkBool($var);
        $this->disabled = $var;

        return $this;
    }

    /**
     * Arbitrary, user-defined tags on this action.
     *
     * Generated from protobuf field <code>repeated string tags = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTags()
    {
        return $this->tags;
    }

    /**
     * Arbitrary, user-defined tags on this action.
     *
     * Generated from protobuf field <code>repeated string tags = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTags($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->tags = $arr;

        return $this;
    }

    /**
     * Descriptor for the relation and its columns.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 4;</code>
     * @return \Google\Cloud\Dataform\V1beta1\RelationDescriptor|null
     */
    public function getRelationDescriptor()
    {
        return $this->relation_descriptor;
    }

    public function hasRelationDescriptor()
    {
        return isset($this->relation_descriptor);
    }

    public function clearRelationDescriptor()
    {
        unset($this->relation_descriptor);
    }

    /**
     * Descriptor for the relation and its columns.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.RelationDescriptor relation_descriptor = 4;</code>
     * @param \Google\Cloud\Dataform\V1beta1\RelationDescriptor $var
     * @return $this
     */
    public function setRelationDescriptor($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\RelationDescriptor::class);
        $this->relation_descriptor = $var;

        return $this;
    }

    /**
     * The type of this relation.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation.RelationType relation_type = 5;</code>
     * @return int
     */
    public function getRelationType()
    {
        return $this->relation_type;
    }

    /**
     * The type of this relation.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation.RelationType relation_type = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setRelationType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation\RelationType::class);
        $this->relation_type = $var;

        return $this;
    }

    /**
     * The SELECT query which returns rows which this relation should contain.
     *
     * Generated from protobuf field <code>string select_query = 6;</code>
     * @return string
     */
    public function getSelectQuery()
    {
        return $this->select_query;
    }

    /**
     * The SELECT query which returns rows which this relation should contain.
     *
     * Generated from protobuf field <code>string select_query = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setSelectQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->select_query = $var;

        return $this;
    }

    /**
     * SQL statements to be executed before creating the relation.
     *
     * Generated from protobuf field <code>repeated string pre_operations = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPreOperations()
    {
        return $this->pre_operations;
    }

    /**
     * SQL statements to be executed before creating the relation.
     *
     * Generated from protobuf field <code>repeated string pre_operations = 7;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPreOperations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->pre_operations = $arr;

        return $this;
    }

    /**
     * SQL statements to be executed after creating the relation.
     *
     * Generated from protobuf field <code>repeated string post_operations = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPostOperations()
    {
        return $this->post_operations;
    }

    /**
     * SQL statements to be executed after creating the relation.
     *
     * Generated from protobuf field <code>repeated string post_operations = 8;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPostOperations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->post_operations = $arr;

        return $this;
    }

    /**
     * Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
     * `relation_type` is `INCREMENTAL_TABLE`.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation.IncrementalTableConfig incremental_table_config = 9;</code>
     * @return \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation\IncrementalTableConfig|null
     */
    public function getIncrementalTableConfig()
    {
        return $this->incremental_table_config;
    }

    public function hasIncrementalTableConfig()
    {
        return isset($this->incremental_table_config);
    }

    public function clearIncrementalTableConfig()
    {
        unset($this->incremental_table_config);
    }

    /**
     * Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
     * `relation_type` is `INCREMENTAL_TABLE`.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.CompilationResultAction.Relation.IncrementalTableConfig incremental_table_config = 9;</code>
     * @param \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation\IncrementalTableConfig $var
     * @return $this
     */
    public function setIncrementalTableConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation\IncrementalTableConfig::class);
        $this->incremental_table_config = $var;

        return $this;
    }

    /**
     * The SQL expression used to partition the relation.
     *
     * Generated from protobuf field <code>string partition_expression = 10;</code>
     * @return string
     */
    public function getPartitionExpression()
    {
        return $this->partition_expression;
    }

    /**
     * The SQL expression used to partition the relation.
     *
     * Generated from protobuf field <code>string partition_expression = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setPartitionExpression($var)
    {
        GPBUtil::checkString($var, True);
        $this->partition_expression = $var;

        return $this;
    }

    /**
     * A list of columns or SQL expressions used to cluster the table.
     *
     * Generated from protobuf field <code>repeated string cluster_expressions = 11;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getClusterExpressions()
    {
        return $this->cluster_expressions;
    }

    /**
     * A list of columns or SQL expressions used to cluster the table.
     *
     * Generated from protobuf field <code>repeated string cluster_expressions = 11;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setClusterExpressions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->cluster_expressions = $arr;

        return $this;
    }

    /**
     * Sets the partition expiration in days.
     *
     * Generated from protobuf field <code>int32 partition_expiration_days = 12;</code>
     * @return int
     */
    public function getPartitionExpirationDays()
    {
        return $this->partition_expiration_days;
    }

    /**
     * Sets the partition expiration in days.
     *
     * Generated from protobuf field <code>int32 partition_expiration_days = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setPartitionExpirationDays($var)
    {
        GPBUtil::checkInt32($var);
        $this->partition_expiration_days = $var;

        return $this;
    }

    /**
     * Specifies whether queries on this table must include a predicate filter
     * that filters on the partitioning column.
     *
     * Generated from protobuf field <code>bool require_partition_filter = 13;</code>
     * @return bool
     */
    public function getRequirePartitionFilter()
    {
        return $this->require_partition_filter;
    }

    /**
     * Specifies whether queries on this table must include a predicate filter
     * that filters on the partitioning column.
     *
     * Generated from protobuf field <code>bool require_partition_filter = 13;</code>
     * @param bool $var
     * @return $this
     */
    public function setRequirePartitionFilter($var)
    {
        GPBUtil::checkBool($var);
        $this->require_partition_filter = $var;

        return $this;
    }

    /**
     * Additional options that will be provided as key/value pairs into the
     * options clause of a create table/view statement. See
     * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
     * for more information on which options are supported.
     *
     * Generated from protobuf field <code>map<string, string> additional_options = 14;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAdditionalOptions()
    {
        return $this->additional_options;
    }

    /**
     * Additional options that will be provided as key/value pairs into the
     * options clause of a create table/view statement. See
     * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
     * for more information on which options are supported.
     *
     * Generated from protobuf field <code>map<string, string> additional_options = 14;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAdditionalOptions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->additional_options = $arr;

        return $this;
    }

}


