Skip to main content

aws_sdk_rekognition/types/
_face.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the face properties such as the bounding box, face ID, image ID of the input image, and external image ID that you assigned.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Face {
7    /// <p>Unique identifier that Amazon Rekognition assigns to the face.</p>
8    pub face_id: ::std::option::Option<::std::string::String>,
9    /// <p>Bounding box of the face.</p>
10    pub bounding_box: ::std::option::Option<crate::types::BoundingBox>,
11    /// <p>Unique identifier that Amazon Rekognition assigns to the input image.</p>
12    pub image_id: ::std::option::Option<::std::string::String>,
13    /// <p>Identifier that you assign to all the faces in the input image.</p>
14    pub external_image_id: ::std::option::Option<::std::string::String>,
15    /// <p>Confidence level that the bounding box contains a face (and not a different object such as a tree).</p>
16    pub confidence: ::std::option::Option<f32>,
17    /// <p>The version of the face detect and storage model that was used when indexing the face vector.</p>
18    pub index_faces_model_version: ::std::option::Option<::std::string::String>,
19    /// <p>Unique identifier assigned to the user.</p>
20    pub user_id: ::std::option::Option<::std::string::String>,
21}
22impl Face {
23    /// <p>Unique identifier that Amazon Rekognition assigns to the face.</p>
24    pub fn face_id(&self) -> ::std::option::Option<&str> {
25        self.face_id.as_deref()
26    }
27    /// <p>Bounding box of the face.</p>
28    pub fn bounding_box(&self) -> ::std::option::Option<&crate::types::BoundingBox> {
29        self.bounding_box.as_ref()
30    }
31    /// <p>Unique identifier that Amazon Rekognition assigns to the input image.</p>
32    pub fn image_id(&self) -> ::std::option::Option<&str> {
33        self.image_id.as_deref()
34    }
35    /// <p>Identifier that you assign to all the faces in the input image.</p>
36    pub fn external_image_id(&self) -> ::std::option::Option<&str> {
37        self.external_image_id.as_deref()
38    }
39    /// <p>Confidence level that the bounding box contains a face (and not a different object such as a tree).</p>
40    pub fn confidence(&self) -> ::std::option::Option<f32> {
41        self.confidence
42    }
43    /// <p>The version of the face detect and storage model that was used when indexing the face vector.</p>
44    pub fn index_faces_model_version(&self) -> ::std::option::Option<&str> {
45        self.index_faces_model_version.as_deref()
46    }
47    /// <p>Unique identifier assigned to the user.</p>
48    pub fn user_id(&self) -> ::std::option::Option<&str> {
49        self.user_id.as_deref()
50    }
51}
52impl Face {
53    /// Creates a new builder-style object to manufacture [`Face`](crate::types::Face).
54    pub fn builder() -> crate::types::builders::FaceBuilder {
55        crate::types::builders::FaceBuilder::default()
56    }
57}
58
59/// A builder for [`Face`](crate::types::Face).
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
61#[non_exhaustive]
62pub struct FaceBuilder {
63    pub(crate) face_id: ::std::option::Option<::std::string::String>,
64    pub(crate) bounding_box: ::std::option::Option<crate::types::BoundingBox>,
65    pub(crate) image_id: ::std::option::Option<::std::string::String>,
66    pub(crate) external_image_id: ::std::option::Option<::std::string::String>,
67    pub(crate) confidence: ::std::option::Option<f32>,
68    pub(crate) index_faces_model_version: ::std::option::Option<::std::string::String>,
69    pub(crate) user_id: ::std::option::Option<::std::string::String>,
70}
71impl FaceBuilder {
72    /// <p>Unique identifier that Amazon Rekognition assigns to the face.</p>
73    pub fn face_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.face_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>Unique identifier that Amazon Rekognition assigns to the face.</p>
78    pub fn set_face_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.face_id = input;
80        self
81    }
82    /// <p>Unique identifier that Amazon Rekognition assigns to the face.</p>
83    pub fn get_face_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.face_id
85    }
86    /// <p>Bounding box of the face.</p>
87    pub fn bounding_box(mut self, input: crate::types::BoundingBox) -> Self {
88        self.bounding_box = ::std::option::Option::Some(input);
89        self
90    }
91    /// <p>Bounding box of the face.</p>
92    pub fn set_bounding_box(mut self, input: ::std::option::Option<crate::types::BoundingBox>) -> Self {
93        self.bounding_box = input;
94        self
95    }
96    /// <p>Bounding box of the face.</p>
97    pub fn get_bounding_box(&self) -> &::std::option::Option<crate::types::BoundingBox> {
98        &self.bounding_box
99    }
100    /// <p>Unique identifier that Amazon Rekognition assigns to the input image.</p>
101    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.image_id = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>Unique identifier that Amazon Rekognition assigns to the input image.</p>
106    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.image_id = input;
108        self
109    }
110    /// <p>Unique identifier that Amazon Rekognition assigns to the input image.</p>
111    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
112        &self.image_id
113    }
114    /// <p>Identifier that you assign to all the faces in the input image.</p>
115    pub fn external_image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.external_image_id = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>Identifier that you assign to all the faces in the input image.</p>
120    pub fn set_external_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.external_image_id = input;
122        self
123    }
124    /// <p>Identifier that you assign to all the faces in the input image.</p>
125    pub fn get_external_image_id(&self) -> &::std::option::Option<::std::string::String> {
126        &self.external_image_id
127    }
128    /// <p>Confidence level that the bounding box contains a face (and not a different object such as a tree).</p>
129    pub fn confidence(mut self, input: f32) -> Self {
130        self.confidence = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>Confidence level that the bounding box contains a face (and not a different object such as a tree).</p>
134    pub fn set_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
135        self.confidence = input;
136        self
137    }
138    /// <p>Confidence level that the bounding box contains a face (and not a different object such as a tree).</p>
139    pub fn get_confidence(&self) -> &::std::option::Option<f32> {
140        &self.confidence
141    }
142    /// <p>The version of the face detect and storage model that was used when indexing the face vector.</p>
143    pub fn index_faces_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.index_faces_model_version = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The version of the face detect and storage model that was used when indexing the face vector.</p>
148    pub fn set_index_faces_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.index_faces_model_version = input;
150        self
151    }
152    /// <p>The version of the face detect and storage model that was used when indexing the face vector.</p>
153    pub fn get_index_faces_model_version(&self) -> &::std::option::Option<::std::string::String> {
154        &self.index_faces_model_version
155    }
156    /// <p>Unique identifier assigned to the user.</p>
157    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.user_id = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>Unique identifier assigned to the user.</p>
162    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.user_id = input;
164        self
165    }
166    /// <p>Unique identifier assigned to the user.</p>
167    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
168        &self.user_id
169    }
170    /// Consumes the builder and constructs a [`Face`](crate::types::Face).
171    pub fn build(self) -> crate::types::Face {
172        crate::types::Face {
173            face_id: self.face_id,
174            bounding_box: self.bounding_box,
175            image_id: self.image_id,
176            external_image_id: self.external_image_id,
177            confidence: self.confidence,
178            index_faces_model_version: self.index_faces_model_version,
179            user_id: self.user_id,
180        }
181    }
182}