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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Breakdown of detected information, seperated into the catagories Type, LabelDetection, and ValueDetection</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExpenseField {
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub r#type: ::std::option::Option<crate::types::ExpenseType>,
/// <p>The explicitly stated label of a detected element.</p>
pub label_detection: ::std::option::Option<crate::types::ExpenseDetection>,
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub value_detection: ::std::option::Option<crate::types::ExpenseDetection>,
/// <p>The page number the value was detected on.</p>
pub page_number: ::std::option::Option<i32>,
/// <p>Shows the kind of currency, both the code and confidence associated with any monatary value detected.</p>
pub currency: ::std::option::Option<crate::types::ExpenseCurrency>,
/// <p>Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.</p>
pub group_properties: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseGroupProperty>>,
}
impl ExpenseField {
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::ExpenseType> {
self.r#type.as_ref()
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn label_detection(&self) -> ::std::option::Option<&crate::types::ExpenseDetection> {
self.label_detection.as_ref()
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn value_detection(&self) -> ::std::option::Option<&crate::types::ExpenseDetection> {
self.value_detection.as_ref()
}
/// <p>The page number the value was detected on.</p>
pub fn page_number(&self) -> ::std::option::Option<i32> {
self.page_number
}
/// <p>Shows the kind of currency, both the code and confidence associated with any monatary value detected.</p>
pub fn currency(&self) -> ::std::option::Option<&crate::types::ExpenseCurrency> {
self.currency.as_ref()
}
/// <p>Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.group_properties.is_none()`.
pub fn group_properties(&self) -> &[crate::types::ExpenseGroupProperty] {
self.group_properties.as_deref().unwrap_or_default()
}
}
impl ExpenseField {
/// Creates a new builder-style object to manufacture [`ExpenseField`](crate::types::ExpenseField).
pub fn builder() -> crate::types::builders::ExpenseFieldBuilder {
crate::types::builders::ExpenseFieldBuilder::default()
}
}
/// A builder for [`ExpenseField`](crate::types::ExpenseField).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ExpenseFieldBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::ExpenseType>,
pub(crate) label_detection: ::std::option::Option<crate::types::ExpenseDetection>,
pub(crate) value_detection: ::std::option::Option<crate::types::ExpenseDetection>,
pub(crate) page_number: ::std::option::Option<i32>,
pub(crate) currency: ::std::option::Option<crate::types::ExpenseCurrency>,
pub(crate) group_properties: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseGroupProperty>>,
}
impl ExpenseFieldBuilder {
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn r#type(mut self, input: crate::types::ExpenseType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::ExpenseType>) -> Self {
self.r#type = input;
self
}
/// <p>The implied label of a detected element. Present alongside LabelDetection for explicit elements.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::ExpenseType> {
&self.r#type
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn label_detection(mut self, input: crate::types::ExpenseDetection) -> Self {
self.label_detection = ::std::option::Option::Some(input);
self
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn set_label_detection(mut self, input: ::std::option::Option<crate::types::ExpenseDetection>) -> Self {
self.label_detection = input;
self
}
/// <p>The explicitly stated label of a detected element.</p>
pub fn get_label_detection(&self) -> &::std::option::Option<crate::types::ExpenseDetection> {
&self.label_detection
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn value_detection(mut self, input: crate::types::ExpenseDetection) -> Self {
self.value_detection = ::std::option::Option::Some(input);
self
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn set_value_detection(mut self, input: ::std::option::Option<crate::types::ExpenseDetection>) -> Self {
self.value_detection = input;
self
}
/// <p>The value of a detected element. Present in explicit and implicit elements.</p>
pub fn get_value_detection(&self) -> &::std::option::Option<crate::types::ExpenseDetection> {
&self.value_detection
}
/// <p>The page number the value was detected on.</p>
pub fn page_number(mut self, input: i32) -> Self {
self.page_number = ::std::option::Option::Some(input);
self
}
/// <p>The page number the value was detected on.</p>
pub fn set_page_number(mut self, input: ::std::option::Option<i32>) -> Self {
self.page_number = input;
self
}
/// <p>The page number the value was detected on.</p>
pub fn get_page_number(&self) -> &::std::option::Option<i32> {
&self.page_number
}
/// <p>Shows the kind of currency, both the code and confidence associated with any monatary value detected.</p>
pub fn currency(mut self, input: crate::types::ExpenseCurrency) -> Self {
self.currency = ::std::option::Option::Some(input);
self
}
/// <p>Shows the kind of currency, both the code and confidence associated with any monatary value detected.</p>
pub fn set_currency(mut self, input: ::std::option::Option<crate::types::ExpenseCurrency>) -> Self {
self.currency = input;
self
}
/// <p>Shows the kind of currency, both the code and confidence associated with any monatary value detected.</p>
pub fn get_currency(&self) -> &::std::option::Option<crate::types::ExpenseCurrency> {
&self.currency
}
/// Appends an item to `group_properties`.
///
/// To override the contents of this collection use [`set_group_properties`](Self::set_group_properties).
///
/// <p>Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.</p>
pub fn group_properties(mut self, input: crate::types::ExpenseGroupProperty) -> Self {
let mut v = self.group_properties.unwrap_or_default();
v.push(input);
self.group_properties = ::std::option::Option::Some(v);
self
}
/// <p>Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.</p>
pub fn set_group_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExpenseGroupProperty>>) -> Self {
self.group_properties = input;
self
}
/// <p>Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.</p>
pub fn get_group_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExpenseGroupProperty>> {
&self.group_properties
}
/// Consumes the builder and constructs a [`ExpenseField`](crate::types::ExpenseField).
pub fn build(self) -> crate::types::ExpenseField {
crate::types::ExpenseField {
r#type: self.r#type,
label_detection: self.label_detection,
value_detection: self.value_detection,
page_number: self.page_number,
currency: self.currency,
group_properties: self.group_properties,
}
}
}