/*
 * 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');

/**
 * Describes how data from an input is serialized or how data is serialized
 * when written to an output in CSV format.
 *
 * @extends models['Serialization']
 */
class CsvSerialization extends models['Serialization'] {
  /**
   * Create a CsvSerialization.
   * @member {string} [fieldDelimiter] Specifies the delimiter that will be
   * used to separate comma-separated value (CSV) records. See
   * https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input
   * or
   * https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output
   * for a list of supported values. Required on PUT (CreateOrReplace)
   * requests.
   * @member {string} [encoding] Specifies the encoding of the incoming data in
   * the case of input and the encoding of outgoing data in the case of output.
   * Required on PUT (CreateOrReplace) requests. Possible values include:
   * 'UTF8'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CsvSerialization
   *
   * @returns {object} metadata of CsvSerialization
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Csv',
      type: {
        name: 'Composite',
        className: 'CsvSerialization',
        modelProperties: {
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          fieldDelimiter: {
            required: false,
            serializedName: 'properties.fieldDelimiter',
            type: {
              name: 'String'
            }
          },
          encoding: {
            required: false,
            serializedName: 'properties.encoding',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CsvSerialization;
