using System; using System.Collections.Generic; using System.Text; using System.Xml.Serialization; namespace COSXML.Model.Tag { /// /// 所有分块上传的信息 /// /// [XmlRoot("ListMultipartUploadsResult")] public sealed class ListMultipartUploads { /// /// 分块上传的目标 Bucket /// [XmlElement("Bucket")] public string bucket; /// /// 规定返回值的编码格式,合法值:url /// [XmlElement("Encoding-type")] public string encodingType; /// /// 列出条目从该 key 值开始 /// [XmlElement("KeyMarker")] public string keyMarker; /// /// 列出条目从该 UploadId 值开始 /// [XmlElement("UploadIdMarker")] public string uploadIdMarker; /// /// 假如返回条目被截断,则返回 NextKeyMarker 就是下一个条目的起点 /// [XmlElement("NextKeyMarker")] public string nextKeyMarker; /// /// 假如返回条目被截断,则返回 UploadId 就是下一个条目的起点 /// [XmlElement("NextUploadIdMarker")] public string nextUploadIdMarker; /// /// 设置最大返回的 multipart 数量,合法取值从 0 到 1000 /// [XmlElement("MaxUploads")] public string maxUploads; /// /// 返回条目是否被截断,布尔值:TRUE,FALSE /// [XmlElement("IsTruncated")] public bool isTruncated; /// /// 限定返回的 Object key 必须以 Prefix 作为前缀。 /// 注意使用 prefix 查询时,返回的 key 中仍会包含 Prefix /// [XmlElement("Prefix")] public string prefix; /// /// 定界符为一个符号, /// 对 object 名字包含指定前缀且第一次出现 delimiter 字符之间的 object 作为一组元素:common prefix。 /// 如果没有 prefix,则从路径起点开始 /// [XmlElement("Delimiter")] public string delimiter; /// /// 每个 Upload 的信息 /// /// [XmlElement("Upload")] public List uploads; /// /// 将 prefix 到 delimiter 之间的相同路径归为一类,定义为 Common Prefix /// /// [XmlElement("CommonPrefixes")] public List commonPrefixesList; public string GetInfo() { StringBuilder stringBuilder = new StringBuilder("{ListMultipartUploads:\n"); stringBuilder.Append("Bucket:").Append(bucket).Append("\n"); stringBuilder.Append("EncodingType:").Append(encodingType).Append("\n"); stringBuilder.Append("KeyMarker:").Append(keyMarker).Append("\n"); stringBuilder.Append("UploadIdMarker:").Append(uploadIdMarker).Append("\n"); stringBuilder.Append("NextKeyMarker:").Append(nextKeyMarker).Append("\n"); stringBuilder.Append("NextUploadIdMarker:").Append(nextUploadIdMarker).Append("\n"); stringBuilder.Append("MaxUploads:").Append(maxUploads).Append("\n"); stringBuilder.Append("IsTruncated:").Append(isTruncated).Append("\n"); stringBuilder.Append("Prefix:").Append(prefix).Append("\n"); stringBuilder.Append("Delimiter:").Append(delimiter).Append("\n"); if (uploads != null) { foreach (Upload upload in uploads) { if (upload != null) { stringBuilder.Append(upload.GetInfo()).Append("\n"); } } } if (commonPrefixesList != null) { foreach (CommonPrefixes commonPrefix in commonPrefixesList) { if (commonPrefix != null) { stringBuilder.Append(commonPrefix.GetInfo()).Append("\n"); } } } stringBuilder.Append("}"); return stringBuilder.ToString(); } public sealed class Upload { /// /// Object 的名称 /// [XmlElement("Key")] public string key; /// /// 示本次分块上传的 ID /// [XmlElement("UploadId")] public string uploadID; /// /// 用来表示分块的存储级别,枚举值:STANDARD,STANDARD_IA,ARCHIVE /// [XmlElement("StorageClass")] public string storageClass; /// /// 用来表示本次上传发起者的信息 /// /// [XmlElement("Initiator")] public Initiator initiator; /// /// 用来表示这些分块所有者的信息 /// /// [XmlElement("Owner")] public Owner owner; /// /// 分块上传的起始时间 /// [XmlElement("Initiated")] public string initiated; public string GetInfo() { StringBuilder stringBuilder = new StringBuilder("{Upload:\n"); stringBuilder.Append("Key:").Append(key).Append("\n"); stringBuilder.Append("UploadID:").Append(uploadID).Append("\n"); stringBuilder.Append("StorageClass:").Append(storageClass).Append("\n"); if (initiator != null) { stringBuilder.Append(initiator.GetInfo()).Append("\n"); } if (owner != null) { stringBuilder.Append(owner.GetInfo()).Append("\n"); } stringBuilder.Append("Initiated:").Append(initiated).Append("\n"); stringBuilder.Append("}"); return stringBuilder.ToString(); } } public sealed class CommonPrefixes { /// /// 显示具体的 CommonPrefixes /// [XmlElement("Prefix")] public string prefix; public string GetInfo() { StringBuilder stringBuilder = new StringBuilder("{CommonPrefixes:\n"); stringBuilder.Append("Prefix:").Append(prefix).Append("\n"); stringBuilder.Append("}"); return stringBuilder.ToString(); } } public sealed class Initiator { /// /// 用户唯一的 CAM 身份 UIN /// [XmlElement("UIN")] public string uin; /// /// 用户唯一的 CAM 身份 ID /// [XmlElement("ID")] public string id; /// /// 用户身份 ID 的简称(UIN) /// [XmlElement("DisplayName")] public string displayName; public string GetInfo() { StringBuilder stringBuilder = new StringBuilder("{Initiator:\n"); stringBuilder.Append("Uin:").Append(uin).Append("\n"); stringBuilder.Append("Id:").Append(id).Append("\n"); stringBuilder.Append("DisplayName:").Append(displayName).Append("\n"); stringBuilder.Append("}"); return stringBuilder.ToString(); } } public sealed class Owner { /// /// 用户唯一的 CAM 身份 UID /// public string uid; /// /// 用户唯一的 CAM 身份 ID /// [XmlElement("ID")] public string id; /// /// 用户身份 ID 的简称(UIN) /// [XmlElement("DisplayName")] public string displayName; public string GetInfo() { StringBuilder stringBuilder = new StringBuilder("{Owner:\n"); stringBuilder.Append("Uid:").Append(uid).Append("\n"); stringBuilder.Append("Id:").Append(id).Append("\n"); stringBuilder.Append("DisplayName:").Append(displayName).Append("\n"); stringBuilder.Append("}"); return stringBuilder.ToString(); } } } }