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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object used to store information about the Value or Label detected by Amazon Textract.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExpenseDetection {
/// <p>The word or line of text recognized by Amazon Textract</p>
pub text: ::std::option::Option<::std::string::String>,
/// <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 in detection, as a percentage</p>
pub confidence: ::std::option::Option<f32>,
}
impl ExpenseDetection {
/// <p>The word or line of text recognized by Amazon Textract</p>
pub fn text(&self) -> ::std::option::Option<&str> {
self.text.as_deref()
}
/// <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 in detection, as a percentage</p>
pub fn confidence(&self) -> ::std::option::Option<f32> {
self.confidence
}
}
impl ExpenseDetection {
/// Creates a new builder-style object to manufacture [`ExpenseDetection`](crate::types::ExpenseDetection).
pub fn builder() -> crate::types::builders::ExpenseDetectionBuilder {
crate::types::builders::ExpenseDetectionBuilder::default()
}
}
/// A builder for [`ExpenseDetection`](crate::types::ExpenseDetection).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExpenseDetectionBuilder {
pub(crate) text: ::std::option::Option<::std::string::String>,
pub(crate) geometry: ::std::option::Option<crate::types::Geometry>,
pub(crate) confidence: ::std::option::Option<f32>,
}
impl ExpenseDetectionBuilder {
/// <p>The word or line of text recognized by Amazon Textract</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 word or line of text recognized by Amazon Textract</p>
pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.text = input;
self
}
/// <p>The word or line of text recognized by Amazon Textract</p>
pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
&self.text
}
/// <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 in detection, as a percentage</p>
pub fn confidence(mut self, input: f32) -> Self {
self.confidence = ::std::option::Option::Some(input);
self
}
/// <p>The confidence in detection, as a percentage</p>
pub fn set_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
self.confidence = input;
self
}
/// <p>The confidence in detection, as a percentage</p>
pub fn get_confidence(&self) -> &::std::option::Option<f32> {
&self.confidence
}
/// Consumes the builder and constructs a [`ExpenseDetection`](crate::types::ExpenseDetection).
pub fn build(self) -> crate::types::ExpenseDetection {
crate::types::ExpenseDetection {
text: self.text,
geometry: self.geometry,
confidence: self.confidence,
}
}
}