ListBucketVersionsRequest.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using COSXML.Common;
  5. namespace COSXML.Model.Bucket
  6. {
  7. public sealed class ListBucketVersionsRequest : BucketRequest
  8. {
  9. public ListBucketVersionsRequest(string bucket)
  10. : base(bucket)
  11. {
  12. this.method = CosRequestMethod.GET;
  13. this.queryParameters.Add("versions", null);
  14. }
  15. public void SetPrefix(string prefix)
  16. {
  17. if (prefix != null)
  18. {
  19. SetQueryParameter("prefix", prefix);
  20. }
  21. }
  22. public void SetKeyMarker(string keyMarker)
  23. {
  24. if (keyMarker != null)
  25. {
  26. SetQueryParameter("key-marker", keyMarker);
  27. }
  28. }
  29. public void SetVersionIdMarker(string versionIdMarker)
  30. {
  31. if (versionIdMarker != null)
  32. {
  33. SetQueryParameter("version-id-marker", versionIdMarker);
  34. }
  35. }
  36. public void SetDelimiter(string delimiter)
  37. {
  38. if (delimiter != null)
  39. {
  40. SetQueryParameter("delimiter", delimiter);
  41. }
  42. }
  43. public void SetEncodingType(string encodingType)
  44. {
  45. if (encodingType != null)
  46. {
  47. SetQueryParameter("encoding-type", encodingType);
  48. }
  49. }
  50. public void SetMaxKeys(string maxKeys)
  51. {
  52. if (maxKeys != null)
  53. {
  54. SetQueryParameter("max-keys", maxKeys);
  55. }
  56. else
  57. {
  58. SetQueryParameter("max-keys", "1000");
  59. }
  60. }
  61. }
  62. }