42 42 | formatter.field("session_token", &"*** Sensitive Data Redacted ***");
|
43 43 | formatter.field("expiration", &"*** Sensitive Data Redacted ***");
|
44 44 | formatter.finish()
|
45 45 | }
|
46 46 | }
|
47 47 | static CREDENTIALS_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
48 48 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts#Credentials", "com.amazonaws.sts", "Credentials");
|
49 49 | static CREDENTIALS_MEMBER_ACCESS_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
50 50 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts#Credentials$AccessKeyId", "com.amazonaws.sts", "Credentials"),
|
51 51 | ::aws_smithy_schema::ShapeType::String,
|
52 - | "access_key_id",
|
52 + | "AccessKeyId",
|
53 53 | 0,
|
54 54 | );
|
55 55 | static CREDENTIALS_MEMBER_SECRET_ACCESS_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
56 56 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts#Credentials$SecretAccessKey", "com.amazonaws.sts", "Credentials"),
|
57 57 | ::aws_smithy_schema::ShapeType::String,
|
58 - | "secret_access_key",
|
58 + | "SecretAccessKey",
|
59 59 | 1,
|
60 60 | );
|
61 61 | static CREDENTIALS_MEMBER_SESSION_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
62 62 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts#Credentials$SessionToken", "com.amazonaws.sts", "Credentials"),
|
63 63 | ::aws_smithy_schema::ShapeType::String,
|
64 - | "session_token",
|
64 + | "SessionToken",
|
65 65 | 2,
|
66 66 | );
|
67 67 | static CREDENTIALS_MEMBER_EXPIRATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
68 68 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts#Credentials$Expiration", "com.amazonaws.sts", "Credentials"),
|
69 69 | ::aws_smithy_schema::ShapeType::Timestamp,
|
70 - | "expiration",
|
70 + | "Expiration",
|
71 71 | 3,
|
72 72 | );
|
73 73 | static CREDENTIALS_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
74 74 | CREDENTIALS_SCHEMA_ID,
|
75 75 | ::aws_smithy_schema::ShapeType::Structure,
|
76 76 | &[
|
77 77 | &CREDENTIALS_MEMBER_ACCESS_KEY_ID,
|
78 78 | &CREDENTIALS_MEMBER_SECRET_ACCESS_KEY,
|
79 79 | &CREDENTIALS_MEMBER_SESSION_TOKEN,
|
80 80 | &CREDENTIALS_MEMBER_EXPIRATION,
|
81 81 | ],
|
82 82 | )
|
83 83 | .with_sensitive();
|
84 84 | impl Credentials {
|
85 85 | /// The schema for this shape.
|
86 86 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREDENTIALS_SCHEMA;
|
87 87 | }
|
88 88 | impl ::aws_smithy_schema::serde::SerializableStruct for Credentials {
|
89 89 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
90 90 | fn serialize_members(
|
91 91 | &self,
|
92 92 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
93 93 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
94 94 | {
|
95 95 | let val = &self.access_key_id;
|
96 96 | ser.write_string(&CREDENTIALS_MEMBER_ACCESS_KEY_ID, val)?;
|
97 97 | }
|
98 98 | {
|
99 99 | let val = &self.secret_access_key;
|
100 100 | ser.write_string(&CREDENTIALS_MEMBER_SECRET_ACCESS_KEY, val)?;
|
101 101 | }
|
102 102 | {
|
103 103 | let val = &self.session_token;
|
104 104 | ser.write_string(&CREDENTIALS_MEMBER_SESSION_TOKEN, val)?;
|
105 105 | }
|
106 106 | {
|
107 107 | let val = &self.expiration;
|
108 108 | ser.write_timestamp(&CREDENTIALS_MEMBER_EXPIRATION, val)?;
|
109 109 | }
|
110 110 | Ok(())
|
111 111 | }
|
112 112 | }
|
113 113 | impl Credentials {
|
114 114 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
115 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
116 - | deserializer: &mut D,
|
115 + | pub fn deserialize(
|
116 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
117 117 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
118 118 | #[allow(unused_variables, unused_mut)]
|
119 119 | let mut builder = Self::builder();
|
120 120 | #[allow(
|
121 121 | unused_variables,
|
122 122 | unreachable_code,
|
123 123 | clippy::single_match,
|
124 124 | clippy::match_single_binding,
|
125 125 | clippy::diverging_sub_expression
|
126 126 | )]
|
127 - | deserializer.read_struct(&CREDENTIALS_SCHEMA, (), |_, member, deser| {
|
127 + | deserializer.read_struct(&CREDENTIALS_SCHEMA, &mut |member, deser| {
|
128 128 | match member.member_index() {
|
129 129 | Some(0) => {
|
130 130 | builder.access_key_id = Some(deser.read_string(member)?);
|
131 131 | }
|
132 132 | Some(1) => {
|
133 133 | builder.secret_access_key = Some(deser.read_string(member)?);
|
134 134 | }
|
135 135 | Some(2) => {
|
136 136 | builder.session_token = Some(deser.read_string(member)?);
|
137 137 | }
|
138 138 | Some(3) => {
|
139 139 | builder.expiration = Some(deser.read_timestamp(member)?);
|
140 140 | }
|
141 141 | _ => {}
|
142 142 | }
|
143 143 | Ok(())
|
144 144 | })?;
|
145 + | builder.access_key_id = builder.access_key_id.or(Some(String::new()));
|
146 + | builder.secret_access_key = builder.secret_access_key.or(Some(String::new()));
|
147 + | builder.session_token = builder.session_token.or(Some(String::new()));
|
148 + | builder.expiration = builder.expiration.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
|
145 149 | builder
|
146 150 | .build()
|
147 151 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
148 152 | }
|
149 153 | }
|
154 + | impl Credentials {
|
155 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
156 + | pub fn deserialize_with_response(
|
157 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
158 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
159 + | _status: u16,
|
160 + | _body: &[u8],
|
161 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
162 + | Self::deserialize(deserializer)
|
163 + | }
|
164 + | }
|
150 165 | impl Credentials {
|
151 166 | /// Creates a new builder-style object to manufacture [`Credentials`](crate::types::Credentials).
|
152 167 | pub fn builder() -> crate::types::builders::CredentialsBuilder {
|
153 168 | crate::types::builders::CredentialsBuilder::default()
|
154 169 | }
|
155 170 | }
|
156 171 |
|
157 172 | /// A builder for [`Credentials`](crate::types::Credentials).
|
158 173 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
|
159 174 | #[non_exhaustive]
|
160 175 | pub struct CredentialsBuilder {
|
161 176 | pub(crate) access_key_id: ::std::option::Option<::std::string::String>,
|
162 177 | pub(crate) secret_access_key: ::std::option::Option<::std::string::String>,
|
163 178 | pub(crate) session_token: ::std::option::Option<::std::string::String>,
|
164 179 | pub(crate) expiration: ::std::option::Option<::aws_smithy_types::DateTime>,
|
165 180 | }
|
166 181 | impl CredentialsBuilder {
|
167 182 | /// <p>The access key ID that identifies the temporary security credentials.</p>
|
168 183 | /// This field is required.
|
169 184 | pub fn access_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
170 185 | self.access_key_id = ::std::option::Option::Some(input.into());
|
171 186 | self
|
172 187 | }
|
173 188 | /// <p>The access key ID that identifies the temporary security credentials.</p>
|
174 189 | pub fn set_access_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
175 190 | self.access_key_id = input;
|
176 191 | self
|
177 192 | }
|
178 193 | /// <p>The access key ID that identifies the temporary security credentials.</p>
|
179 194 | pub fn get_access_key_id(&self) -> &::std::option::Option<::std::string::String> {
|