/*
 * 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 connector mapping properties.
 *
 */
class ConnectorMappingProperties {
  /**
   * Create a ConnectorMappingProperties.
   * @member {string} [folderPath] The folder path for the mapping.
   * @member {string} [fileFilter] The file filter for the mapping.
   * @member {boolean} [hasHeader] If the file contains a header or not.
   * @member {object} errorManagement The error management setting for the
   * mapping.
   * @member {string} [errorManagement.errorManagementType] The type of error
   * management to use for the mapping. Possible values include:
   * 'RejectAndContinue', 'StopImport', 'RejectUntilLimit'
   * @member {number} [errorManagement.errorLimit] The error limit allowed
   * while importing data.
   * @member {object} format The format of mapping property.
   * @member {string} [format.columnDelimiter] The character that signifies a
   * break between columns.
   * @member {string} [format.acceptLanguage] The oData language.
   * @member {string} [format.quoteCharacter] Quote character, used to indicate
   * enquoted fields.
   * @member {string} [format.quoteEscapeCharacter] Escape character for
   * quotes, can be the same as the quoteCharacter.
   * @member {string} [format.arraySeparator] Character separating array
   * elements.
   * @member {object} availability The availability of mapping property.
   * @member {string} [availability.frequency] The frequency to update.
   * Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'
   * @member {number} [availability.interval] The interval of the given
   * frequency to use.
   * @member {array} structure Ingestion mapping information at property level.
   * @member {object} completeOperation The operation after import is done.
   * @member {string} [completeOperation.completionOperationType] The type of
   * completion operation. Possible values include: 'DoNothing', 'DeleteFile',
   * 'MoveFile'
   * @member {string} [completeOperation.destinationFolder] The destination
   * folder where files will be moved to once the import is done.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ConnectorMappingProperties
   *
   * @returns {object} metadata of ConnectorMappingProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ConnectorMappingProperties',
      type: {
        name: 'Composite',
        className: 'ConnectorMappingProperties',
        modelProperties: {
          folderPath: {
            required: false,
            serializedName: 'folderPath',
            type: {
              name: 'String'
            }
          },
          fileFilter: {
            required: false,
            serializedName: 'fileFilter',
            type: {
              name: 'String'
            }
          },
          hasHeader: {
            required: false,
            serializedName: 'hasHeader',
            type: {
              name: 'Boolean'
            }
          },
          errorManagement: {
            required: true,
            serializedName: 'errorManagement',
            type: {
              name: 'Composite',
              className: 'ConnectorMappingErrorManagement'
            }
          },
          format: {
            required: true,
            serializedName: 'format',
            defaultValue: {},
            type: {
              name: 'Composite',
              className: 'ConnectorMappingFormat'
            }
          },
          availability: {
            required: true,
            serializedName: 'availability',
            type: {
              name: 'Composite',
              className: 'ConnectorMappingAvailability'
            }
          },
          structure: {
            required: true,
            serializedName: 'structure',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ConnectorMappingStructureElementType',
                  type: {
                    name: 'Composite',
                    className: 'ConnectorMappingStructure'
                  }
              }
            }
          },
          completeOperation: {
            required: true,
            serializedName: 'completeOperation',
            type: {
              name: 'Composite',
              className: 'ConnectorMappingCompleteOperation'
            }
          }
        }
      }
    };
  }
}

module.exports = ConnectorMappingProperties;
