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
#[derive(Deserialize, Debug, Clone)]
pub struct Owner {
#[serde(rename = "DisplayName")]
pub display_name: String,
#[serde(rename = "ID")]
pub id: String,
}
#[derive(Deserialize, Debug, Clone)]
pub struct Object {
#[serde(rename = "LastModified")]
pub last_modified: String,
#[serde(rename = "ETag")]
pub e_tag: String,
#[serde(rename = "StorageClass")]
pub storage_class: String,
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Owner")]
pub owner: Option<Owner>,
#[serde(rename = "Size")]
pub size: u64,
}
#[derive(Deserialize, Debug, Clone)]
pub struct Tagging {
#[serde(rename = "TagSet")]
pub tag_set: Vec<Tag>
}
#[derive(Deserialize, Debug, Clone)]
pub struct Tag {
#[serde(rename = "Tag")]
pub kvpair: KVPair
}
impl Tag {
pub fn key(&self) -> String {
self.kvpair.key.clone()
}
pub fn value(&self) -> String {
self.kvpair.value.clone()
}
}
#[derive(Deserialize, Debug, Clone)]
pub struct KVPair {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Deserialize, Debug, Clone)]
pub struct BucketLocationResult {
#[serde(rename = "$value")]
pub region: String
}
#[derive(Deserialize, Debug, Clone)]
pub struct ListBucketResult {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "NextMarker")]
pub next_marker: Option<String>,
#[serde(rename = "Delimiter")]
pub delimiter: Option<String>,
#[serde(rename = "MaxKeys")]
pub max_keys: i32,
#[serde(rename = "Prefix")]
pub prefix: String,
#[serde(rename = "Marker")]
pub marker: Option<String>,
#[serde(rename = "EncodingType")]
pub encoding_type: Option<String>,
#[serde(rename = "IsTruncated", deserialize_with = "super::deserializer::bool_deserializer")]
pub is_truncated: bool,
#[serde(rename = "NextContinuationToken", default)]
pub next_continuation_token: Option<String>,
#[serde(rename = "Contents", default)]
pub contents: Vec<Object>,
#[serde(rename = "CommonPrefixes", default)]
pub common_prefixes: Option<Vec<CommonPrefix>>,
}
#[derive(Deserialize, Debug, Clone)]
pub struct CommonPrefix {
#[serde(rename = "Prefix")]
pub prefix: String,
}
#[derive(Deserialize, Debug)]
pub struct AwsError {
#[serde(rename = "Code")]
pub code: String,
#[serde(rename = "Message")]
pub message: String,
#[serde(rename = "RequestId")]
pub request_id: String,
}