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

namespace Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig;

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

/**
 * Query job configuration.
 *
 * Generated from protobuf message <code>google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query</code>
 */
class Query extends \Google\Protobuf\Internal\Message
{
    /**
     * The SQL query to run. Truncated if exceeds 50K.
     *
     * Generated from protobuf field <code>string query = 1;</code>
     */
    protected $query = '';
    /**
     * True if the query field was truncated.
     *
     * Generated from protobuf field <code>bool query_truncated = 10;</code>
     */
    protected $query_truncated = false;
    /**
     * The destination table for the query results.
     *
     * Generated from protobuf field <code>string destination_table = 2;</code>
     */
    protected $destination_table = '';
    /**
     * Destination table create disposition.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.CreateDisposition create_disposition = 3;</code>
     */
    protected $create_disposition = 0;
    /**
     * Destination table write disposition.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.WriteDisposition write_disposition = 4;</code>
     */
    protected $write_disposition = 0;
    /**
     * Default dataset for the query.
     *
     * Generated from protobuf field <code>string default_dataset = 5;</code>
     */
    protected $default_dataset = '';
    /**
     * External data sources used in the query.
     *
     * Generated from protobuf field <code>repeated .google.cloud.audit.BigQueryAuditMetadata.TableDefinition table_definitions = 6;</code>
     */
    private $table_definitions;
    /**
     * Priority given to the query.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query.Priority priority = 7;</code>
     */
    protected $priority = 0;
    /**
     * Result table encryption information. Set when non-default encryption is
     * used.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.EncryptionInfo destination_table_encryption = 8;</code>
     */
    protected $destination_table_encryption = null;
    /**
     * Type of the query.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.QueryStatementType statement_type = 9;</code>
     */
    protected $statement_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $query
     *           The SQL query to run. Truncated if exceeds 50K.
     *     @type bool $query_truncated
     *           True if the query field was truncated.
     *     @type string $destination_table
     *           The destination table for the query results.
     *     @type int $create_disposition
     *           Destination table create disposition.
     *     @type int $write_disposition
     *           Destination table write disposition.
     *     @type string $default_dataset
     *           Default dataset for the query.
     *     @type array<\Google\Cloud\Audit\BigQueryAuditMetadata\TableDefinition>|\Google\Protobuf\Internal\RepeatedField $table_definitions
     *           External data sources used in the query.
     *     @type int $priority
     *           Priority given to the query.
     *     @type \Google\Cloud\Audit\BigQueryAuditMetadata\EncryptionInfo $destination_table_encryption
     *           Result table encryption information. Set when non-default encryption is
     *           used.
     *     @type int $statement_type
     *           Type of the query.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Audit\BigqueryAuditMetadata::initOnce();
        parent::__construct($data);
    }

    /**
     * The SQL query to run. Truncated if exceeds 50K.
     *
     * Generated from protobuf field <code>string query = 1;</code>
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * The SQL query to run. Truncated if exceeds 50K.
     *
     * Generated from protobuf field <code>string query = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->query = $var;

        return $this;
    }

    /**
     * True if the query field was truncated.
     *
     * Generated from protobuf field <code>bool query_truncated = 10;</code>
     * @return bool
     */
    public function getQueryTruncated()
    {
        return $this->query_truncated;
    }

    /**
     * True if the query field was truncated.
     *
     * Generated from protobuf field <code>bool query_truncated = 10;</code>
     * @param bool $var
     * @return $this
     */
    public function setQueryTruncated($var)
    {
        GPBUtil::checkBool($var);
        $this->query_truncated = $var;

        return $this;
    }

    /**
     * The destination table for the query results.
     *
     * Generated from protobuf field <code>string destination_table = 2;</code>
     * @return string
     */
    public function getDestinationTable()
    {
        return $this->destination_table;
    }

    /**
     * The destination table for the query results.
     *
     * Generated from protobuf field <code>string destination_table = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationTable($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_table = $var;

        return $this;
    }

    /**
     * Destination table create disposition.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.CreateDisposition create_disposition = 3;</code>
     * @return int
     */
    public function getCreateDisposition()
    {
        return $this->create_disposition;
    }

    /**
     * Destination table create disposition.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.CreateDisposition create_disposition = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setCreateDisposition($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\BigQueryAuditMetadata\CreateDisposition::class);
        $this->create_disposition = $var;

        return $this;
    }

    /**
     * Destination table write disposition.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.WriteDisposition write_disposition = 4;</code>
     * @return int
     */
    public function getWriteDisposition()
    {
        return $this->write_disposition;
    }

    /**
     * Destination table write disposition.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.WriteDisposition write_disposition = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setWriteDisposition($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\BigQueryAuditMetadata\WriteDisposition::class);
        $this->write_disposition = $var;

        return $this;
    }

    /**
     * Default dataset for the query.
     *
     * Generated from protobuf field <code>string default_dataset = 5;</code>
     * @return string
     */
    public function getDefaultDataset()
    {
        return $this->default_dataset;
    }

    /**
     * Default dataset for the query.
     *
     * Generated from protobuf field <code>string default_dataset = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultDataset($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_dataset = $var;

        return $this;
    }

    /**
     * External data sources used in the query.
     *
     * Generated from protobuf field <code>repeated .google.cloud.audit.BigQueryAuditMetadata.TableDefinition table_definitions = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTableDefinitions()
    {
        return $this->table_definitions;
    }

    /**
     * External data sources used in the query.
     *
     * Generated from protobuf field <code>repeated .google.cloud.audit.BigQueryAuditMetadata.TableDefinition table_definitions = 6;</code>
     * @param array<\Google\Cloud\Audit\BigQueryAuditMetadata\TableDefinition>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTableDefinitions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Audit\BigQueryAuditMetadata\TableDefinition::class);
        $this->table_definitions = $arr;

        return $this;
    }

    /**
     * Priority given to the query.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query.Priority priority = 7;</code>
     * @return int
     */
    public function getPriority()
    {
        return $this->priority;
    }

    /**
     * Priority given to the query.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.JobConfig.Query.Priority priority = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setPriority($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\BigQueryAuditMetadata\JobConfig\Query\Priority::class);
        $this->priority = $var;

        return $this;
    }

    /**
     * Result table encryption information. Set when non-default encryption is
     * used.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.EncryptionInfo destination_table_encryption = 8;</code>
     * @return \Google\Cloud\Audit\BigQueryAuditMetadata\EncryptionInfo|null
     */
    public function getDestinationTableEncryption()
    {
        return $this->destination_table_encryption;
    }

    public function hasDestinationTableEncryption()
    {
        return isset($this->destination_table_encryption);
    }

    public function clearDestinationTableEncryption()
    {
        unset($this->destination_table_encryption);
    }

    /**
     * Result table encryption information. Set when non-default encryption is
     * used.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.EncryptionInfo destination_table_encryption = 8;</code>
     * @param \Google\Cloud\Audit\BigQueryAuditMetadata\EncryptionInfo $var
     * @return $this
     */
    public function setDestinationTableEncryption($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Audit\BigQueryAuditMetadata\EncryptionInfo::class);
        $this->destination_table_encryption = $var;

        return $this;
    }

    /**
     * Type of the query.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.QueryStatementType statement_type = 9;</code>
     * @return int
     */
    public function getStatementType()
    {
        return $this->statement_type;
    }

    /**
     * Type of the query.
     *
     * Generated from protobuf field <code>.google.cloud.audit.BigQueryAuditMetadata.QueryStatementType statement_type = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setStatementType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\BigQueryAuditMetadata\QueryStatementType::class);
        $this->statement_type = $var;

        return $this;
    }

}


