Class: AWSCDK::Bedrock::CfnGuardrail::ManagedWordsConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_guardrail.rb

Overview

The managed word list to configure for the guardrail.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) ⇒ ManagedWordsConfigProperty

Returns a new instance of ManagedWordsConfigProperty.

Parameters:

  • type (String)

    The managed word type to configure for the guardrail.

  • input_action (String, nil) (defaults to: nil)

    Specifies the action to take when harmful content is detected in the input. Supported values include:.

  • input_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether to enable guardrail evaluation on the input.

  • output_action (String, nil) (defaults to: nil)

    Specifies the action to take when harmful content is detected in the output. Supported values include:.

  • output_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether to enable guardrail evaluation on the output.



1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
# File 'bedrock/cfn_guardrail.rb', line 1162

def initialize(type:, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @input_action = input_action
  Jsii::Type.check_type(@input_action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inputAction") unless @input_action.nil?
  @input_enabled = input_enabled
  Jsii::Type.check_type(@input_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "inputEnabled") unless @input_enabled.nil?
  @output_action = output_action
  Jsii::Type.check_type(@output_action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outputAction") unless @output_action.nil?
  @output_enabled = output_enabled
  Jsii::Type.check_type(@output_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "outputEnabled") unless @output_enabled.nil?
end

Instance Attribute Details

#input_actionString? (readonly)

Specifies the action to take when harmful content is detected in the input. Supported values include:.

  • BLOCK – Block the content and replace it with blocked messaging.
  • NONE – Take no action but return detection information in the trace response.


1187
1188
1189
# File 'bedrock/cfn_guardrail.rb', line 1187

def input_action
  @input_action
end

#input_enabledBoolean, ... (readonly)

Specifies whether to enable guardrail evaluation on the input.

When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.



1194
1195
1196
# File 'bedrock/cfn_guardrail.rb', line 1194

def input_enabled
  @input_enabled
end

#output_actionString? (readonly)

Specifies the action to take when harmful content is detected in the output. Supported values include:.

  • BLOCK – Block the content and replace it with blocked messaging.
  • NONE – Take no action but return detection information in the trace response.


1202
1203
1204
# File 'bedrock/cfn_guardrail.rb', line 1202

def output_action
  @output_action
end

#output_enabledBoolean, ... (readonly)

Specifies whether to enable guardrail evaluation on the output.

When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.



1209
1210
1211
# File 'bedrock/cfn_guardrail.rb', line 1209

def output_enabled
  @output_enabled
end

#typeString (readonly)

The managed word type to configure for the guardrail.



1179
1180
1181
# File 'bedrock/cfn_guardrail.rb', line 1179

def type
  @type
end

Class Method Details

.jsii_propertiesObject



1211
1212
1213
1214
1215
1216
1217
1218
1219
# File 'bedrock/cfn_guardrail.rb', line 1211

def self.jsii_properties
  {
    :type => "type",
    :input_action => "inputAction",
    :input_enabled => "inputEnabled",
    :output_action => "outputAction",
    :output_enabled => "outputEnabled",
  }
end

Instance Method Details

#to_jsiiObject



1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
# File 'bedrock/cfn_guardrail.rb', line 1221

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "inputAction" => @input_action,
    "inputEnabled" => @input_enabled,
    "outputAction" => @output_action,
    "outputEnabled" => @output_enabled,
  })
  result.compact
end