# 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/regionurlmap_path_matchers_route_rules_match_rules_header_matches_range_match'
module GoogleInSpec
  module Compute
    module Property
      class RegionUrlMapPathMatchersRouteRulesMatchRulesHeaderMatches
        attr_reader :header_name

        attr_reader :exact_match

        attr_reader :regex_match

        attr_reader :range_match

        attr_reader :present_match

        attr_reader :prefix_match

        attr_reader :suffix_match

        attr_reader :invert_match

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @header_name = args['headerName']
          @exact_match = args['exactMatch']
          @regex_match = args['regexMatch']
          @range_match = GoogleInSpec::Compute::Property::RegionUrlMapPathMatchersRouteRulesMatchRulesHeaderMatchesRangeMatch.new(args['rangeMatch'], to_s)
          @present_match = args['presentMatch']
          @prefix_match = args['prefixMatch']
          @suffix_match = args['suffixMatch']
          @invert_match = args['invertMatch']
        end

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

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