"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Schedule=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class Schedule{static once(){return new Schedule("rate(0 minutes)")}static expression(expression){return new Schedule(expression)}static rate(interval){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(interval)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.rate),error}const minutes=interval.toMinutes();if(minutes>60)throw new Error("Schedule duration must be between 1 and 60 minutes");return minutes===0?Schedule.once():minutes===1?new Schedule("rate(1 minute)"):new Schedule(`rate(${minutes} minutes)`)}static cron(options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_synthetics_CronOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.cron),error}if(options.weekDay!==void 0&&options.day!==void 0)throw new Error("Cannot supply both 'day' and 'weekDay', use at most one");const minute=fallback(options.minute,"*"),hour=fallback(options.hour,"*"),month=fallback(options.month,"*"),day=fallback(options.day,options.weekDay!==void 0?"?":"*"),weekDay=fallback(options.weekDay,"?"),year="*";return new Schedule(`cron(${minute} ${hour} ${day} ${month} ${weekDay} ${year})`)}constructor(expressionString){this.expressionString=expressionString}}exports.Schedule=Schedule,_a=JSII_RTTI_SYMBOL_1,Schedule[_a]={fqn:"aws-cdk-lib.aws_synthetics.Schedule",version:"2.148.1"};function fallback(x,def){return x??def}
