SubmitTextCensorJobRequest.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using COSXML.Common;
  5. using COSXML.Model.Object;
  6. using COSXML.Model.Tag;
  7. using COSXML.CosException;
  8. using COSXML.Utils;
  9. namespace COSXML.Model.CI
  10. {
  11. /// <summary>
  12. /// 提交文本审核任务
  13. /// <see href="https://cloud.tencent.com/document/product/436/56289"/>
  14. /// </summary>
  15. public sealed class SubmitTextCensorJobRequest : CIRequest
  16. {
  17. public TextCensorJobInfo textCensorJobInfo;
  18. public SubmitTextCensorJobRequest(string bucket)
  19. : base(bucket)
  20. {
  21. textCensorJobInfo = new TextCensorJobInfo();
  22. this.method = CosRequestMethod.POST;
  23. this.SetRequestPath("/text/auditing");
  24. this.SetRequestHeader("Content-Type", "application/xml");
  25. textCensorJobInfo.input = new TextCensorJobInfo.Input();
  26. textCensorJobInfo.conf = new TextCensorJobInfo.Conf();
  27. }
  28. public void SetCensorObject(string key)
  29. {
  30. textCensorJobInfo.input.obj = key;
  31. }
  32. public void SetCensorContent(string content)
  33. {
  34. textCensorJobInfo.input.content = content;
  35. }
  36. public void SetDetectType(string detectType)
  37. {
  38. textCensorJobInfo.conf.detectType = detectType;
  39. }
  40. public void SetCallback(string callbackUrl)
  41. {
  42. textCensorJobInfo.conf.callback = callbackUrl;
  43. }
  44. public void SetBizType(string BizType)
  45. {
  46. textCensorJobInfo.conf.bizType = BizType;
  47. }
  48. public override Network.RequestBody GetRequestBody()
  49. {
  50. return GetXmlRequestBody(textCensorJobInfo);
  51. }
  52. }
  53. }