aws_sdk_rekognition/operation/create_user/_create_user_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 CreateUserInput {
6 /// <p>The ID of an existing collection to which the new UserID needs to be created.</p>
7 pub collection_id: ::std::option::Option<::std::string::String>,
8 /// <p>ID for the UserID to be created. This ID needs to be unique within the collection.</p>
9 pub user_id: ::std::option::Option<::std::string::String>,
10 /// <p>Idempotent token used to identify the request to <code>CreateUser</code>. If you use the same token with multiple <code>CreateUser</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}
13impl CreateUserInput {
14 /// <p>The ID of an existing collection to which the new UserID needs to be created.</p>
15 pub fn collection_id(&self) -> ::std::option::Option<&str> {
16 self.collection_id.as_deref()
17 }
18 /// <p>ID for the UserID to be created. This ID needs to be unique within the collection.</p>
19 pub fn user_id(&self) -> ::std::option::Option<&str> {
20 self.user_id.as_deref()
21 }
22 /// <p>Idempotent token used to identify the request to <code>CreateUser</code>. If you use the same token with multiple <code>CreateUser</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
23 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
24 self.client_request_token.as_deref()
25 }
26}
27impl CreateUserInput {
28 /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
29 pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
30 crate::operation::create_user::builders::CreateUserInputBuilder::default()
31 }
32}
33
34/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateUserInputBuilder {
38 pub(crate) collection_id: ::std::option::Option<::std::string::String>,
39 pub(crate) user_id: ::std::option::Option<::std::string::String>,
40 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
41}
42impl CreateUserInputBuilder {
43 /// <p>The ID of an existing collection to which the new UserID needs to be created.</p>
44 /// This field is required.
45 pub fn collection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.collection_id = ::std::option::Option::Some(input.into());
47 self
48 }
49 /// <p>The ID of an existing collection to which the new UserID needs to be created.</p>
50 pub fn set_collection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.collection_id = input;
52 self
53 }
54 /// <p>The ID of an existing collection to which the new UserID needs to be created.</p>
55 pub fn get_collection_id(&self) -> &::std::option::Option<::std::string::String> {
56 &self.collection_id
57 }
58 /// <p>ID for the UserID to be created. This ID needs to be unique within the collection.</p>
59 /// This field is required.
60 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.user_id = ::std::option::Option::Some(input.into());
62 self
63 }
64 /// <p>ID for the UserID to be created. This ID needs to be unique within the collection.</p>
65 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.user_id = input;
67 self
68 }
69 /// <p>ID for the UserID to be created. This ID needs to be unique within the collection.</p>
70 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
71 &self.user_id
72 }
73 /// <p>Idempotent token used to identify the request to <code>CreateUser</code>. If you use the same token with multiple <code>CreateUser</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
74 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.client_request_token = ::std::option::Option::Some(input.into());
76 self
77 }
78 /// <p>Idempotent token used to identify the request to <code>CreateUser</code>. If you use the same token with multiple <code>CreateUser</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
79 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.client_request_token = input;
81 self
82 }
83 /// <p>Idempotent token used to identify the request to <code>CreateUser</code>. If you use the same token with multiple <code>CreateUser</code> requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.</p>
84 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
85 &self.client_request_token
86 }
87 /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
88 pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
89 ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
90 collection_id: self.collection_id,
91 user_id: self.user_id,
92 client_request_token: self.client_request_token,
93 })
94 }
95}