aws_sdk_rekognition/operation/index_faces/
_index_faces_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 IndexFacesOutput {
6    /// <p>An array of faces detected and added to the collection. For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.</p>
7    pub face_records: ::std::option::Option<::std::vec::Vec<crate::types::FaceRecord>>,
8    /// <p>If your collection is associated with a face detection model that's later than version 3.0, the value of <code>OrientationCorrection</code> is always null and no orientation information is returned.</p>
9    /// <p>If your collection is associated with a face detection model that's version 3.0 or earlier, the following applies:</p>
10    /// <ul>
11    /// <li>
12    /// <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. The value of <code>OrientationCorrection</code> is null.</p></li>
13    /// <li>
14    /// <p>If the image doesn't contain orientation information in its Exif metadata, Amazon Rekognition returns an estimated orientation (ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270). Amazon Rekognition doesn’t perform image correction for images. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p></li>
15    /// </ul>
16    /// <p>Bounding box information is returned in the <code>FaceRecords</code> array. You can get the version of the face detection model by calling <code>DescribeCollection</code>.</p>
17    pub orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
18    /// <p>The version number of the face detection model that's associated with the input collection (<code>CollectionId</code>).</p>
19    pub face_model_version: ::std::option::Option<::std::string::String>,
20    /// <p>An array of faces that were detected in the image but weren't indexed. They weren't indexed because the quality filter identified them as low quality, or the <code>MaxFaces</code> request parameter filtered them out. To use the quality filter, you specify the <code>QualityFilter</code> request parameter.</p>
21    pub unindexed_faces: ::std::option::Option<::std::vec::Vec<crate::types::UnindexedFace>>,
22    _request_id: Option<String>,
23}
24impl IndexFacesOutput {
25    /// <p>An array of faces detected and added to the collection. For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.face_records.is_none()`.
28    pub fn face_records(&self) -> &[crate::types::FaceRecord] {
29        self.face_records.as_deref().unwrap_or_default()
30    }
31    /// <p>If your collection is associated with a face detection model that's later than version 3.0, the value of <code>OrientationCorrection</code> is always null and no orientation information is returned.</p>
32    /// <p>If your collection is associated with a face detection model that's version 3.0 or earlier, the following applies:</p>
33    /// <ul>
34    /// <li>
35    /// <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. The value of <code>OrientationCorrection</code> is null.</p></li>
36    /// <li>
37    /// <p>If the image doesn't contain orientation information in its Exif metadata, Amazon Rekognition returns an estimated orientation (ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270). Amazon Rekognition doesn’t perform image correction for images. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p></li>
38    /// </ul>
39    /// <p>Bounding box information is returned in the <code>FaceRecords</code> array. You can get the version of the face detection model by calling <code>DescribeCollection</code>.</p>
40    pub fn orientation_correction(&self) -> ::std::option::Option<&crate::types::OrientationCorrection> {
41        self.orientation_correction.as_ref()
42    }
43    /// <p>The version number of the face detection model that's associated with the input collection (<code>CollectionId</code>).</p>
44    pub fn face_model_version(&self) -> ::std::option::Option<&str> {
45        self.face_model_version.as_deref()
46    }
47    /// <p>An array of faces that were detected in the image but weren't indexed. They weren't indexed because the quality filter identified them as low quality, or the <code>MaxFaces</code> request parameter filtered them out. To use the quality filter, you specify the <code>QualityFilter</code> request parameter.</p>
48    ///
49    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.unindexed_faces.is_none()`.
50    pub fn unindexed_faces(&self) -> &[crate::types::UnindexedFace] {
51        self.unindexed_faces.as_deref().unwrap_or_default()
52    }
53}
54impl ::aws_types::request_id::RequestId for IndexFacesOutput {
55    fn request_id(&self) -> Option<&str> {
56        self._request_id.as_deref()
57    }
58}
59impl IndexFacesOutput {
60    /// Creates a new builder-style object to manufacture [`IndexFacesOutput`](crate::operation::index_faces::IndexFacesOutput).
61    pub fn builder() -> crate::operation::index_faces::builders::IndexFacesOutputBuilder {
62        crate::operation::index_faces::builders::IndexFacesOutputBuilder::default()
63    }
64}
65
66/// A builder for [`IndexFacesOutput`](crate::operation::index_faces::IndexFacesOutput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct IndexFacesOutputBuilder {
70    pub(crate) face_records: ::std::option::Option<::std::vec::Vec<crate::types::FaceRecord>>,
71    pub(crate) orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
72    pub(crate) face_model_version: ::std::option::Option<::std::string::String>,
73    pub(crate) unindexed_faces: ::std::option::Option<::std::vec::Vec<crate::types::UnindexedFace>>,
74    _request_id: Option<String>,
75}
76impl IndexFacesOutputBuilder {
77    /// Appends an item to `face_records`.
78    ///
79    /// To override the contents of this collection use [`set_face_records`](Self::set_face_records).
80    ///
81    /// <p>An array of faces detected and added to the collection. For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.</p>
82    pub fn face_records(mut self, input: crate::types::FaceRecord) -> Self {
83        let mut v = self.face_records.unwrap_or_default();
84        v.push(input);
85        self.face_records = ::std::option::Option::Some(v);
86        self
87    }
88    /// <p>An array of faces detected and added to the collection. For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.</p>
89    pub fn set_face_records(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FaceRecord>>) -> Self {
90        self.face_records = input;
91        self
92    }
93    /// <p>An array of faces detected and added to the collection. For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.</p>
94    pub fn get_face_records(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FaceRecord>> {
95        &self.face_records
96    }
97    /// <p>If your collection is associated with a face detection model that's later than version 3.0, the value of <code>OrientationCorrection</code> is always null and no orientation information is returned.</p>
98    /// <p>If your collection is associated with a face detection model that's version 3.0 or earlier, the following applies:</p>
99    /// <ul>
100    /// <li>
101    /// <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. The value of <code>OrientationCorrection</code> is null.</p></li>
102    /// <li>
103    /// <p>If the image doesn't contain orientation information in its Exif metadata, Amazon Rekognition returns an estimated orientation (ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270). Amazon Rekognition doesn’t perform image correction for images. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p></li>
104    /// </ul>
105    /// <p>Bounding box information is returned in the <code>FaceRecords</code> array. You can get the version of the face detection model by calling <code>DescribeCollection</code>.</p>
106    pub fn orientation_correction(mut self, input: crate::types::OrientationCorrection) -> Self {
107        self.orientation_correction = ::std::option::Option::Some(input);
108        self
109    }
110    /// <p>If your collection is associated with a face detection model that's later than version 3.0, the value of <code>OrientationCorrection</code> is always null and no orientation information is returned.</p>
111    /// <p>If your collection is associated with a face detection model that's version 3.0 or earlier, the following applies:</p>
112    /// <ul>
113    /// <li>
114    /// <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. The value of <code>OrientationCorrection</code> is null.</p></li>
115    /// <li>
116    /// <p>If the image doesn't contain orientation information in its Exif metadata, Amazon Rekognition returns an estimated orientation (ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270). Amazon Rekognition doesn’t perform image correction for images. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p></li>
117    /// </ul>
118    /// <p>Bounding box information is returned in the <code>FaceRecords</code> array. You can get the version of the face detection model by calling <code>DescribeCollection</code>.</p>
119    pub fn set_orientation_correction(mut self, input: ::std::option::Option<crate::types::OrientationCorrection>) -> Self {
120        self.orientation_correction = input;
121        self
122    }
123    /// <p>If your collection is associated with a face detection model that's later than version 3.0, the value of <code>OrientationCorrection</code> is always null and no orientation information is returned.</p>
124    /// <p>If your collection is associated with a face detection model that's version 3.0 or earlier, the following applies:</p>
125    /// <ul>
126    /// <li>
127    /// <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. The value of <code>OrientationCorrection</code> is null.</p></li>
128    /// <li>
129    /// <p>If the image doesn't contain orientation information in its Exif metadata, Amazon Rekognition returns an estimated orientation (ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270). Amazon Rekognition doesn’t perform image correction for images. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p></li>
130    /// </ul>
131    /// <p>Bounding box information is returned in the <code>FaceRecords</code> array. You can get the version of the face detection model by calling <code>DescribeCollection</code>.</p>
132    pub fn get_orientation_correction(&self) -> &::std::option::Option<crate::types::OrientationCorrection> {
133        &self.orientation_correction
134    }
135    /// <p>The version number of the face detection model that's associated with the input collection (<code>CollectionId</code>).</p>
136    pub fn face_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.face_model_version = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>The version number of the face detection model that's associated with the input collection (<code>CollectionId</code>).</p>
141    pub fn set_face_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.face_model_version = input;
143        self
144    }
145    /// <p>The version number of the face detection model that's associated with the input collection (<code>CollectionId</code>).</p>
146    pub fn get_face_model_version(&self) -> &::std::option::Option<::std::string::String> {
147        &self.face_model_version
148    }
149    /// Appends an item to `unindexed_faces`.
150    ///
151    /// To override the contents of this collection use [`set_unindexed_faces`](Self::set_unindexed_faces).
152    ///
153    /// <p>An array of faces that were detected in the image but weren't indexed. They weren't indexed because the quality filter identified them as low quality, or the <code>MaxFaces</code> request parameter filtered them out. To use the quality filter, you specify the <code>QualityFilter</code> request parameter.</p>
154    pub fn unindexed_faces(mut self, input: crate::types::UnindexedFace) -> Self {
155        let mut v = self.unindexed_faces.unwrap_or_default();
156        v.push(input);
157        self.unindexed_faces = ::std::option::Option::Some(v);
158        self
159    }
160    /// <p>An array of faces that were detected in the image but weren't indexed. They weren't indexed because the quality filter identified them as low quality, or the <code>MaxFaces</code> request parameter filtered them out. To use the quality filter, you specify the <code>QualityFilter</code> request parameter.</p>
161    pub fn set_unindexed_faces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UnindexedFace>>) -> Self {
162        self.unindexed_faces = input;
163        self
164    }
165    /// <p>An array of faces that were detected in the image but weren't indexed. They weren't indexed because the quality filter identified them as low quality, or the <code>MaxFaces</code> request parameter filtered them out. To use the quality filter, you specify the <code>QualityFilter</code> request parameter.</p>
166    pub fn get_unindexed_faces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UnindexedFace>> {
167        &self.unindexed_faces
168    }
169    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
170        self._request_id = Some(request_id.into());
171        self
172    }
173
174    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
175        self._request_id = request_id;
176        self
177    }
178    /// Consumes the builder and constructs a [`IndexFacesOutput`](crate::operation::index_faces::IndexFacesOutput).
179    pub fn build(self) -> crate::operation::index_faces::IndexFacesOutput {
180        crate::operation::index_faces::IndexFacesOutput {
181            face_records: self.face_records,
182            orientation_correction: self.orientation_correction,
183            face_model_version: self.face_model_version,
184            unindexed_faces: self.unindexed_faces,
185            _request_id: self._request_id,
186        }
187    }
188}