// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The results extracted for a lending document.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct LendingDetection {
/// <p>The text extracted for a detected value in a lending document.</p>
pub text: ::std::option::Option<::std::string::String>,
/// <p>The selection status of a selection element, such as an option button or check box.</p>
pub selection_status: ::std::option::Option<crate::types::SelectionStatus>,
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub geometry: ::std::option::Option<crate::types::Geometry>,
/// <p>The confidence level for the text of a detected value in a lending document.</p>
pub confidence: ::std::option::Option<f32>,
}
impl LendingDetection {
/// <p>The text extracted for a detected value in a lending document.</p>
pub fn text(&self) -> ::std::option::Option<&str> {
self.text.as_deref()
}
/// <p>The selection status of a selection element, such as an option button or check box.</p>
pub fn selection_status(&self) -> ::std::option::Option<&crate::types::SelectionStatus> {
self.selection_status.as_ref()
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn geometry(&self) -> ::std::option::Option<&crate::types::Geometry> {
self.geometry.as_ref()
}
/// <p>The confidence level for the text of a detected value in a lending document.</p>
pub fn confidence(&self) -> ::std::option::Option<f32> {
self.confidence
}
}
impl LendingDetection {
/// Creates a new builder-style object to manufacture [`LendingDetection`](crate::types::LendingDetection).
pub fn builder() -> crate::types::builders::LendingDetectionBuilder {
crate::types::builders::LendingDetectionBuilder::default()
}
}
/// A builder for [`LendingDetection`](crate::types::LendingDetection).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct LendingDetectionBuilder {
pub(crate) text: ::std::option::Option<::std::string::String>,
pub(crate) selection_status: ::std::option::Option<crate::types::SelectionStatus>,
pub(crate) geometry: ::std::option::Option<crate::types::Geometry>,
pub(crate) confidence: ::std::option::Option<f32>,
}
impl LendingDetectionBuilder {
/// <p>The text extracted for a detected value in a lending document.</p>
pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.text = ::std::option::Option::Some(input.into());
self
}
/// <p>The text extracted for a detected value in a lending document.</p>
pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.text = input;
self
}
/// <p>The text extracted for a detected value in a lending document.</p>
pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
&self.text
}
/// <p>The selection status of a selection element, such as an option button or check box.</p>
pub fn selection_status(mut self, input: crate::types::SelectionStatus) -> Self {
self.selection_status = ::std::option::Option::Some(input);
self
}
/// <p>The selection status of a selection element, such as an option button or check box.</p>
pub fn set_selection_status(mut self, input: ::std::option::Option<crate::types::SelectionStatus>) -> Self {
self.selection_status = input;
self
}
/// <p>The selection status of a selection element, such as an option button or check box.</p>
pub fn get_selection_status(&self) -> &::std::option::Option<crate::types::SelectionStatus> {
&self.selection_status
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn geometry(mut self, input: crate::types::Geometry) -> Self {
self.geometry = ::std::option::Option::Some(input);
self
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn set_geometry(mut self, input: ::std::option::Option<crate::types::Geometry>) -> Self {
self.geometry = input;
self
}
/// <p>Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.</p>
pub fn get_geometry(&self) -> &::std::option::Option<crate::types::Geometry> {
&self.geometry
}
/// <p>The confidence level for the text of a detected value in a lending document.</p>
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = ::std::option::Option::Some(input);
self
}
/// <p>The confidence level for the text of a detected value in a lending document.</p>
pub fn set_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
/// <p>The confidence level for the text of a detected value in a lending document.</p>
pub fn get_confidence(&self) -> &::std::option::Option<f32> {
&self.confidence
}
/// Consumes the builder and constructs a [`LendingDetection`](crate::types::LendingDetection).
pub fn build(self) -> crate::types::LendingDetection {
crate::types::LendingDetection {
text: self.text,
selection_status: self.selection_status,
geometry: self.geometry,
confidence: self.confidence,
}
}
}