# 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.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
  module Compute
    module Property
      class NetworkPeerings
        attr_reader :name

        attr_reader :state

        attr_reader :state_details

        attr_reader :network

        attr_reader :export_custom_routes

        attr_reader :import_custom_routes

        attr_reader :peer_mtu

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @name = args['name']
          @state = args['state']
          @state_details = args['stateDetails']
          @network = args['network']
          @export_custom_routes = args['exportCustomRoutes']
          @import_custom_routes = args['importCustomRoutes']
          @peer_mtu = args['peerMtu']
        end

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

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