Class: AWSCDK::CloudWatch::CustomWidgetProps

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

Overview

The properties for a CustomWidget.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_arn:, title:, height: nil, params: nil, update_on_refresh: nil, update_on_resize: nil, update_on_time_range_change: nil, width: nil) ⇒ CustomWidgetProps

Returns a new instance of CustomWidgetProps.

Parameters:

  • function_arn (String)

    The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.

  • title (String)

    The title of the widget.

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

    Height of the widget.

  • params (Object, nil) (defaults to: nil)

    Parameters passed to the lambda function.

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

    Update the widget on refresh.

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

    Update the widget on resize.

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

    Update the widget on time range change.

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

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



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'cloud_watch/custom_widget_props.rb', line 15

def initialize(function_arn:, title:, height: nil, params: nil, update_on_refresh: nil, update_on_resize: nil, update_on_time_range_change: nil, width: nil)
  @function_arn = function_arn
  Jsii::Type.check_type(@function_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionArn")
  @title = title
  Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title")
  @height = height
  Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") unless @height.nil?
  @params = params
  Jsii::Type.check_type(@params, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "params") unless @params.nil?
  @update_on_refresh = update_on_refresh
  Jsii::Type.check_type(@update_on_refresh, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "updateOnRefresh") unless @update_on_refresh.nil?
  @update_on_resize = update_on_resize
  Jsii::Type.check_type(@update_on_resize, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "updateOnResize") unless @update_on_resize.nil?
  @update_on_time_range_change = update_on_time_range_change
  Jsii::Type.check_type(@update_on_time_range_change, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "updateOnTimeRangeChange") unless @update_on_time_range_change.nil?
  @width = width
  Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") unless @width.nil?
end

Instance Attribute Details

#function_arnString (readonly)

The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.

Returns:

  • (String)


37
38
39
# File 'cloud_watch/custom_widget_props.rb', line 37

def function_arn
  @function_arn
end

#heightNumeric? (readonly)

Note:

Default: - 6 for Alarm and Graph widgets. 3 for single value widgets where most recent value of a metric is displayed.

Height of the widget.

Returns:

  • (Numeric, nil)


46
47
48
# File 'cloud_watch/custom_widget_props.rb', line 46

def height
  @height
end

#paramsObject? (readonly)

Note:

Default: - no parameters are passed to the lambda function

Parameters passed to the lambda function.

Returns:

  • (Object, nil)


51
52
53
# File 'cloud_watch/custom_widget_props.rb', line 51

def params
  @params
end

#titleString (readonly)

The title of the widget.

Returns:

  • (String)


41
42
43
# File 'cloud_watch/custom_widget_props.rb', line 41

def title
  @title
end

#update_on_refreshBoolean? (readonly)

Note:

Default: true

Update the widget on refresh.

Returns:

  • (Boolean, nil)


56
57
58
# File 'cloud_watch/custom_widget_props.rb', line 56

def update_on_refresh
  @update_on_refresh
end

#update_on_resizeBoolean? (readonly)

Note:

Default: true

Update the widget on resize.

Returns:

  • (Boolean, nil)


61
62
63
# File 'cloud_watch/custom_widget_props.rb', line 61

def update_on_resize
  @update_on_resize
end

#update_on_time_range_changeBoolean? (readonly)

Note:

Default: true

Update the widget on time range change.

Returns:

  • (Boolean, nil)


66
67
68
# File 'cloud_watch/custom_widget_props.rb', line 66

def update_on_time_range_change
  @update_on_time_range_change
end

#widthNumeric? (readonly)

Note:

Default: 6

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

Returns:

  • (Numeric, nil)


71
72
73
# File 'cloud_watch/custom_widget_props.rb', line 71

def width
  @width
end

Class Method Details

.jsii_propertiesObject



73
74
75
76
77
78
79
80
81
82
83
84
# File 'cloud_watch/custom_widget_props.rb', line 73

def self.jsii_properties
  {
    :function_arn => "functionArn",
    :title => "title",
    :height => "height",
    :params => "params",
    :update_on_refresh => "updateOnRefresh",
    :update_on_resize => "updateOnResize",
    :update_on_time_range_change => "updateOnTimeRangeChange",
    :width => "width",
  }
end

Instance Method Details

#to_jsiiObject



86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'cloud_watch/custom_widget_props.rb', line 86

def to_jsii
  result = {}
  result.merge!({
    "functionArn" => @function_arn,
    "title" => @title,
    "height" => @height,
    "params" => @params,
    "updateOnRefresh" => @update_on_refresh,
    "updateOnResize" => @update_on_resize,
    "updateOnTimeRangeChange" => @update_on_time_range_change,
    "width" => @width,
  })
  result.compact
end