Struct aws_sdk_lexmodelsv2::model::message::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for Message.
Implementations§
source§impl Builder
impl Builder
sourcepub fn plain_text_message(self, input: PlainTextMessage) -> Self
pub fn plain_text_message(self, input: PlainTextMessage) -> Self
A message in plain text format.
sourcepub fn set_plain_text_message(self, input: Option<PlainTextMessage>) -> Self
pub fn set_plain_text_message(self, input: Option<PlainTextMessage>) -> Self
A message in plain text format.
Examples found in repository?
src/json_deser.rs (lines 15114-15116)
15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158
pub(crate) fn deser_structure_crate_model_message<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Message>, 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::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() {
"plainTextMessage" => {
builder = builder.set_plain_text_message(
crate::json_deser::deser_structure_crate_model_plain_text_message(tokens)?
);
}
"customPayload" => {
builder = builder.set_custom_payload(
crate::json_deser::deser_structure_crate_model_custom_payload(
tokens,
)?,
);
}
"ssmlMessage" => {
builder = builder.set_ssml_message(
crate::json_deser::deser_structure_crate_model_ssml_message(
tokens,
)?,
);
}
"imageResponseCard" => {
builder = builder.set_image_response_card(
crate::json_deser::deser_structure_crate_model_image_response_card(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 custom_payload(self, input: CustomPayload) -> Self
pub fn custom_payload(self, input: CustomPayload) -> Self
A message in a custom format defined by the client application.
sourcepub fn set_custom_payload(self, input: Option<CustomPayload>) -> Self
pub fn set_custom_payload(self, input: Option<CustomPayload>) -> Self
A message in a custom format defined by the client application.
Examples found in repository?
src/json_deser.rs (lines 15119-15123)
15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158
pub(crate) fn deser_structure_crate_model_message<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Message>, 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::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() {
"plainTextMessage" => {
builder = builder.set_plain_text_message(
crate::json_deser::deser_structure_crate_model_plain_text_message(tokens)?
);
}
"customPayload" => {
builder = builder.set_custom_payload(
crate::json_deser::deser_structure_crate_model_custom_payload(
tokens,
)?,
);
}
"ssmlMessage" => {
builder = builder.set_ssml_message(
crate::json_deser::deser_structure_crate_model_ssml_message(
tokens,
)?,
);
}
"imageResponseCard" => {
builder = builder.set_image_response_card(
crate::json_deser::deser_structure_crate_model_image_response_card(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 ssml_message(self, input: SsmlMessage) -> Self
pub fn ssml_message(self, input: SsmlMessage) -> Self
A message in Speech Synthesis Markup Language (SSML).
sourcepub fn set_ssml_message(self, input: Option<SsmlMessage>) -> Self
pub fn set_ssml_message(self, input: Option<SsmlMessage>) -> Self
A message in Speech Synthesis Markup Language (SSML).
Examples found in repository?
src/json_deser.rs (lines 15126-15130)
15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158
pub(crate) fn deser_structure_crate_model_message<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Message>, 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::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() {
"plainTextMessage" => {
builder = builder.set_plain_text_message(
crate::json_deser::deser_structure_crate_model_plain_text_message(tokens)?
);
}
"customPayload" => {
builder = builder.set_custom_payload(
crate::json_deser::deser_structure_crate_model_custom_payload(
tokens,
)?,
);
}
"ssmlMessage" => {
builder = builder.set_ssml_message(
crate::json_deser::deser_structure_crate_model_ssml_message(
tokens,
)?,
);
}
"imageResponseCard" => {
builder = builder.set_image_response_card(
crate::json_deser::deser_structure_crate_model_image_response_card(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 image_response_card(self, input: ImageResponseCard) -> Self
pub fn image_response_card(self, input: ImageResponseCard) -> Self
A message that defines a response card that the client application can show to the user.
sourcepub fn set_image_response_card(self, input: Option<ImageResponseCard>) -> Self
pub fn set_image_response_card(self, input: Option<ImageResponseCard>) -> Self
A message that defines a response card that the client application can show to the user.
Examples found in repository?
src/json_deser.rs (lines 15133-15135)
15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158
pub(crate) fn deser_structure_crate_model_message<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Message>, 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::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() {
"plainTextMessage" => {
builder = builder.set_plain_text_message(
crate::json_deser::deser_structure_crate_model_plain_text_message(tokens)?
);
}
"customPayload" => {
builder = builder.set_custom_payload(
crate::json_deser::deser_structure_crate_model_custom_payload(
tokens,
)?,
);
}
"ssmlMessage" => {
builder = builder.set_ssml_message(
crate::json_deser::deser_structure_crate_model_ssml_message(
tokens,
)?,
);
}
"imageResponseCard" => {
builder = builder.set_image_response_card(
crate::json_deser::deser_structure_crate_model_image_response_card(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) -> Message
pub fn build(self) -> Message
Consumes the builder and constructs a Message.
Examples found in repository?
src/json_deser.rs (line 15150)
15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158
pub(crate) fn deser_structure_crate_model_message<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Message>, 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::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() {
"plainTextMessage" => {
builder = builder.set_plain_text_message(
crate::json_deser::deser_structure_crate_model_plain_text_message(tokens)?
);
}
"customPayload" => {
builder = builder.set_custom_payload(
crate::json_deser::deser_structure_crate_model_custom_payload(
tokens,
)?,
);
}
"ssmlMessage" => {
builder = builder.set_ssml_message(
crate::json_deser::deser_structure_crate_model_ssml_message(
tokens,
)?,
);
}
"imageResponseCard" => {
builder = builder.set_image_response_card(
crate::json_deser::deser_structure_crate_model_image_response_card(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",
),
),
}
}