GetBucketWebSiteResultDeserializer.cs 930 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using Aliyun.OSS.Common.Communication;
  8. using Aliyun.OSS.Model;
  9. using System.IO;
  10. namespace Aliyun.OSS.Transform
  11. {
  12. internal class GetBucketWebSiteResultDeserializer : ResponseDeserializer<BucketWebsiteResult, SetBucketWebsiteRequestModel>
  13. {
  14. public GetBucketWebSiteResultDeserializer(IDeserializer<Stream, SetBucketWebsiteRequestModel> contentDeserializer)
  15. : base(contentDeserializer)
  16. { }
  17. public override BucketWebsiteResult Deserialize(ServiceResponse xmlStream)
  18. {
  19. var model = ContentDeserializer.Deserialize(xmlStream.Content);
  20. return new BucketWebsiteResult
  21. {
  22. IndexDocument = model.IndexDocument.Suffix,
  23. ErrorDocument = model.ErrorDocument.Key
  24. };
  25. }
  26. }
  27. }