Struct aws_sdk_lexruntime::model::predicted_intent::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for PredictedIntent
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn intent_name(self, input: impl Into<String>) -> Self
pub fn intent_name(self, input: impl Into<String>) -> Self
The name of the intent that Amazon Lex suggests satisfies the user's intent.
sourcepub fn set_intent_name(self, input: Option<String>) -> Self
pub fn set_intent_name(self, input: Option<String>) -> Self
The name of the intent that Amazon Lex suggests satisfies the user's intent.
Examples found in repository?
src/json_deser.rs (lines 1558-1564)
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
pub(crate) fn deser_structure_crate_model_predicted_intent<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PredictedIntent>,
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::predicted_intent::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() {
"intentName" => {
builder = builder.set_intent_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"nluIntentConfidence" => {
builder = builder.set_nlu_intent_confidence(
crate::json_deser::deser_structure_crate_model_intent_confidence(tokens)?
);
}
"slots" => {
builder = builder.set_slots(
crate::json_deser::deser_map_com_amazonaws_lexruntimeservice_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 nlu_intent_confidence(self, input: IntentConfidence) -> Self
pub fn nlu_intent_confidence(self, input: IntentConfidence) -> Self
Indicates how confident Amazon Lex is that an intent satisfies the user's intent.
sourcepub fn set_nlu_intent_confidence(self, input: Option<IntentConfidence>) -> Self
pub fn set_nlu_intent_confidence(self, input: Option<IntentConfidence>) -> Self
Indicates how confident Amazon Lex is that an intent satisfies the user's intent.
Examples found in repository?
src/json_deser.rs (lines 1567-1569)
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
pub(crate) fn deser_structure_crate_model_predicted_intent<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PredictedIntent>,
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::predicted_intent::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() {
"intentName" => {
builder = builder.set_intent_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"nluIntentConfidence" => {
builder = builder.set_nlu_intent_confidence(
crate::json_deser::deser_structure_crate_model_intent_confidence(tokens)?
);
}
"slots" => {
builder = builder.set_slots(
crate::json_deser::deser_map_com_amazonaws_lexruntimeservice_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 slots(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn slots(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to slots
.
To override the contents of this collection use set_slots
.
The slot and slot values associated with the predicted intent.
sourcepub fn set_slots(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_slots(self, input: Option<HashMap<String, String>>) -> Self
The slot and slot values associated with the predicted intent.
Examples found in repository?
src/json_deser.rs (lines 1572-1574)
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
pub(crate) fn deser_structure_crate_model_predicted_intent<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PredictedIntent>,
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::predicted_intent::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() {
"intentName" => {
builder = builder.set_intent_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"nluIntentConfidence" => {
builder = builder.set_nlu_intent_confidence(
crate::json_deser::deser_structure_crate_model_intent_confidence(tokens)?
);
}
"slots" => {
builder = builder.set_slots(
crate::json_deser::deser_map_com_amazonaws_lexruntimeservice_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) -> PredictedIntent
pub fn build(self) -> PredictedIntent
Consumes the builder and constructs a PredictedIntent
.
Examples found in repository?
src/json_deser.rs (line 1589)
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
pub(crate) fn deser_structure_crate_model_predicted_intent<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PredictedIntent>,
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::predicted_intent::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() {
"intentName" => {
builder = builder.set_intent_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"nluIntentConfidence" => {
builder = builder.set_nlu_intent_confidence(
crate::json_deser::deser_structure_crate_model_intent_confidence(tokens)?
);
}
"slots" => {
builder = builder.set_slots(
crate::json_deser::deser_map_com_amazonaws_lexruntimeservice_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",
),
),
}
}