"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.MetricAggregationType=exports.AdjustmentType=exports.StepScalingAction=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cdk=require("../../core"),constructs_1=require("constructs"),applicationautoscaling_generated_1=require("./applicationautoscaling.generated");class StepScalingAction extends constructs_1.Construct{constructor(scope,id,props){super(scope,id),this.adjustments=new Array;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_applicationautoscaling_StepScalingActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}const resource=new applicationautoscaling_generated_1.CfnScalingPolicy(this,"Resource",{policyName:props.policyName||cdk.Names.uniqueId(this),policyType:"StepScaling",scalingTargetId:props.scalingTarget.scalableTargetId,stepScalingPolicyConfiguration:{adjustmentType:props.adjustmentType,cooldown:props.cooldown&&props.cooldown.toSeconds(),minAdjustmentMagnitude:props.minAdjustmentMagnitude,metricAggregationType:props.metricAggregationType,stepAdjustments:cdk.Lazy.any({produce:()=>this.adjustments})}});this.scalingPolicyArn=resource.ref}addAdjustment(adjustment){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_applicationautoscaling_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_applicationautoscaling.StepScalingAction",version:"2.24.1"};var AdjustmentType;(function(AdjustmentType2){AdjustmentType2.CHANGE_IN_CAPACITY="ChangeInCapacity",AdjustmentType2.PERCENT_CHANGE_IN_CAPACITY="PercentChangeInCapacity",AdjustmentType2.EXACT_CAPACITY="ExactCapacity"})(AdjustmentType=exports.AdjustmentType||(exports.AdjustmentType={}));var MetricAggregationType;(function(MetricAggregationType2){MetricAggregationType2.AVERAGE="Average",MetricAggregationType2.MINIMUM="Minimum",MetricAggregationType2.MAXIMUM="Maximum"})(MetricAggregationType=exports.MetricAggregationType||(exports.MetricAggregationType={}));
//# sourceMappingURL=step-scaling-action.js.map
