GetBucketRefererCommand.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) Alibaba Cloud Computing
  3. * All rights reserved.
  4. *
  5. * 版权所有 (C)阿里云计算有限公司
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using Aliyun.OSS.Common.Communication;
  10. using Aliyun.OSS.Util;
  11. using Aliyun.OSS.Transform;
  12. namespace Aliyun.OSS.Commands
  13. {
  14. internal class GetBucketRefererCommand : OssCommand<RefererConfiguration>
  15. {
  16. private readonly string _bucketName;
  17. protected override string Bucket
  18. {
  19. get { return _bucketName; }
  20. }
  21. private GetBucketRefererCommand(IServiceClient client, Uri endpoint, ExecutionContext context,
  22. string bucketName, IDeserializer<ServiceResponse, RefererConfiguration> deserializer)
  23. : base(client, endpoint, context, deserializer)
  24. {
  25. OssUtils.CheckBucketName(bucketName);
  26. _bucketName = bucketName;
  27. }
  28. public static GetBucketRefererCommand Create(IServiceClient client, Uri endpoint,
  29. ExecutionContext context,
  30. string bucketName)
  31. {
  32. return new GetBucketRefererCommand(client, endpoint, context, bucketName,
  33. DeserializerFactory.GetFactory().CreateGetBucketRefererResultDeserializer());
  34. }
  35. protected override IDictionary<string, string> Parameters
  36. {
  37. get
  38. {
  39. return new Dictionary<string, string>()
  40. {
  41. { RequestParameters.SUBRESOURCE_REFERER, null }
  42. };
  43. }
  44. }
  45. }
  46. }