SubmitVideoCensorJobRequest.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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/47316"/>
  14. /// </summary>
  15. public sealed class SubmitVideoCensorJobRequest : CIRequest
  16. {
  17. public VideoCencorJobInfo videoCencorJobInfo;
  18. public SubmitVideoCensorJobRequest(string bucket)
  19. : base(bucket)
  20. {
  21. videoCencorJobInfo = new VideoCencorJobInfo();
  22. this.method = CosRequestMethod.POST;
  23. this.SetRequestPath("/video/auditing");
  24. this.SetRequestHeader("Content-Type", "application/xml");
  25. videoCencorJobInfo.input = new VideoCencorJobInfo.Input();
  26. videoCencorJobInfo.conf = new VideoCencorJobInfo.Conf();
  27. videoCencorJobInfo.conf.snapshot = new VideoCencorJobInfo.Snapshot();
  28. }
  29. public void SetCensorObject(string key)
  30. {
  31. videoCencorJobInfo.input.obj = key;
  32. }
  33. public void SetDetectType(string detectType)
  34. {
  35. videoCencorJobInfo.conf.detectType = detectType;
  36. }
  37. public void SetCallback(string callbackUrl)
  38. {
  39. videoCencorJobInfo.conf.callback = callbackUrl;
  40. }
  41. public void SetCallbackVersion(string callbackVersion)
  42. {
  43. videoCencorJobInfo.conf.callbackVersion = callbackVersion;
  44. }
  45. public void SetBizType(string BizType)
  46. {
  47. videoCencorJobInfo.conf.bizType = BizType;
  48. }
  49. public void SetDetectContent(int detectContent)
  50. {
  51. videoCencorJobInfo.conf.detectContent = detectContent.ToString();
  52. }
  53. public void SetSnapshotCount(string count)
  54. {
  55. videoCencorJobInfo.conf.snapshot.count = count;
  56. }
  57. public void SetSnapshotMode(string mode)
  58. {
  59. videoCencorJobInfo.conf.snapshot.mode = mode;
  60. }
  61. public void SetSnapshotTimeInterval(string timeInterval)
  62. {
  63. videoCencorJobInfo.conf.snapshot.timeInterval = timeInterval;
  64. }
  65. public override Network.RequestBody GetRequestBody()
  66. {
  67. return GetXmlRequestBody(videoCencorJobInfo);
  68. }
  69. }
  70. }