Struct aws_sdk_lexmodelsv2::model::dialog_state::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for DialogState.
Implementations§
source§impl Builder
impl Builder
sourcepub fn dialog_action(self, input: DialogAction) -> Self
pub fn dialog_action(self, input: DialogAction) -> Self
Defines the action that the bot executes at runtime when the conversation reaches this step.
sourcepub fn set_dialog_action(self, input: Option<DialogAction>) -> Self
pub fn set_dialog_action(self, input: Option<DialogAction>) -> Self
Defines the action that the bot executes at runtime when the conversation reaches this step.
Examples found in repository?
9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804
pub(crate) fn deser_structure_crate_model_dialog_state<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::DialogState>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::dialog_state::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"dialogAction" => {
builder = builder.set_dialog_action(
crate::json_deser::deser_structure_crate_model_dialog_action(
tokens,
)?,
);
}
"intent" => {
builder = builder.set_intent(
crate::json_deser::deser_structure_crate_model_intent_override(
tokens,
)?,
);
}
"sessionAttributes" => {
builder = builder.set_session_attributes(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_string_map(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn intent(self, input: IntentOverride) -> Self
pub fn intent(self, input: IntentOverride) -> Self
Override settings to configure the intent state.
sourcepub fn set_intent(self, input: Option<IntentOverride>) -> Self
pub fn set_intent(self, input: Option<IntentOverride>) -> Self
Override settings to configure the intent state.
Examples found in repository?
9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804
pub(crate) fn deser_structure_crate_model_dialog_state<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::DialogState>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::dialog_state::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"dialogAction" => {
builder = builder.set_dialog_action(
crate::json_deser::deser_structure_crate_model_dialog_action(
tokens,
)?,
);
}
"intent" => {
builder = builder.set_intent(
crate::json_deser::deser_structure_crate_model_intent_override(
tokens,
)?,
);
}
"sessionAttributes" => {
builder = builder.set_session_attributes(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_string_map(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn session_attributes(
self,
k: impl Into<String>,
v: impl Into<String>
) -> Self
pub fn session_attributes(
self,
k: impl Into<String>,
v: impl Into<String>
) -> Self
Adds a key-value pair to session_attributes.
To override the contents of this collection use set_session_attributes.
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex and a client application.
sourcepub fn set_session_attributes(
self,
input: Option<HashMap<String, String>>
) -> Self
pub fn set_session_attributes(
self,
input: Option<HashMap<String, String>>
) -> Self
Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex and a client application.
Examples found in repository?
9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804
pub(crate) fn deser_structure_crate_model_dialog_state<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::DialogState>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::dialog_state::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"dialogAction" => {
builder = builder.set_dialog_action(
crate::json_deser::deser_structure_crate_model_dialog_action(
tokens,
)?,
);
}
"intent" => {
builder = builder.set_intent(
crate::json_deser::deser_structure_crate_model_intent_override(
tokens,
)?,
);
}
"sessionAttributes" => {
builder = builder.set_session_attributes(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_string_map(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn build(self) -> DialogState
pub fn build(self) -> DialogState
Consumes the builder and constructs a DialogState.
Examples found in repository?
9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804
pub(crate) fn deser_structure_crate_model_dialog_state<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::DialogState>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::dialog_state::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"dialogAction" => {
builder = builder.set_dialog_action(
crate::json_deser::deser_structure_crate_model_dialog_action(
tokens,
)?,
);
}
"intent" => {
builder = builder.set_intent(
crate::json_deser::deser_structure_crate_model_intent_override(
tokens,
)?,
);
}
"sessionAttributes" => {
builder = builder.set_session_attributes(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_string_map(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}