UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 1.7 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ContextAttribute=exports.ScheduleTargetInput=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class ScheduleTargetInput{static fromText(text){return new FieldAwareEventInput(text,!1)}static fromObject(obj){return new FieldAwareEventInput(obj,!0)}constructor(){}}exports.ScheduleTargetInput=ScheduleTargetInput,_a=JSII_RTTI_SYMBOL_1,ScheduleTargetInput[_a]={fqn:"aws-cdk-lib.aws_scheduler.ScheduleTargetInput",version:"2.211.0"};class FieldAwareEventInput extends ScheduleTargetInput{constructor(input,toJsonString){super(),this.input=input,this.toJsonString=toJsonString}bind(schedule){class Replacer extends core_1().DefaultTokenResolver{constructor(){super(new(core_1()).StringConcat)}resolveToken(t,_context){return core_1().Token.asString(t)}}const stack=core_1().Stack.of(schedule),inputString=core_1().Tokenization.resolve(this.input,{scope:schedule,resolver:new Replacer});return this.toJsonString?stack.toJsonString(inputString):inputString}}class ContextAttribute{static get scheduleArn(){return this.fromName("schedule-arn")}static get scheduledTime(){return this.fromName("scheduled-time")}static get executionId(){return this.fromName("execution-id")}static get attemptNumber(){return this.fromName("attempt-number")}static fromName(name){return new ContextAttribute(name).toString()}constructor(name){this.name=name}toString(){return`<aws.scheduler.${this.name}>`}}exports.ContextAttribute=ContextAttribute,_b=JSII_RTTI_SYMBOL_1,ContextAttribute[_b]={fqn:"aws-cdk-lib.aws_scheduler.ContextAttribute",version:"2.211.0"};