"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Capacity=exports.CapacityMode=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var CapacityMode;(function(CapacityMode2){CapacityMode2.FIXED="FIXED",CapacityMode2.AUTOSCALED="AUTOSCALED"})(CapacityMode||(exports.CapacityMode=CapacityMode={}));class Capacity{static fixed(iops){return new class extends Capacity{_renderReadCapacity(){return{readCapacityUnits:iops}}_renderWriteCapacity(){throw new Error(`You cannot configure 'writeCapacity' with ${CapacityMode.FIXED} capacity mode`)}}(CapacityMode.FIXED)}static autoscaled(options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_dynamodb_AutoscaledCapacityOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.autoscaled),error}return new class extends Capacity{constructor(mode){if(super(mode),(options.minCapacity??1)>options.maxCapacity)throw new Error("`minCapacity` must be less than or equal to `maxCapacity`");if(options.targetUtilizationPercent!==void 0&&(options.targetUtilizationPercent<20||options.targetUtilizationPercent>90))throw new Error("`targetUtilizationPercent` cannot be less than 20 or greater than 90")}_renderReadCapacity(){return{readCapacityAutoScalingSettings:this.renderAutoscaledCapacity()}}_renderWriteCapacity(){return{writeCapacityAutoScalingSettings:this.renderAutoscaledCapacity()}}renderAutoscaledCapacity(){return{minCapacity:options.minCapacity??1,maxCapacity:options.maxCapacity,targetTrackingScalingPolicyConfiguration:{targetValue:options.targetUtilizationPercent??70}}}}(CapacityMode.AUTOSCALED)}constructor(mode){this.mode=mode}}exports.Capacity=Capacity,_a=JSII_RTTI_SYMBOL_1,Capacity[_a]={fqn:"aws-cdk-lib.aws_dynamodb.Capacity",version:"2.96.1"};
