auditing_resp.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. #pragma once
  2. #include <sstream>
  3. #include <string>
  4. #include <vector>
  5. #include "rapidxml/1.13/rapidxml.hpp"
  6. #include "rapidxml/1.13/rapidxml_print.hpp"
  7. #include "rapidxml/1.13/rapidxml_utils.hpp"
  8. #include "request/auditing_req.h"
  9. #include "response/object_resp.h"
  10. namespace qcloud_cos {
  11. class AuditingResp: public BaseResp {
  12. public:
  13. AuditingResp() {}
  14. virtual ~AuditingResp() {}
  15. virtual bool ParseFromXmlString(const std::string& body) { UNUSED_PARAM(body); return true;};
  16. protected:
  17. static bool ParseSceneResultInfo(rapidxml::xml_node<>* root, SceneResultInfo& scene_result_info);
  18. static bool ParseOcrResultInfo(rapidxml::xml_node<>* root, OcrResult& ocr_results);
  19. static bool ParseLocation(rapidxml::xml_node<>* root, Location& location);
  20. static bool ParseUserInfo(rapidxml::xml_node<>* root, UserInfo& user_info);
  21. static bool ParseSegmentResult(rapidxml::xml_node<>* root, SegmentResult& segment_result);
  22. static bool ParseResults(rapidxml::xml_node<>* root, Result& result);
  23. static bool ParseObjectResults(rapidxml::xml_node<>* root, ObjectResults& object_results);
  24. static bool ParseRecognitionResult(rapidxml::xml_node<>* root, RecognitionResult& result);
  25. static bool ParseListInfo(rapidxml::xml_node<>* root, ListInfo& list_info);
  26. };
  27. class AuditingJobResp : public AuditingResp {
  28. public:
  29. AuditingJobResp() {}
  30. virtual ~AuditingJobResp() {}
  31. virtual bool ParseFromXmlString(const std::string& body);
  32. virtual bool ParseJobsDetail(rapidxml::xml_node<>* root) { UNUSED_PARAM(root); return true;};
  33. std::string GetRequestId() const { return m_request_id; }
  34. protected:
  35. std::string m_request_id;
  36. };
  37. class ImageAuditingResp : public AuditingJobResp {
  38. public:
  39. ImageAuditingResp() {}
  40. virtual ~ImageAuditingResp() {}
  41. virtual bool ParseFromXmlString(const std::string& body) { UNUSED_PARAM(body); return true; }
  42. static bool ParseImageAuditingJobsDetail(rapidxml::xml_node<>* root, ImageAuditingJobsDetail& jobs_detail);
  43. };
  44. class GetImageAuditingResp : public ImageAuditingResp {
  45. public:
  46. GetImageAuditingResp() {}
  47. virtual ~GetImageAuditingResp() {}
  48. virtual bool ParseFromXmlString(const std::string& body);
  49. ImageAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  50. private:
  51. ImageAuditingJobsDetail m_jobs_detail;
  52. };
  53. class BatchImageAuditingResp : public ImageAuditingResp {
  54. public:
  55. BatchImageAuditingResp() {}
  56. virtual ~BatchImageAuditingResp() {}
  57. virtual bool ParseFromXmlString(const std::string& body);
  58. std::vector<ImageAuditingJobsDetail> GetJobsDetails() const { return m_jobs_details; }
  59. private:
  60. std::vector<ImageAuditingJobsDetail> m_jobs_details;
  61. };
  62. class DescribeImageAuditingJobResp : public ImageAuditingResp {
  63. public:
  64. DescribeImageAuditingJobResp() {}
  65. virtual ~DescribeImageAuditingJobResp() {}
  66. virtual bool ParseFromXmlString(const std::string& body);
  67. ImageAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  68. private:
  69. ImageAuditingJobsDetail m_jobs_detail;
  70. std::string m_request_id;
  71. };
  72. class VideoAuditingResp : public AuditingJobResp {
  73. public:
  74. VideoAuditingResp() {}
  75. virtual ~VideoAuditingResp() {}
  76. virtual bool ParseJobsDetail(rapidxml::xml_node<>* root);
  77. VideoAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  78. protected:
  79. VideoAuditingJobsDetail m_jobs_detail;
  80. };
  81. class CreateVideoAuditingJobResp : public VideoAuditingResp {
  82. public:
  83. CreateVideoAuditingJobResp() {}
  84. virtual ~CreateVideoAuditingJobResp() {}
  85. };
  86. class DescribeVideoAuditingJobResp : public VideoAuditingResp {
  87. public:
  88. DescribeVideoAuditingJobResp() {}
  89. virtual ~DescribeVideoAuditingJobResp() {}
  90. };
  91. class AudioAuditingResp : public AuditingJobResp {
  92. public:
  93. AudioAuditingResp() {}
  94. virtual ~AudioAuditingResp() {}
  95. virtual bool ParseJobsDetail(rapidxml::xml_node<>* root);
  96. AudioAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  97. protected:
  98. AudioAuditingJobsDetail m_jobs_detail;
  99. };
  100. class CreateAudioAuditingJobResp : public AudioAuditingResp {
  101. public:
  102. CreateAudioAuditingJobResp() {}
  103. virtual ~CreateAudioAuditingJobResp() {}
  104. };
  105. class DescribeAudioAuditingJobResp : public AudioAuditingResp {
  106. public:
  107. DescribeAudioAuditingJobResp() {}
  108. virtual ~DescribeAudioAuditingJobResp() {}
  109. };
  110. class TextAuditingResp : public AuditingJobResp {
  111. public:
  112. TextAuditingResp() {}
  113. virtual ~TextAuditingResp() {}
  114. virtual bool ParseJobsDetail(rapidxml::xml_node<>* root);
  115. TextAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  116. protected:
  117. TextAuditingJobsDetail m_jobs_detail;
  118. };
  119. class CreateTextAuditingJobResp : public TextAuditingResp {
  120. public:
  121. CreateTextAuditingJobResp() {}
  122. virtual ~CreateTextAuditingJobResp() {}
  123. };
  124. class DescribeTextAuditingJobResp : public TextAuditingResp {
  125. public:
  126. DescribeTextAuditingJobResp() {}
  127. virtual ~DescribeTextAuditingJobResp() {}
  128. };
  129. class DocumentAuditingResp : public AuditingJobResp {
  130. public:
  131. DocumentAuditingResp() {}
  132. virtual ~DocumentAuditingResp() {}
  133. virtual bool ParseJobsDetail(rapidxml::xml_node<>* root);
  134. DocumentAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  135. protected:
  136. DocumentAuditingJobsDetail m_jobs_detail;
  137. };
  138. class CreateDocumentAuditingJobResp : public DocumentAuditingResp {
  139. public:
  140. CreateDocumentAuditingJobResp() {}
  141. virtual ~CreateDocumentAuditingJobResp() {}
  142. };
  143. class DescribeDocumentAuditingJobResp : public DocumentAuditingResp {
  144. public:
  145. DescribeDocumentAuditingJobResp() {}
  146. virtual ~DescribeDocumentAuditingJobResp() {}
  147. };
  148. class WebPageAuditingResp : public AuditingJobResp {
  149. public:
  150. WebPageAuditingResp() {}
  151. virtual ~WebPageAuditingResp() {}
  152. virtual bool ParseJobsDetail(rapidxml::xml_node<>* root);
  153. WebPageAuditingJobsDetail GetJobsDetail() const { return m_jobs_detail; }
  154. protected:
  155. WebPageAuditingJobsDetail m_jobs_detail;
  156. };
  157. class CreateWebPageAuditingJobResp : public WebPageAuditingResp {
  158. public:
  159. CreateWebPageAuditingJobResp() {}
  160. virtual ~CreateWebPageAuditingJobResp() {}
  161. };
  162. class DescribeWebPageAuditingJobResp : public WebPageAuditingResp {
  163. public:
  164. DescribeWebPageAuditingJobResp() {}
  165. virtual ~DescribeWebPageAuditingJobResp() {}
  166. };
  167. }