UploadPartCopyResponseDeserializer.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using System.IO;
  8. using Aliyun.OSS.Common.Communication;
  9. using Aliyun.OSS.Util;
  10. using Aliyun.OSS.Model;
  11. namespace Aliyun.OSS.Transform
  12. {
  13. internal class UploadPartCopyResultDeserializer : ResponseDeserializer<UploadPartCopyResult, UploadPartCopyRequestModel>
  14. {
  15. private readonly int _partNumber;
  16. public UploadPartCopyResultDeserializer(IDeserializer<Stream, UploadPartCopyRequestModel> contentDeserializer, int partNumber)
  17. : base(contentDeserializer)
  18. {
  19. _partNumber = partNumber;
  20. }
  21. public override UploadPartCopyResult Deserialize(ServiceResponse xmlStream)
  22. {
  23. var partCopyRequestModel = ContentDeserializer.Deserialize(xmlStream.Content);
  24. var result = new UploadPartCopyResult
  25. {
  26. ETag = OssUtils.TrimQuotes(partCopyRequestModel.ETag),
  27. PartNumber = _partNumber
  28. };
  29. return result;
  30. }
  31. }
  32. }