# 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::Monitor::Mgmt::V2016_03_01
  module Models
    #
    # The condition that results in the alert rule being activated.
    #
    class RuleCondition

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"] = "ThresholdRuleCondition"
      @@discriminatorMap["Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"] = "LocationThresholdRuleCondition"
      @@discriminatorMap["Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"] = "ManagementEventRuleCondition"

      def initialize
        @odatatype = "RuleCondition"
      end

      attr_accessor :odatatype

      # @return [RuleDataSource] the resource from which the rule collects its
      # data. For this type dataSource will always be of type
      # RuleMetricDataSource.
      attr_accessor :data_source


      #
      # Mapper for RuleCondition class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'RuleCondition',
          type: {
            name: 'Composite',
            polymorphic_discriminator: 'odata.type',
            uber_parent: 'RuleCondition',
            class_name: 'RuleCondition',
            model_properties: {
              data_source: {
                client_side_validation: true,
                required: false,
                serialized_name: 'dataSource',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'odata.type',
                  uber_parent: 'RuleDataSource',
                  class_name: 'RuleDataSource'
                }
              }
            }
          }
        }
      end
    end
  end
end
