Class: AWSCDK::Synthetics::CronOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
synthetics/cron_options.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) ⇒ CronOptions

Returns a new instance of CronOptions.

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.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'synthetics/cron_options.rb', line 17

def initialize(day: nil, hour: nil, minute: nil, month: nil, week_day: 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?
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)


34
35
36
# File 'synthetics/cron_options.rb', line 34

def day
  @day
end

#hourString? (readonly)

Note:

Default: - Every hour

The hour to run this rule at.

Returns:

  • (String, nil)


39
40
41
# File 'synthetics/cron_options.rb', line 39

def hour
  @hour
end

#minuteString? (readonly)

Note:

Default: - Every minute

The minute to run this rule at.

Returns:

  • (String, nil)


44
45
46
# File 'synthetics/cron_options.rb', line 44

def minute
  @minute
end

#monthString? (readonly)

Note:

Default: - Every month

The month to run this rule at.

Returns:

  • (String, nil)


49
50
51
# File 'synthetics/cron_options.rb', line 49

def month
  @month
end

#week_dayString? (readonly)

Note:

Default: - Any day of the week

The day of the week to run this rule at.

Returns:

  • (String, nil)


54
55
56
# File 'synthetics/cron_options.rb', line 54

def week_day
  @week_day
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
64
# File 'synthetics/cron_options.rb', line 56

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

Instance Method Details

#to_jsiiObject



66
67
68
69
70
71
72
73
74
75
76
# File 'synthetics/cron_options.rb', line 66

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