Class: AWSCDK::AmplifyUIBuilder::CfnComponent::ComponentEventProperty

Inherits:
Jsii::Struct
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action: nil, binding_event: nil, parameters: nil) ⇒ ComponentEventProperty

Returns a new instance of ComponentEventProperty.

Parameters:



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

#actionString? (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_eventString? (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

#parametersAWSCDK::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_propertiesObject



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_jsiiObject



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