# 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_rules_preconfigured_waf_config_exclusions_request_cookies_to_exclude'
require 'google/compute/property/regionsecuritypolicy_rules_preconfigured_waf_config_exclusions_request_headers_to_exclude'
require 'google/compute/property/regionsecuritypolicy_rules_preconfigured_waf_config_exclusions_request_query_params_to_exclude'
require 'google/compute/property/regionsecuritypolicy_rules_preconfigured_waf_config_exclusions_request_uris_to_exclude'
module GoogleInSpec
  module Compute
    module Property
      class RegionSecurityPolicyRulesPreconfiguredWafConfigExclusions
        attr_reader :target_rule_set

        attr_reader :target_rule_ids

        attr_reader :request_headers_to_exclude

        attr_reader :request_cookies_to_exclude

        attr_reader :request_query_params_to_exclude

        attr_reader :request_uris_to_exclude

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @target_rule_set = args['targetRuleSet']
          @target_rule_ids = args['targetRuleIds']
          @request_headers_to_exclude = GoogleInSpec::Compute::Property::RegionSecurityPolicyRulesPreconfiguredWafConfigExclusionsRequestHeadersToExcludeArray.parse(args['requestHeadersToExclude'], to_s)
          @request_cookies_to_exclude = GoogleInSpec::Compute::Property::RegionSecurityPolicyRulesPreconfiguredWafConfigExclusionsRequestCookiesToExcludeArray.parse(args['requestCookiesToExclude'], to_s)
          @request_query_params_to_exclude = GoogleInSpec::Compute::Property::RegionSecurityPolicyRulesPreconfiguredWafConfigExclusionsRequestQueryParamsToExcludeArray.parse(args['requestQueryParamsToExclude'], to_s)
          @request_uris_to_exclude = GoogleInSpec::Compute::Property::RegionSecurityPolicyRulesPreconfiguredWafConfigExclusionsRequestUrisToExcludeArray.parse(args['requestUrisToExclude'], to_s)
        end

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

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