Class: AWSCDK::Bedrock::CfnGuardrail::RegexConfigProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnGuardrail::RegexConfigProperty
- Defined in:
- bedrock/cfn_guardrail.rb
Overview
The regular expression to configure for the guardrail.
Instance Attribute Summary collapse
-
#action ⇒ String
readonly
The guardrail action to configure when matching regular expression is detected.
-
#description ⇒ String?
readonly
The description of the regular expression to configure for the guardrail.
-
#input_action ⇒ String?
readonly
Specifies the action to take when harmful content is detected in the input.
-
#input_enabled ⇒ Boolean, ...
readonly
Specifies whether to enable guardrail evaluation on the input.
-
#name ⇒ String
readonly
The name of the regular expression to configure for the guardrail.
-
#output_action ⇒ String?
readonly
Specifies the action to take when harmful content is detected in the output.
-
#output_enabled ⇒ Boolean, ...
readonly
Specifies whether to enable guardrail evaluation on the output.
-
#pattern ⇒ String
readonly
The regular expression pattern to configure for the guardrail.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(action:, name:, pattern:, description: nil, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) ⇒ RegexConfigProperty
constructor
A new instance of RegexConfigProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(action:, name:, pattern:, description: nil, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) ⇒ RegexConfigProperty
Returns a new instance of RegexConfigProperty.
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'bedrock/cfn_guardrail.rb', line 1484 def initialize(action:, name:, pattern:, description: nil, input_action: nil, input_enabled: nil, output_action: nil, output_enabled: nil) @action = action Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") @pattern = pattern Jsii::Type.check_type(@pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern") @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @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
#action ⇒ String (readonly)
The guardrail action to configure when matching regular expression is detected.
1507 1508 1509 |
# File 'bedrock/cfn_guardrail.rb', line 1507 def action @action end |
#description ⇒ String? (readonly)
The description of the regular expression to configure for the guardrail.
1522 1523 1524 |
# File 'bedrock/cfn_guardrail.rb', line 1522 def description @description end |
#input_action ⇒ String? (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.
1530 1531 1532 |
# File 'bedrock/cfn_guardrail.rb', line 1530 def input_action @input_action end |
#input_enabled ⇒ Boolean, ... (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.
1537 1538 1539 |
# File 'bedrock/cfn_guardrail.rb', line 1537 def input_enabled @input_enabled end |
#name ⇒ String (readonly)
The name of the regular expression to configure for the guardrail.
1512 1513 1514 |
# File 'bedrock/cfn_guardrail.rb', line 1512 def name @name end |
#output_action ⇒ String? (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.
1545 1546 1547 |
# File 'bedrock/cfn_guardrail.rb', line 1545 def output_action @output_action end |
#output_enabled ⇒ Boolean, ... (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.
1552 1553 1554 |
# File 'bedrock/cfn_guardrail.rb', line 1552 def output_enabled @output_enabled end |
#pattern ⇒ String (readonly)
The regular expression pattern to configure for the guardrail.
1517 1518 1519 |
# File 'bedrock/cfn_guardrail.rb', line 1517 def pattern @pattern end |
Class Method Details
.jsii_properties ⇒ Object
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 |
# File 'bedrock/cfn_guardrail.rb', line 1554 def self.jsii_properties { :action => "action", :name => "name", :pattern => "pattern", :description => "description", :input_action => "inputAction", :input_enabled => "inputEnabled", :output_action => "outputAction", :output_enabled => "outputEnabled", } end |
Instance Method Details
#to_jsii ⇒ Object
1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 |
# File 'bedrock/cfn_guardrail.rb', line 1567 def to_jsii result = {} result.merge!({ "action" => @action, "name" => @name, "pattern" => @pattern, "description" => @description, "inputAction" => @input_action, "inputEnabled" => @input_enabled, "outputAction" => @output_action, "outputEnabled" => @output_enabled, }) result.compact end |