# 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/run/property/service_template_volumes_cloud_sql_instance'
require 'google/run/property/service_template_volumes_empty_dir'
require 'google/run/property/service_template_volumes_gcs'
require 'google/run/property/service_template_volumes_nfs'
require 'google/run/property/service_template_volumes_secret'
require 'google/run/property/service_template_volumes_secret_items'
module GoogleInSpec
  module Run
    module Property
      class ServiceTemplateVolumes
        attr_reader :name

        attr_reader :secret

        attr_reader :cloud_sql_instance

        attr_reader :empty_dir

        attr_reader :nfs

        attr_reader :gcs

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @name = args['name']
          @secret = GoogleInSpec::Run::Property::ServiceTemplateVolumesSecret.new(args['secret'], to_s)
          @cloud_sql_instance = GoogleInSpec::Run::Property::ServiceTemplateVolumesCloudSqlInstance.new(args['cloudSqlInstance'], to_s)
          @empty_dir = GoogleInSpec::Run::Property::ServiceTemplateVolumesEmptyDir.new(args['emptyDir'], to_s)
          @nfs = GoogleInSpec::Run::Property::ServiceTemplateVolumesNfs.new(args['nfs'], to_s)
          @gcs = GoogleInSpec::Run::Property::ServiceTemplateVolumesGcs.new(args['gcs'], to_s)
        end

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

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