LifecycleConfiguration.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using System;
  8. using System.Xml.Serialization;
  9. namespace Aliyun.OSS.Model
  10. {
  11. [XmlRoot("LifecycleConfiguration")]
  12. public class LifecycleConfiguration
  13. {
  14. [XmlElement("Rule")]
  15. public LifecycleRule[] LifecycleRules { get; set; }
  16. }
  17. [XmlRoot("Rule")]
  18. public class LifecycleRule
  19. {
  20. [XmlElement("ID")]
  21. public string ID { get; set; }
  22. [XmlElement("Prefix")]
  23. public String Prefix { get; set; }
  24. [XmlElement("Status")]
  25. public string Status { get; set; }
  26. [XmlElement("Expiration")]
  27. public Expiration Expiration { get; set; }
  28. }
  29. public class Expiration
  30. {
  31. [XmlElement("Days", IsNullable = true)]
  32. public int? Days { get; set; }
  33. public bool ShouldSerializeDays()
  34. {
  35. return Days.HasValue;
  36. }
  37. public bool IsSetDays()
  38. {
  39. return Days.HasValue;
  40. }
  41. [XmlElement("Date", IsNullable = true)]
  42. public string Date { get; set; }
  43. public bool ShouldSerializeDate()
  44. {
  45. return Date != null;
  46. }
  47. public bool IsSetDate()
  48. {
  49. return Date != null;
  50. }
  51. }
  52. }