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