aws_sdk_rekognition/operation/search_faces/
_search_faces_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 SearchFacesInput {
6    /// <p>ID of the collection the face belongs to.</p>
7    pub collection_id: ::std::option::Option<::std::string::String>,
8    /// <p>ID of a face to find matches for in the collection.</p>
9    pub face_id: ::std::option::Option<::std::string::String>,
10    /// <p>Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence in the match.</p>
11    pub max_faces: ::std::option::Option<i32>,
12    /// <p>Optional value specifying the minimum confidence in the face match to return. For example, don't return any matches where confidence in matches is less than 70%. The default value is 80%.</p>
13    pub face_match_threshold: ::std::option::Option<f32>,
14}
15impl SearchFacesInput {
16    /// <p>ID of the collection the face belongs to.</p>
17    pub fn collection_id(&self) -> ::std::option::Option<&str> {
18        self.collection_id.as_deref()
19    }
20    /// <p>ID of a face to find matches for in the collection.</p>
21    pub fn face_id(&self) -> ::std::option::Option<&str> {
22        self.face_id.as_deref()
23    }
24    /// <p>Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence in the match.</p>
25    pub fn max_faces(&self) -> ::std::option::Option<i32> {
26        self.max_faces
27    }
28    /// <p>Optional value specifying the minimum confidence in the face match to return. For example, don't return any matches where confidence in matches is less than 70%. The default value is 80%.</p>
29    pub fn face_match_threshold(&self) -> ::std::option::Option<f32> {
30        self.face_match_threshold
31    }
32}
33impl SearchFacesInput {
34    /// Creates a new builder-style object to manufacture [`SearchFacesInput`](crate::operation::search_faces::SearchFacesInput).
35    pub fn builder() -> crate::operation::search_faces::builders::SearchFacesInputBuilder {
36        crate::operation::search_faces::builders::SearchFacesInputBuilder::default()
37    }
38}
39
40/// A builder for [`SearchFacesInput`](crate::operation::search_faces::SearchFacesInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct SearchFacesInputBuilder {
44    pub(crate) collection_id: ::std::option::Option<::std::string::String>,
45    pub(crate) face_id: ::std::option::Option<::std::string::String>,
46    pub(crate) max_faces: ::std::option::Option<i32>,
47    pub(crate) face_match_threshold: ::std::option::Option<f32>,
48}
49impl SearchFacesInputBuilder {
50    /// <p>ID of the collection the face belongs to.</p>
51    /// This field is required.
52    pub fn collection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.collection_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>ID of the collection the face belongs to.</p>
57    pub fn set_collection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.collection_id = input;
59        self
60    }
61    /// <p>ID of the collection the face belongs to.</p>
62    pub fn get_collection_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.collection_id
64    }
65    /// <p>ID of a face to find matches for in the collection.</p>
66    /// This field is required.
67    pub fn face_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.face_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>ID of a face to find matches for in the collection.</p>
72    pub fn set_face_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.face_id = input;
74        self
75    }
76    /// <p>ID of a face to find matches for in the collection.</p>
77    pub fn get_face_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.face_id
79    }
80    /// <p>Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence in the match.</p>
81    pub fn max_faces(mut self, input: i32) -> Self {
82        self.max_faces = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence in the match.</p>
86    pub fn set_max_faces(mut self, input: ::std::option::Option<i32>) -> Self {
87        self.max_faces = input;
88        self
89    }
90    /// <p>Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence in the match.</p>
91    pub fn get_max_faces(&self) -> &::std::option::Option<i32> {
92        &self.max_faces
93    }
94    /// <p>Optional value specifying the minimum confidence in the face match to return. For example, don't return any matches where confidence in matches is less than 70%. The default value is 80%.</p>
95    pub fn face_match_threshold(mut self, input: f32) -> Self {
96        self.face_match_threshold = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>Optional value specifying the minimum confidence in the face match to return. For example, don't return any matches where confidence in matches is less than 70%. The default value is 80%.</p>
100    pub fn set_face_match_threshold(mut self, input: ::std::option::Option<f32>) -> Self {
101        self.face_match_threshold = input;
102        self
103    }
104    /// <p>Optional value specifying the minimum confidence in the face match to return. For example, don't return any matches where confidence in matches is less than 70%. The default value is 80%.</p>
105    pub fn get_face_match_threshold(&self) -> &::std::option::Option<f32> {
106        &self.face_match_threshold
107    }
108    /// Consumes the builder and constructs a [`SearchFacesInput`](crate::operation::search_faces::SearchFacesInput).
109    pub fn build(self) -> ::std::result::Result<crate::operation::search_faces::SearchFacesInput, ::aws_smithy_types::error::operation::BuildError> {
110        ::std::result::Result::Ok(crate::operation::search_faces::SearchFacesInput {
111            collection_id: self.collection_id,
112            face_id: self.face_id,
113            max_faces: self.max_faces,
114            face_match_threshold: self.face_match_threshold,
115        })
116    }
117}