aws_sdk_rekognition/operation/detect_text/
_detect_text_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DetectTextInput {
6    /// <p>The input image as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Rekognition operations, you can't pass image bytes.</p>
7    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
8    pub image: ::std::option::Option<crate::types::Image>,
9    /// <p>Optional parameters that let you set the criteria that the text must meet to be included in your response.</p>
10    pub filters: ::std::option::Option<crate::types::DetectTextFilters>,
11}
12impl DetectTextInput {
13    /// <p>The input image as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Rekognition operations, you can't pass image bytes.</p>
14    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
15    pub fn image(&self) -> ::std::option::Option<&crate::types::Image> {
16        self.image.as_ref()
17    }
18    /// <p>Optional parameters that let you set the criteria that the text must meet to be included in your response.</p>
19    pub fn filters(&self) -> ::std::option::Option<&crate::types::DetectTextFilters> {
20        self.filters.as_ref()
21    }
22}
23impl DetectTextInput {
24    /// Creates a new builder-style object to manufacture [`DetectTextInput`](crate::operation::detect_text::DetectTextInput).
25    pub fn builder() -> crate::operation::detect_text::builders::DetectTextInputBuilder {
26        crate::operation::detect_text::builders::DetectTextInputBuilder::default()
27    }
28}
29
30/// A builder for [`DetectTextInput`](crate::operation::detect_text::DetectTextInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct DetectTextInputBuilder {
34    pub(crate) image: ::std::option::Option<crate::types::Image>,
35    pub(crate) filters: ::std::option::Option<crate::types::DetectTextFilters>,
36}
37impl DetectTextInputBuilder {
38    /// <p>The input image as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Rekognition operations, you can't pass image bytes.</p>
39    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
40    /// This field is required.
41    pub fn image(mut self, input: crate::types::Image) -> Self {
42        self.image = ::std::option::Option::Some(input);
43        self
44    }
45    /// <p>The input image as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Rekognition operations, you can't pass image bytes.</p>
46    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
47    pub fn set_image(mut self, input: ::std::option::Option<crate::types::Image>) -> Self {
48        self.image = input;
49        self
50    }
51    /// <p>The input image as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Rekognition operations, you can't pass image bytes.</p>
52    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
53    pub fn get_image(&self) -> &::std::option::Option<crate::types::Image> {
54        &self.image
55    }
56    /// <p>Optional parameters that let you set the criteria that the text must meet to be included in your response.</p>
57    pub fn filters(mut self, input: crate::types::DetectTextFilters) -> Self {
58        self.filters = ::std::option::Option::Some(input);
59        self
60    }
61    /// <p>Optional parameters that let you set the criteria that the text must meet to be included in your response.</p>
62    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::DetectTextFilters>) -> Self {
63        self.filters = input;
64        self
65    }
66    /// <p>Optional parameters that let you set the criteria that the text must meet to be included in your response.</p>
67    pub fn get_filters(&self) -> &::std::option::Option<crate::types::DetectTextFilters> {
68        &self.filters
69    }
70    /// Consumes the builder and constructs a [`DetectTextInput`](crate::operation::detect_text::DetectTextInput).
71    pub fn build(self) -> ::std::result::Result<crate::operation::detect_text::DetectTextInput, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::operation::detect_text::DetectTextInput {
73            image: self.image,
74            filters: self.filters,
75        })
76    }
77}