Struct aws_sdk_lexmodelsv2::model::message_group::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for MessageGroup.
Implementations§
source§impl Builder
impl Builder
sourcepub fn message(self, input: Message) -> Self
pub fn message(self, input: Message) -> Self
The primary message that Amazon Lex should send to the user.
sourcepub fn set_message(self, input: Option<Message>) -> Self
pub fn set_message(self, input: Option<Message>) -> Self
The primary message that Amazon Lex should send to the user.
Examples found in repository?
src/json_deser.rs (lines 14502-14504)
14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532
pub(crate) fn deser_structure_crate_model_message_group<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::MessageGroup>, 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::message_group::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() {
"message" => {
builder = builder.set_message(
crate::json_deser::deser_structure_crate_model_message(tokens)?,
);
}
"variations" => {
builder = builder.set_variations(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_variations_list(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 variations(self, input: Message) -> Self
pub fn variations(self, input: Message) -> Self
Appends an item to variations.
To override the contents of this collection use set_variations.
Message variations to send to the user. When variations are defined, Amazon Lex chooses the primary message or one of the variations to send to the user.
sourcepub fn set_variations(self, input: Option<Vec<Message>>) -> Self
pub fn set_variations(self, input: Option<Vec<Message>>) -> Self
Message variations to send to the user. When variations are defined, Amazon Lex chooses the primary message or one of the variations to send to the user.
Examples found in repository?
src/json_deser.rs (lines 14507-14509)
14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532
pub(crate) fn deser_structure_crate_model_message_group<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::MessageGroup>, 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::message_group::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() {
"message" => {
builder = builder.set_message(
crate::json_deser::deser_structure_crate_model_message(tokens)?,
);
}
"variations" => {
builder = builder.set_variations(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_variations_list(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) -> MessageGroup
pub fn build(self) -> MessageGroup
Consumes the builder and constructs a MessageGroup.
Examples found in repository?
src/json_deser.rs (line 14524)
14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532
pub(crate) fn deser_structure_crate_model_message_group<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::MessageGroup>, 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::message_group::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() {
"message" => {
builder = builder.set_message(
crate::json_deser::deser_structure_crate_model_message(tokens)?,
);
}
"variations" => {
builder = builder.set_variations(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_variations_list(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",
),
),
}
}