1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object containing information about an intent that Amazon Lex V2 determined might satisfy the user's utterance. The intents are ordered by the confidence score.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Interpretation {
/// <p>Determines the threshold where Amazon Lex V2 will insert the <code>AMAZON.FallbackIntent</code>, <code>AMAZON.KendraSearchIntent</code>, or both when returning alternative intents in a response. <code>AMAZON.FallbackIntent</code> and <code>AMAZON.KendraSearchIntent</code> are only inserted if they are configured for the bot.</p>
pub nlu_confidence: ::std::option::Option<crate::types::ConfidenceScore>,
/// <p>The sentiment expressed in an utterance.</p>
/// <p>When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.</p>
pub sentiment_response: ::std::option::Option<crate::types::SentimentResponse>,
/// <p>A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.</p>
pub intent: ::std::option::Option<crate::types::Intent>,
/// <p>Specifies the service that interpreted the input.</p>
pub interpretation_source: ::std::option::Option<crate::types::InterpretationSource>,
}
impl Interpretation {
/// <p>Determines the threshold where Amazon Lex V2 will insert the <code>AMAZON.FallbackIntent</code>, <code>AMAZON.KendraSearchIntent</code>, or both when returning alternative intents in a response. <code>AMAZON.FallbackIntent</code> and <code>AMAZON.KendraSearchIntent</code> are only inserted if they are configured for the bot.</p>
pub fn nlu_confidence(&self) -> ::std::option::Option<&crate::types::ConfidenceScore> {
self.nlu_confidence.as_ref()
}
/// <p>The sentiment expressed in an utterance.</p>
/// <p>When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.</p>
pub fn sentiment_response(&self) -> ::std::option::Option<&crate::types::SentimentResponse> {
self.sentiment_response.as_ref()
}
/// <p>A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.</p>
pub fn intent(&self) -> ::std::option::Option<&crate::types::Intent> {
self.intent.as_ref()
}
/// <p>Specifies the service that interpreted the input.</p>
pub fn interpretation_source(&self) -> ::std::option::Option<&crate::types::InterpretationSource> {
self.interpretation_source.as_ref()
}
}
impl Interpretation {
/// Creates a new builder-style object to manufacture [`Interpretation`](crate::types::Interpretation).
pub fn builder() -> crate::types::builders::InterpretationBuilder {
crate::types::builders::InterpretationBuilder::default()
}
}
/// A builder for [`Interpretation`](crate::types::Interpretation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InterpretationBuilder {
pub(crate) nlu_confidence: ::std::option::Option<crate::types::ConfidenceScore>,
pub(crate) sentiment_response: ::std::option::Option<crate::types::SentimentResponse>,
pub(crate) intent: ::std::option::Option<crate::types::Intent>,
pub(crate) interpretation_source: ::std::option::Option<crate::types::InterpretationSource>,
}
impl InterpretationBuilder {
/// <p>Determines the threshold where Amazon Lex V2 will insert the <code>AMAZON.FallbackIntent</code>, <code>AMAZON.KendraSearchIntent</code>, or both when returning alternative intents in a response. <code>AMAZON.FallbackIntent</code> and <code>AMAZON.KendraSearchIntent</code> are only inserted if they are configured for the bot.</p>
pub fn nlu_confidence(mut self, input: crate::types::ConfidenceScore) -> Self {
self.nlu_confidence = ::std::option::Option::Some(input);
self
}
/// <p>Determines the threshold where Amazon Lex V2 will insert the <code>AMAZON.FallbackIntent</code>, <code>AMAZON.KendraSearchIntent</code>, or both when returning alternative intents in a response. <code>AMAZON.FallbackIntent</code> and <code>AMAZON.KendraSearchIntent</code> are only inserted if they are configured for the bot.</p>
pub fn set_nlu_confidence(mut self, input: ::std::option::Option<crate::types::ConfidenceScore>) -> Self {
self.nlu_confidence = input;
self
}
/// <p>Determines the threshold where Amazon Lex V2 will insert the <code>AMAZON.FallbackIntent</code>, <code>AMAZON.KendraSearchIntent</code>, or both when returning alternative intents in a response. <code>AMAZON.FallbackIntent</code> and <code>AMAZON.KendraSearchIntent</code> are only inserted if they are configured for the bot.</p>
pub fn get_nlu_confidence(&self) -> &::std::option::Option<crate::types::ConfidenceScore> {
&self.nlu_confidence
}
/// <p>The sentiment expressed in an utterance.</p>
/// <p>When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.</p>
pub fn sentiment_response(mut self, input: crate::types::SentimentResponse) -> Self {
self.sentiment_response = ::std::option::Option::Some(input);
self
}
/// <p>The sentiment expressed in an utterance.</p>
/// <p>When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.</p>
pub fn set_sentiment_response(mut self, input: ::std::option::Option<crate::types::SentimentResponse>) -> Self {
self.sentiment_response = input;
self
}
/// <p>The sentiment expressed in an utterance.</p>
/// <p>When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.</p>
pub fn get_sentiment_response(&self) -> &::std::option::Option<crate::types::SentimentResponse> {
&self.sentiment_response
}
/// <p>A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.</p>
pub fn intent(mut self, input: crate::types::Intent) -> Self {
self.intent = ::std::option::Option::Some(input);
self
}
/// <p>A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.</p>
pub fn set_intent(mut self, input: ::std::option::Option<crate::types::Intent>) -> Self {
self.intent = input;
self
}
/// <p>A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score.</p>
pub fn get_intent(&self) -> &::std::option::Option<crate::types::Intent> {
&self.intent
}
/// <p>Specifies the service that interpreted the input.</p>
pub fn interpretation_source(mut self, input: crate::types::InterpretationSource) -> Self {
self.interpretation_source = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the service that interpreted the input.</p>
pub fn set_interpretation_source(mut self, input: ::std::option::Option<crate::types::InterpretationSource>) -> Self {
self.interpretation_source = input;
self
}
/// <p>Specifies the service that interpreted the input.</p>
pub fn get_interpretation_source(&self) -> &::std::option::Option<crate::types::InterpretationSource> {
&self.interpretation_source
}
/// Consumes the builder and constructs a [`Interpretation`](crate::types::Interpretation).
pub fn build(self) -> crate::types::Interpretation {
crate::types::Interpretation {
nlu_confidence: self.nlu_confidence,
sentiment_response: self.sentiment_response,
intent: self.intent,
interpretation_source: self.interpretation_source,
}
}
}