/*
 * 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 Abnormal Time Period detected.
 *
 */
class DetectorAbnormalTimePeriod {
  /**
   * Create a DetectorAbnormalTimePeriod.
   * @member {date} [startTime] Start time of the corelated event
   * @member {date} [endTime] End time of the corelated event
   * @member {string} [message] Message describing the event
   * @member {string} [source] Represents the name of the Detector
   * @member {number} [priority] Represents the rank of the Detector
   * @member {array} [metaData] Downtime metadata
   * @member {string} [type] Represents the type of the Detector. Possible
   * values include: 'ServiceIncident', 'AppDeployment', 'AppCrash',
   * 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', 'PlatformIssue',
   * 'Other'
   * @member {array} [solutions] List of proposed solutions
   */
  constructor() {
  }

  /**
   * Defines the metadata of DetectorAbnormalTimePeriod
   *
   * @returns {object} metadata of DetectorAbnormalTimePeriod
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DetectorAbnormalTimePeriod',
      type: {
        name: 'Composite',
        className: 'DetectorAbnormalTimePeriod',
        modelProperties: {
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          message: {
            required: false,
            serializedName: 'message',
            type: {
              name: 'String'
            }
          },
          source: {
            required: false,
            serializedName: 'source',
            type: {
              name: 'String'
            }
          },
          priority: {
            required: false,
            serializedName: 'priority',
            type: {
              name: 'Number'
            }
          },
          metaData: {
            required: false,
            serializedName: 'metaData',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ArrayElementType',
                  type: {
                    name: 'Sequence',
                    element: {
                        required: false,
                        serializedName: 'NameValuePairElementType',
                        type: {
                          name: 'Composite',
                          className: 'NameValuePair'
                        }
                    }
                  }
              }
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'Enum',
              allowedValues: [ 'ServiceIncident', 'AppDeployment', 'AppCrash', 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', 'PlatformIssue', 'Other' ]
            }
          },
          solutions: {
            required: false,
            serializedName: 'solutions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SolutionElementType',
                  type: {
                    name: 'Composite',
                    className: 'Solution'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = DetectorAbnormalTimePeriod;
