DescribeLogItemsResult.cc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/aegis/model/DescribeLogItemsResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Aegis;
  19. using namespace AlibabaCloud::Aegis::Model;
  20. DescribeLogItemsResult::DescribeLogItemsResult() :
  21. ServiceResult()
  22. {}
  23. DescribeLogItemsResult::DescribeLogItemsResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeLogItemsResult::~DescribeLogItemsResult()
  29. {}
  30. void DescribeLogItemsResult::parse(const std::string &payload)
  31. {
  32. Json::Reader reader;
  33. Json::Value value;
  34. reader.parse(payload, value);
  35. setRequestId(value["RequestId"].asString());
  36. auto allLogsListNode = value["LogsList"]["LogsListItem"];
  37. for (auto valueLogsListLogsListItem : allLogsListNode)
  38. {
  39. LogsListItem logsListObject;
  40. if(!valueLogsListLogsListItem["MLogTime"].isNull())
  41. logsListObject.mLogTime = valueLogsListLogsListItem["MLogTime"].asString();
  42. if(!valueLogsListLogsListItem["LogSourceId"].isNull())
  43. logsListObject.logSourceId = valueLogsListLogsListItem["LogSourceId"].asString();
  44. if(!valueLogsListLogsListItem["LogSource"].isNull())
  45. logsListObject.logSource = valueLogsListLogsListItem["LogSource"].asString();
  46. auto allMContentsNode = allLogsListNode["MContents"]["MContentsItem"];
  47. for (auto allLogsListNodeMContentsMContentsItem : allMContentsNode)
  48. {
  49. LogsListItem::MContentsItem mContentsObject;
  50. if(!allLogsListNodeMContentsMContentsItem["MKey"].isNull())
  51. mContentsObject.mKey = allLogsListNodeMContentsMContentsItem["MKey"].asString();
  52. if(!allLogsListNodeMContentsMContentsItem["MValue"].isNull())
  53. mContentsObject.mValue = allLogsListNodeMContentsMContentsItem["MValue"].asString();
  54. logsListObject.mContents.push_back(mContentsObject);
  55. }
  56. logsList_.push_back(logsListObject);
  57. }
  58. if(!value["TotalCount"].isNull())
  59. totalCount_ = std::stoi(value["TotalCount"].asString());
  60. if(!value["CrackTotalCount"].isNull())
  61. crackTotalCount_ = std::stoi(value["CrackTotalCount"].asString());
  62. if(!value["SetPageSize"].isNull())
  63. setPageSize_ = std::stoi(value["SetPageSize"].asString());
  64. if(!value["ProcessOffset"].isNull())
  65. processOffset_ = std::stoi(value["ProcessOffset"].asString());
  66. if(!value["NetworkOffset"].isNull())
  67. networkOffset_ = std::stoi(value["NetworkOffset"].asString());
  68. if(!value["PortSnapshotOffset"].isNull())
  69. portSnapshotOffset_ = std::stoi(value["PortSnapshotOffset"].asString());
  70. if(!value["ProcessSnapshotTotalCount"].isNull())
  71. processSnapshotTotalCount_ = std::stoi(value["ProcessSnapshotTotalCount"].asString());
  72. if(!value["CrackOffset"].isNull())
  73. crackOffset_ = std::stoi(value["CrackOffset"].asString());
  74. if(!value["NetworkTotalCount"].isNull())
  75. networkTotalCount_ = std::stoi(value["NetworkTotalCount"].asString());
  76. if(!value["PortSnapshotTotalCount"].isNull())
  77. portSnapshotTotalCount_ = std::stoi(value["PortSnapshotTotalCount"].asString());
  78. if(!value["ProcessSnapshotOffset"].isNull())
  79. processSnapshotOffset_ = std::stoi(value["ProcessSnapshotOffset"].asString());
  80. if(!value["ProcessTotalCount"].isNull())
  81. processTotalCount_ = std::stoi(value["ProcessTotalCount"].asString());
  82. if(!value["LoginTotalCount"].isNull())
  83. loginTotalCount_ = std::stoi(value["LoginTotalCount"].asString());
  84. if(!value["CurrentPage"].isNull())
  85. currentPage_ = std::stoi(value["CurrentPage"].asString());
  86. if(!value["AccountSnapshotOffset"].isNull())
  87. accountSnapshotOffset_ = std::stoi(value["AccountSnapshotOffset"].asString());
  88. if(!value["AccountSnapshotTotalCount"].isNull())
  89. accountSnapshotTotalCount_ = std::stoi(value["AccountSnapshotTotalCount"].asString());
  90. }
  91. int DescribeLogItemsResult::getSetPageSize()const
  92. {
  93. return setPageSize_;
  94. }
  95. std::vector<DescribeLogItemsResult::LogsListItem> DescribeLogItemsResult::getLogsList()const
  96. {
  97. return logsList_;
  98. }
  99. int DescribeLogItemsResult::getCrackOffset()const
  100. {
  101. return crackOffset_;
  102. }
  103. int DescribeLogItemsResult::getAccountSnapshotTotalCount()const
  104. {
  105. return accountSnapshotTotalCount_;
  106. }
  107. int DescribeLogItemsResult::getProcessOffset()const
  108. {
  109. return processOffset_;
  110. }
  111. int DescribeLogItemsResult::getNetworkOffset()const
  112. {
  113. return networkOffset_;
  114. }
  115. int DescribeLogItemsResult::getTotalCount()const
  116. {
  117. return totalCount_;
  118. }
  119. int DescribeLogItemsResult::getProcessSnapshotOffset()const
  120. {
  121. return processSnapshotOffset_;
  122. }
  123. int DescribeLogItemsResult::getLoginTotalCount()const
  124. {
  125. return loginTotalCount_;
  126. }
  127. int DescribeLogItemsResult::getCurrentPage()const
  128. {
  129. return currentPage_;
  130. }
  131. int DescribeLogItemsResult::getPortSnapshotOffset()const
  132. {
  133. return portSnapshotOffset_;
  134. }
  135. int DescribeLogItemsResult::getNetworkTotalCount()const
  136. {
  137. return networkTotalCount_;
  138. }
  139. int DescribeLogItemsResult::getAccountSnapshotOffset()const
  140. {
  141. return accountSnapshotOffset_;
  142. }
  143. int DescribeLogItemsResult::getCrackTotalCount()const
  144. {
  145. return crackTotalCount_;
  146. }
  147. int DescribeLogItemsResult::getProcessSnapshotTotalCount()const
  148. {
  149. return processSnapshotTotalCount_;
  150. }
  151. int DescribeLogItemsResult::getPortSnapshotTotalCount()const
  152. {
  153. return portSnapshotTotalCount_;
  154. }
  155. int DescribeLogItemsResult::getProcessTotalCount()const
  156. {
  157. return processTotalCount_;
  158. }