"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScheduleExpression=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var events=()=>{var tmp=require("../../aws-events");return events=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class ScheduleExpression{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_scheduler.ScheduleExpression",version:"2.256.1"};static at(date,timeZone){try{jsiiDeprecationWarnings().aws_cdk_lib_TimeZone(timeZone)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.at),error}try{const literal=date.toISOString().split(".")[0];return new LiteralScheduleExpression(`at(${literal})`,timeZone??core_1().TimeZone.ETC_UTC)}catch(e){throw e instanceof RangeError?new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidDate`,"Invalid date"):e}}static expression(expression,timeZone){try{jsiiDeprecationWarnings().aws_cdk_lib_TimeZone(timeZone)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.expression),error}return new LiteralScheduleExpression(expression,timeZone??core_1().TimeZone.ETC_UTC)}static rate(duration){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(duration)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.rate),error}const schedule=events().Schedule.rate(duration);return new LiteralScheduleExpression(schedule.expressionString)}static cron(options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_scheduler_CronOptionsWithTimezone(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.cron),error}const{timeZone,...cronOptions}=options,schedule=events().Schedule.cron(cronOptions);return new LiteralScheduleExpression(schedule.expressionString,timeZone)}constructor(){}}exports.ScheduleExpression=ScheduleExpression;const DEFAULT_TIMEZONE=core_1().TimeZone.ETC_UTC;class LiteralScheduleExpression extends ScheduleExpression{expressionString;timeZone;constructor(expressionString,timeZone=DEFAULT_TIMEZONE){super(),this.expressionString=expressionString,this.timeZone=timeZone}}
