Skip to content
v2.277.0

ConditionalBranchProperty Struct ​

A set of actions that Amazon Lex should run if the condition is matched.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lex as lex } from 'aws-cdk-lib';

declare const slotValueOverrideProperty_: lex.CfnBot.SlotValueOverrideProperty;
const conditionalBranchProperty: lex.CfnBot.ConditionalBranchProperty = {
  condition: {
    expressionString: 'expressionString',
  },
  name: 'name',
  nextStep: {
    dialogAction: {
      type: 'type',

      // the properties below are optional
      slotToElicit: 'slotToElicit',
      suppressNextMessage: false,
    },
    intent: {
      name: 'name',
      slots: [{
        slotName: 'slotName',
        slotValueOverride: {
          shape: 'shape',
          value: {
            interpretedValue: 'interpretedValue',
          },
          values: [slotValueOverrideProperty_],
        },
      }],
    },
    sessionAttributes: [{
      key: 'key',

      // the properties below are optional
      value: 'value',
    }],
  },

  // the properties below are optional
  response: {
    messageGroupsList: [{
      message: {
        customPayload: {
          value: 'value',
        },
        imageResponseCard: {
          title: 'title',

          // the properties below are optional
          buttons: [{
            text: 'text',
            value: 'value',
          }],
          imageUrl: 'imageUrl',
          subtitle: 'subtitle',
        },
        plainTextMessage: {
          value: 'value',
        },
        ssmlMessage: {
          value: 'value',
        },
      },

      // the properties below are optional
      variations: [{
        customPayload: {
          value: 'value',
        },
        imageResponseCard: {
          title: 'title',

          // the properties below are optional
          buttons: [{
            text: 'text',
            value: 'value',
          }],
          imageUrl: 'imageUrl',
          subtitle: 'subtitle',
        },
        plainTextMessage: {
          value: 'value',
        },
        ssmlMessage: {
          value: 'value',
        },
      }],
    }],

    // the properties below are optional
    allowInterrupt: false,
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lex as lex

# slot_value_override_property_: lex.CfnBot.SlotValueOverrideProperty

conditional_branch_property = lex.CfnBot.ConditionalBranchProperty(
    condition=lex.CfnBot.ConditionProperty(
        expression_string="expressionString"
    ),
    name="name",
    next_step=lex.CfnBot.DialogStateProperty(
        dialog_action=lex.CfnBot.DialogActionProperty(
            type="type",

            # the properties below are optional
            slot_to_elicit="slotToElicit",
            suppress_next_message=False
        ),
        intent=lex.CfnBot.IntentOverrideProperty(
            name="name",
            slots=[lex.CfnBot.SlotValueOverrideMapProperty(
                slot_name="slotName",
                slot_value_override=lex.CfnBot.SlotValueOverrideProperty(
                    shape="shape",
                    value=lex.CfnBot.SlotValueProperty(
                        interpreted_value="interpretedValue"
                    ),
                    values=[slot_value_override_property_]
                )
            )]
        ),
        session_attributes=[lex.CfnBot.SessionAttributeProperty(
            key="key",

            # the properties below are optional
            value="value"
        )]
    ),

    # the properties below are optional
    response=lex.CfnBot.ResponseSpecificationProperty(
        message_groups_list=[lex.CfnBot.MessageGroupProperty(
            message=lex.CfnBot.MessageProperty(
                custom_payload=lex.CfnBot.CustomPayloadProperty(
                    value="value"
                ),
                image_response_card=lex.CfnBot.ImageResponseCardProperty(
                    title="title",

                    # the properties below are optional
                    buttons=[lex.CfnBot.ButtonProperty(
                        text="text",
                        value="value"
                    )],
                    image_url="imageUrl",
                    subtitle="subtitle"
                ),
                plain_text_message=lex.CfnBot.PlainTextMessageProperty(
                    value="value"
                ),
                ssml_message=lex.CfnBot.SSMLMessageProperty(
                    value="value"
                )
            ),

            # the properties below are optional
            variations=[lex.CfnBot.MessageProperty(
                custom_payload=lex.CfnBot.CustomPayloadProperty(
                    value="value"
                ),
                image_response_card=lex.CfnBot.ImageResponseCardProperty(
                    title="title",

                    # the properties below are optional
                    buttons=[lex.CfnBot.ButtonProperty(
                        text="text",
                        value="value"
                    )],
                    image_url="imageUrl",
                    subtitle="subtitle"
                ),
                plain_text_message=lex.CfnBot.PlainTextMessageProperty(
                    value="value"
                ),
                ssml_message=lex.CfnBot.SSMLMessageProperty(
                    value="value"
                )
            )]
        )],

        # the properties below are optional
        allow_interrupt=False
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lex.*;

SlotValueOverrideProperty slotValueOverrideProperty_;

ConditionalBranchProperty conditionalBranchProperty = ConditionalBranchProperty.builder()
        .condition(ConditionProperty.builder()
                .expressionString("expressionString")
                .build())
        .name("name")
        .nextStep(DialogStateProperty.builder()
                .dialogAction(DialogActionProperty.builder()
                        .type("type")

                        // the properties below are optional
                        .slotToElicit("slotToElicit")
                        .suppressNextMessage(false)
                        .build())
                .intent(IntentOverrideProperty.builder()
                        .name("name")
                        .slots(List.of(SlotValueOverrideMapProperty.builder()
                                .slotName("slotName")
                                .slotValueOverride(SlotValueOverrideProperty.builder()
                                        .shape("shape")
                                        .value(SlotValueProperty.builder()
                                                .interpretedValue("interpretedValue")
                                                .build())
                                        .values(List.of(slotValueOverrideProperty_))
                                        .build())
                                .build()))
                        .build())
                .sessionAttributes(List.of(SessionAttributeProperty.builder()
                        .key("key")

                        // the properties below are optional
                        .value("value")
                        .build()))
                .build())

        // the properties below are optional
        .response(ResponseSpecificationProperty.builder()
                .messageGroupsList(List.of(MessageGroupProperty.builder()
                        .message(MessageProperty.builder()
                                .customPayload(CustomPayloadProperty.builder()
                                        .value("value")
                                        .build())
                                .imageResponseCard(ImageResponseCardProperty.builder()
                                        .title("title")

                                        // the properties below are optional
                                        .buttons(List.of(ButtonProperty.builder()
                                                .text("text")
                                                .value("value")
                                                .build()))
                                        .imageUrl("imageUrl")
                                        .subtitle("subtitle")
                                        .build())
                                .plainTextMessage(PlainTextMessageProperty.builder()
                                        .value("value")
                                        .build())
                                .ssmlMessage(SSMLMessageProperty.builder()
                                        .value("value")
                                        .build())
                                .build())

                        // the properties below are optional
                        .variations(List.of(MessageProperty.builder()
                                .customPayload(CustomPayloadProperty.builder()
                                        .value("value")
                                        .build())
                                .imageResponseCard(ImageResponseCardProperty.builder()
                                        .title("title")

                                        // the properties below are optional
                                        .buttons(List.of(ButtonProperty.builder()
                                                .text("text")
                                                .value("value")
                                                .build()))
                                        .imageUrl("imageUrl")
                                        .subtitle("subtitle")
                                        .build())
                                .plainTextMessage(PlainTextMessageProperty.builder()
                                        .value("value")
                                        .build())
                                .ssmlMessage(SSMLMessageProperty.builder()
                                        .value("value")
                                        .build())
                                .build()))
                        .build()))

                // the properties below are optional
                .allowInterrupt(false)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lex;

SlotValueOverrideProperty slotValueOverrideProperty_;

var conditionalBranchProperty = new ConditionalBranchProperty {
    Condition = new ConditionProperty {
        ExpressionString = "expressionString"
    },
    Name = "name",
    NextStep = new DialogStateProperty {
        DialogAction = new DialogActionProperty {
            Type = "type",

            // the properties below are optional
            SlotToElicit = "slotToElicit",
            SuppressNextMessage = false
        },
        Intent = new IntentOverrideProperty {
            Name = "name",
            Slots = new [] { new SlotValueOverrideMapProperty {
                SlotName = "slotName",
                SlotValueOverride = new SlotValueOverrideProperty {
                    Shape = "shape",
                    Value = new SlotValueProperty {
                        InterpretedValue = "interpretedValue"
                    },
                    Values = new [] { slotValueOverrideProperty_ }
                }
            } }
        },
        SessionAttributes = new [] { new SessionAttributeProperty {
            Key = "key",

            // the properties below are optional
            Value = "value"
        } }
    },

    // the properties below are optional
    Response = new ResponseSpecificationProperty {
        MessageGroupsList = new [] { new MessageGroupProperty {
            Message = new MessageProperty {
                CustomPayload = new CustomPayloadProperty {
                    Value = "value"
                },
                ImageResponseCard = new ImageResponseCardProperty {
                    Title = "title",

                    // the properties below are optional
                    Buttons = new [] { new ButtonProperty {
                        Text = "text",
                        Value = "value"
                    } },
                    ImageUrl = "imageUrl",
                    Subtitle = "subtitle"
                },
                PlainTextMessage = new PlainTextMessageProperty {
                    Value = "value"
                },
                SsmlMessage = new SSMLMessageProperty {
                    Value = "value"
                }
            },

            // the properties below are optional
            Variations = new [] { new MessageProperty {
                CustomPayload = new CustomPayloadProperty {
                    Value = "value"
                },
                ImageResponseCard = new ImageResponseCardProperty {
                    Title = "title",

                    // the properties below are optional
                    Buttons = new [] { new ButtonProperty {
                        Text = "text",
                        Value = "value"
                    } },
                    ImageUrl = "imageUrl",
                    Subtitle = "subtitle"
                },
                PlainTextMessage = new PlainTextMessageProperty {
                    Value = "value"
                },
                SsmlMessage = new SSMLMessageProperty {
                    Value = "value"
                }
            } }
        } },

        // the properties below are optional
        AllowInterrupt = false
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var slotValueOverrideProperty_ SlotValueOverrideProperty

conditionalBranchProperty := &ConditionalBranchProperty{
	Condition: &ConditionProperty{
		ExpressionString: jsii.String("expressionString"),
	},
	Name: jsii.String("name"),
	NextStep: &DialogStateProperty{
		DialogAction: &DialogActionProperty{
			Type: jsii.String("type"),

			// the properties below are optional
			SlotToElicit: jsii.String("slotToElicit"),
			SuppressNextMessage: jsii.Boolean(false),
		},
		Intent: &IntentOverrideProperty{
			Name: jsii.String("name"),
			Slots: []interface{}{
				&SlotValueOverrideMapProperty{
					SlotName: jsii.String("slotName"),
					SlotValueOverride: &SlotValueOverrideProperty{
						Shape: jsii.String("shape"),
						Value: &SlotValueProperty{
							InterpretedValue: jsii.String("interpretedValue"),
						},
						Values: []interface{}{
							slotValueOverrideProperty_,
						},
					},
				},
			},
		},
		SessionAttributes: []interface{}{
			&SessionAttributeProperty{
				Key: jsii.String("key"),

				// the properties below are optional
				Value: jsii.String("value"),
			},
		},
	},

	// the properties below are optional
	Response: &ResponseSpecificationProperty{
		MessageGroupsList: []interface{}{
			&MessageGroupProperty{
				Message: &MessageProperty{
					CustomPayload: &CustomPayloadProperty{
						Value: jsii.String("value"),
					},
					ImageResponseCard: &ImageResponseCardProperty{
						Title: jsii.String("title"),

						// the properties below are optional
						Buttons: []interface{}{
							&ButtonProperty{
								Text: jsii.String("text"),
								Value: jsii.String("value"),
							},
						},
						ImageUrl: jsii.String("imageUrl"),
						Subtitle: jsii.String("subtitle"),
					},
					PlainTextMessage: &PlainTextMessageProperty{
						Value: jsii.String("value"),
					},
					SsmlMessage: &SSMLMessageProperty{
						Value: jsii.String("value"),
					},
				},

				// the properties below are optional
				Variations: []interface{}{
					&MessageProperty{
						CustomPayload: &CustomPayloadProperty{
							Value: jsii.String("value"),
						},
						ImageResponseCard: &ImageResponseCardProperty{
							Title: jsii.String("title"),

							// the properties below are optional
							Buttons: []interface{}{
								&ButtonProperty{
									Text: jsii.String("text"),
									Value: jsii.String("value"),
								},
							},
							ImageUrl: jsii.String("imageUrl"),
							Subtitle: jsii.String("subtitle"),
						},
						PlainTextMessage: &PlainTextMessageProperty{
							Value: jsii.String("value"),
						},
						SsmlMessage: &SSMLMessageProperty{
							Value: jsii.String("value"),
						},
					},
				},
			},
		},

		// the properties below are optional
		AllowInterrupt: jsii.Boolean(false),
	},
}

Properties ​

conditionIResolvable | CfnBot.ConditionPropertyconditiontyping.Union[IResolvable, ConditionProperty]conditionIResolvableConditionIResolvableConditioninterface{}required#
Contains the expression to evaluate.

If the condition is true, the branch's actions are taken.

namestringnamestrnameStringNamestringName*stringrequired#
The name of the branch.
nextStepIResolvable | CfnBot.DialogStatePropertynext_steptyping.Union[IResolvable, DialogStateProperty]nextStepIResolvableNextStepIResolvableNextStepinterface{}required#
The next step in the conversation.
responseoptionalIResolvable | CfnBot.ResponseSpecificationPropertyresponseoptionaltyping.Union[IResolvable, ResponseSpecificationProperty]responseoptionalIResolvableResponseoptionalIResolvableResponseoptionalinterface{}#
Specifies a list of message groups that Amazon Lex uses to respond the user input.