# By: Riasat Ullah
# This file contains all constants and functions that are related to integrations with Microsoft Azure.

from utils import constants


# names of message attributes
var_data = 'data'
var_schema_id = 'schemaId'

# sub attributes under the "data" attribute
var_alert_context = 'alertContext'
var_essentials = 'essentials'

# sub attributes under the "essentials" attribute
var_ess_alert_rule = 'alertRule'
var_ess_description = 'description'
var_ess_monitor_condition = 'monitorCondition'
var_ess_monitoring_service = 'monitoringService'
var_ess_origin_alert_id = 'originAlertId'
var_ess_severity = 'severity'
var_ess_signal_type = 'signalType'

# acceptable schema values
acceptable_schema = ['azureMonitorCommonAlertSchema']

# expected attribute value
fired_monitor_condition = 'Fired'
resolved_monitor_condition = 'Resolved'

# Azure severity levels mapped to TaskCall urgency
azure_urgency_map = {
    'Sev0': constants.critical_urgency,
    'Sev1': constants.high_urgency,
    'Sev2': constants.medium_urgency,
    'Sev3': constants.low_urgency,
    'Sev4': constants.minor_urgency
}
