# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
#     ***     AUTO GENERATED CODE    ***    Type: MMv1     ***
#
# ----------------------------------------------------------------------------
#
#     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/compute/property/regionsecuritypolicy_apclddctctg_configs'
module GoogleInSpec
  module Compute
    module Property
      class RegionSecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigs
        attr_reader :name

        attr_reader :auto_deploy_load_threshold

        attr_reader :auto_deploy_confidence_threshold

        attr_reader :auto_deploy_impacted_baseline_threshold

        attr_reader :auto_deploy_expiration_sec

        attr_reader :detection_load_threshold

        attr_reader :detection_absolute_qps

        attr_reader :detection_relative_to_baseline_qps

        attr_reader :traffic_granularity_configs

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @name = args['name']
          @auto_deploy_load_threshold = args['autoDeployLoadThreshold']
          @auto_deploy_confidence_threshold = args['autoDeployConfidenceThreshold']
          @auto_deploy_impacted_baseline_threshold = args['autoDeployImpactedBaselineThreshold']
          @auto_deploy_expiration_sec = args['autoDeployExpirationSec']
          @detection_load_threshold = args['detectionLoadThreshold']
          @detection_absolute_qps = args['detectionAbsoluteQps']
          @detection_relative_to_baseline_qps = args['detectionRelativeToBaselineQps']
          @traffic_granularity_configs = GoogleInSpec::Compute::Property::RegionSecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigsTrafficGranularityConfigsArray.parse(args['trafficGranularityConfigs'], to_s)
        end

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

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