Class: AWSCDK::Chatbot::CfnCustomActionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
chatbot/cfn_custom_action_props.rb

Overview

Properties for defining a CfnCustomAction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name:, definition:, alias_name: nil, attachments: nil, tags: nil) ⇒ CfnCustomActionProps

Returns a new instance of CfnCustomActionProps.

Parameters:



14
15
16
17
18
19
20
21
22
23
24
25
# File 'chatbot/cfn_custom_action_props.rb', line 14

def initialize(action_name:, definition:, alias_name: nil, attachments: nil, tags: nil)
  @action_name = action_name
  Jsii::Type.check_type(@action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionName")
  @definition = definition.is_a?(Hash) ? ::AWSCDK::Chatbot::CfnCustomAction::CustomActionDefinitionProperty.new(**definition.transform_keys(&:to_sym)) : definition
  Jsii::Type.check_type(@definition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jaGF0Ym90LkNmbkN1c3RvbUFjdGlvbi5DdXN0b21BY3Rpb25EZWZpbml0aW9uUHJvcGVydHkifV19fQ==")), "definition")
  @alias_name = alias_name
  Jsii::Type.check_type(@alias_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "aliasName") unless @alias_name.nil?
  @attachments = attachments
  Jsii::Type.check_type(@attachments, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2hhdGJvdC5DZm5DdXN0b21BY3Rpb24uQ3VzdG9tQWN0aW9uQXR0YWNobWVudFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "attachments") unless @attachments.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#action_nameString (readonly)

The name of the custom action.

This name is included in the Amazon Resource Name (ARN).



33
34
35
# File 'chatbot/cfn_custom_action_props.rb', line 33

def action_name
  @action_name
end

#alias_nameString? (readonly)

The name used to invoke this action in a chat channel.

For example, @Amazon Q run my-alias .



45
46
47
# File 'chatbot/cfn_custom_action_props.rb', line 45

def alias_name
  @alias_name
end

#attachmentsAWSCDK::IResolvable, ... (readonly)

Defines when this custom action button should be attached to a notification.



50
51
52
# File 'chatbot/cfn_custom_action_props.rb', line 50

def attachments
  @attachments
end

#definitionAWSCDK::IResolvable, AWSCDK::Chatbot::CfnCustomAction::CustomActionDefinitionProperty (readonly)

The definition of the command to run when invoked as an alias or as an action button.



38
39
40
# File 'chatbot/cfn_custom_action_props.rb', line 38

def definition
  @definition
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The tags to add to the configuration.



55
56
57
# File 'chatbot/cfn_custom_action_props.rb', line 55

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



57
58
59
60
61
62
63
64
65
# File 'chatbot/cfn_custom_action_props.rb', line 57

def self.jsii_properties
  {
    :action_name => "actionName",
    :definition => "definition",
    :alias_name => "aliasName",
    :attachments => "attachments",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



67
68
69
70
71
72
73
74
75
76
77
# File 'chatbot/cfn_custom_action_props.rb', line 67

def to_jsii
  result = {}
  result.merge!({
    "actionName" => @action_name,
    "definition" => @definition,
    "aliasName" => @alias_name,
    "attachments" => @attachments,
    "tags" => @tags,
  })
  result.compact
end