raws_show/sts/
accesskey.rs1use super::*;
2
3#[derive(Debug, Serialize)]
4#[serde(rename_all = "PascalCase")]
5struct Account {
6 account: String,
7}
8
9impl Show for Account {
10 fn _fmt(&self) -> Box<dyn fmt::Display + '_> {
11 Box::new(fmtools::fmt!({
12 prefixed_item("ACCOUNT", Some(&self.account))
13 }))
14 }
15
16 fn json(&self) -> String {
17 json::to_string_pretty(self).unwrap_or_default()
18 }
19}
20
21impl Show for aws_sdk_sts::operation::get_access_key_info::GetAccessKeyInfoOutput {
22 fn _fmt(&self) -> Box<dyn fmt::Display + '_> {
23 prefixed_item("ACCOUNT", self.account.as_deref())
24 }
25
26 fn json(&self) -> String {
27 Account::from(self).json()
28 }
29}
30
31impl From<&aws_sdk_sts::operation::get_access_key_info::GetAccessKeyInfoOutput> for Account {
32 fn from(info: &aws_sdk_sts::operation::get_access_key_info::GetAccessKeyInfoOutput) -> Self {
33 let account = info.account().unwrap_or_default().to_string();
34 Self { account }
35 }
36}