aws_sdk_rekognition/operation/detect_labels/
_detect_labels_output.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 DetectLabelsOutput {
6    /// <p>An array of labels for the real-world objects detected.</p>
7    pub labels: ::std::option::Option<::std::vec::Vec<crate::types::Label>>,
8    /// <p>The value of <code>OrientationCorrection</code> is always null.</p>
9    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
10    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
11    pub orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
12    /// <p>Version number of the label detection model that was used to detect labels.</p>
13    pub label_model_version: ::std::option::Option<::std::string::String>,
14    /// <p>Information about the properties of the input image, such as brightness, sharpness, contrast, and dominant colors.</p>
15    pub image_properties: ::std::option::Option<crate::types::DetectLabelsImageProperties>,
16    _request_id: Option<String>,
17}
18impl DetectLabelsOutput {
19    /// <p>An array of labels for the real-world objects detected.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.labels.is_none()`.
22    pub fn labels(&self) -> &[crate::types::Label] {
23        self.labels.as_deref().unwrap_or_default()
24    }
25    /// <p>The value of <code>OrientationCorrection</code> is always null.</p>
26    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
27    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
28    pub fn orientation_correction(&self) -> ::std::option::Option<&crate::types::OrientationCorrection> {
29        self.orientation_correction.as_ref()
30    }
31    /// <p>Version number of the label detection model that was used to detect labels.</p>
32    pub fn label_model_version(&self) -> ::std::option::Option<&str> {
33        self.label_model_version.as_deref()
34    }
35    /// <p>Information about the properties of the input image, such as brightness, sharpness, contrast, and dominant colors.</p>
36    pub fn image_properties(&self) -> ::std::option::Option<&crate::types::DetectLabelsImageProperties> {
37        self.image_properties.as_ref()
38    }
39}
40impl ::aws_types::request_id::RequestId for DetectLabelsOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl DetectLabelsOutput {
46    /// Creates a new builder-style object to manufacture [`DetectLabelsOutput`](crate::operation::detect_labels::DetectLabelsOutput).
47    pub fn builder() -> crate::operation::detect_labels::builders::DetectLabelsOutputBuilder {
48        crate::operation::detect_labels::builders::DetectLabelsOutputBuilder::default()
49    }
50}
51
52/// A builder for [`DetectLabelsOutput`](crate::operation::detect_labels::DetectLabelsOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct DetectLabelsOutputBuilder {
56    pub(crate) labels: ::std::option::Option<::std::vec::Vec<crate::types::Label>>,
57    pub(crate) orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
58    pub(crate) label_model_version: ::std::option::Option<::std::string::String>,
59    pub(crate) image_properties: ::std::option::Option<crate::types::DetectLabelsImageProperties>,
60    _request_id: Option<String>,
61}
62impl DetectLabelsOutputBuilder {
63    /// Appends an item to `labels`.
64    ///
65    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
66    ///
67    /// <p>An array of labels for the real-world objects detected.</p>
68    pub fn labels(mut self, input: crate::types::Label) -> Self {
69        let mut v = self.labels.unwrap_or_default();
70        v.push(input);
71        self.labels = ::std::option::Option::Some(v);
72        self
73    }
74    /// <p>An array of labels for the real-world objects detected.</p>
75    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Label>>) -> Self {
76        self.labels = input;
77        self
78    }
79    /// <p>An array of labels for the real-world objects detected.</p>
80    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Label>> {
81        &self.labels
82    }
83    /// <p>The value of <code>OrientationCorrection</code> is always null.</p>
84    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
85    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
86    pub fn orientation_correction(mut self, input: crate::types::OrientationCorrection) -> Self {
87        self.orientation_correction = ::std::option::Option::Some(input);
88        self
89    }
90    /// <p>The value of <code>OrientationCorrection</code> is always null.</p>
91    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
92    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
93    pub fn set_orientation_correction(mut self, input: ::std::option::Option<crate::types::OrientationCorrection>) -> Self {
94        self.orientation_correction = input;
95        self
96    }
97    /// <p>The value of <code>OrientationCorrection</code> is always null.</p>
98    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
99    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
100    pub fn get_orientation_correction(&self) -> &::std::option::Option<crate::types::OrientationCorrection> {
101        &self.orientation_correction
102    }
103    /// <p>Version number of the label detection model that was used to detect labels.</p>
104    pub fn label_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.label_model_version = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>Version number of the label detection model that was used to detect labels.</p>
109    pub fn set_label_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.label_model_version = input;
111        self
112    }
113    /// <p>Version number of the label detection model that was used to detect labels.</p>
114    pub fn get_label_model_version(&self) -> &::std::option::Option<::std::string::String> {
115        &self.label_model_version
116    }
117    /// <p>Information about the properties of the input image, such as brightness, sharpness, contrast, and dominant colors.</p>
118    pub fn image_properties(mut self, input: crate::types::DetectLabelsImageProperties) -> Self {
119        self.image_properties = ::std::option::Option::Some(input);
120        self
121    }
122    /// <p>Information about the properties of the input image, such as brightness, sharpness, contrast, and dominant colors.</p>
123    pub fn set_image_properties(mut self, input: ::std::option::Option<crate::types::DetectLabelsImageProperties>) -> Self {
124        self.image_properties = input;
125        self
126    }
127    /// <p>Information about the properties of the input image, such as brightness, sharpness, contrast, and dominant colors.</p>
128    pub fn get_image_properties(&self) -> &::std::option::Option<crate::types::DetectLabelsImageProperties> {
129        &self.image_properties
130    }
131    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
132        self._request_id = Some(request_id.into());
133        self
134    }
135
136    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
137        self._request_id = request_id;
138        self
139    }
140    /// Consumes the builder and constructs a [`DetectLabelsOutput`](crate::operation::detect_labels::DetectLabelsOutput).
141    pub fn build(self) -> crate::operation::detect_labels::DetectLabelsOutput {
142        crate::operation::detect_labels::DetectLabelsOutput {
143            labels: self.labels,
144            orientation_correction: self.orientation_correction,
145            label_model_version: self.label_model_version,
146            image_properties: self.image_properties,
147            _request_id: self._request_id,
148        }
149    }
150}