Class: AWSCDK::CloudWatch::CustomWidgetProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::CustomWidgetProps
- Defined in:
- cloud_watch/custom_widget_props.rb
Overview
The properties for a CustomWidget.
Instance Attribute Summary collapse
-
#function_arn ⇒ String
readonly
The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.
-
#height ⇒ Numeric?
readonly
Height of the widget.
-
#params ⇒ Object?
readonly
Parameters passed to the lambda function.
-
#title ⇒ String
readonly
The title of the widget.
-
#update_on_refresh ⇒ Boolean?
readonly
Update the widget on refresh.
-
#update_on_resize ⇒ Boolean?
readonly
Update the widget on resize.
-
#update_on_time_range_change ⇒ Boolean?
readonly
Update the widget on time range change.
-
#width ⇒ Numeric?
readonly
Width of the widget, in a grid of 24 units wide.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of CustomWidgetProps.
- #to_jsii ⇒ Object
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.
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_arn ⇒ String (readonly)
The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.
37 38 39 |
# File 'cloud_watch/custom_widget_props.rb', line 37 def function_arn @function_arn end |
#height ⇒ Numeric? (readonly)
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.
46 47 48 |
# File 'cloud_watch/custom_widget_props.rb', line 46 def height @height end |
#params ⇒ Object? (readonly)
Default: - no parameters are passed to the lambda function
Parameters passed to the lambda function.
51 52 53 |
# File 'cloud_watch/custom_widget_props.rb', line 51 def params @params end |
#title ⇒ String (readonly)
The title of the widget.
41 42 43 |
# File 'cloud_watch/custom_widget_props.rb', line 41 def title @title end |
#update_on_refresh ⇒ Boolean? (readonly)
Default: true
Update the widget on refresh.
56 57 58 |
# File 'cloud_watch/custom_widget_props.rb', line 56 def update_on_refresh @update_on_refresh end |
#update_on_resize ⇒ Boolean? (readonly)
Default: true
Update the widget on resize.
61 62 63 |
# File 'cloud_watch/custom_widget_props.rb', line 61 def update_on_resize @update_on_resize end |
#update_on_time_range_change ⇒ Boolean? (readonly)
Default: true
Update the widget on time range change.
66 67 68 |
# File 'cloud_watch/custom_widget_props.rb', line 66 def update_on_time_range_change @update_on_time_range_change end |
#width ⇒ Numeric? (readonly)
Default: 6
Width of the widget, in a grid of 24 units wide.
71 72 73 |
# File 'cloud_watch/custom_widget_props.rb', line 71 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |