# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::AlertsManagement::Mgmt::V2019_03_01
  module Models
    #
    # This object contains consistent fields across different monitor services.
    #
    class Essentials

      include MsRestAzure

      # @return [Severity] Severity of alert Sev0 being highest and Sev4 being
      # lowest. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4'
      attr_accessor :severity

      # @return [SignalType] The type of signal the alert is based on, which
      # could be metrics, logs or activity logs. Possible values include:
      # 'Metric', 'Log', 'Unknown'
      attr_accessor :signal_type

      # @return [AlertState] Alert object state, which can be modified by the
      # user. Possible values include: 'New', 'Acknowledged', 'Closed'
      attr_accessor :alert_state

      # @return [MonitorCondition] Can be 'Fired' or 'Resolved', which
      # represents whether the underlying conditions have crossed the defined
      # alert rule thresholds. Possible values include: 'Fired', 'Resolved'
      attr_accessor :monitor_condition

      # @return [String] Target ARM resource, on which alert got created.
      attr_accessor :target_resource

      # @return [String] Name of the target ARM resource name, on which alert
      # got created.
      attr_accessor :target_resource_name

      # @return [String] Resource group of target ARM resource, on which alert
      # got created.
      attr_accessor :target_resource_group

      # @return [String] Resource type of target ARM resource, on which alert
      # got created.
      attr_accessor :target_resource_type

      # @return [MonitorService] Monitor service on which the rule(monitor) is
      # set. Possible values include: 'Application Insights', 'ActivityLog
      # Administrative', 'ActivityLog Security', 'ActivityLog Recommendation',
      # 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log Analytics',
      # 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM
      # Insights', 'Zabbix', 'Resource Health'
      attr_accessor :monitor_service

      # @return [String] Rule(monitor) which fired alert instance. Depending on
      # the monitor service,  this would be ARM id or name of the rule.
      attr_accessor :alert_rule

      # @return [String] Unique Id created by monitor service for each alert
      # instance. This could be used to track the issue at the monitor service,
      # in case of Nagios, Zabbix, SCOM etc.
      attr_accessor :source_created_id

      # @return [String] Unique Id of the smart group
      attr_accessor :smart_group_id

      # @return [String] Verbose reason describing the reason why this alert
      # instance is added to a smart group
      attr_accessor :smart_grouping_reason

      # @return [DateTime] Creation time(ISO-8601 format) of alert instance.
      attr_accessor :start_date_time

      # @return [DateTime] Last modification time(ISO-8601 format) of alert
      # instance.
      attr_accessor :last_modified_date_time

      # @return [DateTime] Resolved time(ISO-8601 format) of alert instance.
      # This will be updated when monitor service resolves the alert instance
      # because the rule condition is no longer met.
      attr_accessor :monitor_condition_resolved_date_time

      # @return [String] User who last modified the alert, in case of monitor
      # service updates user would be 'system', otherwise name of the user.
      attr_accessor :last_modified_user_name


      #
      # Mapper for Essentials class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'essentials',
          type: {
            name: 'Composite',
            class_name: 'Essentials',
            model_properties: {
              severity: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'severity',
                type: {
                  name: 'String'
                }
              },
              signal_type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'signalType',
                type: {
                  name: 'String'
                }
              },
              alert_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'alertState',
                type: {
                  name: 'String'
                }
              },
              monitor_condition: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'monitorCondition',
                type: {
                  name: 'String'
                }
              },
              target_resource: {
                client_side_validation: true,
                required: false,
                serialized_name: 'targetResource',
                type: {
                  name: 'String'
                }
              },
              target_resource_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'targetResourceName',
                type: {
                  name: 'String'
                }
              },
              target_resource_group: {
                client_side_validation: true,
                required: false,
                serialized_name: 'targetResourceGroup',
                type: {
                  name: 'String'
                }
              },
              target_resource_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'targetResourceType',
                type: {
                  name: 'String'
                }
              },
              monitor_service: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'monitorService',
                type: {
                  name: 'String'
                }
              },
              alert_rule: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'alertRule',
                type: {
                  name: 'String'
                }
              },
              source_created_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'sourceCreatedId',
                type: {
                  name: 'String'
                }
              },
              smart_group_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'smartGroupId',
                type: {
                  name: 'String'
                }
              },
              smart_grouping_reason: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'smartGroupingReason',
                type: {
                  name: 'String'
                }
              },
              start_date_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'startDateTime',
                type: {
                  name: 'DateTime'
                }
              },
              last_modified_date_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'lastModifiedDateTime',
                type: {
                  name: 'DateTime'
                }
              },
              monitor_condition_resolved_date_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'monitorConditionResolvedDateTime',
                type: {
                  name: 'DateTime'
                }
              },
              last_modified_user_name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'lastModifiedUserName',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
