DescribeQuaraFileResult.cc 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/DescribeQuaraFileResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Aegis;
  19. using namespace AlibabaCloud::Aegis::Model;
  20. DescribeQuaraFileResult::DescribeQuaraFileResult() :
  21. ServiceResult()
  22. {}
  23. DescribeQuaraFileResult::DescribeQuaraFileResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeQuaraFileResult::~DescribeQuaraFileResult()
  29. {}
  30. void DescribeQuaraFileResult::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 allQuaraFilesNode = value["QuaraFiles"]["QuaraFile"];
  37. for (auto valueQuaraFilesQuaraFile : allQuaraFilesNode)
  38. {
  39. QuaraFile quaraFilesObject;
  40. if(!valueQuaraFilesQuaraFile["Path"].isNull())
  41. quaraFilesObject.path = valueQuaraFilesQuaraFile["Path"].asString();
  42. if(!valueQuaraFilesQuaraFile["EventName"].isNull())
  43. quaraFilesObject.eventName = valueQuaraFilesQuaraFile["EventName"].asString();
  44. if(!valueQuaraFilesQuaraFile["Online"].isNull())
  45. quaraFilesObject.online = valueQuaraFilesQuaraFile["Online"].asString() == "true";
  46. if(!valueQuaraFilesQuaraFile["EventType"].isNull())
  47. quaraFilesObject.eventType = valueQuaraFilesQuaraFile["EventType"].asString();
  48. if(!valueQuaraFilesQuaraFile["Tag"].isNull())
  49. quaraFilesObject.tag = valueQuaraFilesQuaraFile["Tag"].asString();
  50. if(!valueQuaraFilesQuaraFile["Uuid"].isNull())
  51. quaraFilesObject.uuid = valueQuaraFilesQuaraFile["Uuid"].asString();
  52. if(!valueQuaraFilesQuaraFile["FileStatus"].isNull())
  53. quaraFilesObject.fileStatus = valueQuaraFilesQuaraFile["FileStatus"].asString();
  54. if(!valueQuaraFilesQuaraFile["Md5"].isNull())
  55. quaraFilesObject.md5 = valueQuaraFilesQuaraFile["Md5"].asString();
  56. quaraFiles_.push_back(quaraFilesObject);
  57. }
  58. if(!value["PageSize"].isNull())
  59. pageSize_ = std::stoi(value["PageSize"].asString());
  60. if(!value["TotalCount"].isNull())
  61. totalCount_ = std::stoi(value["TotalCount"].asString());
  62. if(!value["CurrentPage"].isNull())
  63. currentPage_ = std::stoi(value["CurrentPage"].asString());
  64. }
  65. int DescribeQuaraFileResult::getTotalCount()const
  66. {
  67. return totalCount_;
  68. }
  69. int DescribeQuaraFileResult::getPageSize()const
  70. {
  71. return pageSize_;
  72. }
  73. int DescribeQuaraFileResult::getCurrentPage()const
  74. {
  75. return currentPage_;
  76. }
  77. std::vector<DescribeQuaraFileResult::QuaraFile> DescribeQuaraFileResult::getQuaraFiles()const
  78. {
  79. return quaraFiles_;
  80. }