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

/**
 * Class representing a diagnostic analysis done on an application
 *
 * @extends models['ProxyOnlyResource']
 */
class DiagnosticAnalysis extends models['ProxyOnlyResource'] {
  /**
   * Create a DiagnosticAnalysis.
   * @member {date} [startTime] Start time of the period
   * @member {date} [endTime] End time of the period
   * @member {array} [abnormalTimePeriods] List of time periods.
   * @member {array} [payload] Data by each detector
   * @member {array} [nonCorrelatedDetectors] Data by each detector for
   * detectors that did not corelate
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DiagnosticAnalysis
   *
   * @returns {object} metadata of DiagnosticAnalysis
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DiagnosticAnalysis',
      type: {
        name: 'Composite',
        className: 'DiagnosticAnalysis',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'properties.endTime',
            type: {
              name: 'DateTime'
            }
          },
          abnormalTimePeriods: {
            required: false,
            serializedName: 'properties.abnormalTimePeriods',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AbnormalTimePeriodElementType',
                  type: {
                    name: 'Composite',
                    className: 'AbnormalTimePeriod'
                  }
              }
            }
          },
          payload: {
            required: false,
            serializedName: 'properties.payload',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AnalysisDataElementType',
                  type: {
                    name: 'Composite',
                    className: 'AnalysisData'
                  }
              }
            }
          },
          nonCorrelatedDetectors: {
            required: false,
            serializedName: 'properties.nonCorrelatedDetectors',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DetectorDefinitionElementType',
                  type: {
                    name: 'Composite',
                    className: 'DetectorDefinition'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = DiagnosticAnalysis;
