Class: AWSCDK::AmplifyUIBuilder::CfnComponent::ComponentEventProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::AmplifyUIBuilder::CfnComponent::ComponentEventProperty
- Defined in:
- amplify_ui_builder/cfn_component.rb
Overview
The ComponentEvent property specifies the configuration of an event.
You can bind an event and a corresponding action to a Component or a ComponentChild . A button click is an example of an event.
Instance Attribute Summary collapse
-
#action ⇒ String?
readonly
The action to perform when a specific event is raised.
-
#binding_event ⇒ String?
readonly
Binds an event to an action on a component.
-
#parameters ⇒ AWSCDK::IResolvable, ...
readonly
Describes information about the action.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(action: nil, binding_event: nil, parameters: nil) ⇒ ComponentEventProperty
constructor
A new instance of ComponentEventProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(action: nil, binding_event: nil, parameters: nil) ⇒ ComponentEventProperty
Returns a new instance of ComponentEventProperty.
1238 1239 1240 1241 1242 1243 1244 1245 |
# File 'amplify_ui_builder/cfn_component.rb', line 1238 def initialize(action: nil, binding_event: nil, parameters: nil) @action = action Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") unless @action.nil? @binding_event = binding_event Jsii::Type.check_type(@binding_event, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bindingEvent") unless @binding_event.nil? @parameters = parameters.is_a?(Hash) ? ::AWSCDK::AmplifyUIBuilder::CfnComponent::ActionParametersProperty.new(**parameters.transform_keys(&:to_sym)) : parameters Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hbXBsaWZ5dWlidWlsZGVyLkNmbkNvbXBvbmVudC5BY3Rpb25QYXJhbWV0ZXJzUHJvcGVydHkifV19fQ==")), "parameters") unless @parameters.nil? end |
Instance Attribute Details
#action ⇒ String? (readonly)
The action to perform when a specific event is raised.
1251 1252 1253 |
# File 'amplify_ui_builder/cfn_component.rb', line 1251 def action @action end |
#binding_event ⇒ String? (readonly)
Binds an event to an action on a component.
When you specify a binding_event , the event is called when the action is performed.
1258 1259 1260 |
# File 'amplify_ui_builder/cfn_component.rb', line 1258 def binding_event @binding_event end |
#parameters ⇒ AWSCDK::IResolvable, ... (readonly)
Describes information about the action.
1263 1264 1265 |
# File 'amplify_ui_builder/cfn_component.rb', line 1263 def parameters @parameters end |
Class Method Details
.jsii_properties ⇒ Object
1265 1266 1267 1268 1269 1270 1271 |
# File 'amplify_ui_builder/cfn_component.rb', line 1265 def self.jsii_properties { :action => "action", :binding_event => "bindingEvent", :parameters => "parameters", } end |
Instance Method Details
#to_jsii ⇒ Object
1273 1274 1275 1276 1277 1278 1279 1280 1281 |
# File 'amplify_ui_builder/cfn_component.rb', line 1273 def to_jsii result = {} result.merge!({ "action" => @action, "bindingEvent" => @binding_event, "parameters" => @parameters, }) result.compact end |