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

/**
 * An alert incident indicates the activation status of an alert rule.
 *
 */
class Incident {
  /**
   * Create a Incident.
   * @property {string} [name] Incident name.
   * @property {string} [ruleName] Rule name that is associated with the
   * incident.
   * @property {boolean} [isActive] A boolean to indicate whether the incident
   * is active or resolved.
   * @property {date} [activatedTime] The time at which the incident was
   * activated in ISO8601 format.
   * @property {date} [resolvedTime] The time at which the incident was
   * resolved in ISO8601 format. If null, it means the incident is still
   * active.
   */
  constructor() {
  }

  /**
   * Defines the metadata of Incident
   *
   * @returns {object} metadata of Incident
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Incident',
      type: {
        name: 'Composite',
        className: 'Incident',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          ruleName: {
            required: false,
            readOnly: true,
            serializedName: 'ruleName',
            type: {
              name: 'String'
            }
          },
          isActive: {
            required: false,
            readOnly: true,
            serializedName: 'isActive',
            type: {
              name: 'Boolean'
            }
          },
          activatedTime: {
            required: false,
            readOnly: true,
            serializedName: 'activatedTime',
            type: {
              name: 'DateTime'
            }
          },
          resolvedTime: {
            required: false,
            readOnly: true,
            serializedName: 'resolvedTime',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = Incident;
