aws_sdk_cognitoidentity/operation/unlink_identity/
_unlink_identity_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UnlinkIdentityInput {
7 pub identity_id: ::std::option::Option<::std::string::String>,
9 pub logins: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
11 pub logins_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13}
14impl UnlinkIdentityInput {
15 pub fn identity_id(&self) -> ::std::option::Option<&str> {
17 self.identity_id.as_deref()
18 }
19 pub fn logins(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
21 self.logins.as_ref()
22 }
23 pub fn logins_to_remove(&self) -> &[::std::string::String] {
27 self.logins_to_remove.as_deref().unwrap_or_default()
28 }
29}
30impl UnlinkIdentityInput {
31 pub fn builder() -> crate::operation::unlink_identity::builders::UnlinkIdentityInputBuilder {
33 crate::operation::unlink_identity::builders::UnlinkIdentityInputBuilder::default()
34 }
35}
36
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct UnlinkIdentityInputBuilder {
41 pub(crate) identity_id: ::std::option::Option<::std::string::String>,
42 pub(crate) logins: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
43 pub(crate) logins_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
44}
45impl UnlinkIdentityInputBuilder {
46 pub fn identity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.identity_id = ::std::option::Option::Some(input.into());
50 self
51 }
52 pub fn set_identity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.identity_id = input;
55 self
56 }
57 pub fn get_identity_id(&self) -> &::std::option::Option<::std::string::String> {
59 &self.identity_id
60 }
61 pub fn logins(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut hash_map = self.logins.unwrap_or_default();
68 hash_map.insert(k.into(), v.into());
69 self.logins = ::std::option::Option::Some(hash_map);
70 self
71 }
72 pub fn set_logins(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
74 self.logins = input;
75 self
76 }
77 pub fn get_logins(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
79 &self.logins
80 }
81 pub fn logins_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 let mut v = self.logins_to_remove.unwrap_or_default();
88 v.push(input.into());
89 self.logins_to_remove = ::std::option::Option::Some(v);
90 self
91 }
92 pub fn set_logins_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
94 self.logins_to_remove = input;
95 self
96 }
97 pub fn get_logins_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
99 &self.logins_to_remove
100 }
101 pub fn build(
103 self,
104 ) -> ::std::result::Result<crate::operation::unlink_identity::UnlinkIdentityInput, ::aws_smithy_types::error::operation::BuildError> {
105 ::std::result::Result::Ok(crate::operation::unlink_identity::UnlinkIdentityInput {
106 identity_id: self.identity_id,
107 logins: self.logins,
108 logins_to_remove: self.logins_to_remove,
109 })
110 }
111}