Skip to content

Commit 010ae03

Browse files
authored
Merge pull request #9 from rustfs/rename-user-metadata-entry
Rename user metadata entry aliases
2 parents 79bb9ab + 7d99e9c commit 010ae03

4 files changed

Lines changed: 83 additions & 83 deletions

File tree

crates/s3s/src/dto/generated_minio.rs

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,8 +4607,8 @@ pub struct DeleteMarkerM {
46074607
pub key: Option<ObjectKey>,
46084608
pub last_modified: Option<LastModified>,
46094609
pub owner: Option<Owner>,
4610-
pub user_metadata: Option<MinioUserMetadata>,
4611-
pub user_tags: Option<MinioUserTags>,
4610+
pub user_metadata: Option<UserMetadataCollection>,
4611+
pub user_tags: Option<UserTags>,
46124612
pub version_id: Option<ObjectVersionId>,
46134613
}
46144614

@@ -11128,6 +11128,8 @@ impl FromStr for IntelligentTieringStatus {
1112811128
}
1112911129
}
1113011130

11131+
pub type InternalCount = i32;
11132+
1113111133
/// <p>Object is archived and inaccessible until restored.</p>
1113211134
/// <p>If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage
1113311135
/// class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access
@@ -14111,44 +14113,6 @@ impl FromStr for MetricsStatus {
1411114113
}
1411214114
}
1411314115

14114-
pub type MinioInternalCount = i32;
14115-
14116-
pub type MinioMetadataEntries = List<MinioMetadataEntry>;
14117-
14118-
#[derive(Clone, Default, PartialEq)]
14119-
pub struct MinioMetadataEntry {
14120-
pub key: MinioMetadataKey,
14121-
pub value: MinioMetadataValue,
14122-
}
14123-
14124-
impl fmt::Debug for MinioMetadataEntry {
14125-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14126-
let mut d = f.debug_struct("MinioMetadataEntry");
14127-
d.field("key", &self.key);
14128-
d.field("value", &self.value);
14129-
d.finish_non_exhaustive()
14130-
}
14131-
}
14132-
14133-
pub type MinioMetadataKey = String;
14134-
14135-
pub type MinioMetadataValue = String;
14136-
14137-
#[derive(Clone, Default, PartialEq)]
14138-
pub struct MinioUserMetadata {
14139-
pub items: MinioMetadataEntries,
14140-
}
14141-
14142-
impl fmt::Debug for MinioUserMetadata {
14143-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14144-
let mut d = f.debug_struct("MinioUserMetadata");
14145-
d.field("items", &self.items);
14146-
d.finish_non_exhaustive()
14147-
}
14148-
}
14149-
14150-
pub type MinioUserTags = String;
14151-
1415214116
pub type Minutes = i32;
1415314117

1415414118
pub type MissingMeta = i32;
@@ -14691,8 +14655,8 @@ pub type ObjectIdentifierList = List<ObjectIdentifier>;
1469114655

1469214656
#[derive(Clone, Default, PartialEq)]
1469314657
pub struct ObjectInternalInfo {
14694-
pub k: MinioInternalCount,
14695-
pub m: MinioInternalCount,
14658+
pub k: InternalCount,
14659+
pub m: InternalCount,
1469614660
}
1469714661

1469814662
impl fmt::Debug for ObjectInternalInfo {
@@ -14960,8 +14924,8 @@ pub struct ObjectM {
1496014924
pub owner: Option<Owner>,
1496114925
pub size: Option<Size>,
1496214926
pub storage_class: Option<ObjectStorageClass>,
14963-
pub user_metadata: Option<MinioUserMetadata>,
14964-
pub user_tags: Option<MinioUserTags>,
14927+
pub user_metadata: Option<UserMetadataCollection>,
14928+
pub user_tags: Option<UserTags>,
1496514929
}
1496614930

1496714931
impl fmt::Debug for ObjectM {
@@ -15278,8 +15242,8 @@ pub struct ObjectVersionM {
1527815242
pub owner: Option<Owner>,
1527915243
pub size: Option<Size>,
1528015244
pub storage_class: Option<ObjectVersionStorageClass>,
15281-
pub user_metadata: Option<MinioUserMetadata>,
15282-
pub user_tags: Option<MinioUserTags>,
15245+
pub user_metadata: Option<UserMetadataCollection>,
15246+
pub user_tags: Option<UserTags>,
1528315247
pub version_id: Option<ObjectVersionId>,
1528415248
}
1528515249

@@ -22023,6 +21987,42 @@ impl fmt::Debug for UploadPartOutput {
2202321987

2202421988
pub type UserMetadata = List<MetadataEntry>;
2202521989

21990+
#[derive(Clone, Default, PartialEq)]
21991+
pub struct UserMetadataCollection {
21992+
pub items: UserMetadataEntries,
21993+
}
21994+
21995+
impl fmt::Debug for UserMetadataCollection {
21996+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21997+
let mut d = f.debug_struct("UserMetadataCollection");
21998+
d.field("items", &self.items);
21999+
d.finish_non_exhaustive()
22000+
}
22001+
}
22002+
22003+
pub type UserMetadataEntries = List<UserMetadataEntry>;
22004+
22005+
#[derive(Clone, Default, PartialEq)]
22006+
pub struct UserMetadataEntry {
22007+
pub key: UserMetadataKey,
22008+
pub value: UserMetadataValue,
22009+
}
22010+
22011+
impl fmt::Debug for UserMetadataEntry {
22012+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22013+
let mut d = f.debug_struct("UserMetadataEntry");
22014+
d.field("key", &self.key);
22015+
d.field("value", &self.value);
22016+
d.finish_non_exhaustive()
22017+
}
22018+
}
22019+
22020+
pub type UserMetadataKey = String;
22021+
22022+
pub type UserMetadataValue = String;
22023+
22024+
pub type UserTags = String;
22025+
2202622026
pub type Value = String;
2202722027

2202822028
pub type VersionCount = i32;
@@ -36949,12 +36949,6 @@ impl DtoExt for MetricsAndOperator {
3694936949
impl DtoExt for MetricsConfiguration {
3695036950
fn ignore_empty_strings(&mut self) {}
3695136951
}
36952-
impl DtoExt for MinioMetadataEntry {
36953-
fn ignore_empty_strings(&mut self) {}
36954-
}
36955-
impl DtoExt for MinioUserMetadata {
36956-
fn ignore_empty_strings(&mut self) {}
36957-
}
3695836952
impl DtoExt for MultipartUpload {
3695936953
fn ignore_empty_strings(&mut self) {
3696036954
if let Some(ref val) = self.checksum_algorithm
@@ -38565,6 +38559,12 @@ impl DtoExt for UploadPartOutput {
3856538559
}
3856638560
}
3856738561
}
38562+
impl DtoExt for UserMetadataCollection {
38563+
fn ignore_empty_strings(&mut self) {}
38564+
}
38565+
impl DtoExt for UserMetadataEntry {
38566+
fn ignore_empty_strings(&mut self) {}
38567+
}
3856838568
impl DtoExt for VersioningConfiguration {
3856938569
fn ignore_empty_strings(&mut self) {
3857038570
if let Some(ref val) = self.mfa_delete

crates/s3s/src/ops/tests.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,8 +1805,8 @@ fn list_object_versions_m_route_resolved_before_standard_versions() {
18051805
#[test]
18061806
fn list_object_versions_m_serialize_http_includes_minio_metadata_fields() {
18071807
use crate::dto::{
1808-
DeleteMarkerM, ListObjectVersionMEntry, ListObjectVersionsMOutput, MinioMetadataEntry, MinioUserMetadata,
1809-
ObjectInternalInfo, ObjectVersionM, Owner,
1808+
DeleteMarkerM, ListObjectVersionMEntry, ListObjectVersionsMOutput, ObjectInternalInfo, ObjectVersionM, Owner,
1809+
UserMetadataCollection, UserMetadataEntry,
18101810
};
18111811

18121812
let output = ListObjectVersionsMOutput {
@@ -1823,8 +1823,8 @@ fn list_object_versions_m_serialize_http_includes_minio_metadata_fields() {
18231823
version_id: Some("v1".to_string()),
18241824
is_latest: Some(true),
18251825
user_tags: Some("env=prod".to_string()),
1826-
user_metadata: Some(MinioUserMetadata {
1827-
items: vec![MinioMetadataEntry {
1826+
user_metadata: Some(UserMetadataCollection {
1827+
items: vec![UserMetadataEntry {
18281828
key: "project".to_string(),
18291829
value: "alpha".to_string(),
18301830
}],
@@ -1840,8 +1840,8 @@ fn list_object_versions_m_serialize_http_includes_minio_metadata_fields() {
18401840
key: Some("obj-b".to_string()),
18411841
version_id: Some("v2".to_string()),
18421842
is_latest: Some(false),
1843-
user_metadata: Some(MinioUserMetadata {
1844-
items: vec![MinioMetadataEntry {
1843+
user_metadata: Some(UserMetadataCollection {
1844+
items: vec![UserMetadataEntry {
18451845
key: "marker".to_string(),
18461846
value: "true".to_string(),
18471847
}],
@@ -1893,7 +1893,7 @@ fn list_objects_v2_m_route_resolved_before_standard_list_objects_v2() {
18931893
#[cfg(feature = "minio")]
18941894
#[test]
18951895
fn list_objects_v2_m_serialize_http_includes_metadata_fields() {
1896-
use crate::dto::{ListObjectsV2MOutput, MinioMetadataEntry, MinioUserMetadata, ObjectInternalInfo, ObjectM, Owner};
1896+
use crate::dto::{ListObjectsV2MOutput, ObjectInternalInfo, ObjectM, Owner, UserMetadataCollection, UserMetadataEntry};
18971897

18981898
let output = ListObjectsV2MOutput {
18991899
name: Some("my-bucket".to_string()),
@@ -1906,8 +1906,8 @@ fn list_objects_v2_m_serialize_http_includes_metadata_fields() {
19061906
contents: Some(vec![ObjectM {
19071907
key: Some("prefix/object.txt".to_string()),
19081908
user_tags: Some("env=prod".to_string()),
1909-
user_metadata: Some(MinioUserMetadata {
1910-
items: vec![MinioMetadataEntry {
1909+
user_metadata: Some(UserMetadataCollection {
1910+
items: vec![UserMetadataEntry {
19111911
key: "project".to_string(),
19121912
value: "alpha".to_string(),
19131913
}],

crates/s3s/src/xml/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ mod manually {
7979

8080
#[cfg(feature = "minio")]
8181
use crate::dto::{
82-
DeleteMarkerM, ListObjectVersionMEntry, ListObjectVersionsMOutput, ListObjectsV2MOutput, MinioUserMetadata,
83-
ObjectInternalInfo, ObjectM, ObjectVersionM, TimestampFormat,
82+
DeleteMarkerM, ListObjectVersionMEntry, ListObjectVersionsMOutput, ListObjectsV2MOutput, ObjectInternalInfo, ObjectM,
83+
ObjectVersionM, TimestampFormat, UserMetadataCollection,
8484
};
8585

8686
#[cfg(feature = "minio")]
@@ -302,7 +302,7 @@ mod manually {
302302
}
303303

304304
#[cfg(feature = "minio")]
305-
impl SerializeContent for MinioUserMetadata {
305+
impl SerializeContent for UserMetadataCollection {
306306
fn serialize_content<W: std::io::Write>(&self, s: &mut Serializer<W>) -> SerResult {
307307
for item in &self.items {
308308
if item.key.is_empty() {

data/minio-patches.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -227,41 +227,41 @@
227227
}
228228
}
229229
},
230-
"com.amazonaws.s3#MinioMetadataKey": {
230+
"com.amazonaws.s3#UserMetadataKey": {
231231
"type": "string",
232232
"traits": {
233233
"s3s#minio": ""
234234
}
235235
},
236-
"com.amazonaws.s3#MinioMetadataValue": {
236+
"com.amazonaws.s3#UserMetadataValue": {
237237
"type": "string",
238238
"traits": {
239239
"s3s#minio": ""
240240
}
241241
},
242-
"com.amazonaws.s3#MinioUserTags": {
242+
"com.amazonaws.s3#UserTags": {
243243
"type": "string",
244244
"traits": {
245245
"s3s#minio": ""
246246
}
247247
},
248-
"com.amazonaws.s3#MinioInternalCount": {
248+
"com.amazonaws.s3#InternalCount": {
249249
"type": "integer",
250250
"traits": {
251251
"s3s#minio": ""
252252
}
253253
},
254-
"com.amazonaws.s3#MinioMetadataEntry": {
254+
"com.amazonaws.s3#UserMetadataEntry": {
255255
"type": "structure",
256256
"members": {
257257
"Key": {
258-
"target": "com.amazonaws.s3#MinioMetadataKey",
258+
"target": "com.amazonaws.s3#UserMetadataKey",
259259
"traits": {
260260
"smithy.api#required": {}
261261
}
262262
},
263263
"Value": {
264-
"target": "com.amazonaws.s3#MinioMetadataValue",
264+
"target": "com.amazonaws.s3#UserMetadataValue",
265265
"traits": {
266266
"smithy.api#required": {}
267267
}
@@ -271,20 +271,20 @@
271271
"s3s#minio": ""
272272
}
273273
},
274-
"com.amazonaws.s3#MinioMetadataEntries": {
274+
"com.amazonaws.s3#UserMetadataEntries": {
275275
"type": "list",
276276
"member": {
277-
"target": "com.amazonaws.s3#MinioMetadataEntry"
277+
"target": "com.amazonaws.s3#UserMetadataEntry"
278278
},
279279
"traits": {
280280
"s3s#minio": ""
281281
}
282282
},
283-
"com.amazonaws.s3#MinioUserMetadata": {
283+
"com.amazonaws.s3#UserMetadataCollection": {
284284
"type": "structure",
285285
"members": {
286286
"Items": {
287-
"target": "com.amazonaws.s3#MinioMetadataEntries",
287+
"target": "com.amazonaws.s3#UserMetadataEntries",
288288
"traits": {
289289
"smithy.api#required": {},
290290
"s3s#minio": ""
@@ -299,14 +299,14 @@
299299
"type": "structure",
300300
"members": {
301301
"K": {
302-
"target": "com.amazonaws.s3#MinioInternalCount",
302+
"target": "com.amazonaws.s3#InternalCount",
303303
"traits": {
304304
"smithy.api#required": {},
305305
"s3s#minio": ""
306306
}
307307
},
308308
"M": {
309-
"target": "com.amazonaws.s3#MinioInternalCount",
309+
"target": "com.amazonaws.s3#InternalCount",
310310
"traits": {
311311
"smithy.api#required": {},
312312
"s3s#minio": ""
@@ -369,13 +369,13 @@
369369
}
370370
},
371371
"UserMetadata": {
372-
"target": "com.amazonaws.s3#MinioUserMetadata",
372+
"target": "com.amazonaws.s3#UserMetadataCollection",
373373
"traits": {
374374
"s3s#minio": ""
375375
}
376376
},
377377
"UserTags": {
378-
"target": "com.amazonaws.s3#MinioUserTags",
378+
"target": "com.amazonaws.s3#UserTags",
379379
"traits": {
380380
"s3s#minio": ""
381381
}
@@ -425,13 +425,13 @@
425425
}
426426
},
427427
"UserMetadata": {
428-
"target": "com.amazonaws.s3#MinioUserMetadata",
428+
"target": "com.amazonaws.s3#UserMetadataCollection",
429429
"traits": {
430430
"s3s#minio": ""
431431
}
432432
},
433433
"UserTags": {
434-
"target": "com.amazonaws.s3#MinioUserTags",
434+
"target": "com.amazonaws.s3#UserTags",
435435
"traits": {
436436
"s3s#minio": ""
437437
}
@@ -599,13 +599,13 @@
599599
}
600600
},
601601
"UserMetadata": {
602-
"target": "com.amazonaws.s3#MinioUserMetadata",
602+
"target": "com.amazonaws.s3#UserMetadataCollection",
603603
"traits": {
604604
"s3s#minio": ""
605605
}
606606
},
607607
"UserTags": {
608-
"target": "com.amazonaws.s3#MinioUserTags",
608+
"target": "com.amazonaws.s3#UserTags",
609609
"traits": {
610610
"s3s#minio": ""
611611
}

0 commit comments

Comments
 (0)