/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const models = require('./index');

/**
 * The data stored in text format.
 *
 * @extends models['DatasetStorageFormat']
 */
class TextFormat extends models['DatasetStorageFormat'] {
  /**
   * Create a TextFormat.
   * @member {object} [columnDelimiter] The column delimiter. Type: string (or
   * Expression with resultType string).
   * @member {object} [rowDelimiter] The row delimiter. Type: string (or
   * Expression with resultType string).
   * @member {object} [escapeChar] The escape character. Type: string (or
   * Expression with resultType string).
   * @member {object} [quoteChar] The quote character. Type: string (or
   * Expression with resultType string).
   * @member {object} [nullValue] The null value string. Type: string (or
   * Expression with resultType string).
   * @member {object} [encodingName] The code page name of the preferred
   * encoding. If miss, the default value is ΓÇ£utf-8ΓÇ¥, unless BOM denotes
   * another Unicode encoding. Refer to the ΓÇ£NameΓÇ¥ column of the table in
   * the following link to set supported values:
   * https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string
   * (or Expression with resultType string).
   * @member {object} [treatEmptyAsNull] Treat empty column values in the text
   * file as null. The default value is true. Type: boolean (or Expression with
   * resultType boolean).
   * @member {object} [skipLineCount] The number of lines/rows to be skipped
   * when parsing text files. The default value is 0. Type: integer (or
   * Expression with resultType integer).
   * @member {object} [firstRowAsHeader] When used as input, treat the first
   * row of data as headers. When used as output,write the headers into the
   * output as the first row of data. The default value is false. Type: boolean
   * (or Expression with resultType boolean).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of TextFormat
   *
   * @returns {object} metadata of TextFormat
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TextFormat',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'DatasetStorageFormat',
        className: 'TextFormat',
        modelProperties: {
          serializer: {
            required: false,
            serializedName: 'serializer',
            type: {
              name: 'Object'
            }
          },
          deserializer: {
            required: false,
            serializedName: 'deserializer',
            type: {
              name: 'Object'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          columnDelimiter: {
            required: false,
            serializedName: 'columnDelimiter',
            type: {
              name: 'Object'
            }
          },
          rowDelimiter: {
            required: false,
            serializedName: 'rowDelimiter',
            type: {
              name: 'Object'
            }
          },
          escapeChar: {
            required: false,
            serializedName: 'escapeChar',
            type: {
              name: 'Object'
            }
          },
          quoteChar: {
            required: false,
            serializedName: 'quoteChar',
            type: {
              name: 'Object'
            }
          },
          nullValue: {
            required: false,
            serializedName: 'nullValue',
            type: {
              name: 'Object'
            }
          },
          encodingName: {
            required: false,
            serializedName: 'encodingName',
            type: {
              name: 'Object'
            }
          },
          treatEmptyAsNull: {
            required: false,
            serializedName: 'treatEmptyAsNull',
            type: {
              name: 'Object'
            }
          },
          skipLineCount: {
            required: false,
            serializedName: 'skipLineCount',
            type: {
              name: 'Object'
            }
          },
          firstRowAsHeader: {
            required: false,
            serializedName: 'firstRowAsHeader',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = TextFormat;
