#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AnalyzeIdDetections {
pub text: ::std::string::String,
pub normalized_value: ::std::option::Option<crate::types::NormalizedValue>,
pub confidence: ::std::option::Option<f32>,
}
impl AnalyzeIdDetections {
pub fn text(&self) -> &str {
use std::ops::Deref;
self.text.deref()
}
pub fn normalized_value(&self) -> ::std::option::Option<&crate::types::NormalizedValue> {
self.normalized_value.as_ref()
}
pub fn confidence(&self) -> ::std::option::Option<f32> {
self.confidence
}
}
impl AnalyzeIdDetections {
pub fn builder() -> crate::types::builders::AnalyzeIdDetectionsBuilder {
crate::types::builders::AnalyzeIdDetectionsBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AnalyzeIdDetectionsBuilder {
pub(crate) text: ::std::option::Option<::std::string::String>,
pub(crate) normalized_value: ::std::option::Option<crate::types::NormalizedValue>,
pub(crate) confidence: ::std::option::Option<f32>,
}
impl AnalyzeIdDetectionsBuilder {
pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.text = ::std::option::Option::Some(input.into());
self
}
pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.text = input;
self
}
pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
&self.text
}
pub fn normalized_value(mut self, input: crate::types::NormalizedValue) -> Self {
self.normalized_value = ::std::option::Option::Some(input);
self
}
pub fn set_normalized_value(mut self, input: ::std::option::Option<crate::types::NormalizedValue>) -> Self {
self.normalized_value = input;
self
}
pub fn get_normalized_value(&self) -> &::std::option::Option<crate::types::NormalizedValue> {
&self.normalized_value
}
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = ::std::option::Option::Some(input);
self
}
pub fn set_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
pub fn get_confidence(&self) -> &::std::option::Option<f32> {
&self.confidence
}
pub fn build(self) -> ::std::result::Result<crate::types::AnalyzeIdDetections, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::AnalyzeIdDetections {
text: self.text.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"text",
"text was not specified but it is required when building AnalyzeIdDetections",
)
})?,
normalized_value: self.normalized_value,
confidence: self.confidence,
})
}
}