Struct aws_sdk_lexmodelsv2::model::prompt_specification::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for PromptSpecification.
Implementations§
source§impl Builder
impl Builder
sourcepub fn message_groups(self, input: MessageGroup) -> Self
pub fn message_groups(self, input: MessageGroup) -> Self
Appends an item to message_groups.
To override the contents of this collection use set_message_groups.
A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
sourcepub fn set_message_groups(self, input: Option<Vec<MessageGroup>>) -> Self
pub fn set_message_groups(self, input: Option<Vec<MessageGroup>>) -> Self
A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
Examples found in repository?
9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082
pub(crate) fn deser_structure_crate_model_prompt_specification<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PromptSpecification>,
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::prompt_specification::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() {
"messageGroups" => {
builder = builder.set_message_groups(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_groups_list(tokens)?
);
}
"maxRetries" => {
builder = builder.set_max_retries(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"allowInterrupt" => {
builder = builder.set_allow_interrupt(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"messageSelectionStrategy" => {
builder = builder.set_message_selection_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::MessageSelectionStrategy::from(u.as_ref())
})
})
.transpose()?,
);
}
"promptAttemptsSpecification" => {
builder = builder.set_prompt_attempts_specification(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_prompt_attempts_specification_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 max_retries(self, input: i32) -> Self
pub fn max_retries(self, input: i32) -> Self
The maximum number of times the bot tries to elicit a response from the user using this prompt.
sourcepub fn set_max_retries(self, input: Option<i32>) -> Self
pub fn set_max_retries(self, input: Option<i32>) -> Self
The maximum number of times the bot tries to elicit a response from the user using this prompt.
Examples found in repository?
9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082
pub(crate) fn deser_structure_crate_model_prompt_specification<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PromptSpecification>,
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::prompt_specification::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() {
"messageGroups" => {
builder = builder.set_message_groups(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_groups_list(tokens)?
);
}
"maxRetries" => {
builder = builder.set_max_retries(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"allowInterrupt" => {
builder = builder.set_allow_interrupt(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"messageSelectionStrategy" => {
builder = builder.set_message_selection_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::MessageSelectionStrategy::from(u.as_ref())
})
})
.transpose()?,
);
}
"promptAttemptsSpecification" => {
builder = builder.set_prompt_attempts_specification(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_prompt_attempts_specification_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 allow_interrupt(self, input: bool) -> Self
pub fn allow_interrupt(self, input: bool) -> Self
Indicates whether the user can interrupt a speech prompt from the bot.
sourcepub fn set_allow_interrupt(self, input: Option<bool>) -> Self
pub fn set_allow_interrupt(self, input: Option<bool>) -> Self
Indicates whether the user can interrupt a speech prompt from the bot.
Examples found in repository?
9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082
pub(crate) fn deser_structure_crate_model_prompt_specification<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PromptSpecification>,
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::prompt_specification::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() {
"messageGroups" => {
builder = builder.set_message_groups(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_groups_list(tokens)?
);
}
"maxRetries" => {
builder = builder.set_max_retries(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"allowInterrupt" => {
builder = builder.set_allow_interrupt(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"messageSelectionStrategy" => {
builder = builder.set_message_selection_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::MessageSelectionStrategy::from(u.as_ref())
})
})
.transpose()?,
);
}
"promptAttemptsSpecification" => {
builder = builder.set_prompt_attempts_specification(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_prompt_attempts_specification_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 message_selection_strategy(self, input: MessageSelectionStrategy) -> Self
pub fn message_selection_strategy(self, input: MessageSelectionStrategy) -> Self
Indicates how a message is selected from a message group among retries.
sourcepub fn set_message_selection_strategy(
self,
input: Option<MessageSelectionStrategy>
) -> Self
pub fn set_message_selection_strategy(
self,
input: Option<MessageSelectionStrategy>
) -> Self
Indicates how a message is selected from a message group among retries.
Examples found in repository?
9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082
pub(crate) fn deser_structure_crate_model_prompt_specification<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PromptSpecification>,
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::prompt_specification::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() {
"messageGroups" => {
builder = builder.set_message_groups(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_groups_list(tokens)?
);
}
"maxRetries" => {
builder = builder.set_max_retries(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"allowInterrupt" => {
builder = builder.set_allow_interrupt(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"messageSelectionStrategy" => {
builder = builder.set_message_selection_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::MessageSelectionStrategy::from(u.as_ref())
})
})
.transpose()?,
);
}
"promptAttemptsSpecification" => {
builder = builder.set_prompt_attempts_specification(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_prompt_attempts_specification_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 prompt_attempts_specification(
self,
k: PromptAttempt,
v: PromptAttemptSpecification
) -> Self
pub fn prompt_attempts_specification(
self,
k: PromptAttempt,
v: PromptAttemptSpecification
) -> Self
Adds a key-value pair to prompt_attempts_specification.
To override the contents of this collection use set_prompt_attempts_specification.
Specifies the advanced settings on each attempt of the prompt.
sourcepub fn set_prompt_attempts_specification(
self,
input: Option<HashMap<PromptAttempt, PromptAttemptSpecification>>
) -> Self
pub fn set_prompt_attempts_specification(
self,
input: Option<HashMap<PromptAttempt, PromptAttemptSpecification>>
) -> Self
Specifies the advanced settings on each attempt of the prompt.
Examples found in repository?
9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082
pub(crate) fn deser_structure_crate_model_prompt_specification<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PromptSpecification>,
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::prompt_specification::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() {
"messageGroups" => {
builder = builder.set_message_groups(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_groups_list(tokens)?
);
}
"maxRetries" => {
builder = builder.set_max_retries(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"allowInterrupt" => {
builder = builder.set_allow_interrupt(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"messageSelectionStrategy" => {
builder = builder.set_message_selection_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::MessageSelectionStrategy::from(u.as_ref())
})
})
.transpose()?,
);
}
"promptAttemptsSpecification" => {
builder = builder.set_prompt_attempts_specification(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_prompt_attempts_specification_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) -> PromptSpecification
pub fn build(self) -> PromptSpecification
Consumes the builder and constructs a PromptSpecification.
Examples found in repository?
9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082
pub(crate) fn deser_structure_crate_model_prompt_specification<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::PromptSpecification>,
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::prompt_specification::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() {
"messageGroups" => {
builder = builder.set_message_groups(
crate::json_deser::deser_list_com_amazonaws_lexmodelsv2_message_groups_list(tokens)?
);
}
"maxRetries" => {
builder = builder.set_max_retries(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"allowInterrupt" => {
builder = builder.set_allow_interrupt(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"messageSelectionStrategy" => {
builder = builder.set_message_selection_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::MessageSelectionStrategy::from(u.as_ref())
})
})
.transpose()?,
);
}
"promptAttemptsSpecification" => {
builder = builder.set_prompt_attempts_specification(
crate::json_deser::deser_map_com_amazonaws_lexmodelsv2_prompt_attempts_specification_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",
),
),
}
}