SubmitAudioCensorJobRequest.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/54063"/>
  14. /// </summary>
  15. public sealed class SubmitAudioCensorJobRequest : CIRequest
  16. {
  17. public AudioCencorJobInfo audioCencorJobInfo;
  18. public SubmitAudioCensorJobRequest(string bucket)
  19. : base(bucket)
  20. {
  21. audioCencorJobInfo = new AudioCencorJobInfo();
  22. this.method = CosRequestMethod.POST;
  23. this.SetRequestPath("/audio/auditing");
  24. this.SetRequestHeader("Content-Type", "application/xml");
  25. audioCencorJobInfo.input = new AudioCencorJobInfo.Input();
  26. audioCencorJobInfo.conf = new AudioCencorJobInfo.Conf();
  27. }
  28. public void SetCensorObject(string key)
  29. {
  30. audioCencorJobInfo.input.obj = key;
  31. }
  32. public void SetCensorUrl(string url)
  33. {
  34. audioCencorJobInfo.input.url = url;
  35. }
  36. public void SetDetectType(string detectType)
  37. {
  38. audioCencorJobInfo.conf.detectType = detectType;
  39. }
  40. public void SetCallback(string callbackUrl)
  41. {
  42. audioCencorJobInfo.conf.callback = callbackUrl;
  43. }
  44. public void SetCallbackVersion(string callbackVersion)
  45. {
  46. audioCencorJobInfo.conf.callbackVersion = callbackVersion;
  47. }
  48. public void SetBizType(string BizType)
  49. {
  50. audioCencorJobInfo.conf.bizType = BizType;
  51. }
  52. public override Network.RequestBody GetRequestBody()
  53. {
  54. return GetXmlRequestBody(audioCencorJobInfo);
  55. }
  56. }
  57. }