1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetMfaDeviceOutput {
/// <p>The friendly name identifying the user.</p>
pub user_name: ::std::option::Option<::std::string::String>,
/// <p>Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARNs</a>.</p>
pub serial_number: ::std::string::String,
/// <p>The date that a specified user's MFA device was first enabled.</p>
pub enable_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from <a href="https://fidoalliance.org/metadata/"> FIDO Alliance Metadata Service (MDS)</a>.</p>
pub certifications: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
_request_id: Option<String>,
}
impl GetMfaDeviceOutput {
/// <p>The friendly name identifying the user.</p>
pub fn user_name(&self) -> ::std::option::Option<&str> {
self.user_name.as_deref()
}
/// <p>Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARNs</a>.</p>
pub fn serial_number(&self) -> &str {
use std::ops::Deref;
self.serial_number.deref()
}
/// <p>The date that a specified user's MFA device was first enabled.</p>
pub fn enable_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.enable_date.as_ref()
}
/// <p>The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from <a href="https://fidoalliance.org/metadata/"> FIDO Alliance Metadata Service (MDS)</a>.</p>
pub fn certifications(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.certifications.as_ref()
}
}
impl ::aws_types::request_id::RequestId for GetMfaDeviceOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetMfaDeviceOutput {
/// Creates a new builder-style object to manufacture [`GetMfaDeviceOutput`](crate::operation::get_mfa_device::GetMfaDeviceOutput).
pub fn builder() -> crate::operation::get_mfa_device::builders::GetMfaDeviceOutputBuilder {
crate::operation::get_mfa_device::builders::GetMfaDeviceOutputBuilder::default()
}
}
/// A builder for [`GetMfaDeviceOutput`](crate::operation::get_mfa_device::GetMfaDeviceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMfaDeviceOutputBuilder {
pub(crate) user_name: ::std::option::Option<::std::string::String>,
pub(crate) serial_number: ::std::option::Option<::std::string::String>,
pub(crate) enable_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) certifications: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
_request_id: Option<String>,
}
impl GetMfaDeviceOutputBuilder {
/// <p>The friendly name identifying the user.</p>
pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.user_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The friendly name identifying the user.</p>
pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.user_name = input;
self
}
/// <p>The friendly name identifying the user.</p>
pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
&self.user_name
}
/// <p>Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARNs</a>.</p>
/// This field is required.
pub fn serial_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.serial_number = ::std::option::Option::Some(input.into());
self
}
/// <p>Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARNs</a>.</p>
pub fn set_serial_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.serial_number = input;
self
}
/// <p>Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARNs</a>.</p>
pub fn get_serial_number(&self) -> &::std::option::Option<::std::string::String> {
&self.serial_number
}
/// <p>The date that a specified user's MFA device was first enabled.</p>
pub fn enable_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.enable_date = ::std::option::Option::Some(input);
self
}
/// <p>The date that a specified user's MFA device was first enabled.</p>
pub fn set_enable_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.enable_date = input;
self
}
/// <p>The date that a specified user's MFA device was first enabled.</p>
pub fn get_enable_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.enable_date
}
/// Adds a key-value pair to `certifications`.
///
/// To override the contents of this collection use [`set_certifications`](Self::set_certifications).
///
/// <p>The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from <a href="https://fidoalliance.org/metadata/"> FIDO Alliance Metadata Service (MDS)</a>.</p>
pub fn certifications(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.certifications.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.certifications = ::std::option::Option::Some(hash_map);
self
}
/// <p>The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from <a href="https://fidoalliance.org/metadata/"> FIDO Alliance Metadata Service (MDS)</a>.</p>
pub fn set_certifications(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.certifications = input;
self
}
/// <p>The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from <a href="https://fidoalliance.org/metadata/"> FIDO Alliance Metadata Service (MDS)</a>.</p>
pub fn get_certifications(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.certifications
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetMfaDeviceOutput`](crate::operation::get_mfa_device::GetMfaDeviceOutput).
/// This method will fail if any of the following fields are not set:
/// - [`serial_number`](crate::operation::get_mfa_device::builders::GetMfaDeviceOutputBuilder::serial_number)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_mfa_device::GetMfaDeviceOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_mfa_device::GetMfaDeviceOutput {
user_name: self.user_name,
serial_number: self.serial_number.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"serial_number",
"serial_number was not specified but it is required when building GetMfaDeviceOutput",
)
})?,
enable_date: self.enable_date,
certifications: self.certifications,
_request_id: self._request_id,
})
}
}