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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The credentials that provide DataSync Discovery read access to your on-premises storage system's management interface.</p>
/// <p>DataSync Discovery stores these credentials in <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html">Secrets Manager</a>. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/discovery-configure-storage.html">Accessing your on-premises storage system</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Credentials {
/// <p>Specifies the user name for your storage system's management interface.</p>
pub username: ::std::string::String,
/// <p>Specifies the password for your storage system's management interface.</p>
pub password: ::std::string::String,
}
impl Credentials {
/// <p>Specifies the user name for your storage system's management interface.</p>
pub fn username(&self) -> &str {
use std::ops::Deref;
self.username.deref()
}
/// <p>Specifies the password for your storage system's management interface.</p>
pub fn password(&self) -> &str {
use std::ops::Deref;
self.password.deref()
}
}
impl ::std::fmt::Debug for Credentials {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Credentials");
formatter.field("username", &"*** Sensitive Data Redacted ***");
formatter.field("password", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl Credentials {
/// Creates a new builder-style object to manufacture [`Credentials`](crate::types::Credentials).
pub fn builder() -> crate::types::builders::CredentialsBuilder {
crate::types::builders::CredentialsBuilder::default()
}
}
/// A builder for [`Credentials`](crate::types::Credentials).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CredentialsBuilder {
pub(crate) username: ::std::option::Option<::std::string::String>,
pub(crate) password: ::std::option::Option<::std::string::String>,
}
impl CredentialsBuilder {
/// <p>Specifies the user name for your storage system's management interface.</p>
/// This field is required.
pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.username = ::std::option::Option::Some(input.into());
self
}
/// <p>Specifies the user name for your storage system's management interface.</p>
pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.username = input;
self
}
/// <p>Specifies the user name for your storage system's management interface.</p>
pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
&self.username
}
/// <p>Specifies the password for your storage system's management interface.</p>
/// This field is required.
pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.password = ::std::option::Option::Some(input.into());
self
}
/// <p>Specifies the password for your storage system's management interface.</p>
pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.password = input;
self
}
/// <p>Specifies the password for your storage system's management interface.</p>
pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
&self.password
}
/// Consumes the builder and constructs a [`Credentials`](crate::types::Credentials).
/// This method will fail if any of the following fields are not set:
/// - [`username`](crate::types::builders::CredentialsBuilder::username)
/// - [`password`](crate::types::builders::CredentialsBuilder::password)
pub fn build(self) -> ::std::result::Result<crate::types::Credentials, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Credentials {
username: self.username.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"username",
"username was not specified but it is required when building Credentials",
)
})?,
password: self.password.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"password",
"password was not specified but it is required when building Credentials",
)
})?,
})
}
}
impl ::std::fmt::Debug for CredentialsBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CredentialsBuilder");
formatter.field("username", &"*** Sensitive Data Redacted ***");
formatter.field("password", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}