/*
 * 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 c onnector mapping resource format.
 *
 * @extends models['ProxyResource']
 */
class ConnectorMappingResourceFormat extends models['ProxyResource'] {
  /**
   * Create a ConnectorMappingResourceFormat.
   * @member {string} [connectorName] The connector name.
   * @member {string} [connectorType] Type of connector. Possible values
   * include: 'None', 'CRM', 'AzureBlob', 'Salesforce', 'ExchangeOnline',
   * 'Outbound'
   * @member {date} [created] The created time.
   * @member {date} [lastModified] The last monified time.
   * @member {string} entityType Defines which entity type the file should map
   * to. Possible values include: 'None', 'Profile', 'Interaction',
   * 'Relationship'
   * @member {string} entityTypeName The mapping entity name.
   * @member {string} [connectorMappingName] The connector mapping name
   * @member {string} [displayName] Display name for the connector mapping.
   * @member {string} [description] The description of the connector mapping.
   * @member {string} [dataFormatId] The DataFormat ID.
   * @member {object} mappingProperties The properties of the mapping.
   * @member {string} [mappingProperties.folderPath] The folder path for the
   * mapping.
   * @member {string} [mappingProperties.fileFilter] The file filter for the
   * mapping.
   * @member {boolean} [mappingProperties.hasHeader] If the file contains a
   * header or not.
   * @member {object} [mappingProperties.errorManagement] The error management
   * setting for the mapping.
   * @member {string} [mappingProperties.errorManagement.errorManagementType]
   * The type of error management to use for the mapping. Possible values
   * include: 'RejectAndContinue', 'StopImport', 'RejectUntilLimit'
   * @member {number} [mappingProperties.errorManagement.errorLimit] The error
   * limit allowed while importing data.
   * @member {object} [mappingProperties.format] The format of mapping
   * property.
   * @member {string} [mappingProperties.format.columnDelimiter] The character
   * that signifies a break between columns.
   * @member {string} [mappingProperties.format.acceptLanguage] The oData
   * language.
   * @member {string} [mappingProperties.format.quoteCharacter] Quote
   * character, used to indicate enquoted fields.
   * @member {string} [mappingProperties.format.quoteEscapeCharacter] Escape
   * character for quotes, can be the same as the quoteCharacter.
   * @member {string} [mappingProperties.format.arraySeparator] Character
   * separating array elements.
   * @member {object} [mappingProperties.availability] The availability of
   * mapping property.
   * @member {string} [mappingProperties.availability.frequency] The frequency
   * to update. Possible values include: 'Minute', 'Hour', 'Day', 'Week',
   * 'Month'
   * @member {number} [mappingProperties.availability.interval] The interval of
   * the given frequency to use.
   * @member {array} [mappingProperties.structure] Ingestion mapping
   * information at property level.
   * @member {object} [mappingProperties.completeOperation] The operation after
   * import is done.
   * @member {string}
   * [mappingProperties.completeOperation.completionOperationType] The type of
   * completion operation. Possible values include: 'DoNothing', 'DeleteFile',
   * 'MoveFile'
   * @member {string} [mappingProperties.completeOperation.destinationFolder]
   * The destination folder where files will be moved to once the import is
   * done.
   * @member {date} [nextRunTime] The next run time based on customer's
   * settings.
   * @member {string} [runId] The RunId.
   * @member {string} [state] State of connector mapping. Possible values
   * include: 'Creating', 'Created', 'Failed', 'Ready', 'Running', 'Stopped',
   * 'Expiring'
   * @member {string} [tenantId] The hub name.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ConnectorMappingResourceFormat
   *
   * @returns {object} metadata of ConnectorMappingResourceFormat
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ConnectorMappingResourceFormat',
      type: {
        name: 'Composite',
        className: 'ConnectorMappingResourceFormat',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          connectorName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.connectorName',
            type: {
              name: 'String'
            }
          },
          connectorType: {
            required: false,
            serializedName: 'properties.connectorType',
            type: {
              name: 'String'
            }
          },
          created: {
            required: false,
            readOnly: true,
            serializedName: 'properties.created',
            type: {
              name: 'DateTime'
            }
          },
          lastModified: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastModified',
            type: {
              name: 'DateTime'
            }
          },
          entityType: {
            required: true,
            serializedName: 'properties.entityType',
            type: {
              name: 'Enum',
              allowedValues: [ 'None', 'Profile', 'Interaction', 'Relationship' ]
            }
          },
          entityTypeName: {
            required: true,
            serializedName: 'properties.entityTypeName',
            type: {
              name: 'String'
            }
          },
          connectorMappingName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.connectorMappingName',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          dataFormatId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.dataFormatId',
            type: {
              name: 'String'
            }
          },
          mappingProperties: {
            required: true,
            serializedName: 'properties.mappingProperties',
            defaultValue: {},
            type: {
              name: 'Composite',
              className: 'ConnectorMappingProperties'
            }
          },
          nextRunTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.nextRunTime',
            type: {
              name: 'DateTime'
            }
          },
          runId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.runId',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'Enum',
              allowedValues: [ 'Creating', 'Created', 'Failed', 'Ready', 'Running', 'Stopped', 'Expiring' ]
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.tenantId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ConnectorMappingResourceFormat;
