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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The Amazon Web Services Security Token Service temporary credential that S3 Access Grants vends to grantees and client applications.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Credentials {
/// <p>The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub access_key_id: ::std::option::Option<::std::string::String>,
/// <p>The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub secret_access_key: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub session_token: ::std::option::Option<::std::string::String>,
/// <p>The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub expiration: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Credentials {
/// <p>The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn access_key_id(&self) -> ::std::option::Option<&str> {
self.access_key_id.as_deref()
}
/// <p>The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn secret_access_key(&self) -> ::std::option::Option<&str> {
self.secret_access_key.as_deref()
}
/// <p>The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn session_token(&self) -> ::std::option::Option<&str> {
self.session_token.as_deref()
}
/// <p>The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn expiration(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.expiration.as_ref()
}
}
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("access_key_id", &"*** Sensitive Data Redacted ***");
formatter.field("secret_access_key", &"*** Sensitive Data Redacted ***");
formatter.field("session_token", &"*** Sensitive Data Redacted ***");
formatter.field("expiration", &"*** 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) access_key_id: ::std::option::Option<::std::string::String>,
pub(crate) secret_access_key: ::std::option::Option<::std::string::String>,
pub(crate) session_token: ::std::option::Option<::std::string::String>,
pub(crate) expiration: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl CredentialsBuilder {
/// <p>The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn access_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.access_key_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn set_access_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.access_key_id = input;
self
}
/// <p>The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn get_access_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.access_key_id
}
/// <p>The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn secret_access_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.secret_access_key = ::std::option::Option::Some(input.into());
self
}
/// <p>The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn set_secret_access_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.secret_access_key = input;
self
}
/// <p>The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn get_secret_access_key(&self) -> &::std::option::Option<::std::string::String> {
&self.secret_access_key
}
/// <p>The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn session_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_token = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn set_session_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_token = input;
self
}
/// <p>The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn get_session_token(&self) -> &::std::option::Option<::std::string::String> {
&self.session_token
}
/// <p>The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn expiration(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.expiration = ::std::option::Option::Some(input);
self
}
/// <p>The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn set_expiration(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.expiration = input;
self
}
/// <p>The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications.</p>
pub fn get_expiration(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.expiration
}
/// Consumes the builder and constructs a [`Credentials`](crate::types::Credentials).
pub fn build(self) -> crate::types::Credentials {
crate::types::Credentials {
access_key_id: self.access_key_id,
secret_access_key: self.secret_access_key,
session_token: self.session_token,
expiration: self.expiration,
}
}
}
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("access_key_id", &"*** Sensitive Data Redacted ***");
formatter.field("secret_access_key", &"*** Sensitive Data Redacted ***");
formatter.field("session_token", &"*** Sensitive Data Redacted ***");
formatter.field("expiration", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}