#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct PredictedIntent {
pub intent_name: ::std::option::Option<::std::string::String>,
pub nlu_intent_confidence: ::std::option::Option<crate::types::IntentConfidence>,
pub slots: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl PredictedIntent {
pub fn intent_name(&self) -> ::std::option::Option<&str> {
self.intent_name.as_deref()
}
pub fn nlu_intent_confidence(&self) -> ::std::option::Option<&crate::types::IntentConfidence> {
self.nlu_intent_confidence.as_ref()
}
pub fn slots(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.slots.as_ref()
}
}
impl ::std::fmt::Debug for PredictedIntent {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("PredictedIntent");
formatter.field("intent_name", &self.intent_name);
formatter.field("nlu_intent_confidence", &self.nlu_intent_confidence);
formatter.field("slots", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl PredictedIntent {
pub fn builder() -> crate::types::builders::PredictedIntentBuilder {
crate::types::builders::PredictedIntentBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct PredictedIntentBuilder {
pub(crate) intent_name: ::std::option::Option<::std::string::String>,
pub(crate) nlu_intent_confidence: ::std::option::Option<crate::types::IntentConfidence>,
pub(crate) slots: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl PredictedIntentBuilder {
pub fn intent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.intent_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_intent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.intent_name = input;
self
}
pub fn get_intent_name(&self) -> &::std::option::Option<::std::string::String> {
&self.intent_name
}
pub fn nlu_intent_confidence(mut self, input: crate::types::IntentConfidence) -> Self {
self.nlu_intent_confidence = ::std::option::Option::Some(input);
self
}
pub fn set_nlu_intent_confidence(mut self, input: ::std::option::Option<crate::types::IntentConfidence>) -> Self {
self.nlu_intent_confidence = input;
self
}
pub fn get_nlu_intent_confidence(&self) -> &::std::option::Option<crate::types::IntentConfidence> {
&self.nlu_intent_confidence
}
pub fn slots(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.slots.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.slots = ::std::option::Option::Some(hash_map);
self
}
pub fn set_slots(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.slots = input;
self
}
pub fn get_slots(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.slots
}
pub fn build(self) -> crate::types::PredictedIntent {
crate::types::PredictedIntent {
intent_name: self.intent_name,
nlu_intent_confidence: self.nlu_intent_confidence,
slots: self.slots,
}
}
}
impl ::std::fmt::Debug for PredictedIntentBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("PredictedIntentBuilder");
formatter.field("intent_name", &self.intent_name);
formatter.field("nlu_intent_confidence", &self.nlu_intent_confidence);
formatter.field("slots", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}