aws_sdk_rekognition/operation/search_users/
_search_users_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 SearchUsersOutput {
6    /// <p>An array of UserMatch objects that matched the input face along with the confidence in the match. Array will be empty if there are no matches.</p>
7    pub user_matches: ::std::option::Option<::std::vec::Vec<crate::types::UserMatch>>,
8    /// <p>Version number of the face detection model associated with the input CollectionId.</p>
9    pub face_model_version: ::std::option::Option<::std::string::String>,
10    /// <p>Contains the ID of a face that was used to search for matches in a collection.</p>
11    pub searched_face: ::std::option::Option<crate::types::SearchedFace>,
12    /// <p>Contains the ID of the UserID that was used to search for matches in a collection.</p>
13    pub searched_user: ::std::option::Option<crate::types::SearchedUser>,
14    _request_id: Option<String>,
15}
16impl SearchUsersOutput {
17    /// <p>An array of UserMatch objects that matched the input face along with the confidence in the match. Array will be empty if there are no matches.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.user_matches.is_none()`.
20    pub fn user_matches(&self) -> &[crate::types::UserMatch] {
21        self.user_matches.as_deref().unwrap_or_default()
22    }
23    /// <p>Version number of the face detection model associated with the input CollectionId.</p>
24    pub fn face_model_version(&self) -> ::std::option::Option<&str> {
25        self.face_model_version.as_deref()
26    }
27    /// <p>Contains the ID of a face that was used to search for matches in a collection.</p>
28    pub fn searched_face(&self) -> ::std::option::Option<&crate::types::SearchedFace> {
29        self.searched_face.as_ref()
30    }
31    /// <p>Contains the ID of the UserID that was used to search for matches in a collection.</p>
32    pub fn searched_user(&self) -> ::std::option::Option<&crate::types::SearchedUser> {
33        self.searched_user.as_ref()
34    }
35}
36impl ::aws_types::request_id::RequestId for SearchUsersOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl SearchUsersOutput {
42    /// Creates a new builder-style object to manufacture [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput).
43    pub fn builder() -> crate::operation::search_users::builders::SearchUsersOutputBuilder {
44        crate::operation::search_users::builders::SearchUsersOutputBuilder::default()
45    }
46}
47
48/// A builder for [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct SearchUsersOutputBuilder {
52    pub(crate) user_matches: ::std::option::Option<::std::vec::Vec<crate::types::UserMatch>>,
53    pub(crate) face_model_version: ::std::option::Option<::std::string::String>,
54    pub(crate) searched_face: ::std::option::Option<crate::types::SearchedFace>,
55    pub(crate) searched_user: ::std::option::Option<crate::types::SearchedUser>,
56    _request_id: Option<String>,
57}
58impl SearchUsersOutputBuilder {
59    /// Appends an item to `user_matches`.
60    ///
61    /// To override the contents of this collection use [`set_user_matches`](Self::set_user_matches).
62    ///
63    /// <p>An array of UserMatch objects that matched the input face along with the confidence in the match. Array will be empty if there are no matches.</p>
64    pub fn user_matches(mut self, input: crate::types::UserMatch) -> Self {
65        let mut v = self.user_matches.unwrap_or_default();
66        v.push(input);
67        self.user_matches = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>An array of UserMatch objects that matched the input face along with the confidence in the match. Array will be empty if there are no matches.</p>
71    pub fn set_user_matches(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserMatch>>) -> Self {
72        self.user_matches = input;
73        self
74    }
75    /// <p>An array of UserMatch objects that matched the input face along with the confidence in the match. Array will be empty if there are no matches.</p>
76    pub fn get_user_matches(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserMatch>> {
77        &self.user_matches
78    }
79    /// <p>Version number of the face detection model associated with the input CollectionId.</p>
80    pub fn face_model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.face_model_version = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>Version number of the face detection model associated with the input CollectionId.</p>
85    pub fn set_face_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.face_model_version = input;
87        self
88    }
89    /// <p>Version number of the face detection model associated with the input CollectionId.</p>
90    pub fn get_face_model_version(&self) -> &::std::option::Option<::std::string::String> {
91        &self.face_model_version
92    }
93    /// <p>Contains the ID of a face that was used to search for matches in a collection.</p>
94    pub fn searched_face(mut self, input: crate::types::SearchedFace) -> Self {
95        self.searched_face = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Contains the ID of a face that was used to search for matches in a collection.</p>
99    pub fn set_searched_face(mut self, input: ::std::option::Option<crate::types::SearchedFace>) -> Self {
100        self.searched_face = input;
101        self
102    }
103    /// <p>Contains the ID of a face that was used to search for matches in a collection.</p>
104    pub fn get_searched_face(&self) -> &::std::option::Option<crate::types::SearchedFace> {
105        &self.searched_face
106    }
107    /// <p>Contains the ID of the UserID that was used to search for matches in a collection.</p>
108    pub fn searched_user(mut self, input: crate::types::SearchedUser) -> Self {
109        self.searched_user = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>Contains the ID of the UserID that was used to search for matches in a collection.</p>
113    pub fn set_searched_user(mut self, input: ::std::option::Option<crate::types::SearchedUser>) -> Self {
114        self.searched_user = input;
115        self
116    }
117    /// <p>Contains the ID of the UserID that was used to search for matches in a collection.</p>
118    pub fn get_searched_user(&self) -> &::std::option::Option<crate::types::SearchedUser> {
119        &self.searched_user
120    }
121    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
122        self._request_id = Some(request_id.into());
123        self
124    }
125
126    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
127        self._request_id = request_id;
128        self
129    }
130    /// Consumes the builder and constructs a [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput).
131    pub fn build(self) -> crate::operation::search_users::SearchUsersOutput {
132        crate::operation::search_users::SearchUsersOutput {
133            user_matches: self.user_matches,
134            face_model_version: self.face_model_version,
135            searched_face: self.searched_face,
136            searched_user: self.searched_user,
137            _request_id: self._request_id,
138        }
139    }
140}