# 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/regionautoscaler_autoscaling_policy_cpu_utilization'
require 'google/compute/property/regionautoscaler_autoscaling_policy_custom_metric_utilizations'
require 'google/compute/property/regionautoscaler_autoscaling_policy_load_balancing_utilization'
require 'google/compute/property/regionautoscaler_autoscaling_policy_scale_down_control'
require 'google/compute/property/regionautoscaler_autoscaling_policy_scale_down_control_max_scaled_down_replicas'
require 'google/compute/property/regionautoscaler_autoscaling_policy_scale_in_control'
require 'google/compute/property/regionautoscaler_autoscaling_policy_scale_in_control_max_scaled_in_replicas'
require 'google/compute/property/regionautoscaler_autoscaling_policy_scaling_schedules'
module GoogleInSpec
  module Compute
    module Property
      class RegionAutoscalerAutoscalingPolicy
        attr_reader :min_num_replicas

        attr_reader :max_num_replicas

        attr_reader :scale_down_control

        attr_reader :scale_in_control

        attr_reader :cool_down_period_sec

        attr_reader :cpu_utilization

        attr_reader :custom_metric_utilizations

        attr_reader :load_balancing_utilization

        attr_reader :mode

        attr_reader :scaling_schedules

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @min_num_replicas = args['minNumReplicas']
          @max_num_replicas = args['maxNumReplicas']
          @scale_down_control = GoogleInSpec::Compute::Property::RegionAutoscalerAutoscalingPolicyScaleDownControl.new(args['scaleDownControl'], to_s)
          @scale_in_control = GoogleInSpec::Compute::Property::RegionAutoscalerAutoscalingPolicyScaleInControl.new(args['scaleInControl'], to_s)
          @cool_down_period_sec = args['coolDownPeriodSec']
          @cpu_utilization = GoogleInSpec::Compute::Property::RegionAutoscalerAutoscalingPolicyCpuUtilization.new(args['cpuUtilization'], to_s)
          @custom_metric_utilizations = GoogleInSpec::Compute::Property::RegionAutoscalerAutoscalingPolicyCustomMetricUtilizationsArray.parse(args['customMetricUtilizations'], to_s)
          @load_balancing_utilization = GoogleInSpec::Compute::Property::RegionAutoscalerAutoscalingPolicyLoadBalancingUtilization.new(args['loadBalancingUtilization'], to_s)
          @mode = args['mode']
          @scaling_schedules = GoogleInSpec::Compute::Property::RegionAutoscalerAutoscalingPolicyScalingSchedules.new(args['scalingSchedules'], to_s)
        end

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