"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.MetricAggregationType=exports.AdjustmentType=exports.StepScalingAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},autoscaling_generated_1=()=>{var tmp=require("./autoscaling.generated");return autoscaling_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class StepScalingAction extends constructs_1().Construct{constructor(scope,id,props){super(scope,id),this.adjustments=new Array;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_autoscaling_StepScalingActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,StepScalingAction),error}props.cooldown&&core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-autoscaling:cooldownOnStepScaling","'Cooldown' is valid only if the policy type is SimpleScaling. Default to ignore the values set.");const resource=new(autoscaling_generated_1()).CfnScalingPolicy(this,"Resource",{policyType:"StepScaling",autoScalingGroupName:props.autoScalingGroup.autoScalingGroupName,estimatedInstanceWarmup:props.estimatedInstanceWarmup&&props.estimatedInstanceWarmup.toSeconds(),adjustmentType:props.adjustmentType,minAdjustmentMagnitude:props.minAdjustmentMagnitude,metricAggregationType:props.metricAggregationType,stepAdjustments:core_1().Lazy.any({produce:()=>this.adjustments})});this.scalingPolicyArn=resource.ref}addAdjustment(adjustment){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_autoscaling_AdjustmentTier(adjustment)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addAdjustment),error}if(adjustment.lowerBound===void 0&&adjustment.upperBound===void 0)throw new Error("At least one of lowerBound or upperBound is required");this.adjustments.push({metricIntervalLowerBound:adjustment.lowerBound,metricIntervalUpperBound:adjustment.upperBound,scalingAdjustment:adjustment.adjustment})}}exports.StepScalingAction=StepScalingAction,_a=JSII_RTTI_SYMBOL_1,StepScalingAction[_a]={fqn:"aws-cdk-lib.aws_autoscaling.StepScalingAction",version:"2.148.1"};var AdjustmentType;(function(AdjustmentType2){AdjustmentType2.CHANGE_IN_CAPACITY="ChangeInCapacity",AdjustmentType2.PERCENT_CHANGE_IN_CAPACITY="PercentChangeInCapacity",AdjustmentType2.EXACT_CAPACITY="ExactCapacity"})(AdjustmentType||(exports.AdjustmentType=AdjustmentType={}));var MetricAggregationType;(function(MetricAggregationType2){MetricAggregationType2.AVERAGE="Average",MetricAggregationType2.MINIMUM="Minimum",MetricAggregationType2.MAXIMUM="Maximum"})(MetricAggregationType||(exports.MetricAggregationType=MetricAggregationType={}));
