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

namespace Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo\TableDefinition;

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

/**
 * CSV specific options.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.datatransfer.v1.ImportedDataInfo.TableDefinition.CsvOptions</code>
 */
class CsvOptions extends \Google\Protobuf\Internal\Message
{
    /**
     * The delimiter.  We currently restrict this to U+0001 to U+00FF and
     * apply additional constraints during validation.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue field_delimiter = 1;</code>
     */
    private $field_delimiter = null;
    /**
     * Whether CSV files are allowed to have quoted newlines. If quoted
     * newlines are allowed, we can't split CSV files.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_quoted_newlines = 2;</code>
     */
    private $allow_quoted_newlines = null;
    /**
     * The quote character.  We currently restrict this to U+0000 to U+00FF
     * and apply additional constraints during validation. Set to '\0' to
     * indicate no quote is used.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue quote_char = 3;</code>
     */
    private $quote_char = null;
    /**
     * Number of leading rows to skip.
     *
     * Generated from protobuf field <code>.google.protobuf.Int64Value skip_leading_rows = 4;</code>
     */
    private $skip_leading_rows = null;
    /**
     * Accept rows that are missing trailing optional columns.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_jagged_rows = 5;</code>
     */
    private $allow_jagged_rows = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\StringValue $field_delimiter
     *           The delimiter.  We currently restrict this to U+0001 to U+00FF and
     *           apply additional constraints during validation.
     *     @type \Google\Protobuf\BoolValue $allow_quoted_newlines
     *           Whether CSV files are allowed to have quoted newlines. If quoted
     *           newlines are allowed, we can't split CSV files.
     *     @type \Google\Protobuf\StringValue $quote_char
     *           The quote character.  We currently restrict this to U+0000 to U+00FF
     *           and apply additional constraints during validation. Set to '\0' to
     *           indicate no quote is used.
     *     @type \Google\Protobuf\Int64Value $skip_leading_rows
     *           Number of leading rows to skip.
     *     @type \Google\Protobuf\BoolValue $allow_jagged_rows
     *           Accept rows that are missing trailing optional columns.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Datasource::initOnce();
        parent::__construct($data);
    }

    /**
     * The delimiter.  We currently restrict this to U+0001 to U+00FF and
     * apply additional constraints during validation.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue field_delimiter = 1;</code>
     * @return \Google\Protobuf\StringValue
     */
    public function getFieldDelimiter()
    {
        return $this->field_delimiter;
    }

    /**
     * Returns the unboxed value from <code>getFieldDelimiter()</code>

     * The delimiter.  We currently restrict this to U+0001 to U+00FF and
     * apply additional constraints during validation.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue field_delimiter = 1;</code>
     * @return string|null
     */
    public function getFieldDelimiterValue()
    {
        $wrapper = $this->getFieldDelimiter();
        return is_null($wrapper) ? null : $wrapper->getValue();
    }

    /**
     * The delimiter.  We currently restrict this to U+0001 to U+00FF and
     * apply additional constraints during validation.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue field_delimiter = 1;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setFieldDelimiter($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->field_delimiter = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * The delimiter.  We currently restrict this to U+0001 to U+00FF and
     * apply additional constraints during validation.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue field_delimiter = 1;</code>
     * @param string|null $var
     * @return $this
     */
    public function setFieldDelimiterValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\StringValue(['value' => $var]);
        return $this->setFieldDelimiter($wrappedVar);
    }

    /**
     * Whether CSV files are allowed to have quoted newlines. If quoted
     * newlines are allowed, we can't split CSV files.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_quoted_newlines = 2;</code>
     * @return \Google\Protobuf\BoolValue
     */
    public function getAllowQuotedNewlines()
    {
        return $this->allow_quoted_newlines;
    }

    /**
     * Returns the unboxed value from <code>getAllowQuotedNewlines()</code>

     * Whether CSV files are allowed to have quoted newlines. If quoted
     * newlines are allowed, we can't split CSV files.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_quoted_newlines = 2;</code>
     * @return bool|null
     */
    public function getAllowQuotedNewlinesValue()
    {
        $wrapper = $this->getAllowQuotedNewlines();
        return is_null($wrapper) ? null : $wrapper->getValue();
    }

    /**
     * Whether CSV files are allowed to have quoted newlines. If quoted
     * newlines are allowed, we can't split CSV files.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_quoted_newlines = 2;</code>
     * @param \Google\Protobuf\BoolValue $var
     * @return $this
     */
    public function setAllowQuotedNewlines($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class);
        $this->allow_quoted_newlines = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.

     * Whether CSV files are allowed to have quoted newlines. If quoted
     * newlines are allowed, we can't split CSV files.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_quoted_newlines = 2;</code>
     * @param bool|null $var
     * @return $this
     */
    public function setAllowQuotedNewlinesValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\BoolValue(['value' => $var]);
        return $this->setAllowQuotedNewlines($wrappedVar);
    }

    /**
     * The quote character.  We currently restrict this to U+0000 to U+00FF
     * and apply additional constraints during validation. Set to '\0' to
     * indicate no quote is used.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue quote_char = 3;</code>
     * @return \Google\Protobuf\StringValue
     */
    public function getQuoteChar()
    {
        return $this->quote_char;
    }

    /**
     * Returns the unboxed value from <code>getQuoteChar()</code>

     * The quote character.  We currently restrict this to U+0000 to U+00FF
     * and apply additional constraints during validation. Set to '\0' to
     * indicate no quote is used.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue quote_char = 3;</code>
     * @return string|null
     */
    public function getQuoteCharValue()
    {
        $wrapper = $this->getQuoteChar();
        return is_null($wrapper) ? null : $wrapper->getValue();
    }

    /**
     * The quote character.  We currently restrict this to U+0000 to U+00FF
     * and apply additional constraints during validation. Set to '\0' to
     * indicate no quote is used.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue quote_char = 3;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setQuoteChar($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->quote_char = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * The quote character.  We currently restrict this to U+0000 to U+00FF
     * and apply additional constraints during validation. Set to '\0' to
     * indicate no quote is used.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue quote_char = 3;</code>
     * @param string|null $var
     * @return $this
     */
    public function setQuoteCharValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\StringValue(['value' => $var]);
        return $this->setQuoteChar($wrappedVar);
    }

    /**
     * Number of leading rows to skip.
     *
     * Generated from protobuf field <code>.google.protobuf.Int64Value skip_leading_rows = 4;</code>
     * @return \Google\Protobuf\Int64Value
     */
    public function getSkipLeadingRows()
    {
        return $this->skip_leading_rows;
    }

    /**
     * Returns the unboxed value from <code>getSkipLeadingRows()</code>

     * Number of leading rows to skip.
     *
     * Generated from protobuf field <code>.google.protobuf.Int64Value skip_leading_rows = 4;</code>
     * @return int|string|null
     */
    public function getSkipLeadingRowsValue()
    {
        $wrapper = $this->getSkipLeadingRows();
        return is_null($wrapper) ? null : $wrapper->getValue();
    }

    /**
     * Number of leading rows to skip.
     *
     * Generated from protobuf field <code>.google.protobuf.Int64Value skip_leading_rows = 4;</code>
     * @param \Google\Protobuf\Int64Value $var
     * @return $this
     */
    public function setSkipLeadingRows($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class);
        $this->skip_leading_rows = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object.

     * Number of leading rows to skip.
     *
     * Generated from protobuf field <code>.google.protobuf.Int64Value skip_leading_rows = 4;</code>
     * @param int|string|null $var
     * @return $this
     */
    public function setSkipLeadingRowsValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\Int64Value(['value' => $var]);
        return $this->setSkipLeadingRows($wrappedVar);
    }

    /**
     * Accept rows that are missing trailing optional columns.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_jagged_rows = 5;</code>
     * @return \Google\Protobuf\BoolValue
     */
    public function getAllowJaggedRows()
    {
        return $this->allow_jagged_rows;
    }

    /**
     * Returns the unboxed value from <code>getAllowJaggedRows()</code>

     * Accept rows that are missing trailing optional columns.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_jagged_rows = 5;</code>
     * @return bool|null
     */
    public function getAllowJaggedRowsValue()
    {
        $wrapper = $this->getAllowJaggedRows();
        return is_null($wrapper) ? null : $wrapper->getValue();
    }

    /**
     * Accept rows that are missing trailing optional columns.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_jagged_rows = 5;</code>
     * @param \Google\Protobuf\BoolValue $var
     * @return $this
     */
    public function setAllowJaggedRows($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class);
        $this->allow_jagged_rows = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.

     * Accept rows that are missing trailing optional columns.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue allow_jagged_rows = 5;</code>
     * @param bool|null $var
     * @return $this
     */
    public function setAllowJaggedRowsValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\BoolValue(['value' => $var]);
        return $this->setAllowJaggedRows($wrappedVar);
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(CsvOptions::class, \Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo_TableDefinition_CsvOptions::class);

