QueryFpImportResultResult.cc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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/mts/model/QueryFpImportResultResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Mts;
  19. using namespace AlibabaCloud::Mts::Model;
  20. QueryFpImportResultResult::QueryFpImportResultResult() :
  21. ServiceResult()
  22. {}
  23. QueryFpImportResultResult::QueryFpImportResultResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. QueryFpImportResultResult::~QueryFpImportResultResult()
  29. {}
  30. void QueryFpImportResultResult::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 allFpResultLogInfoList = value["FpResultLogInfoList"]["FpResultLogInfo"];
  37. for (auto value : allFpResultLogInfoList)
  38. {
  39. FpResultLogInfo fpResultLogInfoListObject;
  40. if(!value["LogPath"].isNull())
  41. fpResultLogInfoListObject.logPath = value["LogPath"].asString();
  42. if(!value["LogName"].isNull())
  43. fpResultLogInfoListObject.logName = value["LogName"].asString();
  44. if(!value["LogStartTime"].isNull())
  45. fpResultLogInfoListObject.logStartTime = std::stol(value["LogStartTime"].asString());
  46. if(!value["LogEndTime"].isNull())
  47. fpResultLogInfoListObject.logEndTime = std::stol(value["LogEndTime"].asString());
  48. if(!value["LogSize"].isNull())
  49. fpResultLogInfoListObject.logSize = std::stol(value["LogSize"].asString());
  50. if(!value["CreateTime"].isNull())
  51. fpResultLogInfoListObject.createTime = std::stol(value["CreateTime"].asString());
  52. fpResultLogInfoList_.push_back(fpResultLogInfoListObject);
  53. }
  54. auto pageInfoNode = value["PageInfo"];
  55. if(!pageInfoNode["PageIndex"].isNull())
  56. pageInfo_.pageIndex = std::stol(pageInfoNode["PageIndex"].asString());
  57. if(!pageInfoNode["PageSize"].isNull())
  58. pageInfo_.pageSize = std::stol(pageInfoNode["PageSize"].asString());
  59. if(!pageInfoNode["Total"].isNull())
  60. pageInfo_.total = std::stol(pageInfoNode["Total"].asString());
  61. if(!value["LogCount"].isNull())
  62. logCount_ = std::stol(value["LogCount"].asString());
  63. }
  64. QueryFpImportResultResult::PageInfo QueryFpImportResultResult::getPageInfo()const
  65. {
  66. return pageInfo_;
  67. }
  68. std::vector<QueryFpImportResultResult::FpResultLogInfo> QueryFpImportResultResult::getFpResultLogInfoList()const
  69. {
  70. return fpResultLogInfoList_;
  71. }
  72. long QueryFpImportResultResult::getLogCount()const
  73. {
  74. return logCount_;
  75. }