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

/**
 * Security alert
 *
 * @extends models['Resource']
 */
class Alert extends models['Resource'] {
  /**
   * Create a Alert.
   * @member {string} [state] State of the alert (Active, Dismissed etc.)
   * @member {date} [reportedTimeUtc] The time the incident was reported to
   * Microsoft.Security in UTC
   * @member {string} [vendorName] Name of the vendor that discovered the
   * incident
   * @member {string} [alertName] Name of the alert type
   * @member {string} [alertDisplayName] Display name of the alert type
   * @member {date} [detectedTimeUtc] The time the incident was detected by the
   * vendor
   * @member {string} [description] Description of the incident and what it
   * means
   * @member {string} [remediationSteps] Recommended steps to reradiate the
   * incident
   * @member {string} [actionTaken] The action that was taken as a response to
   * the alert (Active, Blocked etc.)
   * @member {string} [reportedSeverity] Estimated severity of this alert
   * @member {string} [compromisedEntity] The entity that the incident happened
   * on
   * @member {string} [associatedResource] Azure resource ID of the associated
   * resource
   * @member {object} [extendedProperties]
   * @member {string} [systemSource] The type of the alerted resource (Azure,
   * Non-Azure)
   * @member {boolean} [canBeInvestigated] Whether this alert can be
   * investigated with Azure Security Center
   * @member {array} [entities] objects that are related to this alerts
   * @member {number} [confidenceScore] level of confidence we have on the
   * alert
   * @member {array} [confidenceReasons] reasons the alert got the
   * confidenceScore value
   * @member {string} [subscriptionId] Azure subscription ID of the resource
   * that had the security alert or the subscription ID of the workspace that
   * this resource reports to
   * @member {string} [instanceId] Instance ID of the alert.
   * @member {string} [workspaceArmId] Azure resource ID of the workspace that
   * the alert was reported to.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Alert
   *
   * @returns {object} metadata of Alert
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Alert',
      type: {
        name: 'Composite',
        className: 'Alert',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          reportedTimeUtc: {
            required: false,
            readOnly: true,
            serializedName: 'properties.reportedTimeUtc',
            type: {
              name: 'DateTime'
            }
          },
          vendorName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.vendorName',
            type: {
              name: 'String'
            }
          },
          alertName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.alertName',
            type: {
              name: 'String'
            }
          },
          alertDisplayName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.alertDisplayName',
            type: {
              name: 'String'
            }
          },
          detectedTimeUtc: {
            required: false,
            readOnly: true,
            serializedName: 'properties.detectedTimeUtc',
            type: {
              name: 'DateTime'
            }
          },
          description: {
            required: false,
            readOnly: true,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          remediationSteps: {
            required: false,
            readOnly: true,
            serializedName: 'properties.remediationSteps',
            type: {
              name: 'String'
            }
          },
          actionTaken: {
            required: false,
            readOnly: true,
            serializedName: 'properties.actionTaken',
            type: {
              name: 'String'
            }
          },
          reportedSeverity: {
            required: false,
            readOnly: true,
            serializedName: 'properties.reportedSeverity',
            type: {
              name: 'String'
            }
          },
          compromisedEntity: {
            required: false,
            readOnly: true,
            serializedName: 'properties.compromisedEntity',
            type: {
              name: 'String'
            }
          },
          associatedResource: {
            required: false,
            readOnly: true,
            serializedName: 'properties.associatedResource',
            type: {
              name: 'String'
            }
          },
          extendedProperties: {
            required: false,
            serializedName: 'properties.extendedProperties',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          systemSource: {
            required: false,
            readOnly: true,
            serializedName: 'properties.systemSource',
            type: {
              name: 'String'
            }
          },
          canBeInvestigated: {
            required: false,
            readOnly: true,
            serializedName: 'properties.canBeInvestigated',
            type: {
              name: 'Boolean'
            }
          },
          entities: {
            required: false,
            serializedName: 'properties.entities',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AlertEntityElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'AlertEntity'
                  }
              }
            }
          },
          confidenceScore: {
            required: false,
            readOnly: true,
            serializedName: 'properties.confidenceScore',
            constraints: {
              InclusiveMaximum: 1,
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          },
          confidenceReasons: {
            required: false,
            serializedName: 'properties.confidenceReasons',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AlertConfidenceReasonElementType',
                  type: {
                    name: 'Composite',
                    className: 'AlertConfidenceReason'
                  }
              }
            }
          },
          subscriptionId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.subscriptionId',
            type: {
              name: 'String'
            }
          },
          instanceId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.instanceId',
            type: {
              name: 'String'
            }
          },
          workspaceArmId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.workspaceArmId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Alert;
