/* * Copyright (C) Alibaba Cloud Computing * All rights reserved. * * 版权所有 (C)阿里云计算有限公司 */ using System.IO; using System.Collections.Generic; using Aliyun.OSS.Model; namespace Aliyun.OSS.Transform { internal class CompleteMultipartUploadRequestSerializer : RequestSerializer { public CompleteMultipartUploadRequestSerializer(ISerializer contentSerializer) : base(contentSerializer) { } public override Stream Serialize(CompleteMultipartUploadRequest request) { var model = new CompleteMultipartUploadRequestModel(); var modelParts = new List(); foreach (var part in request.PartETags) { var modelPart = new CompleteMultipartUploadRequestModel.CompletePart { ETag = "\"" + part.ETag + "\"", PartNumber = part.PartNumber }; modelParts.Add(modelPart); } model.Parts = modelParts.ToArray(); return ContentSerializer.Serialize(model); } } }