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

/**
 * Class representing a TrackingEvent.
 */
class TrackingEvent {
  /**
   * Create a TrackingEvent.
   * @property {string} eventLevel Possible values include: 'LogAlways',
   * 'Critical', 'Error', 'Warning', 'Informational', 'Verbose'
   * @property {date} eventTime
   * @property {string} recordType Possible values include: 'NotSpecified',
   * 'Custom', 'AS2Message', 'AS2MDN', 'X12Interchange', 'X12FunctionalGroup',
   * 'X12TransactionSet', 'X12InterchangeAcknowledgment',
   * 'X12FunctionalGroupAcknowledgment', 'X12TransactionSetAcknowledgment',
   * 'EdifactInterchange', 'EdifactFunctionalGroup', 'EdifactTransactionSet',
   * 'EdifactInterchangeAcknowledgment',
   * 'EdifactFunctionalGroupAcknowledgment',
   * 'EdifactTransactionSetAcknowledgment'
   * @property {object} [error]
   * @property {string} [error.message]
   * @property {string} [error.code]
   */
  constructor() {
  }

  /**
   * Defines the metadata of TrackingEvent
   *
   * @returns {object} metadata of TrackingEvent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TrackingEvent',
      type: {
        name: 'Composite',
        className: 'TrackingEvent',
        modelProperties: {
          eventLevel: {
            required: true,
            serializedName: 'eventLevel',
            type: {
              name: 'Enum',
              allowedValues: [ 'LogAlways', 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' ]
            }
          },
          eventTime: {
            required: true,
            serializedName: 'eventTime',
            type: {
              name: 'DateTime'
            }
          },
          recordType: {
            required: true,
            serializedName: 'recordType',
            type: {
              name: 'String'
            }
          },
          error: {
            required: false,
            serializedName: 'error',
            type: {
              name: 'Composite',
              className: 'TrackingEventErrorInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = TrackingEvent;
