# 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_network_match_user_defined_fields'
module GoogleInSpec
  module Compute
    module Property
      class RegionSecurityPolicyRulesNetworkMatch
        attr_reader :user_defined_fields

        attr_reader :src_ip_ranges

        attr_reader :dest_ip_ranges

        attr_reader :ip_protocols

        attr_reader :src_ports

        attr_reader :dest_ports

        attr_reader :src_region_codes

        attr_reader :src_asns

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @user_defined_fields = GoogleInSpec::Compute::Property::RegionSecurityPolicyRulesNetworkMatchUserDefinedFieldsArray.parse(args['userDefinedFields'], to_s)
          @src_ip_ranges = args['srcIpRanges']
          @dest_ip_ranges = args['destIpRanges']
          @ip_protocols = args['ipProtocols']
          @src_ports = args['srcPorts']
          @dest_ports = args['destPorts']
          @src_region_codes = args['srcRegionCodes']
          @src_asns = args['srcAsns']
        end

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