DescribeGroupedVulResult.cc 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/ecd/model/DescribeGroupedVulResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Ecd;
  19. using namespace AlibabaCloud::Ecd::Model;
  20. DescribeGroupedVulResult::DescribeGroupedVulResult() :
  21. ServiceResult()
  22. {}
  23. DescribeGroupedVulResult::DescribeGroupedVulResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeGroupedVulResult::~DescribeGroupedVulResult()
  29. {}
  30. void DescribeGroupedVulResult::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 allGroupedVulItemsNode = value["GroupedVulItems"]["GroupedVulItem"];
  37. for (auto valueGroupedVulItemsGroupedVulItem : allGroupedVulItemsNode)
  38. {
  39. GroupedVulItem groupedVulItemsObject;
  40. if(!valueGroupedVulItemsGroupedVulItem["Type"].isNull())
  41. groupedVulItemsObject.type = valueGroupedVulItemsGroupedVulItem["Type"].asString();
  42. if(!valueGroupedVulItemsGroupedVulItem["NntfCount"].isNull())
  43. groupedVulItemsObject.nntfCount = std::stoi(valueGroupedVulItemsGroupedVulItem["NntfCount"].asString());
  44. if(!valueGroupedVulItemsGroupedVulItem["HandledCount"].isNull())
  45. groupedVulItemsObject.handledCount = std::stoi(valueGroupedVulItemsGroupedVulItem["HandledCount"].asString());
  46. if(!valueGroupedVulItemsGroupedVulItem["GmtLast"].isNull())
  47. groupedVulItemsObject.gmtLast = valueGroupedVulItemsGroupedVulItem["GmtLast"].asString();
  48. if(!valueGroupedVulItemsGroupedVulItem["Tags"].isNull())
  49. groupedVulItemsObject.tags = valueGroupedVulItemsGroupedVulItem["Tags"].asString();
  50. if(!valueGroupedVulItemsGroupedVulItem["LaterCount"].isNull())
  51. groupedVulItemsObject.laterCount = std::stoi(valueGroupedVulItemsGroupedVulItem["LaterCount"].asString());
  52. if(!valueGroupedVulItemsGroupedVulItem["AliasName"].isNull())
  53. groupedVulItemsObject.aliasName = valueGroupedVulItemsGroupedVulItem["AliasName"].asString();
  54. if(!valueGroupedVulItemsGroupedVulItem["Name"].isNull())
  55. groupedVulItemsObject.name = valueGroupedVulItemsGroupedVulItem["Name"].asString();
  56. if(!valueGroupedVulItemsGroupedVulItem["AsapCount"].isNull())
  57. groupedVulItemsObject.asapCount = std::stoi(valueGroupedVulItemsGroupedVulItem["AsapCount"].asString());
  58. groupedVulItems_.push_back(groupedVulItemsObject);
  59. }
  60. if(!value["CurrentPage"].isNull())
  61. currentPage_ = std::stoi(value["CurrentPage"].asString());
  62. if(!value["PageSize"].isNull())
  63. pageSize_ = std::stoi(value["PageSize"].asString());
  64. if(!value["TotalCount"].isNull())
  65. totalCount_ = std::stoi(value["TotalCount"].asString());
  66. }
  67. int DescribeGroupedVulResult::getTotalCount()const
  68. {
  69. return totalCount_;
  70. }
  71. int DescribeGroupedVulResult::getPageSize()const
  72. {
  73. return pageSize_;
  74. }
  75. int DescribeGroupedVulResult::getCurrentPage()const
  76. {
  77. return currentPage_;
  78. }
  79. std::vector<DescribeGroupedVulResult::GroupedVulItem> DescribeGroupedVulResult::getGroupedVulItems()const
  80. {
  81. return groupedVulItems_;
  82. }