aws-sdk-textract 1.29.0

AWS SDK for Amazon Textract
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An object used to store information about the Type detected by Amazon Textract.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExpenseType {
    /// <p>The word or line of text detected by Amazon Textract.</p>
    pub text: ::std::option::Option<::std::string::String>,
    /// <p>The confidence of accuracy, as a percentage.</p>
    pub confidence: ::std::option::Option<f32>,
}
impl ExpenseType {
    /// <p>The word or line of text detected by Amazon Textract.</p>
    pub fn text(&self) -> ::std::option::Option<&str> {
        self.text.as_deref()
    }
    /// <p>The confidence of accuracy, as a percentage.</p>
    pub fn confidence(&self) -> ::std::option::Option<f32> {
        self.confidence
    }
}
impl ExpenseType {
    /// Creates a new builder-style object to manufacture [`ExpenseType`](crate::types::ExpenseType).
    pub fn builder() -> crate::types::builders::ExpenseTypeBuilder {
        crate::types::builders::ExpenseTypeBuilder::default()
    }
}

/// A builder for [`ExpenseType`](crate::types::ExpenseType).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ExpenseTypeBuilder {
    pub(crate) text: ::std::option::Option<::std::string::String>,
    pub(crate) confidence: ::std::option::Option<f32>,
}
impl ExpenseTypeBuilder {
    /// <p>The word or line of text detected 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 detected 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 detected by Amazon Textract.</p>
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.text
    }
    /// <p>The confidence of accuracy, as a percentage.</p>
    pub fn confidence(mut self, input: f32) -> Self {
        self.confidence = ::std::option::Option::Some(input);
        self
    }
    /// <p>The confidence of accuracy, as a percentage.</p>
    pub fn set_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
        self.confidence = input;
        self
    }
    /// <p>The confidence of accuracy, as a percentage.</p>
    pub fn get_confidence(&self) -> &::std::option::Option<f32> {
        &self.confidence
    }
    /// Consumes the builder and constructs a [`ExpenseType`](crate::types::ExpenseType).
    pub fn build(self) -> crate::types::ExpenseType {
        crate::types::ExpenseType {
            text: self.text,
            confidence: self.confidence,
        }
    }
}