aws_sdk_rekognition/operation/detect_labels/_detect_labels_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 DetectLabelsInput {
6 /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes is not supported. Images stored in an S3 Bucket do not need to be base64-encoded.</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>Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
10 pub max_labels: ::std::option::Option<i32>,
11 /// <p>Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value.</p>
12 /// <p>If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values greater than or equal to 55 percent. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
13 pub min_confidence: ::std::option::Option<f32>,
14 /// <p>A list of the types of analysis to perform. Specifying GENERAL_LABELS uses the label detection feature, while specifying IMAGE_PROPERTIES returns information regarding image color and quality. If no option is specified GENERAL_LABELS is used by default.</p>
15 pub features: ::std::option::Option<::std::vec::Vec<crate::types::DetectLabelsFeatureName>>,
16 /// <p>A list of the filters to be applied to returned detected labels and image properties. Specified filters can be inclusive, exclusive, or a combination of both. Filters can be used for individual labels or label categories. The exact label names or label categories must be supplied. For a full list of labels and label categories, see <a href="https://docs.aws.amazon.com/rekognition/latest/dg/labels.html">Detecting labels</a>.</p>
17 pub settings: ::std::option::Option<crate::types::DetectLabelsSettings>,
18}
19impl DetectLabelsInput {
20 /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes is not supported. Images stored in an S3 Bucket do not need to be base64-encoded.</p>
21 /// <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>
22 pub fn image(&self) -> ::std::option::Option<&crate::types::Image> {
23 self.image.as_ref()
24 }
25 /// <p>Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
26 pub fn max_labels(&self) -> ::std::option::Option<i32> {
27 self.max_labels
28 }
29 /// <p>Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value.</p>
30 /// <p>If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values greater than or equal to 55 percent. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
31 pub fn min_confidence(&self) -> ::std::option::Option<f32> {
32 self.min_confidence
33 }
34 /// <p>A list of the types of analysis to perform. Specifying GENERAL_LABELS uses the label detection feature, while specifying IMAGE_PROPERTIES returns information regarding image color and quality. If no option is specified GENERAL_LABELS is used by default.</p>
35 ///
36 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.features.is_none()`.
37 pub fn features(&self) -> &[crate::types::DetectLabelsFeatureName] {
38 self.features.as_deref().unwrap_or_default()
39 }
40 /// <p>A list of the filters to be applied to returned detected labels and image properties. Specified filters can be inclusive, exclusive, or a combination of both. Filters can be used for individual labels or label categories. The exact label names or label categories must be supplied. For a full list of labels and label categories, see <a href="https://docs.aws.amazon.com/rekognition/latest/dg/labels.html">Detecting labels</a>.</p>
41 pub fn settings(&self) -> ::std::option::Option<&crate::types::DetectLabelsSettings> {
42 self.settings.as_ref()
43 }
44}
45impl DetectLabelsInput {
46 /// Creates a new builder-style object to manufacture [`DetectLabelsInput`](crate::operation::detect_labels::DetectLabelsInput).
47 pub fn builder() -> crate::operation::detect_labels::builders::DetectLabelsInputBuilder {
48 crate::operation::detect_labels::builders::DetectLabelsInputBuilder::default()
49 }
50}
51
52/// A builder for [`DetectLabelsInput`](crate::operation::detect_labels::DetectLabelsInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct DetectLabelsInputBuilder {
56 pub(crate) image: ::std::option::Option<crate::types::Image>,
57 pub(crate) max_labels: ::std::option::Option<i32>,
58 pub(crate) min_confidence: ::std::option::Option<f32>,
59 pub(crate) features: ::std::option::Option<::std::vec::Vec<crate::types::DetectLabelsFeatureName>>,
60 pub(crate) settings: ::std::option::Option<crate::types::DetectLabelsSettings>,
61}
62impl DetectLabelsInputBuilder {
63 /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes is not supported. Images stored in an S3 Bucket do not need to be base64-encoded.</p>
64 /// <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>
65 /// This field is required.
66 pub fn image(mut self, input: crate::types::Image) -> Self {
67 self.image = ::std::option::Option::Some(input);
68 self
69 }
70 /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes is not supported. Images stored in an S3 Bucket do not need to be base64-encoded.</p>
71 /// <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>
72 pub fn set_image(mut self, input: ::std::option::Option<crate::types::Image>) -> Self {
73 self.image = input;
74 self
75 }
76 /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes is not supported. Images stored in an S3 Bucket do not need to be base64-encoded.</p>
77 /// <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>
78 pub fn get_image(&self) -> &::std::option::Option<crate::types::Image> {
79 &self.image
80 }
81 /// <p>Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
82 pub fn max_labels(mut self, input: i32) -> Self {
83 self.max_labels = ::std::option::Option::Some(input);
84 self
85 }
86 /// <p>Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
87 pub fn set_max_labels(mut self, input: ::std::option::Option<i32>) -> Self {
88 self.max_labels = input;
89 self
90 }
91 /// <p>Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
92 pub fn get_max_labels(&self) -> &::std::option::Option<i32> {
93 &self.max_labels
94 }
95 /// <p>Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value.</p>
96 /// <p>If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values greater than or equal to 55 percent. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
97 pub fn min_confidence(mut self, input: f32) -> Self {
98 self.min_confidence = ::std::option::Option::Some(input);
99 self
100 }
101 /// <p>Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value.</p>
102 /// <p>If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values greater than or equal to 55 percent. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
103 pub fn set_min_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
104 self.min_confidence = input;
105 self
106 }
107 /// <p>Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value.</p>
108 /// <p>If <code>MinConfidence</code> is not specified, the operation returns labels with a confidence values greater than or equal to 55 percent. Only valid when GENERAL_LABELS is specified as a feature type in the Feature input parameter.</p>
109 pub fn get_min_confidence(&self) -> &::std::option::Option<f32> {
110 &self.min_confidence
111 }
112 /// Appends an item to `features`.
113 ///
114 /// To override the contents of this collection use [`set_features`](Self::set_features).
115 ///
116 /// <p>A list of the types of analysis to perform. Specifying GENERAL_LABELS uses the label detection feature, while specifying IMAGE_PROPERTIES returns information regarding image color and quality. If no option is specified GENERAL_LABELS is used by default.</p>
117 pub fn features(mut self, input: crate::types::DetectLabelsFeatureName) -> Self {
118 let mut v = self.features.unwrap_or_default();
119 v.push(input);
120 self.features = ::std::option::Option::Some(v);
121 self
122 }
123 /// <p>A list of the types of analysis to perform. Specifying GENERAL_LABELS uses the label detection feature, while specifying IMAGE_PROPERTIES returns information regarding image color and quality. If no option is specified GENERAL_LABELS is used by default.</p>
124 pub fn set_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DetectLabelsFeatureName>>) -> Self {
125 self.features = input;
126 self
127 }
128 /// <p>A list of the types of analysis to perform. Specifying GENERAL_LABELS uses the label detection feature, while specifying IMAGE_PROPERTIES returns information regarding image color and quality. If no option is specified GENERAL_LABELS is used by default.</p>
129 pub fn get_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DetectLabelsFeatureName>> {
130 &self.features
131 }
132 /// <p>A list of the filters to be applied to returned detected labels and image properties. Specified filters can be inclusive, exclusive, or a combination of both. Filters can be used for individual labels or label categories. The exact label names or label categories must be supplied. For a full list of labels and label categories, see <a href="https://docs.aws.amazon.com/rekognition/latest/dg/labels.html">Detecting labels</a>.</p>
133 pub fn settings(mut self, input: crate::types::DetectLabelsSettings) -> Self {
134 self.settings = ::std::option::Option::Some(input);
135 self
136 }
137 /// <p>A list of the filters to be applied to returned detected labels and image properties. Specified filters can be inclusive, exclusive, or a combination of both. Filters can be used for individual labels or label categories. The exact label names or label categories must be supplied. For a full list of labels and label categories, see <a href="https://docs.aws.amazon.com/rekognition/latest/dg/labels.html">Detecting labels</a>.</p>
138 pub fn set_settings(mut self, input: ::std::option::Option<crate::types::DetectLabelsSettings>) -> Self {
139 self.settings = input;
140 self
141 }
142 /// <p>A list of the filters to be applied to returned detected labels and image properties. Specified filters can be inclusive, exclusive, or a combination of both. Filters can be used for individual labels or label categories. The exact label names or label categories must be supplied. For a full list of labels and label categories, see <a href="https://docs.aws.amazon.com/rekognition/latest/dg/labels.html">Detecting labels</a>.</p>
143 pub fn get_settings(&self) -> &::std::option::Option<crate::types::DetectLabelsSettings> {
144 &self.settings
145 }
146 /// Consumes the builder and constructs a [`DetectLabelsInput`](crate::operation::detect_labels::DetectLabelsInput).
147 pub fn build(
148 self,
149 ) -> ::std::result::Result<crate::operation::detect_labels::DetectLabelsInput, ::aws_smithy_types::error::operation::BuildError> {
150 ::std::result::Result::Ok(crate::operation::detect_labels::DetectLabelsInput {
151 image: self.image,
152 max_labels: self.max_labels,
153 min_confidence: self.min_confidence,
154 features: self.features,
155 settings: self.settings,
156 })
157 }
158}