aws_sdk_rekognition/operation/associate_faces/
_associate_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 AssociateFacesInput {
6    /// <p>The ID of an existing collection containing the UserID.</p>
7    pub collection_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID for the existing UserID.</p>
9    pub user_id: ::std::option::Option<::std::string::String>,
10    /// <p>An array of FaceIDs to associate with the UserID.</p>
11    pub face_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>An optional value specifying the minimum confidence in the UserID match to return. The default value is 75.</p>
13    pub user_match_threshold: ::std::option::Option<f32>,
14    /// <p>Idempotent token used to identify the request to <code>AssociateFaces</code>. If you use the same token with multiple <code>AssociateFaces</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
15    pub client_request_token: ::std::option::Option<::std::string::String>,
16}
17impl AssociateFacesInput {
18    /// <p>The ID of an existing collection containing the UserID.</p>
19    pub fn collection_id(&self) -> ::std::option::Option<&str> {
20        self.collection_id.as_deref()
21    }
22    /// <p>The ID for the existing UserID.</p>
23    pub fn user_id(&self) -> ::std::option::Option<&str> {
24        self.user_id.as_deref()
25    }
26    /// <p>An array of FaceIDs to associate with the UserID.</p>
27    ///
28    /// 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_ids.is_none()`.
29    pub fn face_ids(&self) -> &[::std::string::String] {
30        self.face_ids.as_deref().unwrap_or_default()
31    }
32    /// <p>An optional value specifying the minimum confidence in the UserID match to return. The default value is 75.</p>
33    pub fn user_match_threshold(&self) -> ::std::option::Option<f32> {
34        self.user_match_threshold
35    }
36    /// <p>Idempotent token used to identify the request to <code>AssociateFaces</code>. If you use the same token with multiple <code>AssociateFaces</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
37    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
38        self.client_request_token.as_deref()
39    }
40}
41impl AssociateFacesInput {
42    /// Creates a new builder-style object to manufacture [`AssociateFacesInput`](crate::operation::associate_faces::AssociateFacesInput).
43    pub fn builder() -> crate::operation::associate_faces::builders::AssociateFacesInputBuilder {
44        crate::operation::associate_faces::builders::AssociateFacesInputBuilder::default()
45    }
46}
47
48/// A builder for [`AssociateFacesInput`](crate::operation::associate_faces::AssociateFacesInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct AssociateFacesInputBuilder {
52    pub(crate) collection_id: ::std::option::Option<::std::string::String>,
53    pub(crate) user_id: ::std::option::Option<::std::string::String>,
54    pub(crate) face_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
55    pub(crate) user_match_threshold: ::std::option::Option<f32>,
56    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
57}
58impl AssociateFacesInputBuilder {
59    /// <p>The ID of an existing collection containing the UserID.</p>
60    /// This field is required.
61    pub fn collection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.collection_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The ID of an existing collection containing the UserID.</p>
66    pub fn set_collection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.collection_id = input;
68        self
69    }
70    /// <p>The ID of an existing collection containing the UserID.</p>
71    pub fn get_collection_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.collection_id
73    }
74    /// <p>The ID for the existing UserID.</p>
75    /// This field is required.
76    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.user_id = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The ID for the existing UserID.</p>
81    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.user_id = input;
83        self
84    }
85    /// <p>The ID for the existing UserID.</p>
86    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.user_id
88    }
89    /// Appends an item to `face_ids`.
90    ///
91    /// To override the contents of this collection use [`set_face_ids`](Self::set_face_ids).
92    ///
93    /// <p>An array of FaceIDs to associate with the UserID.</p>
94    pub fn face_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        let mut v = self.face_ids.unwrap_or_default();
96        v.push(input.into());
97        self.face_ids = ::std::option::Option::Some(v);
98        self
99    }
100    /// <p>An array of FaceIDs to associate with the UserID.</p>
101    pub fn set_face_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
102        self.face_ids = input;
103        self
104    }
105    /// <p>An array of FaceIDs to associate with the UserID.</p>
106    pub fn get_face_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
107        &self.face_ids
108    }
109    /// <p>An optional value specifying the minimum confidence in the UserID match to return. The default value is 75.</p>
110    pub fn user_match_threshold(mut self, input: f32) -> Self {
111        self.user_match_threshold = ::std::option::Option::Some(input);
112        self
113    }
114    /// <p>An optional value specifying the minimum confidence in the UserID match to return. The default value is 75.</p>
115    pub fn set_user_match_threshold(mut self, input: ::std::option::Option<f32>) -> Self {
116        self.user_match_threshold = input;
117        self
118    }
119    /// <p>An optional value specifying the minimum confidence in the UserID match to return. The default value is 75.</p>
120    pub fn get_user_match_threshold(&self) -> &::std::option::Option<f32> {
121        &self.user_match_threshold
122    }
123    /// <p>Idempotent token used to identify the request to <code>AssociateFaces</code>. If you use the same token with multiple <code>AssociateFaces</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
124    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.client_request_token = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>Idempotent token used to identify the request to <code>AssociateFaces</code>. If you use the same token with multiple <code>AssociateFaces</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
129    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.client_request_token = input;
131        self
132    }
133    /// <p>Idempotent token used to identify the request to <code>AssociateFaces</code>. If you use the same token with multiple <code>AssociateFaces</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
134    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
135        &self.client_request_token
136    }
137    /// Consumes the builder and constructs a [`AssociateFacesInput`](crate::operation::associate_faces::AssociateFacesInput).
138    pub fn build(
139        self,
140    ) -> ::std::result::Result<crate::operation::associate_faces::AssociateFacesInput, ::aws_smithy_types::error::operation::BuildError> {
141        ::std::result::Result::Ok(crate::operation::associate_faces::AssociateFacesInput {
142            collection_id: self.collection_id,
143            user_id: self.user_id,
144            face_ids: self.face_ids,
145            user_match_threshold: self.user_match_threshold,
146            client_request_token: self.client_request_token,
147        })
148    }
149}