DeleteObjectRequest.cs 837 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using COSXML.Common;
  5. namespace COSXML.Model.Object
  6. {
  7. /// <summary>
  8. /// 删除对象
  9. /// <see href="https://cloud.tencent.com/document/product/436/7743"/>
  10. /// </summary>
  11. public sealed class DeleteObjectRequest : ObjectRequest
  12. {
  13. public DeleteObjectRequest(string bucket, string key)
  14. : base(bucket, key)
  15. {
  16. this.method = CosRequestMethod.DELETE;
  17. }
  18. /// <summary>
  19. /// 删除指定版本的对象
  20. /// </summary>
  21. /// <param name="versionId"></param>
  22. public void SetVersionId(string versionId)
  23. {
  24. if (versionId != null)
  25. {
  26. SetQueryParameter(CosRequestHeaderKey.VERSION_ID, versionId);
  27. }
  28. }
  29. }
  30. }