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

namespace Google\Cloud\BigQuery\DataTransfer\V1;

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

/**
 * Describes data which should be imported.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.datatransfer.v1.ImportedDataInfo</code>
 */
class ImportedDataInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * SQL query to run. When empty, API checks that there is only one
     * table_def specified and loads this table. Only Standard SQL queries
     * are accepted. Legacy SQL is not allowed.
     *
     * Generated from protobuf field <code>string sql = 1;</code>
     */
    private $sql = '';
    /**
     * Table where results should be written.
     *
     * Generated from protobuf field <code>string destination_table_id = 2;</code>
     */
    private $destination_table_id = '';
    /**
     * The description of a destination table. This can be several sentences
     * or paragraphs describing the table contents in detail.
     *
     * Generated from protobuf field <code>string destination_table_description = 10;</code>
     */
    private $destination_table_description = '';
    /**
     * When used WITHOUT the "sql" parameter, describes the schema of the
     * destination table.
     * When used WITH the "sql" parameter, describes tables with data stored
     * outside of BigQuery.
     *
     * Generated from protobuf field <code>repeated .google.cloud.bigquery.datatransfer.v1.ImportedDataInfo.TableDefinition table_defs = 3;</code>
     */
    private $table_defs;
    /**
     * Inline code for User-defined function resources.
     * Ignored when "sql" parameter is empty.
     *
     * Generated from protobuf field <code>repeated string user_defined_functions = 4;</code>
     */
    private $user_defined_functions;
    /**
     * Specifies the action if the destination table already exists.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.WriteDisposition write_disposition = 6;</code>
     */
    private $write_disposition = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $sql
     *           SQL query to run. When empty, API checks that there is only one
     *           table_def specified and loads this table. Only Standard SQL queries
     *           are accepted. Legacy SQL is not allowed.
     *     @type string $destination_table_id
     *           Table where results should be written.
     *     @type string $destination_table_description
     *           The description of a destination table. This can be several sentences
     *           or paragraphs describing the table contents in detail.
     *     @type \Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo\TableDefinition[]|\Google\Protobuf\Internal\RepeatedField $table_defs
     *           When used WITHOUT the "sql" parameter, describes the schema of the
     *           destination table.
     *           When used WITH the "sql" parameter, describes tables with data stored
     *           outside of BigQuery.
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $user_defined_functions
     *           Inline code for User-defined function resources.
     *           Ignored when "sql" parameter is empty.
     *     @type int $write_disposition
     *           Specifies the action if the destination table already exists.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datasource::initOnce();
        parent::__construct($data);
    }

    /**
     * SQL query to run. When empty, API checks that there is only one
     * table_def specified and loads this table. Only Standard SQL queries
     * are accepted. Legacy SQL is not allowed.
     *
     * Generated from protobuf field <code>string sql = 1;</code>
     * @return string
     */
    public function getSql()
    {
        return $this->sql;
    }

    /**
     * SQL query to run. When empty, API checks that there is only one
     * table_def specified and loads this table. Only Standard SQL queries
     * are accepted. Legacy SQL is not allowed.
     *
     * Generated from protobuf field <code>string sql = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setSql($var)
    {
        GPBUtil::checkString($var, True);
        $this->sql = $var;

        return $this;
    }

    /**
     * Table where results should be written.
     *
     * Generated from protobuf field <code>string destination_table_id = 2;</code>
     * @return string
     */
    public function getDestinationTableId()
    {
        return $this->destination_table_id;
    }

    /**
     * Table where results should be written.
     *
     * Generated from protobuf field <code>string destination_table_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationTableId($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_table_id = $var;

        return $this;
    }

    /**
     * The description of a destination table. This can be several sentences
     * or paragraphs describing the table contents in detail.
     *
     * Generated from protobuf field <code>string destination_table_description = 10;</code>
     * @return string
     */
    public function getDestinationTableDescription()
    {
        return $this->destination_table_description;
    }

    /**
     * The description of a destination table. This can be several sentences
     * or paragraphs describing the table contents in detail.
     *
     * Generated from protobuf field <code>string destination_table_description = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationTableDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_table_description = $var;

        return $this;
    }

    /**
     * When used WITHOUT the "sql" parameter, describes the schema of the
     * destination table.
     * When used WITH the "sql" parameter, describes tables with data stored
     * outside of BigQuery.
     *
     * Generated from protobuf field <code>repeated .google.cloud.bigquery.datatransfer.v1.ImportedDataInfo.TableDefinition table_defs = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTableDefs()
    {
        return $this->table_defs;
    }

    /**
     * When used WITHOUT the "sql" parameter, describes the schema of the
     * destination table.
     * When used WITH the "sql" parameter, describes tables with data stored
     * outside of BigQuery.
     *
     * Generated from protobuf field <code>repeated .google.cloud.bigquery.datatransfer.v1.ImportedDataInfo.TableDefinition table_defs = 3;</code>
     * @param \Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo\TableDefinition[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTableDefs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo\TableDefinition::class);
        $this->table_defs = $arr;

        return $this;
    }

    /**
     * Inline code for User-defined function resources.
     * Ignored when "sql" parameter is empty.
     *
     * Generated from protobuf field <code>repeated string user_defined_functions = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUserDefinedFunctions()
    {
        return $this->user_defined_functions;
    }

    /**
     * Inline code for User-defined function resources.
     * Ignored when "sql" parameter is empty.
     *
     * Generated from protobuf field <code>repeated string user_defined_functions = 4;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUserDefinedFunctions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->user_defined_functions = $arr;

        return $this;
    }

    /**
     * Specifies the action if the destination table already exists.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.WriteDisposition write_disposition = 6;</code>
     * @return int
     */
    public function getWriteDisposition()
    {
        return $this->write_disposition;
    }

    /**
     * Specifies the action if the destination table already exists.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.WriteDisposition write_disposition = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setWriteDisposition($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\WriteDisposition::class);
        $this->write_disposition = $var;

        return $this;
    }

}

