/*
 * 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 Reponse from Diagnostic Detectors
 *
 * @extends models['ProxyOnlyResource']
 */
class DiagnosticDetectorResponse extends models['ProxyOnlyResource'] {
  /**
   * Create a DiagnosticDetectorResponse.
   * @member {date} [startTime] Start time of the period
   * @member {date} [endTime] End time of the period
   * @member {boolean} [issueDetected] Flag representing Issue was detected.
   * @member {object} [detectorDefinition] Detector's definition
   * @member {string} [detectorDefinition.displayName] Display name of the
   * detector
   * @member {string} [detectorDefinition.description] Description of the
   * detector
   * @member {number} [detectorDefinition.rank] Detector Rank
   * @member {boolean} [detectorDefinition.isEnabled] Flag representing whether
   * detector is enabled or not.
   * @member {array} [metrics] Metrics provided by the detector
   * @member {array} [abnormalTimePeriods] List of Correlated events found by
   * the detector
   * @member {array} [data] Additional Data that detector wants to send.
   * @member {object} [responseMetaData] Meta Data
   * @member {object} [responseMetaData.dataSource] Source of the Data
   * @member {array} [responseMetaData.dataSource.instructions] Instrunctions
   * if any for the data source
   * @member {array} [responseMetaData.dataSource.dataSourceUri] Datasource Uri
   * Links
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DiagnosticDetectorResponse
   *
   * @returns {object} metadata of DiagnosticDetectorResponse
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DiagnosticDetectorResponse',
      type: {
        name: 'Composite',
        className: 'DiagnosticDetectorResponse',
        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'
            }
          },
          issueDetected: {
            required: false,
            serializedName: 'properties.issueDetected',
            type: {
              name: 'Boolean'
            }
          },
          detectorDefinition: {
            required: false,
            serializedName: 'properties.detectorDefinition',
            type: {
              name: 'Composite',
              className: 'DetectorDefinition'
            }
          },
          metrics: {
            required: false,
            serializedName: 'properties.metrics',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DiagnosticMetricSetElementType',
                  type: {
                    name: 'Composite',
                    className: 'DiagnosticMetricSet'
                  }
              }
            }
          },
          abnormalTimePeriods: {
            required: false,
            serializedName: 'properties.abnormalTimePeriods',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DetectorAbnormalTimePeriodElementType',
                  type: {
                    name: 'Composite',
                    className: 'DetectorAbnormalTimePeriod'
                  }
              }
            }
          },
          data: {
            required: false,
            serializedName: 'properties.data',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ArrayElementType',
                  type: {
                    name: 'Sequence',
                    element: {
                        required: false,
                        serializedName: 'NameValuePairElementType',
                        type: {
                          name: 'Composite',
                          className: 'NameValuePair'
                        }
                    }
                  }
              }
            }
          },
          responseMetaData: {
            required: false,
            serializedName: 'properties.responseMetaData',
            type: {
              name: 'Composite',
              className: 'ResponseMetaData'
            }
          }
        }
      }
    };
  }
}

module.exports = DiagnosticDetectorResponse;
