Class: AWSCDK::Scheduler::CronOptionsWithTimezone

Inherits:
Events::CronOptions
  • Object
show all
Defined in:
scheduler/cron_options_with_timezone.rb

Overview

Options to configure a cron expression.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(day: nil, hour: nil, minute: nil, month: nil, week_day: nil, year: nil, time_zone: nil) ⇒ CronOptionsWithTimezone

Returns a new instance of CronOptionsWithTimezone.

Parameters:

  • day (String, nil) (defaults to: nil)

    The day of the month to run this rule at.

  • hour (String, nil) (defaults to: nil)

    The hour to run this rule at.

  • minute (String, nil) (defaults to: nil)

    The minute to run this rule at.

  • month (String, nil) (defaults to: nil)

    The month to run this rule at.

  • week_day (String, nil) (defaults to: nil)

    The day of the week to run this rule at.

  • year (String, nil) (defaults to: nil)

    The year to run this rule at.

  • time_zone (AWSCDK::TimeZone, nil) (defaults to: nil)

    The timezone to run the schedule in.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'scheduler/cron_options_with_timezone.rb', line 19

def initialize(day: nil, hour: nil, minute: nil, month: nil, week_day: nil, year: nil, time_zone: nil)
  @day = day
  Jsii::Type.check_type(@day, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "day") unless @day.nil?
  @hour = hour
  Jsii::Type.check_type(@hour, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hour") unless @hour.nil?
  @minute = minute
  Jsii::Type.check_type(@minute, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "minute") unless @minute.nil?
  @month = month
  Jsii::Type.check_type(@month, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "month") unless @month.nil?
  @week_day = week_day
  Jsii::Type.check_type(@week_day, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "weekDay") unless @week_day.nil?
  @year = year
  Jsii::Type.check_type(@year, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "year") unless @year.nil?
  @time_zone = time_zone
  Jsii::Type.check_type(@time_zone, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UaW1lWm9uZSJ9")), "timeZone") unless @time_zone.nil?
end

Instance Attribute Details

#dayString? (readonly)

Note:

Default: - Every day of the month

The day of the month to run this rule at.

Returns:

  • (String, nil)


40
41
42
# File 'scheduler/cron_options_with_timezone.rb', line 40

def day
  @day
end

#hourString? (readonly)

Note:

Default: - Every hour

The hour to run this rule at.

Returns:

  • (String, nil)


45
46
47
# File 'scheduler/cron_options_with_timezone.rb', line 45

def hour
  @hour
end

#minuteString? (readonly)

Note:

Default: - Every minute

The minute to run this rule at.

Returns:

  • (String, nil)


50
51
52
# File 'scheduler/cron_options_with_timezone.rb', line 50

def minute
  @minute
end

#monthString? (readonly)

Note:

Default: - Every month

The month to run this rule at.

Returns:

  • (String, nil)


55
56
57
# File 'scheduler/cron_options_with_timezone.rb', line 55

def month
  @month
end

#time_zoneAWSCDK::TimeZone? (readonly)

Note:

Default: - TimeZone.ETC_UTC

The timezone to run the schedule in.

Returns:



70
71
72
# File 'scheduler/cron_options_with_timezone.rb', line 70

def time_zone
  @time_zone
end

#week_dayString? (readonly)

Note:

Default: - Any day of the week

The day of the week to run this rule at.

Returns:

  • (String, nil)


60
61
62
# File 'scheduler/cron_options_with_timezone.rb', line 60

def week_day
  @week_day
end

#yearString? (readonly)

Note:

Default: - Every year

The year to run this rule at.

Returns:

  • (String, nil)


65
66
67
# File 'scheduler/cron_options_with_timezone.rb', line 65

def year
  @year
end

Class Method Details

.jsii_propertiesObject



72
73
74
75
76
77
78
79
80
81
82
# File 'scheduler/cron_options_with_timezone.rb', line 72

def self.jsii_properties
  {
    :day => "day",
    :hour => "hour",
    :minute => "minute",
    :month => "month",
    :week_day => "weekDay",
    :year => "year",
    :time_zone => "timeZone",
  }
end

Instance Method Details

#to_jsiiObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'scheduler/cron_options_with_timezone.rb', line 84

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "day" => @day,
    "hour" => @hour,
    "minute" => @minute,
    "month" => @month,
    "weekDay" => @week_day,
    "year" => @year,
    "timeZone" => @time_zone,
  })
  result.compact
end