Class: AWSCDK::CloudWatch::TextWidgetProps

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

Overview

Properties for a Text widget.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(markdown:, background: nil, height: nil, width: nil) ⇒ TextWidgetProps

Returns a new instance of TextWidgetProps.

Parameters:

  • markdown (String)

    The text to display, in MarkDown format.

  • background (AWSCDK::CloudWatch::TextWidgetBackground, nil) (defaults to: nil)

    Background for the widget.

  • height (Numeric, nil) (defaults to: nil)

    Height of the widget.

  • width (Numeric, nil) (defaults to: nil)

    Width of the widget, in a grid of 24 units wide.



11
12
13
14
15
16
17
18
19
20
# File 'cloud_watch/text_widget_props.rb', line 11

def initialize(markdown:, background: nil, height: nil, width: nil)
  @markdown = markdown
  Jsii::Type.check_type(@markdown, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "markdown")
  @background = background
  Jsii::Type.check_type(@background, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5UZXh0V2lkZ2V0QmFja2dyb3VuZCJ9")), "background") unless @background.nil?
  @height = height
  Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") unless @height.nil?
  @width = width
  Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") unless @width.nil?
end

Instance Attribute Details

#backgroundAWSCDK::CloudWatch::TextWidgetBackground? (readonly)

Note:

Default: solid

Background for the widget.



30
31
32
# File 'cloud_watch/text_widget_props.rb', line 30

def background
  @background
end

#heightNumeric? (readonly)

Note:

Default: 2

Height of the widget.

Returns:

  • (Numeric, nil)


35
36
37
# File 'cloud_watch/text_widget_props.rb', line 35

def height
  @height
end

#markdownString (readonly)

The text to display, in MarkDown format.

Returns:

  • (String)


25
26
27
# File 'cloud_watch/text_widget_props.rb', line 25

def markdown
  @markdown
end

#widthNumeric? (readonly)

Note:

Default: 6

Width of the widget, in a grid of 24 units wide.

Returns:

  • (Numeric, nil)


40
41
42
# File 'cloud_watch/text_widget_props.rb', line 40

def width
  @width
end

Class Method Details

.jsii_propertiesObject



42
43
44
45
46
47
48
49
# File 'cloud_watch/text_widget_props.rb', line 42

def self.jsii_properties
  {
    :markdown => "markdown",
    :background => "background",
    :height => "height",
    :width => "width",
  }
end

Instance Method Details

#to_jsiiObject



51
52
53
54
55
56
57
58
59
60
# File 'cloud_watch/text_widget_props.rb', line 51

def to_jsii
  result = {}
  result.merge!({
    "markdown" => @markdown,
    "background" => @background,
    "height" => @height,
    "width" => @width,
  })
  result.compact
end