Class: AWSCDK::CloudWatch::VerticalAnnotation

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_watch/vertical_annotation.rb

Overview

Vertical annotation to be added to a graph.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date:, color: nil, fill: nil, label: nil, visible: nil) ⇒ VerticalAnnotation

Returns a new instance of VerticalAnnotation.

Parameters:

  • date (String)

    The date and time (in ISO 8601 format) in the graph where the vertical annotation line is to appear.

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

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. The Color class has a set of standard colors that can be used here.

  • fill (AWSCDK::CloudWatch::VerticalShading, nil) (defaults to: nil)

    Add shading before or after the annotation.

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

    Label for the annotation.

  • visible (Boolean, nil) (defaults to: nil)

    Whether the annotation is visible.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'cloud_watch/vertical_annotation.rb', line 12

def initialize(date:, color: nil, fill: nil, label: nil, visible: nil)
  @date = date
  Jsii::Type.check_type(@date, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "date")
  @color = color
  Jsii::Type.check_type(@color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "color") unless @color.nil?
  @fill = fill
  Jsii::Type.check_type(@fill, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5WZXJ0aWNhbFNoYWRpbmcifQ==")), "fill") unless @fill.nil?
  @label = label
  Jsii::Type.check_type(@label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "label") unless @label.nil?
  @visible = visible
  Jsii::Type.check_type(@visible, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "visible") unless @visible.nil?
end

Instance Attribute Details

#colorString? (readonly)

Note:

Default: - Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. The Color class has a set of standard colors that can be used here.

Returns:

  • (String, nil)


33
34
35
# File 'cloud_watch/vertical_annotation.rb', line 33

def color
  @color
end

#dateString (readonly)

The date and time (in ISO 8601 format) in the graph where the vertical annotation line is to appear.

Returns:

  • (String)


28
29
30
# File 'cloud_watch/vertical_annotation.rb', line 28

def date
  @date
end

#fillAWSCDK::CloudWatch::VerticalShading? (readonly)

Note:

Default: No shading

Add shading before or after the annotation.



38
39
40
# File 'cloud_watch/vertical_annotation.rb', line 38

def fill
  @fill
end

#labelString? (readonly)

Note:

Default: - No label

Label for the annotation.

Returns:

  • (String, nil)


43
44
45
# File 'cloud_watch/vertical_annotation.rb', line 43

def label
  @label
end

#visibleBoolean? (readonly)

Note:

Default: true

Whether the annotation is visible.

Returns:

  • (Boolean, nil)


48
49
50
# File 'cloud_watch/vertical_annotation.rb', line 48

def visible
  @visible
end

Class Method Details

.jsii_propertiesObject



50
51
52
53
54
55
56
57
58
# File 'cloud_watch/vertical_annotation.rb', line 50

def self.jsii_properties
  {
    :date => "date",
    :color => "color",
    :fill => "fill",
    :label => "label",
    :visible => "visible",
  }
end

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
# File 'cloud_watch/vertical_annotation.rb', line 60

def to_jsii
  result = {}
  result.merge!({
    "date" => @date,
    "color" => @color,
    "fill" => @fill,
    "label" => @label,
    "visible" => @visible,
  })
  result.compact
end