Class: AWSCDK::Events::Schedule

Inherits:
Jsii::Object
  • Object
show all
Defined in:
events/schedule.rb

Overview

Schedule for scheduled event rules.

Note that rates cannot be defined in fractions of minutes.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSchedule

Returns a new instance of Schedule.



12
13
14
# File 'events/schedule.rb', line 12

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.cron(options) ⇒ AWSCDK::Events::Schedule

Create a schedule from a set of cron fields.

Parameters:

Returns:

  • (AWSCDK::Events::Schedule)


26
27
28
29
30
# File 'events/schedule.rb', line 26

def self.cron(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Events::CronOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLkNyb25PcHRpb25zIn0=")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_events.Schedule", "cron", [options])
end

.expression(expression) ⇒ AWSCDK::Events::Schedule

Construct a schedule from a literal schedule expression.

Parameters:

  • expression (String)

    The expression to use.

Returns:

  • (AWSCDK::Events::Schedule)


36
37
38
39
# File 'events/schedule.rb', line 36

def self.expression(expression)
  Jsii::Type.check_type(expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_events.Schedule", "expression", [expression])
end

.jsii_overridable_methodsObject



16
17
18
19
20
# File 'events/schedule.rb', line 16

def self.jsii_overridable_methods
  {
    :expression_string => { kind: :property, name: "expressionString", is_optional: false },
  }
end

.rate(duration) ⇒ AWSCDK::Events::Schedule

Construct a schedule from an interval and a time unit.

Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes.

Parameters:

Returns:

  • (AWSCDK::Events::Schedule)


47
48
49
50
# File 'events/schedule.rb', line 47

def self.rate(duration)
  Jsii::Type.check_type(duration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "duration")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_events.Schedule", "rate", [duration])
end

Instance Method Details

#expression_stringString

Retrieve the expression for this schedule.

Returns:

  • (String)


55
56
57
# File 'events/schedule.rb', line 55

def expression_string()
  jsii_get_property("expressionString")
end