# 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_05_05_preview
  module Models
    #
    # Action rule properties defining scope, conditions, suppression logic for
    # action rule
    #
    class ActionRuleProperties

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["Suppression"] = "Suppression"
      @@discriminatorMap["ActionGroup"] = "ActionGroup"
      @@discriminatorMap["Diagnostics"] = "Diagnostics"

      def initialize
        @type = "ActionRuleProperties"
      end

      attr_accessor :type

      # @return [Scope] scope on which action rule will apply
      attr_accessor :scope

      # @return [Conditions] conditions on which alerts will be filtered
      attr_accessor :conditions

      # @return [String] Description of action rule
      attr_accessor :description

      # @return [DateTime] Creation time of action rule. Date-Time in ISO-8601
      # format.
      attr_accessor :created_at

      # @return [DateTime] Last updated time of action rule. Date-Time in
      # ISO-8601 format.
      attr_accessor :last_modified_at

      # @return [String] Created by user name.
      attr_accessor :created_by

      # @return [String] Last modified by user name.
      attr_accessor :last_modified_by

      # @return [ActionRuleStatus] Indicates if the given action rule is
      # enabled or disabled. Possible values include: 'Enabled', 'Disabled'
      attr_accessor :status


      #
      # Mapper for ActionRuleProperties class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ActionRuleProperties',
          type: {
            name: 'Composite',
            polymorphic_discriminator: 'type',
            uber_parent: 'ActionRuleProperties',
            class_name: 'ActionRuleProperties',
            model_properties: {
              scope: {
                client_side_validation: true,
                required: false,
                serialized_name: 'scope',
                type: {
                  name: 'Composite',
                  class_name: 'Scope'
                }
              },
              conditions: {
                client_side_validation: true,
                required: false,
                serialized_name: 'conditions',
                type: {
                  name: 'Composite',
                  class_name: 'Conditions'
                }
              },
              description: {
                client_side_validation: true,
                required: false,
                serialized_name: 'description',
                type: {
                  name: 'String'
                }
              },
              created_at: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'createdAt',
                type: {
                  name: 'DateTime'
                }
              },
              last_modified_at: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'lastModifiedAt',
                type: {
                  name: 'DateTime'
                }
              },
              created_by: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'createdBy',
                type: {
                  name: 'String'
                }
              },
              last_modified_by: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'lastModifiedBy',
                type: {
                  name: 'String'
                }
              },
              status: {
                client_side_validation: true,
                required: false,
                serialized_name: 'status',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
