# 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/dataflow/property/projectlocationjob_environment_worker_pools_autoscaling_settings'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_data_disks'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_metadata'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_packages'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_pool_args'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_sdk_harness_container_images'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_taskrunner_settings'
require 'google/dataflow/property/projectlocationjob_environment_worker_pools_taskrunner_settings_parallel_worker_settings'
module GoogleInSpec
  module Dataflow
    module Property
      class ProjectLocationJobEnvironmentWorkerPools
        attr_reader :kind

        attr_reader :num_workers

        attr_reader :packages

        attr_reader :default_package_set

        attr_reader :machine_type

        attr_reader :teardown_policy

        attr_reader :disk_size_gb

        attr_reader :disk_type

        attr_reader :disk_source_image

        attr_reader :zone

        attr_reader :taskrunner_settings

        attr_reader :on_host_maintenance

        attr_reader :data_disks

        attr_reader :metadata

        attr_reader :autoscaling_settings

        attr_reader :pool_args

        attr_reader :network

        attr_reader :subnetwork

        attr_reader :worker_harness_container_image

        attr_reader :num_threads_per_worker

        attr_reader :ip_configuration

        attr_reader :sdk_harness_container_images

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @kind = args['kind']
          @num_workers = args['numWorkers']
          @packages = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsPackagesArray.parse(args['packages'], to_s)
          @default_package_set = args['defaultPackageSet']
          @machine_type = args['machineType']
          @teardown_policy = args['teardownPolicy']
          @disk_size_gb = args['diskSizeGb']
          @disk_type = args['diskType']
          @disk_source_image = args['diskSourceImage']
          @zone = args['zone']
          @taskrunner_settings = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsTaskrunnerSettings.new(args['taskrunnerSettings'], to_s)
          @on_host_maintenance = args['onHostMaintenance']
          @data_disks = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsDataDisksArray.parse(args['dataDisks'], to_s)
          @metadata = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsMetadata.new(args['metadata'], to_s)
          @autoscaling_settings = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsAutoscalingSettings.new(args['autoscalingSettings'], to_s)
          @pool_args = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsPoolArgs.new(args['poolArgs'], to_s)
          @network = args['network']
          @subnetwork = args['subnetwork']
          @worker_harness_container_image = args['workerHarnessContainerImage']
          @num_threads_per_worker = args['numThreadsPerWorker']
          @ip_configuration = args['ipConfiguration']
          @sdk_harness_container_images = GoogleInSpec::Dataflow::Property::ProjectLocationJobEnvironmentWorkerPoolsSdkHarnessContainerImagesArray.parse(args['sdkHarnessContainerImages'], to_s)
        end

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

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