aws-sdk-lexruntimev2 1.93.0

AWS SDK for Amazon Lex Runtime V2
Documentation
// 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,
        }
    }
}