# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
#     ***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***
#
# ----------------------------------------------------------------------------
#
#     This file is automatically generated by Magic Modules and manual
#     changes will be clobbered when the file is regenerated.
#
#     Please read more about how to change this file in README.md and
#     CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/monitoring/property/alertpolicy_conditions_condition_absent'
require 'google/monitoring/property/alertpolicy_conditions_condition_absent_aggregations'
require 'google/monitoring/property/alertpolicy_conditions_condition_absent_trigger'
require 'google/monitoring/property/alertpolicy_conditions_condition_monitoring_query_language'
require 'google/monitoring/property/alertpolicy_conditions_condition_monitoring_query_language_trigger'
require 'google/monitoring/property/alertpolicy_conditions_condition_threshold'
require 'google/monitoring/property/alertpolicy_conditions_condition_threshold_aggregations'
require 'google/monitoring/property/alertpolicy_conditions_condition_threshold_denominator_aggregations'
require 'google/monitoring/property/alertpolicy_conditions_condition_threshold_trigger'
module GoogleInSpec
  module Monitoring
    module Property
      class AlertPolicyConditions
        attr_reader :condition_absent

        attr_reader :name

        attr_reader :condition_monitoring_query_language

        attr_reader :condition_threshold

        attr_reader :display_name

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @condition_absent = GoogleInSpec::Monitoring::Property::AlertPolicyConditionsConditionAbsent.new(args['conditionAbsent'], to_s)
          @name = args['name']
          @condition_monitoring_query_language = GoogleInSpec::Monitoring::Property::AlertPolicyConditionsConditionMonitoringQueryLanguage.new(args['conditionMonitoringQueryLanguage'], to_s)
          @condition_threshold = GoogleInSpec::Monitoring::Property::AlertPolicyConditionsConditionThreshold.new(args['conditionThreshold'], to_s)
          @display_name = args['displayName']
        end

        def to_s
          "#{@parent_identifier} AlertPolicyConditions"
        end
      end

      class AlertPolicyConditionsArray
        def self.parse(value, parent_identifier)
          return if value.nil?
          return AlertPolicyConditions.new(value, parent_identifier) unless value.is_a?(::Array)
          value.map { |v| AlertPolicyConditions.new(v, parent_identifier) }
        end
      end
    end
  end
end
