DescribeSmartStatisticsPageListResult.cc 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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/cloudauth/model/DescribeSmartStatisticsPageListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Cloudauth;
  19. using namespace AlibabaCloud::Cloudauth::Model;
  20. DescribeSmartStatisticsPageListResult::DescribeSmartStatisticsPageListResult() :
  21. ServiceResult()
  22. {}
  23. DescribeSmartStatisticsPageListResult::DescribeSmartStatisticsPageListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeSmartStatisticsPageListResult::~DescribeSmartStatisticsPageListResult()
  29. {}
  30. void DescribeSmartStatisticsPageListResult::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 allItemsNode = value["Items"]["ItemsItem"];
  37. for (auto valueItemsItemsItem : allItemsNode)
  38. {
  39. ItemsItem itemsObject;
  40. if(!valueItemsItemsItem["Date"].isNull())
  41. itemsObject.date = valueItemsItemsItem["Date"].asString();
  42. if(!valueItemsItemsItem["SceneId"].isNull())
  43. itemsObject.sceneId = std::stol(valueItemsItemsItem["SceneId"].asString());
  44. if(!valueItemsItemsItem["SceneName"].isNull())
  45. itemsObject.sceneName = valueItemsItemsItem["SceneName"].asString();
  46. if(!valueItemsItemsItem["TotalCount"].isNull())
  47. itemsObject.totalCount = std::stoi(valueItemsItemsItem["TotalCount"].asString());
  48. if(!valueItemsItemsItem["SuccessCount"].isNull())
  49. itemsObject.successCount = std::stoi(valueItemsItemsItem["SuccessCount"].asString());
  50. if(!valueItemsItemsItem["PassRate"].isNull())
  51. itemsObject.passRate = valueItemsItemsItem["PassRate"].asString();
  52. if(!valueItemsItemsItem["ProductCode"].isNull())
  53. itemsObject.productCode = valueItemsItemsItem["ProductCode"].asString();
  54. items_.push_back(itemsObject);
  55. }
  56. if(!value["CurrentPage"].isNull())
  57. currentPage_ = std::stoi(value["CurrentPage"].asString());
  58. if(!value["TotalPage"].isNull())
  59. totalPage_ = std::stoi(value["TotalPage"].asString());
  60. if(!value["PageSize"].isNull())
  61. pageSize_ = std::stoi(value["PageSize"].asString());
  62. if(!value["TotalCount"].isNull())
  63. totalCount_ = std::stoi(value["TotalCount"].asString());
  64. }
  65. int DescribeSmartStatisticsPageListResult::getTotalCount()const
  66. {
  67. return totalCount_;
  68. }
  69. int DescribeSmartStatisticsPageListResult::getTotalPage()const
  70. {
  71. return totalPage_;
  72. }
  73. int DescribeSmartStatisticsPageListResult::getPageSize()const
  74. {
  75. return pageSize_;
  76. }
  77. int DescribeSmartStatisticsPageListResult::getCurrentPage()const
  78. {
  79. return currentPage_;
  80. }
  81. std::vector<DescribeSmartStatisticsPageListResult::ItemsItem> DescribeSmartStatisticsPageListResult::getItems()const
  82. {
  83. return items_;
  84. }